{
  "openapi": "3.1.1",
  "info": {
    "title": "ReceiptRoller Retail Media API",
    "description": "Retail Media API for integrating purchase, advertising, CRM, and AI.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://receiptroller.io/"
    }
  ],
  "paths": {
    "/api/v1/webhooks/shopify/inventory": {
      "post": {
        "tags": [
          "ShopifyWebhook"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/shopify/app-uninstalled": {
      "post": {
        "tags": [
          "ShopifyWebhook"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/shopify/customers-data-request": {
      "post": {
        "tags": [
          "ShopifyWebhook"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/shopify/customers-redact": {
      "post": {
        "tags": [
          "ShopifyWebhook"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/shopify/shop-redact": {
      "post": {
        "tags": [
          "ShopifyWebhook"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/shopify/orders": {
      "post": {
        "tags": [
          "ShopifyWebhook"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/ads": {
      "get": {
        "tags": [
          "AppAdsApi"
        ],
        "summary": "Get this visit's ads",
        "description": "Returns the banner and notice to show, either of which may be null.\nEach ad returned is charged as shown, so call it once per visit and only\nwhen the app is about to show them. `viewer` identifies the customer\n(the mini app's customer id, or the store app's install id) for the\nthree-a-day cap per campaign; without one no ad is shown.",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "viewer",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The visit's ads.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppAdsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppAdsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppAdsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/tokens/register": {
      "post": {
        "tags": [
          "NotificationTokenApi"
        ],
        "summary": "Register or refresh a push token for a (customer, channel, device)\ntriple. Idempotent — calling twice with the same triple updates\nthe token and bumps LastSeenAt.",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterTokenRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterTokenRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Registered."
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/tokens/unregister": {
      "post": {
        "tags": [
          "NotificationTokenApi"
        ],
        "summary": "Stop sending to this token (user explicitly opted out from the device).",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnregisterTokenRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UnregisterTokenRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UnregisterTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Unregistered."
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/stores": {
      "get": {
        "tags": [
          "PublicStoreDirectory"
        ],
        "summary": "GET /api/v1/public/stores\nPublic store search — equivalent to the /explore page.",
        "description": "Search and filter stores by keyword, prefecture, or store type. No authentication required.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "prefecture",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeType",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results."
          }
        }
      }
    },
    "/api/v1/public/stores/{storeId}": {
      "get": {
        "tags": [
          "PublicStoreDirectory"
        ],
        "summary": "GET /api/v1/public/stores/{storeId}\nPublic store detail — only returns stores the operator has published:\nIsPublicListing on and Status active, matching what search returns.",
        "description": "Returns full detail for a publicly listed store. No authentication required.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Store detail."
          },
          "404": {
            "description": "Store not found or not publicly listed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/terminals/{publicTerminalId}/qr.png": {
      "get": {
        "tags": [
          "QrImageApi"
        ],
        "parameters": [
          {
            "name": "publicTerminalId",
            "in": "path",
            "required": true,
            "schema": {
              "maxLength": 16,
              "minLength": 6,
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "image/png": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/terminals/{publicTerminalId}/qr.pdf": {
      "get": {
        "tags": [
          "QrImageApi"
        ],
        "parameters": [
          {
            "name": "publicTerminalId",
            "in": "path",
            "required": true,
            "schema": {
              "maxLength": 16,
              "minLength": 6,
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/claim-tokens/{claimToken}/qr.png": {
      "get": {
        "tags": [
          "QrImageApi"
        ],
        "parameters": [
          {
            "name": "claimToken",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "image/png": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/claim-tokens/{claimToken}/qr.pdf": {
      "get": {
        "tags": [
          "QrImageApi"
        ],
        "parameters": [
          {
            "name": "claimToken",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/receipt-ad": {
      "get": {
        "tags": [
          "ReceiptAdApi"
        ],
        "parameters": [
          {
            "name": "r",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rx",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/ra/{kind}/{slotKey}/image": {
      "get": {
        "tags": [
          "ReceiptAdApi"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slotKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/ra/{kind}/{slotKey}/qr": {
      "get": {
        "tags": [
          "ReceiptAdApi"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slotKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/ra/{kind}/{slotKey}": {
      "get": {
        "tags": [
          "ReceiptAdApi"
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slotKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/manifest": {
      "get": {
        "tags": [
          "StoreAppApi"
        ],
        "summary": "App manifest — everything a client needs to render the shell:\napp identity (name, logo, theme), the resolved template + theme +\nnavigation, and the platform identifiers for LINE / iOS / Android.",
        "description": "Returns the app shell config: identity, theme, template, navigation, platform IDs.",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "description": "Organization id — the same value as organizationId from /me/organizations. 'shopId' and the organization id are identical (one app per business account).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Manifest."
          },
          "404": {
            "description": "No app found for this shopId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/pages": {
      "get": {
        "tags": [
          "StoreAppApi"
        ],
        "summary": "List published pages",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "description": "Organization id (= organizationId from /me/organizations). Pages are org-scoped — shared across all the org's stores.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pages."
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/pages/{slug}": {
      "get": {
        "tags": [
          "StoreAppApi"
        ],
        "summary": "Get a single published page by slug",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "description": "Organization id (= organizationId from /me/organizations).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page detail."
          },
          "404": {
            "description": "Page not found or not published.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/posts": {
      "get": {
        "tags": [
          "StoreAppApi"
        ],
        "summary": "List published posts",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "description": "Organization id (= organizationId from /me/organizations). Posts (お知らせ) are org-scoped — shared across all the org's stores, not per-store.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "take",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Posts."
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/business-info": {
      "get": {
        "tags": [
          "StoreAppApi"
        ],
        "summary": "Get structured business hours + open-now status",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "description": "Organization id (= organizationId from /me/organizations).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "Store id (UUID) — business hours are per-store, so this is required.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "specialDaysAhead",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Business info."
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/membership-card-config": {
      "get": {
        "tags": [
          "StoreAppApi"
        ],
        "summary": "Get the org's membership card + Wallet config",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "description": "Organization id (= organizationId from /me/organizations).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Card config."
          }
        }
      }
    },
    "/api/v1/terminals/{publicTerminalId}/last-receipt": {
      "get": {
        "tags": [
          "TerminalReceiptApi"
        ],
        "summary": "Returns the latest claimable receipt for a terminal.\n\n404 — terminal unknown, no transaction yet, outside TTL, or already\n      fully claimed with AllowMultipleClaims=false.\n429 — rate-limited.\n200 — receipt + signed claim token.",
        "parameters": [
          {
            "name": "publicTerminalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reviewRequest",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Receipt + claim token"
          },
          "404": {
            "description": "No claimable receipt (unknown terminal, expired, or already claimed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/terminals/{publicTerminalId}/claim": {
      "post": {
        "tags": [
          "TerminalReceiptApi"
        ],
        "summary": "Records the customer's claim on the latest receipt. Requires the\nclaim token returned by `last-receipt`. Channel identifies which\nsurface the customer came in through (line/ios/android/web). Email is\nnot offered here: the customer asks for it on the receipt page's\n「メールで受け取る」 form, which checks the address and caps sends per\naddress. `email` is refused with 400 `email_not_supported`.",
        "parameters": [
          {
            "name": "publicTerminalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClaimRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClaimRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClaimRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Claim recorded"
          },
          "400": {
            "description": "Invalid request body, unknown channel, or channel email (email_not_supported).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Claim token missing, malformed, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Terminal or transaction no longer claimable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Transaction already claimed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rx/{claimToken}": {
      "get": {
        "tags": [
          "TransactionReceiptApi"
        ],
        "summary": "Returns the receipt bound to a transaction-QR token.\n\n404 — unknown / expired / claimed / revoked token, or the underlying\n      transaction has been deleted.\n429 — rate-limited.\n200 — receipt payload.",
        "parameters": [
          {
            "name": "claimToken",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reviewRequest",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Receipt"
          },
          "404": {
            "description": "Unknown / expired / claimed / revoked token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rx/{claimToken}/claim": {
      "post": {
        "tags": [
          "TransactionReceiptApi"
        ],
        "summary": "Marks the token Claimed and writes an audit row. Single-use — a\nsecond POST with the same token returns 409, matching the semantics\nthe customer expects (\"this QR was already used\").",
        "parameters": [
          {
            "name": "claimToken",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/TransactionQrClaimRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/TransactionQrClaimRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/TransactionQrClaimRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Claim recorded"
          },
          "400": {
            "description": "Invalid request body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Token unknown / expired / already claimed / revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Token already claimed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/wallet/apple/{customerId}": {
      "get": {
        "tags": [
          "WalletPassApi"
        ],
        "summary": "Issues an Apple Wallet pass for the customer. Returns the\nsigned .pkpass bytes; the iOS Wallet app opens the file\ndirectly when its MIME type matches.",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pass bytes."
          },
          "404": {
            "description": "Customer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Apple Wallet not configured on this environment."
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/wallet/google/{customerId}": {
      "get": {
        "tags": [
          "WalletPassApi"
        ],
        "summary": "Issues a Google Wallet save URL. The client navigates to the\nURL (or hands it to the host's IDeepLinkRouter) to open Google\nWallet's \"Save\" UI.",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Save URL."
          },
          "404": {
            "description": "Customer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Google Wallet not configured on this environment."
          }
        }
      }
    },
    "/api/v1/apps/{shopId}/wallet/push/{customerId}": {
      "post": {
        "tags": [
          "WalletPassApi"
        ],
        "summary": "Manually triggers a rank/points re-push to the customer's\nexisting passes. Used by the campaign worker after a points\nadjustment so the Wallet pass shows fresh data without the\nuser re-launching the app.",
        "parameters": [
          {
            "name": "shopId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Update count."
          }
        }
      }
    },
    "/api/v1/checkins": {
      "post": {
        "tags": [
          "CheckInApi"
        ],
        "summary": "Record a check-in",
        "description": "Resolves the token printed on the store's QR or NFC sticker, validates date range / active state / per-user daily cap, then records the check-in. Idempotent per (user, campaign, day) up to the campaign's configured cap.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckInRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckInRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckInRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Recorded or rejected with reason (see `status`)."
          },
          "400": {
            "description": "Missing token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/checkins/campaign/{token}": {
      "get": {
        "tags": [
          "CheckInApi"
        ],
        "summary": "Lightweight pre-check so the app can render campaign name /\ndescription on the check-in screen BEFORE committing the POST.\nDoes not record anything. Falls back to `unknown_token` on\nmiss so the client shows a helpful error rather than a blank\nscreen.",
        "description": "Looks up the campaign behind a QR/NFC token without recording a check-in. Used by the client to show name/description + validity before prompting the user to confirm.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Campaign found or status indicates why not."
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/checkins/me": {
      "get": {
        "tags": [
          "CheckInApi"
        ],
        "summary": "The caller's own check-in history, newest first. Resolves store +\ncampaign names in a single pass so the client can render a flat\nlist without follow-up requests.\n\nPage size capped at 200 — this is a personal history, not a\nbulk-export feed. Cursor pagination is a follow-up if anyone\nactually accumulates that many visits on one device.",
        "description": "Returns up to `limit` recent check-ins for the current user, newest first, with campaign name and store name resolved for display.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of check-ins."
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/surveys/campaign/{token}": {
      "get": {
        "tags": [
          "SurveyApi"
        ],
        "summary": "Preview a survey by token",
        "description": "Resolves a survey campaign + its question list from a public URL token. Anonymous-friendly so the LIFF can render the header before the user signs in.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Campaign found, with questions inlined."
          }
        }
      }
    },
    "/api/v1/surveys/responses": {
      "post": {
        "tags": [
          "SurveyApi"
        ],
        "summary": "Submit a response. Bearer-authenticated callers attach their\nuserId; anonymous callers must send a stable `deviceId` and\nthe campaign must opt into `IsAnonymous` — otherwise we\nreturn `auth_required` and the client routes the user\nthrough sign-in.",
        "description": "Validates the token, range, and per-user response cap, then persists the answer set. Returns a structured `status` discriminator the client branches on.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitSurveyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitSurveyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitSurveyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Recorded or rejected with reason (see `status`)."
          },
          "400": {
            "description": "Missing token or no answers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/surveys/me": {
      "get": {
        "tags": [
          "SurveyApi"
        ],
        "summary": "List the caller's survey responses",
        "description": "Returns up to `limit` recent survey responses authored by the current user, newest first.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of responses."
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/user/account": {
      "delete": {
        "tags": [
          "UserAccount"
        ],
        "summary": "Delete account (Apple Guideline 5.1.1(v))",
        "description": "Permanently deletes the caller's account and their personal data — receipts and photos, labels, budgets, income, favorites, coupons, devices, store links, votes. Records stores keep (bookings, check-ins, survey answers, community posts) stay without the person. The caller proves they can sign in: `password`, or `proof` with an ID token for accounts that sign in with LINE, Apple or Google. Anonymous accounts only need confirm=true. Idempotent — already-deleted accounts return 200.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteAccountRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteAccountRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Account deleted."
          },
          "400": {
            "description": "confirm flag missing, or password missing / wrong for password accounts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "reauth_required / proof_rejected — accounts without a password prove with an ID token (acceptedMethods).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "owns_business_account — close or hand over the listed business accounts first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/user/password": {
      "put": {
        "tags": [
          "UserAccount"
        ],
        "summary": "Change password (registered accounts only)",
        "description": "Verifies currentPassword, applies newPassword, and revokes every other live OAuth token for the user so a stolen session can't survive the change. Anonymous accounts get 400 — they don't have a password.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Password changed."
          },
          "400": {
            "description": "Anonymous account, wrong current password, or new password fails policy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/user/budget": {
      "get": {
        "tags": [
          "UserBudget"
        ],
        "summary": "Get monthly budget",
        "description": "Returns the user's budget for the given month — the whole month, and per category and\nper label. Falls back to the most recent prior month (carry-forward) when the requested\nmonth has no explicit row. amount is null when no whole-month budget has been set.\nyear and month default to the current month in Japan time.",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the effective budget.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "UserBudget"
        ],
        "summary": "Set monthly budget",
        "description": "Sets the budget for the given month and every month after it until it is changed again.\n\nEach part is optional, and a part left out keeps its current value, so an app that only\nknows the whole-month amount does not erase category budgets:\n- amount — the whole month. Send null to remove it; 0 is a budget of ¥0, not \"no budget\".\n- categories — [{ categoryId, amount }] with ids from GET /api/v1/user/receipt-categories.\n  Replaces every category budget; send [] to remove them all.\n- labels — [{ labelId, amount }] with ids from GET /api/v1/user/receipt-labels. Same rule.\n\nRemoving everything is allowed and means no budget from this month on — the months\nafter it no longer carry an earlier budget forward. Category budgets need not add up to\nthe whole month. Amounts must be 0 or more.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Budget saved.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetResponse"
                }
              }
            }
          },
          "400": {
            "description": "invalid_year_month / invalid_amount / unknown_category / unknown_label / duplicate_id / too_many_lines.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/budget/status": {
      "get": {
        "tags": [
          "UserBudget"
        ],
        "summary": "Budget progress",
        "description": "The month's budgets against what was spent: the whole month (overall), each budgeted\ncategory and each budgeted label. Each line has budget, spent, remaining, percentUsed,\nprojected — where the month ends at the current pace — and status:\n- none — no budget for this line\n- ok\n- warning — 80% used, or from the 7th day on, the pace ends the month over budget\n- over\n\nLabels overlap: a receipt counts in full toward each of its labels. unbudgetedSpent is\nspending in categories without a budget; unallocatedBudget is the whole-month budget\nminus the category budgets. history has budget against spending for historyMonths\nmonths (default 6, at most 12), oldest first, ending with this month. year and month\ndefault to the current month in Japan time.",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "historyMonths",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 6
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Budget progress for the month.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserBudgetStatusDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserBudgetStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserBudgetStatusDto"
                }
              }
            }
          },
          "400": {
            "description": "invalid_year_month / invalid_history_months.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/coupons": {
      "get": {
        "tags": [
          "UserCoupons"
        ],
        "summary": "List coupons from favorite stores",
        "description": "Returns all active coupons from the authenticated user's favorited stores.",
        "responses": {
          "200": {
            "description": "Returns a list of coupons.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserCouponItem"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserCouponItem"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserCouponItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.coupons.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/coupons/{storeId}/{couponId}": {
      "get": {
        "tags": [
          "UserCoupons"
        ],
        "summary": "Get coupon detail",
        "description": "Returns the detail of a single coupon by store ID and coupon ID.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "couponId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the coupon.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserCouponItem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserCouponItem"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserCouponItem"
                }
              }
            }
          },
          "404": {
            "description": "Coupon not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.coupons.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.coupons.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/coupons/mine": {
      "get": {
        "tags": [
          "UserCoupons"
        ],
        "summary": "List the coupons this account holds",
        "description": "Coupons claimed to this account across every store, unused first\n(soonest expiry first), then used ones (most recent first). Each\ncarries its own code and, once used, `usedAt` for the elapsed-time\ndisplay the counter watches (t-e9a2f1428).",
        "responses": {
          "200": {
            "description": "The held coupons.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserHeldCoupon"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserHeldCoupon"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserHeldCoupon"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.coupons.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.coupons.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/coupons/{storeId}/{couponId}/claim": {
      "post": {
        "tags": [
          "UserCoupons"
        ],
        "summary": "Claim a coupon to this account",
        "description": "Issues the coupon to this account, or returns the copy already held\n— tapping twice or retrying never mints a second one.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "couponId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The held coupon.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserHeldCoupon"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserHeldCoupon"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserHeldCoupon"
                }
              }
            }
          },
          "404": {
            "description": "`unavailable`: the coupon does not exist, is inactive, expired or fully used.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.coupons.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.coupons.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/coupons/{storeId}/{couponId}/use": {
      "post": {
        "tags": [
          "UserCoupons"
        ],
        "summary": "Use a coupon at the counter",
        "description": "Pressed with staff watching. Claims the coupon first if it is not\nheld yet, so showing and using are one action, as on the web wallet.\nThe response's `usedAt` drives the elapsed-time \"used\" display;\n`undoUntil` is when the use can no longer be taken back.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "couponId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Used. The held coupon, now with `usedAt`.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserHeldCoupon"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserHeldCoupon"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserHeldCoupon"
                }
              }
            }
          },
          "404": {
            "description": "`unavailable`, `expired` or `inactive`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "`already_used`, or `reusable` (a reusable coupon has no used state — just show it).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.coupons.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.coupons.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/coupons/{storeId}/{couponId}/use/undo": {
      "post": {
        "tags": [
          "UserCoupons"
        ],
        "summary": "Take back a mis-tapped use",
        "description": "Within 10 minutes of the use. The reversal stays on the record; past\nthe window only the store can change it.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "couponId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Taken back. The held coupon, unused again.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserHeldCoupon"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserHeldCoupon"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserHeldCoupon"
                }
              }
            }
          },
          "404": {
            "description": "`not_issued`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "`not_used`, or `window_passed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.coupons.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.coupons.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/daily-notes/today": {
      "get": {
        "tags": [
          "UserDailyNotes"
        ],
        "summary": "Get today",
        "description": "Today in Japan time. Same shape as GET /{date}.",
        "responses": {
          "200": {
            "description": "Today.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteDto"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/daily-notes": {
      "get": {
        "tags": [
          "UserDailyNotes"
        ],
        "summary": "List the days written",
        "description": "The days from and to, both included, that have a ひとこと, oldest first. to defaults to\ntoday and from to the first of to's month, so no parameters gives this month so far.\nAt most 62 days (range_too_long); dates are \"yyyy-MM-dd\" (invalid_date).",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The days.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteListDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteListDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteListDto"
                }
              }
            }
          },
          "400": {
            "description": "invalid_date or range_too_long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/daily-notes/{date}": {
      "get": {
        "tags": [
          "UserDailyNotes"
        ],
        "summary": "Get a day",
        "description": "The day's figures, worked out from the receipts each time:\n- spent — the day's spending, receipts put to a 特別費 left out, refunds taken off\n- receiptCount — receipts dated that day, 特別費 ones included\n\nAnd the ひとこと:\n- entry — text and feeling, null until saved\n- daysWrittenThisMonth — days of the month with a ひとこと. Not a streak: a missed day\n  does not reset it\n\ndate must not be after today (future_date).",
        "parameters": [
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The day.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteDto"
                }
              }
            }
          },
          "400": {
            "description": "invalid_date or future_date.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "UserDailyNotes"
        ],
        "summary": "Save a day's ひとこと",
        "description": "Replaces what the day had. Both fields are optional, and a blank one is stored as nothing:\n- text — up to 100 characters\n- feeling — how the day's spending felt: satisfied, okay or overspent\n\nErrors: invalid_date, future_date, text_too_long, invalid_feeling. Returns the day as GET does.",
        "parameters": [
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DailyNoteRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DailyNoteRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DailyNoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The day, with the saved ひとこと.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDailyNoteDto"
                }
              }
            }
          },
          "400": {
            "description": "An error code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "UserDailyNotes"
        ],
        "summary": "Delete a day's ひとこと",
        "description": "The day's figures stay, as they come from the receipts.",
        "parameters": [
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "The day had no ひとこと.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/devices": {
      "post": {
        "tags": [
          "UserDevices"
        ],
        "summary": "Register a consumer-app device for push",
        "description": "**For the consumer app.** Stores the caller's APNs (iOS) or FCM (Android) token. Idempotent per (userId, token) — re-registering the same token returns the existing row.\n\nThe staff store app registers at `POST /api/v1/devices/register` instead. Staff notifications are not sent to devices registered here.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterDeviceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterDeviceRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterDeviceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Registered (existing row).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDeviceResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDeviceResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDeviceResponse"
                }
              }
            }
          },
          "201": {
            "description": "Registered (new row)."
          },
          "400": {
            "description": "Missing or invalid fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/user/devices/{deviceId}": {
      "delete": {
        "tags": [
          "UserDevices"
        ],
        "summary": "Unregister a consumer-app device",
        "description": "Removes the given device row. Use on logout or token rotation. Returns 204 on success, 404 when the device was already gone.",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Unregistered."
          },
          "404": {
            "description": "Device not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/user/favorites": {
      "get": {
        "tags": [
          "UserFavoriteStores"
        ],
        "summary": "List favorite stores",
        "description": "Returns all stores the authenticated user has favorited, enriched with a per-row store snapshot so the mobile UI can render name / type / prefecture / city without a second round trip.",
        "responses": {
          "200": {
            "description": "Returns a list of favorite stores with embedded snapshot."
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.favorites.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/favorites/{storeId}": {
      "get": {
        "tags": [
          "UserFavoriteStores"
        ],
        "summary": "Check if a store is favorited",
        "description": "Returns whether the authenticated user has favorited the given store.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns favorite status."
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.favorites.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.favorites.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "UserFavoriteStores"
        ],
        "summary": "Add a store to favorites",
        "description": "Adds the given store to the authenticated user's favorites. Idempotent — safe to call if already favorited.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Store added to favorites."
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.favorites.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "UserFavoriteStores"
        ],
        "summary": "Remove a store from favorites",
        "description": "Removes the given store from the authenticated user's favorites (soft delete).",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Store removed from favorites."
          },
          "404": {
            "description": "Store was not in favorites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.favorites.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.favorites.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/flyers": {
      "get": {
        "tags": [
          "UserFlyers"
        ],
        "summary": "List flyers from favorite stores",
        "description": "Returns the active (or all, if active=false) flyers for every store the user has favorited, newest first.",
        "parameters": [
          {
            "name": "active",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of flyers."
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.favorites.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/flyers/{flyerId}": {
      "get": {
        "tags": [
          "UserFlyers"
        ],
        "summary": "Get flyer detail with items",
        "description": "Returns one flyer with its extracted items. Requires storeId because flyers are partitioned per store.",
        "parameters": [
          {
            "name": "flyerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Flyer detail."
          },
          "404": {
            "description": "Not found or not in the user's favorites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.favorites.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.favorites.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/income": {
      "get": {
        "tags": [
          "UserIncome"
        ],
        "summary": "Get monthly income",
        "description": "Returns the user's income for the given month. Falls back to the most recent prior month (carry-forward) when no explicit row exists. Amount is null when never set.",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Effective income."
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "UserIncome"
        ],
        "summary": "Set monthly income",
        "description": "Creates or overwrites the income for the given month. Amount must be non-negative. This figure is\nthe salary, and it carries forward to the months after. A bonus or one-off belongs in\nPOST /api/v1/user/income/records, which counts only in its own month.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncomeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IncomeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IncomeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Income saved."
          },
          "400": {
            "description": "Invalid year, month, or amount.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/income/year": {
      "get": {
        "tags": [
          "UserIncomeRecords"
        ],
        "summary": "The year's income",
        "description": "Income by month and kind, what was spent, and the two savings rates. year defaults to the current\nyear in Japan time; months run to the current month of the current year.\n- salary — the monthly figure from PUT /api/v1/user/income, carried forward. Salary entries count\n  only when no figure is set.\n- sideJob, bonus, irregular — entries of those kinds, added on top\n- regular — salary and sideJob: what comes in every month\n- regularSavingsRate — savings as a percentage of regular income, bonuses and one-offs left out,\n  over the months with regular income\n- annualSavingsRate — savings as a percentage of all income, bonuses included, over the months\n  with any income\n- spent — every month of the year so far, so it can be more than the rates cover",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The year.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeYearDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeYearDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeYearDto"
                }
              }
            }
          },
          "400": {
            "description": "invalid_year.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/income/records": {
      "get": {
        "tags": [
          "UserIncomeRecords"
        ],
        "summary": "List income entries",
        "description": "The month's entries, oldest first: added by hand, or imported from statements. year and month\ndefault to the current month in Japan time.",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The entries.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserIncomeRecordDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserIncomeRecordDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserIncomeRecordDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_year_month.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "UserIncomeRecords"
        ],
        "summary": "Add an income entry",
        "description": "- date — required\n- source — required, up to 50 characters: 給与, 夏の賞与, フリマの売上…\n- amount — more than 0\n- kind — salary, bonus, irregular or side_job; default salary\n- memo — optional, up to 200 characters\n\nOnly the monthly figure carries forward: an entry counts in its own month. A salary entry counts\nonly in a month with no monthly figure, so it is not added to the salary twice.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncomeRecordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IncomeRecordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IncomeRecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The new entry.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeRecordDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeRecordDto"
                }
              }
            }
          },
          "400": {
            "description": "invalid_date / source_required / source_too_long / invalid_amount / invalid_kind / memo_too_long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/income/records/{id}": {
      "put": {
        "tags": [
          "UserIncomeRecords"
        ],
        "summary": "Change an income entry",
        "description": "Replaces the entry, imported ones included, with the same fields and rules as adding one. Changing\ndate changes the id: use the id in the response. What was shared out from it stays as it was.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncomeRecordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IncomeRecordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IncomeRecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The changed entry.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeRecordDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeRecordDto"
                }
              }
            }
          },
          "400": {
            "description": "The same errors as adding one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such entry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "UserIncomeRecords"
        ],
        "summary": "Delete an income entry",
        "description": "What was shared out from it is taken back from the goals.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "No such entry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/income/records/{id}/allocations": {
      "put": {
        "tags": [
          "UserIncomeRecords"
        ],
        "summary": "Share out a bonus",
        "description": "Puts parts of a bonus or irregular entry towards savings goals and 特別費. Body:\n[{ goalId, amount }] or [{ goalId, percent }], up to 20; goalId is a savings goal or 特別費 id.\nEach part is recorded as a contribution to that goal, dated like the entry, with origin allocation.\n\nSending again replaces the earlier parts; [] takes them all back. A percentage is worked out when\nsent, so changing the entry's amount later does not change it. The parts may not add up to more\nthan the entry.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IncomeAllocationRequest"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IncomeAllocationRequest"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IncomeAllocationRequest"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The entry with its allocations.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeRecordDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserIncomeRecordDto"
                }
              }
            }
          },
          "400": {
            "description": "not_allocatable / too_many_allocations / invalid_allocation / duplicate_goal / over_allocated / unknown_goal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such entry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/insights": {
      "get": {
        "tags": [
          "UserInsights"
        ],
        "summary": "Monthly insights",
        "description": "year and month default to the current month in Japan time.\n- smallSpending — ちょこちょこ買い: receipts under thresholdAmount (¥1,000) as smallCount and\n  smallTotal. byStoreKind covers every receipt of the month, not only the small ones, by kind of\n  shop: convenience, supermarket, drugstore, cafe, restaurant, other. The kind comes from the\n  store name, then the store directory.\n- priceChanges — items bought in at least 3 of the last 6 months, and in this month or the one\n  before, whose average price rose 5% or more from the first of those months. At most 5.\n- topItems — the month's items by what was spent on them. At most 10.\n- messages — sentences ready to show, with key (budget_used / budget_over / month_over_month /\n  balance) and the figure each is about in value. budget_* and month_over_month leave out\n  特別費, like /budget/status. balance is all income against all spending, like the summary's\n  incomeAmount − totalAmount.\n\nItem names are matched with spelling differences folded: width, case, spacing, hiragana and\nkatakana, leading marks, and how a size is written. locale picks the language of messages:\nEnglish for en, Japanese otherwise.",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The insights.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserInsightsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInsightsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInsightsDto"
                }
              }
            }
          },
          "400": {
            "description": "invalid_year_month.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/insights/items/history": {
      "get": {
        "tags": [
          "UserInsights"
        ],
        "summary": "An item's price history",
        "description": "The item's average price for each month it was bought, oldest first, for the receipt detail\nscreen. name is the item name as on the receipt; spelling differences are folded. months is how\nfar back to look: default 12, at most 24.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "months",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 12
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The history. months is empty when the item was not found.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ItemPriceHistoryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ItemPriceHistoryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ItemPriceHistoryDto"
                }
              }
            }
          },
          "400": {
            "description": "name_required / invalid_months.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/journal-settings": {
      "get": {
        "tags": [
          "UserJournalSettings"
        ],
        "summary": "Get the settings",
        "description": "- aiUse — true unless the person turned it off\n- noticeSeen — false until the app has shown the notice; show it before the first save",
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserJournalSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserJournalSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserJournalSettingsDto"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "UserJournalSettings"
        ],
        "summary": "Change the settings",
        "description": "Send only what changes; a field left out stays as it is.\n- aiUse — true or false\n- noticeSeen — true once the notice has been shown. It cannot be set back to false",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JournalSettingsInput"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/JournalSettingsInput"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/JournalSettingsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The settings after the change.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserJournalSettingsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserJournalSettingsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserJournalSettingsDto"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/receipt-categories": {
      "get": {
        "tags": [
          "UserReceiptCategories"
        ],
        "summary": "List categories",
        "description": "Every category in display order, hidden ones included (isHidden=true).\nPickers should leave hidden ones out; receipts may still use them.\ncostType is fixed (固定費) or variable (変動費); the built-in 住居・水道光熱費・通信費・保険・サブスク\nstart fixed and every other category variable.",
        "responses": {
          "200": {
            "description": "The categories."
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "UserReceiptCategories"
        ],
        "summary": "Create a category",
        "description": "Body: name (required, up to 20 characters), color (\"#RRGGBB\"), icon, costType (fixed / variable, default variable).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The new category."
          },
          "400": {
            "description": "name_required / name_too_long / name_taken / invalid_color / invalid_icon / invalid_cost_type / too_many_categories.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/receipt-categories/{id}": {
      "patch": {
        "tags": [
          "UserReceiptCategories"
        ],
        "summary": "Change a category",
        "description": "Only the fields sent are changed. Works on defaults too. Send\nisHidden=true to hide a default, since defaults cannot be deleted.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The changed category."
          },
          "400": {
            "description": "An input error, or cannot_hide_uncategorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such category.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "UserReceiptCategories"
        ],
        "summary": "Delete a category",
        "description": "Only categories the user made. Receipts that used it read as 未分類\n(id \"uncategorized\") from then on.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "default_category_cannot_be_deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such category.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/receipt-categories/order": {
      "put": {
        "tags": [
          "UserReceiptCategories"
        ],
        "summary": "Reorder categories",
        "description": "Body: ids in the order to show them. Ids left out keep their relative\norder after the named ones; unknown ids are ignored.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyOrderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyOrderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The whole list in its new order."
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/rx/{claimToken}/claim": {
      "post": {
        "tags": [
          "UserReceiptClaim"
        ],
        "summary": "Claim a transaction-QR receipt into the signed-in user's receipts",
        "description": "Body: { \"channel\": \"ios\" | \"android\" }. Returns the saved receipt in the same shape as\nGET /api/v1/user/receipts/{id}.",
        "parameters": [
          {
            "name": "claimToken",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AppClaimRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AppClaimRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AppClaimRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "This user already claimed it; the saved receipt."
          },
          "201": {
            "description": "Receipt saved."
          },
          "400": {
            "description": "Unknown channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown, expired or revoked QR.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Another user already claimed it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/terminals/{publicTerminalId}/claim": {
      "post": {
        "tags": [
          "UserReceiptClaim"
        ],
        "summary": "Claim a terminal-QR receipt into the signed-in user's receipts",
        "description": "Body: { \"channel\": \"ios\" | \"android\", \"claimToken\": \"...\" }, where claimToken is the value\nGET /api/v1/terminals/{publicTerminalId}/last-receipt returned. The claim is for the sale\nthat was previewed, even if the terminal has rung up another since.",
        "parameters": [
          {
            "name": "publicTerminalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AppClaimRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AppClaimRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AppClaimRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "This user already claimed it; the saved receipt."
          },
          "201": {
            "description": "Receipt saved."
          },
          "400": {
            "description": "Unknown channel, or claimToken missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown terminal, or the claim token is invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The sale has been claimed as many times as the terminal allows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/receipt-labels": {
      "get": {
        "tags": [
          "UserReceiptLabels"
        ],
        "summary": "List labels",
        "responses": {
          "200": {
            "description": "Every label, in display order."
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "UserReceiptLabels"
        ],
        "summary": "Create a label",
        "description": "Body: name (required, up to 20 characters), color (\"#RRGGBB\").",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The new label."
          },
          "400": {
            "description": "name_required / name_too_long / name_taken / invalid_color / too_many_labels.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/receipt-labels/{id}": {
      "patch": {
        "tags": [
          "UserReceiptLabels"
        ],
        "summary": "Change a label",
        "description": "Only the fields sent are changed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyWriteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The changed label."
          },
          "400": {
            "description": "An input error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such label.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "UserReceiptLabels"
        ],
        "summary": "Delete a label",
        "description": "Receipts that carried it stop showing it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "No such label.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/receipt-labels/order": {
      "put": {
        "tags": [
          "UserReceiptLabels"
        ],
        "summary": "Reorder labels",
        "description": "Body: ids in the order to show them. Ids left out keep their relative\norder after the named ones; unknown ids are ignored.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyOrderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyOrderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptTaxonomyOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The whole list in its new order."
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/receipts": {
      "get": {
        "tags": [
          "UserReceipts"
        ],
        "summary": "List user receipts",
        "description": "Returns the authenticated user's receipts. Optionally filter by year and month,\nby categoryId, and by labelId (receipts carrying that label).",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "categoryId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labelId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of receipts (bare array, or PagedReceiptList when page/pageSize is passed)."
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "UserReceipts"
        ],
        "summary": "Save receipt",
        "description": "Creates or updates a receipt. Send as multipart/form-data with an optional image, or as\napplication/json when there is no image — a receipt entered by hand, for one. To change\na saved receipt, prefer PATCH /api/v1/user/receipts/{id}, which only touches the fields\nsent. On create from a scan, send the analysisId returned by analyze; if analyze said\nimageRetained, the image can be left out and the kept photo is used.\n\nreceiptDate is required. A create that matches a receipt already saved returns 409\nduplicate_receipt: same store and total, and the same minute — or, when either has no\ntime, the same day and the same item prices. Ask the user, then send it again with\nallowDuplicate=true to save it anyway.\n\nAn update to a receipt issued by a store (isStoreIssued=true) may change only\ncategoryId, labelIds and notes, as on PATCH. Its store, amounts, date, payment,\nregistration number and items can be sent back as they are, or left blank; a different\nvalue returns 400 store_issued_receipt_locked.",
        "requestBody": {
          "description": "Directory StoreId the client picked from the analyze\nresponse's linkedStore candidates. Null / empty = unlinked.",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "Id": {
                        "type": "string"
                      },
                      "StoreName": {
                        "type": "string"
                      },
                      "TotalAmount": {
                        "type": "number",
                        "format": "double"
                      },
                      "TaxAmount": {
                        "type": "number",
                        "format": "double"
                      },
                      "PaymentMethod": {
                        "type": "string"
                      },
                      "TaxRegistrationNumber": {
                        "type": "string"
                      },
                      "ReceiptDate": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "Category": {
                        "type": "string"
                      },
                      "CategoryId": {
                        "type": "string"
                      },
                      "LabelIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "SpecialExpenseId": {
                        "type": "string"
                      },
                      "RefundOfReceiptId": {
                        "type": "string"
                      },
                      "AnalysisId": {
                        "type": "string"
                      },
                      "Notes": {
                        "type": "string"
                      },
                      "AllowDuplicate": {
                        "type": "boolean"
                      },
                      "StorePhone": {
                        "type": "string"
                      },
                      "StoreAddress": {
                        "type": "string"
                      },
                      "Items": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/ReceiptItemDto"
                        }
                      },
                      "LinkedStoreId": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  }
                ]
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "Id": {
                        "type": "string"
                      },
                      "StoreName": {
                        "type": "string"
                      },
                      "TotalAmount": {
                        "type": "number",
                        "format": "double"
                      },
                      "TaxAmount": {
                        "type": "number",
                        "format": "double"
                      },
                      "PaymentMethod": {
                        "type": "string"
                      },
                      "TaxRegistrationNumber": {
                        "type": "string"
                      },
                      "ReceiptDate": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "Category": {
                        "type": "string"
                      },
                      "CategoryId": {
                        "type": "string"
                      },
                      "LabelIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "SpecialExpenseId": {
                        "type": "string"
                      },
                      "RefundOfReceiptId": {
                        "type": "string"
                      },
                      "AnalysisId": {
                        "type": "string"
                      },
                      "Notes": {
                        "type": "string"
                      },
                      "AllowDuplicate": {
                        "type": "boolean"
                      },
                      "StorePhone": {
                        "type": "string"
                      },
                      "StoreAddress": {
                        "type": "string"
                      },
                      "Items": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/ReceiptItemDto"
                        }
                      },
                      "LinkedStoreId": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  }
                ]
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "storeName": {
                    "type": "string"
                  },
                  "totalAmount": {
                    "type": "number",
                    "format": "double"
                  },
                  "taxAmount": {
                    "type": "number",
                    "format": "double"
                  },
                  "paymentMethod": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "taxRegistrationNumber": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "receiptDate": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "Required. The time printed on the receipt, e.g. \"2026-09-28T12:34:00\". An offset, if\nsent, is ignored. A date with no time (\"2026-09-28\") is fine for a hand entry.",
                    "format": "date-time"
                  },
                  "category": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "Legacy: a category name. Ignored when string? SaveReceiptRequest.CategoryId is sent."
                  },
                  "categoryId": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "An id from GET /api/v1/user/receipt-categories."
                  },
                  "labelIds": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "description": "Ids from GET /api/v1/user/receipt-labels. Up to 10."
                  },
                  "specialExpenseId": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "An id from GET /api/v1/user/special-expenses: the spending counts against that, not the month's budget."
                  },
                  "refundOfReceiptId": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "On a refund (a negative totalAmount): the purchase it gives back, from GET\n/api/v1/user/receipts/refund-candidates. The refund takes that receipt's category and\nspecialExpenseId unless others are sent."
                  },
                  "analysisId": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "The analysisId returned by analyze, when this receipt came from a scan."
                  },
                  "notes": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "allowDuplicate": {
                    "type": "boolean",
                    "description": "Save even if it matches a receipt already saved. Send only after the user confirmed\nit is a separate purchase, in answer to a 409 duplicate_receipt."
                  },
                  "storePhone": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "storeAddress": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "items": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "itemName": {
                          "type": "string"
                        },
                        "price": {
                          "type": "number",
                          "format": "double"
                        },
                        "quantity": {
                          "type": "number",
                          "format": "double"
                        },
                        "quantityDisplay": {
                          "type": [
                            "null",
                            "string"
                          ]
                        }
                      }
                    }
                  },
                  "linkedStoreId": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "Directory StoreId the client picked from the analyze\nresponse's linkedStore candidates. Null / empty = unlinked."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Receipt saved successfully."
          },
          "400": {
            "description": "receipt_date_required / unknown_category / unknown_label / too_many_labels / store_issued_receipt_locked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "duplicate_receipt — resend with allowDuplicate=true once the user confirms.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/receipts/{id}": {
      "get": {
        "tags": [
          "UserReceipts"
        ],
        "summary": "Get receipt detail",
        "description": "Returns a single receipt with line items and store information.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the receipt."
          },
          "404": {
            "description": "Receipt not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "UserReceipts"
        ],
        "summary": "Edit receipt",
        "description": "Changes only the fields sent; a field left out or null keeps its value. Send \"\" to clear\na text field and [] to clear the items. items, when sent, replaces the whole list.\n\nA receipt issued by a store (isStoreIssued=true) only accepts categoryId, labelIds and\nnotes; anything else returns 400 store_issued_receipt_locked.\n\nChanges to scanned receipts are recorded so the OCR can be improved.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptUpdateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptUpdateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiptUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The receipt as saved, with items."
          },
          "400": {
            "description": "store_issued_receipt_locked / unknown_category / unknown_label / too_many_labels / invalid_amount.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Receipt not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "UserReceipts"
        ],
        "summary": "Delete receipt",
        "description": "Soft-deletes a receipt by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Receipt deleted."
          },
          "404": {
            "description": "Receipt not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/receipts/summary": {
      "get": {
        "tags": [
          "UserReceipts"
        ],
        "summary": "Monthly spending summary",
        "description": "Returns spending totals, category breakdown, and month-over-month comparison. A refund is a\nreceipt with a negative totalAmount, so every figure here is net of refunds.\nfixedAmount / variableAmount split the month into 固定費 and 変動費: a receipt is fixed when its\ncategory's costType is fixed, or when it is a payment to a confirmed recurring payment's payee at\nabout its amount. Each category also carries its costType.",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the spending summary."
          },
          "400": {
            "description": "invalid_month: year must be a Gregorian year and month 1 to 12.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/receipts/analyze": {
      "post": {
        "tags": [
          "UserReceipts"
        ],
        "summary": "Analyze receipt image (OCR)",
        "description": "Upload a receipt image for AI-powered data extraction. Returns extracted data without saving.\nThe response carries analysisId: send it back when saving so the server can record what\nthe user corrected. categoryId is the best fit among the user's own categories (hidden\nones excluded), custom ones included.\n\nWhen imageRetained is true the server kept the photo: save with analysisId and no image,\nand the receipt gets the kept photo. When it is absent, send the image as before. A kept\nphoto is held for 24 hours.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns extracted receipt data."
          },
          "400": {
            "description": "No image file provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/receipts/refund-candidates": {
      "get": {
        "tags": [
          "UserReceipts"
        ],
        "summary": "Find the purchase a refund belongs to",
        "description": "Purchases a refund may give back, newest first: the same store, the same amount, up to 30 days\nbefore date, not already refunded. Works before the refund is saved. amount may be sent with\neither sign; date defaults to today in Japan time. Send the chosen id as refundOfReceiptId.",
        "parameters": [
          {
            "name": "storeName",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double",
              "default": 0
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The candidates. Empty when there are none.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RefundCandidate"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RefundCandidate"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RefundCandidate"
                  }
                }
              }
            }
          },
          "400": {
            "description": "store_name_required / invalid_amount.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.receipts.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/recurring-payments": {
      "get": {
        "tags": [
          "UserRecurringPayments"
        ],
        "summary": "List recurring payments",
        "description": "Candidates first, then the rest by yearly cost. Without status, candidates and confirmed ones;\nstatus=candidate / confirmed / dismissed gives only those.\n\nPayments are looked for in the last 14 months of receipts and statement imports: the same payee\nat a similar amount every month (three times) or every year (twice). This runs when the list is\nread and the last run is over an hour old, or straight after a statement import; detect=true\nruns it now. New ones arrive as candidates for the user to confirm or dismiss. A dismissed one\nis not offered again.\n\nEach item has monthlyAmount and yearlyAmount (a yearly payment ÷ 12, a monthly one × 12),\nnextDate (today or later) and reviewReasons:\n- price_increase — more than the time before (previousAmount)\n- duplicate — another subscription, phone plan or insurance, or another payment to the same payee\n\nThe totals — monthlyTotal, yearlyTotal, byCategory — count confirmed payments only.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "detect",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The list with totals.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentSummaryDto"
                }
              }
            }
          },
          "400": {
            "description": "invalid_status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "UserRecurringPayments"
        ],
        "summary": "Add a recurring payment",
        "description": "Added by hand and confirmed:\n- name — required, up to 50 characters\n- amount — more than 0\n- cycle — monthly or yearly\n- nextDate — required: the next time it is paid\n- categoryId — optional, from GET /api/v1/user/receipt-categories; default 未分類\n\nReceipts to the same name are matched to it afterwards, which keeps lastPaidDate and amount current.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecurringPaymentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RecurringPaymentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RecurringPaymentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The new payment.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentDto"
                }
              }
            }
          },
          "400": {
            "description": "name_required / name_too_long / invalid_amount / invalid_cycle / invalid_next_date / unknown_category.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/recurring-payments/{id}": {
      "get": {
        "tags": [
          "UserRecurringPayments"
        ],
        "summary": "Get a recurring payment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The payment.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentDto"
                }
              }
            }
          },
          "404": {
            "description": "No such payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "UserRecurringPayments"
        ],
        "summary": "Change a recurring payment",
        "description": "Only the fields sent are changed, with the same rules as adding one. status confirms a candidate\n(confirmed), turns one down (dismissed — it is not offered again) or puts it back (candidate).\nChanging amount by hand clears previousAmount, so a correction does not read as a price rise.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecurringPaymentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RecurringPaymentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RecurringPaymentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The changed payment.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRecurringPaymentDto"
                }
              }
            }
          },
          "400": {
            "description": "name_required / name_too_long / invalid_amount / invalid_cycle / invalid_next_date / unknown_category / invalid_status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "UserRecurringPayments"
        ],
        "summary": "Delete a recurring payment",
        "description": "A detected payment that is deleted can be found again by the next detection. To stop it being\noffered, dismiss it instead (PATCH status=dismissed).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "No such payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/reports/monthly": {
      "get": {
        "tags": [
          "UserReports"
        ],
        "summary": "Monthly spending report",
        "description": "Server-generated monthly report: aggregated figures plus AI financial-planner commentary.\n\nlocale is the language the app is showing — the AI text is written in it. One of ja-JP,\nen, zh-Hant-TW, th-TH; close forms such as \"ja\" or \"en-US\" are accepted. Left out, or a\nlanguage not supported, the report is in Japanese. A month is stored per language, so\nasking for another language writes it again in that one.",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the monthly report.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserMonthlyReportDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserMonthlyReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserMonthlyReportDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid year/month.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/savings-goals": {
      "get": {
        "tags": [
          "UserSavingsGoals"
        ],
        "summary": "List savings goals",
        "description": "Every goal, oldest first, with how far it has come:\n- savedAmount — everything put in, less everything taken out\n- remaining, percentSaved, contributedThisMonth\n- requiredMonthly — what to set aside each month, this one included, to reach the target by\n  targetDate. Null without a date, once achieved, or once the date has passed.\n- projectedCompletion — { year, month } the goal is reached at the current pace: monthlyAmount\n  when set, otherwise the average of up to the last six complete months. Null without a pace.\n- status — achieved / on_track / behind / overdue / no_date (no targetDate)\n\ntotalSaved and contributedThisMonth add up every goal; monthlyAmount adds up the 先取り額 of\nthe goals not yet achieved. Months are in Japan time.",
        "responses": {
          "200": {
            "description": "Every goal with totals.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsSummaryDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "UserSavingsGoals"
        ],
        "summary": "Create a savings goal",
        "description": "- name — required, up to 50 characters\n- kind — emergency_fund or custom (default)\n- icon — optional, up to 32 characters; an icon key or emoji the app chooses\n- targetAmount — more than 0\n- targetDate — optional\n- monthlyAmount — the 先取り額 planned each month; 0 or more, default 0\n- autoContribute — 自動積立: from this month on, each month is recorded as a contribution of\n  monthlyAmount dated the 1st. Needs monthlyAmount above 0. The recorded months are ordinary\n  contributions, so a month that was skipped is fixed by deleting it.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsGoalRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsGoalRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsGoalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The new goal.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsGoalDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsGoalDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsGoalDto"
                }
              }
            }
          },
          "400": {
            "description": "name_required / name_too_long / invalid_kind / icon_too_long / invalid_amount / invalid_target_date / auto_needs_monthly_amount / too_many_goals.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/savings-goals/emergency-fund-suggestion": {
      "get": {
        "tags": [
          "UserSavingsGoals"
        ],
        "summary": "Suggest an emergency fund",
        "description": "生活防衛資金: three to six months of living costs, from the receipts of the last six complete\nmonths. Months without a receipt are left out of the average; monthsCounted says how many\nwere used, and fewer than 3 makes it a rough guide. minimumAmount (×3) and recommendedAmount\n(×6) are rounded up to ¥10,000. Every amount is null when there are no receipts yet.",
        "responses": {
          "200": {
            "description": "The suggestion.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EmergencyFundSuggestionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmergencyFundSuggestionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmergencyFundSuggestionDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/savings-goals/{goalId}": {
      "get": {
        "tags": [
          "UserSavingsGoals"
        ],
        "summary": "Get a savings goal",
        "description": "The goal as in the list, with its contributions newest first.",
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The goal.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsGoalDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsGoalDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsGoalDto"
                }
              }
            }
          },
          "404": {
            "description": "No such goal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "UserSavingsGoals"
        ],
        "summary": "Change a savings goal",
        "description": "Replaces the whole plan, with the same fields and rules as creating one; a field left out\ntakes its default, so targetDate left out removes the date. Contributions stay. Switching\nautoContribute on records the current month; switching it off keeps the months already\nrecorded. A changed monthlyAmount applies to the months not yet recorded.",
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsGoalRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsGoalRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsGoalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The changed goal.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsGoalDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsGoalDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsGoalDto"
                }
              }
            }
          },
          "400": {
            "description": "The same errors as creating a goal, except too_many_goals.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such goal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "UserSavingsGoals"
        ],
        "summary": "Delete a savings goal",
        "description": "Its contributions are deleted with it.",
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "No such goal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/savings-goals/{goalId}/advice": {
      "get": {
        "tags": [
          "UserSavingsGoals"
        ],
        "summary": "Get AI tips for a savings goal",
        "description": "Two or three short tips for reaching the goal, from its figures and the spending of the last three\ncomplete months and this one (receipts put to a 特別費 left out). The tips stay on spending, budgets\nand the 先取り額: never investments or financial products, whatever the goal is for. Only totals go\nto the AI, not the goal's name, receipt items or store names.\n\n- locale — ja-JP (default), en, zh-Hant-TW or th-TH, as for the monthly report\n- The tips are kept for the Japan-time day and returned again until the goal's figures change\n  (target, saved amount, date, 先取り額 or status); then the next request writes new ones.\n- available is false when there are no tips to show, and reason says why: disabled (the AI is\n  off), daily_limit (too many new tips today; try tomorrow) or failed (the AI did not answer;\n  it counts towards the limit). Show the goal without tips in each case.",
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tips, or why there are none.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserGoalAdviceDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserGoalAdviceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserGoalAdviceDto"
                }
              }
            }
          },
          "404": {
            "description": "No such goal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/savings-goals/{goalId}/contributions": {
      "post": {
        "tags": [
          "UserSavingsGoals"
        ],
        "summary": "Record a contribution",
        "description": "- amount — required, not 0. Negative records a withdrawal (取り崩し).\n- date — the day, default today in Japan time; not in the future\n- memo — optional, up to 200 characters",
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsContributionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsContributionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsContributionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The new contribution.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsContributionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsContributionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsContributionDto"
                }
              }
            }
          },
          "400": {
            "description": "invalid_amount / invalid_date / memo_too_long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such goal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/savings-goals/{goalId}/contributions/{contributionId}": {
      "put": {
        "tags": [
          "UserSavingsGoals"
        ],
        "summary": "Change a contribution",
        "description": "Replaces amount, date and memo, with the same rules as recording one.",
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contributionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsContributionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsContributionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SavingsContributionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The changed contribution.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsContributionDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsContributionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSavingsContributionDto"
                }
              }
            }
          },
          "400": {
            "description": "invalid_amount / invalid_date / memo_too_long.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such goal or contribution.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "UserSavingsGoals"
        ],
        "summary": "Delete a contribution",
        "description": "A 自動積立 month deleted here is not recorded again.",
        "parameters": [
          {
            "name": "goalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contributionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "No such goal or contribution.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/scan/analyze": {
      "post": {
        "tags": [
          "UserScan"
        ],
        "summary": "Analyze any scanned image (auto-detects receipt vs statement)",
        "description": "Upload an image without telling the server what it is. The\nresponse's `kind` says what was detected and which payload is\npopulated:\n\n- `receipt` → `receipt` holds the same shape as POST /user/receipts/analyze\n- `statement` → `statement` holds the same shape as POST /user/statements/analyze,\n  with `source` = credit_card | bank\n- `unknown` → neither payload; the image didn't look like a\n  receipt or a statement (show \"レシート・明細が見つかりませんでした\")\n\nNothing is saved — review then save via POST /user/receipts or\nPOST /user/statements/import as usual. For a receipt, when\n`receipt.imageRetained` is true the save can send `analysisId`\nwithout the image; the photo kept here is used (held for 24 hours).",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Classification + extraction result."
          },
          "400": {
            "description": "No image / bad mime.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "AI extractor unavailable."
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/special-expenses": {
      "get": {
        "tags": [
          "UserSpecialExpenses"
        ],
        "summary": "List special expenses",
        "description": "The year's 特別費 and how far through them the user is. year defaults to the current year in\nJapan time. Each item has annualAmount, monthlyAmount (÷ 12, rounded up), savedAmount (積立),\nspentAmount (receipts of the year with its specialExpenseId) and remaining (annual minus spent;\nnegative when over). The totals add up the items.",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The year's special expenses.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserSpecialExpenseSummaryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSpecialExpenseSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSpecialExpenseSummaryDto"
                }
              }
            }
          },
          "400": {
            "description": "invalid_year.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "UserSpecialExpenses"
        ],
        "summary": "Create a special expense",
        "description": "- name — required, up to 50 characters\n- year — the year it is for; default the current year\n- annualAmount — more than 0\n- plannedMonth — optional, 1 to 12\n- template — optional, a key from /templates\n- icon — optional, up to 32 characters\n- autoContribute — 自動積立: from this month to December, each month is recorded as saved.\n\nmonthlyAmount is annualAmount ÷ 12. It counts in savingsSetAside on /budget/status for the months\nof that year. To record saving by hand, use POST /api/v1/user/savings-goals/{id}/contributions\nwith this id. A 特別費 does not appear in GET /api/v1/user/savings-goals.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpecialExpenseRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SpecialExpenseRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SpecialExpenseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The new special expense.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserSpecialExpenseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSpecialExpenseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSpecialExpenseDto"
                }
              }
            }
          },
          "400": {
            "description": "name_required / name_too_long / invalid_year / invalid_amount / invalid_planned_month / invalid_template / icon_too_long / too_many_expenses.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/special-expenses/templates": {
      "get": {
        "tags": [
          "UserSpecialExpenses"
        ],
        "summary": "Special expense templates",
        "description": "The usual 特別費 to offer at the start of a year: key and name. Send the key as template when\ncreating one. name is in English for en, Japanese otherwise.",
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The templates.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SpecialExpenseTemplateDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SpecialExpenseTemplateDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SpecialExpenseTemplateDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/special-expenses/{id}": {
      "put": {
        "tags": [
          "UserSpecialExpenses"
        ],
        "summary": "Change a special expense",
        "description": "Replaces it, with the same fields and rules as creating one. What was saved stays.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpecialExpenseRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SpecialExpenseRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SpecialExpenseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The changed special expense.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserSpecialExpenseDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSpecialExpenseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSpecialExpenseDto"
                }
              }
            }
          },
          "400": {
            "description": "The same errors as creating one, except too_many_expenses.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such special expense.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "UserSpecialExpenses"
        ],
        "summary": "Delete a special expense",
        "description": "What was saved towards it is deleted too. Receipts assigned to it go back to counting against\ntheir month's budget.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "No such special expense.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/statements/analyze": {
      "post": {
        "tags": [
          "UserStatements"
        ],
        "summary": "Analyze statement screenshot (multi-transaction OCR)",
        "description": "Uploads a credit card / bank app statement screenshot and returns the extracted transactions. Nothing is saved — the client reviews, lets the user edit/confirm, then saves via POST /api/v1/user/statements/import.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "sourceHint": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Extracted statement."
          },
          "400": {
            "description": "No image / bad mime.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "AI extractor unavailable."
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/statements/import": {
      "post": {
        "tags": [
          "UserStatements"
        ],
        "summary": "Bulk-save reviewed statement transactions",
        "description": "Saves the transactions the user confirmed on the review screen.\nexpense/refund rows become receipts (refunds as negative\namounts) so the monthly spending summary and 分析 widgets pick\nthem up. A refund row is sent as analyze returned it — a positive\namount with type refund — and saved with a negative totalAmount and\nisRefund true. When exactly one purchase matches it (same store and\namount, up to 30 days before) it is linked with refundOfReceiptId and\ntakes that purchase's category and specialExpenseId; otherwise it stays\n未分類 and GET /api/v1/user/receipts/refund-candidates lists the choices.\nincome rows (入金・給与) are saved as income records so\nincome-vs-spending analysis has real data. transfer rows\n(口座間振替) are not recorded — they are neither.\n\nDuplicate protection is two-layer: rows that repeat within the\nsame request are collapsed, and each row is checked against\nalready-recorded data (same merchant/source + date + amount →\n\"duplicate\", not an error). Re-importing the same screenshot is\ntherefore safe.\n\nThe per-row results tell the client exactly what happened to\nevery index, including whether a saved row became a receipt or\nan income record (recordedAs), and the receiptId of a receipt.\n\nAn expense row may carry specialExpenseId, from GET\n/api/v1/user/special-expenses, to assign it to that 特別費.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatementImportRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StatementImportRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StatementImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Per-row import results.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StatementImportResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatementImportResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatementImportResult"
                }
              }
            }
          },
          "400": {
            "description": "No transactions / too many transactions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.receipts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/store-mail": {
      "get": {
        "tags": [
          "UserStoreMail"
        ],
        "summary": "Get the store email settings",
        "description": "`everyStore` is `in` (every store), `default` (stores the customer has\nvisited) or `out` (none). `stores` lists the stores the customer has\na setting for, and whether each may email them now — the later of the\nstore's own setting and `everyStore` wins.",
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StoreMailSettingsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreMailSettingsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreMailSettingsResponse"
                }
              }
            }
          },
          "409": {
            "description": "`no_email`: the account has no email address (e.g. anonymous).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.profile.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.profile.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/store-mail/every": {
      "put": {
        "tags": [
          "UserStoreMail"
        ],
        "summary": "Choose every store / visited stores / none",
        "description": "Send `atSignUp: true` when this is the unticked-by-default checkbox\non the account-creation screen being ticked, so the record says\nwhere the consent was given.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetEveryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetEveryRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetEveryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The settings after the change.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StoreMailSettingsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreMailSettingsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreMailSettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_choice`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "`no_email`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.profile.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.profile.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/store-mail/stores/{storeId}": {
      "put": {
        "tags": [
          "UserStoreMail"
        ],
        "summary": "Stop or resume one store",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStoreRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStoreRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetStoreRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The settings after the change.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StoreMailSettingsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreMailSettingsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreMailSettingsResponse"
                }
              }
            }
          },
          "404": {
            "description": "`store_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "`no_email`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.profile.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.profile.write"
            ]
          }
        ]
      }
    },
    "/api/v1/user/weekly-reviews/latest": {
      "get": {
        "tags": [
          "UserWeeklyReviews"
        ],
        "summary": "Get the week to look back on",
        "description": "On a Sunday the week ending today; Monday to Saturday the week that has just ended.\nSame shape as GET /{weekStart}.",
        "responses": {
          "200": {
            "description": "The week.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewDto"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/weekly-reviews": {
      "get": {
        "tags": [
          "UserWeeklyReviews"
        ],
        "summary": "List the weeks looked back on",
        "description": "The weeks of the year with a ふりかえり saved, newest first; count is how many. A week\nbelongs to the year its Monday falls in. Defaults to this year, Japan time.",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The weeks.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewListDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewListDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewListDto"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      }
    },
    "/api/v1/user/weekly-reviews/{weekStart}": {
      "get": {
        "tags": [
          "UserWeeklyReviews"
        ],
        "summary": "Get a week",
        "description": "The week's figures, worked out from the receipts each time:\n- spent — the week's spending, receipts put to a 特別費 left out, refunds taken off\n- budget — the week's share of the monthly budget: each day adds its month's budget over\n  that month's days, so a week across two months takes some of each. Null without a budget\n- previousWeekSpent, specialSpent\n- days — each day up to today, Monday first, with its ひとこと日記 (note, feeling) when one\n  was written; noSpendDays — those days with no spending\n- topCategories — up to three; smallPurchases — purchases under ¥1,000\n\nAnd the ふりかえり:\n- entry — this week's answers, null until saved\n- previousNextAction — the 来週やってみること saved the week before, to ask about first\n- reviewedWeeksThisYear — weeks of this week's year with a ふりかえり. Not a streak: a\n  missed week does not reset it\n\nweekStart must be a Monday (invalid_week) and not after today (future_week).",
        "parameters": [
          {
            "name": "weekStart",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The week.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewDto"
                }
              }
            }
          },
          "400": {
            "description": "invalid_week or future_week.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "UserWeeklyReviews"
        ],
        "summary": "Save a week's ふりかえり",
        "description": "Replaces what the week had. Every field is optional, and a blank one is stored as nothing:\n- good — 良かったこと, up to 200 characters\n- concern — 気になったこと, up to 200 characters\n- nextAction — 来週やってみること, up to 200 characters; next week's review asks about it\n- previousActionResult — how last week's 来週やってみること went: done, partly or not_yet\n\nErrors: invalid_week, future_week, text_too_long, invalid_action_result. Returns the week as\nGET does.",
        "parameters": [
          {
            "name": "weekStart",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WeeklyReviewRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WeeklyReviewRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WeeklyReviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The week, with the saved ふりかえり.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWeeklyReviewDto"
                }
              }
            }
          },
          "400": {
            "description": "An error code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "UserWeeklyReviews"
        ],
        "summary": "Delete a week's ふりかえり",
        "description": "The week's figures stay, as they come from the receipts.",
        "parameters": [
          {
            "name": "weekStart",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "The week had no ふりかえり.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `user.spending.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.spending.write"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/ad-coupons/verify": {
      "post": {
        "tags": [
          "AdCouponsApi"
        ],
        "summary": "Check an advertiser coupon",
        "description": "Says whether the code can be taken here now, and what it gives, so\nthe till can apply the discount. Changes nothing.\n\nRequired scope: `store.coupons.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AdCouponCodeRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AdCouponCodeRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AdCouponCodeRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.coupons.read"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/ad-coupons/redeem": {
      "post": {
        "tags": [
          "AdCouponsApi"
        ],
        "summary": "Take an advertiser coupon",
        "description": "Marks the coupon used. A use is charged to the advertiser, and credited\nto the store in its payout, only once it is matched to its sale.\n\n- `terminalId` + `transactionId` name the POS sale the coupon was used\n  on. Send them when the sale is already recorded and the use is matched\n  at once; otherwise leave them out and match it later with `POST match`.\n- `purchaseYen` is required when the coupon has a minimum purchase and no\n  sale is sent. With a sale, its total is used instead.\n- `discountYen` is required for a percentage coupon: the yen discount\n  given, no more than the percentage of the purchase when that is known.\n\nA refused coupon returns 409 with the same body, `succeeded: false`.\n\nRequired scope: `store.coupons.redeem` (`store.coupons.write` also accepted).",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AdCouponRedeemRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AdCouponRedeemRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AdCouponRedeemRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.coupons.redeem"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/ad-coupons/match": {
      "post": {
        "tags": [
          "AdCouponsApi"
        ],
        "summary": "Match a used coupon to its sale",
        "description": "Matches a coupon this store took without a sale to the POS sale it was\nused on, and charges the use. The sale must be this store's and within\ntwo hours after (or 30 minutes before) the use, and a use can be matched\nfor seven days. One sale matches at most one coupon from the same ad campaign.\n\nA refused match returns 409 with the same body, `succeeded: false`.\n\nRequired scope: `store.coupons.redeem` (`store.coupons.write` also accepted).",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AdCouponMatchRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AdCouponMatchRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AdCouponMatchRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCouponResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.coupons.redeem"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/business-hours": {
      "get": {
        "tags": [
          "BusinessHoursApi"
        ],
        "summary": "Get weekly business hours for a store",
        "description": "Returns one row per (day, shift). Days with multiple\nshifts (e.g. lunch + dinner service) appear as separate\nrows sorted by `shiftIndex`. Closed days collapse to a\nsingle row with `isClosed=true`.\n\nRequired scope: `store.business-hours.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BusinessHoursRow"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BusinessHoursRow"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BusinessHoursRow"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.business-hours.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.business-hours.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "BusinessHoursApi"
        ],
        "summary": "Replace the entire weekly schedule",
        "description": "Bulk-replaces the store's weekly schedule with the\nsupplied rows. Anything not in the body is removed.\nEach row may omit `shiftIndex` (defaults to 0). Send\n`isClosed=true` (and empty times) for closed days.\n\nRequired scope: `store.business-hours.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BusinessHoursDto"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BusinessHoursDto"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BusinessHoursDto"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BusinessHoursRow"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BusinessHoursRow"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BusinessHoursRow"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.business-hours.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.business-hours.write"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/business-hours/{dayOfWeek}/{shiftIndex}": {
      "put": {
        "tags": [
          "BusinessHoursApi"
        ],
        "summary": "Upsert a single (day, shift) entry",
        "description": "Useful when the client is editing one row at a time\ninstead of pushing the whole weekly schedule.\n\nRequired scope: `store.business-hours.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dayOfWeek",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "shiftIndex",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessHoursDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessHoursDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessHoursDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessHoursRow"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessHoursRow"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessHoursRow"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.business-hours.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.business-hours.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "BusinessHoursApi"
        ],
        "summary": "Delete one (day, shift) entry",
        "description": "Required scope: `store.business-hours.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dayOfWeek",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "shiftIndex",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.business-hours.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.business-hours.write"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/business-hours/work-hours-limit": {
      "get": {
        "tags": [
          "BusinessHoursApi"
        ],
        "summary": "Get the store-wide work-hours limits (就業可能時間)",
        "description": "Returns the store's standard work window — the earliest\ntime staff may be scheduled (prep before opening) and\nthe latest time they may stay (cleanup after close).\nDistinct from the customer-facing business hours.\n\nShift editors should pre-fill new shifts inside this\nwindow and warn when a shift falls outside it. Empty\nvalues mean no limit is configured.\n\nRequired scope: `store.business-hours.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkHoursLimitResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkHoursLimitResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkHoursLimitResponse"
                }
              }
            }
          },
          "404": {
            "description": "Store not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.business-hours.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.business-hours.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "BusinessHoursApi"
        ],
        "summary": "Set the store-wide work-hours limits (就業可能時間)",
        "description": "Sets / clears the standard work window. Times in \"HH:mm\"\n24-hour format; send empty strings to clear. Start must\nbe before end when both are supplied.\n\nRequired scope: `store.business-hours.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkHoursLimitRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkHoursLimitRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WorkHoursLimitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WorkHoursLimitResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkHoursLimitResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkHoursLimitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid time format or start ≥ end.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Store not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.business-hours.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.business-hours.write"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/business-hours/special-days": {
      "get": {
        "tags": [
          "BusinessHoursApi"
        ],
        "summary": "List special / exception days in a range",
        "description": "Returns one-off opening / closure exceptions for the\nstore, keyed by date. Use this for holidays, irregular\nopening hours, or extended closures. Default range is\nthe next 90 days when `from` / `to` aren't supplied.\n\nRequired scope: `store.business-hours.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SpecialDayRow"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SpecialDayRow"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SpecialDayRow"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.business-hours.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.business-hours.read"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/business-hours/special-days/{date}": {
      "put": {
        "tags": [
          "BusinessHoursApi"
        ],
        "summary": "Upsert a special / exception day",
        "description": "`date` in URL is `yyyy-MM-dd`. Body fields override the\nURL date if supplied. Send `isClosed=true` (no times)\nfor a closed day; otherwise `openTime` + `closeTime`\nin `HH:mm`.\n\nRequired scope: `store.business-hours.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpecialBusinessDayDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SpecialBusinessDayDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SpecialBusinessDayDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SpecialDayRow"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpecialDayRow"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpecialDayRow"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.business-hours.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.business-hours.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "BusinessHoursApi"
        ],
        "summary": "Remove a special day",
        "description": "Soft-deletes the override; the weekly schedule applies again on that date.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.business-hours.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.business-hours.write"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/business-hours/open-status": {
      "get": {
        "tags": [
          "BusinessHoursApi"
        ],
        "summary": "Is the store open right now?",
        "description": "Honors special days first, then the weekly schedule.\nPass `at` (ISO 8601 UTC) to probe a different moment\nthan `now`. Response carries the matched source\n(`Special` | `Weekly`), the closing time when open,\nor the next opening time when closed.\n\nRequired scope: `store.business-hours.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OpenStatusResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenStatusResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenStatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.business-hours.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.business-hours.read"
            ]
          }
        ]
      }
    },
    "/api/v1/content-channels": {
      "get": {
        "tags": [
          "ContentChannelsApi"
        ],
        "summary": "List the account's channels",
        "description": "Every channel of the media company's account, with its review status\n(`Pending` until ReceiptRoller approves it; stores only see `Active` ones)\nand its feed. Required scope: `media.channels.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "media.channels.read"
            ]
          }
        ]
      }
    },
    "/api/v1/content-channels/{channelId}/items": {
      "get": {
        "tags": [
          "ContentChannelsApi"
        ],
        "summary": "List a channel's items",
        "description": "The images and videos in the channel, newest first. The newest 10 that\nare within their period play; the rest wait. Required scope: `media.channels.read`.",
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ItemListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ItemListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ItemListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "media.channels.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ContentChannelsApi"
        ],
        "summary": "Add an image or video to a channel",
        "description": "Multipart form: `file` (an image or H.264 MP4 video meeting the signage spec,\nthe same as for ads: 16:9 or 9:16, 1920x1080 recommended; video 6, 15 or 30 seconds), and optionally `title`, `validUntil` (when it stops\nplaying; news goes stale) and `externalId` (your own id for the item).\nSending an `externalId` that the channel already has returns that item with\n200 instead of adding it again, so a retry is safe.\nRequired scope: `media.channels.write`.",
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "validUntil": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "externalId": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ItemResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ItemResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ItemResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ItemResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ItemResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "media.channels.write"
            ]
          }
        ]
      }
    },
    "/api/v1/content-channels/{channelId}/items/{itemId}": {
      "delete": {
        "tags": [
          "ContentChannelsApi"
        ],
        "summary": "Remove an item from a channel",
        "description": "It stops playing at stores' next playlist refresh. An item that arrived by\nAPI or feed is deleted with its file. Required scope: `media.channels.write`.",
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "media.channels.write"
            ]
          }
        ]
      }
    },
    "/api/v1/content-channels/{channelId}/feed": {
      "put": {
        "tags": [
          "ContentChannelsApi"
        ],
        "summary": "Set or clear a channel's feed",
        "description": "An RSS 2.0 or Atom feed at a public https address, whose entries carry an\nimage or video (an enclosure or Media RSS content) made for signage.\nReceiptRoller reads it every 15 minutes, adds new entries and takes off\nentries the feed no longer has. An empty `feedUrl` stops reading it.\nRequired scope: `media.channels.write`.",
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/FeedRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "media.channels.write"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/coupons": {
      "get": {
        "tags": [
          "CouponsApi"
        ],
        "summary": "List a store's coupons",
        "description": "Active coupons only by default. `includeInactive=true` also returns\nones that have been withdrawn or have run out — useful for a history\nview, misleading for a list the cashier picks from.\n\nRequired scope: `store.coupons.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CouponListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.coupons.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "CouponsApi"
        ],
        "summary": "Create a coupon",
        "description": "Creating a coupon pushes a notification to everyone who has\nfavourited the store, so this is a customer-visible act rather than\na private draft.\n\nThe code must not already belong to another active coupon in the\nstore — redemption finds a coupon by its code, and a duplicate would\nmake the till's choice arbitrary.\n\nRequired scope: `store.coupons.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CouponRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CouponRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CouponRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.coupons.write"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/coupons/{couponId}": {
      "get": {
        "tags": [
          "CouponsApi"
        ],
        "summary": "Get one coupon",
        "description": "Required scope: `store.coupons.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "couponId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.coupons.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "CouponsApi"
        ],
        "summary": "Update a coupon",
        "description": "Everything except how many times it has been used, which belongs to\nredemption and is not writable here.\n\nRequired scope: `store.coupons.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "couponId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CouponRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CouponRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CouponRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.coupons.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "CouponsApi"
        ],
        "summary": "Withdraw a coupon",
        "description": "Deactivates it. The coupon stops being offered and stops being\nredeemable, and its redemption history survives — a customer who\nalready used it still happened.\n\nRequired scope: `store.coupons.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "couponId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CouponDeletedResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponDeletedResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponDeletedResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.coupons.write"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/coupons/verify": {
      "post": {
        "tags": [
          "CouponsApi"
        ],
        "summary": "Check a code without consuming it",
        "description": "For the moment a cashier is looking at the customer's screen and\nneeds to know whether to accept it. `reason` says why not:\n`not_found`, `inactive`, `not_yet_valid`, `expired`, `fully_used`.\nA refused code is still a 200 — `isValid` is the answer.\n\nThe cases stay separate because the cashier has to say something\ndifferent for each — an expired coupon is an apology, a mistyped\ncode is not.\n\nRequired scope: `store.coupons.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CodeRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CodeRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CodeRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CouponVerifyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponVerifyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponVerifyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.coupons.read"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/coupons/redeem": {
      "post": {
        "tags": [
          "CouponsApi"
        ],
        "summary": "Take a coupon",
        "description": "Consumes one use and writes a redemption record. Fails with the same\n`reason` values as verify, plus `conflict` when another till took the\nlast use first — a capped coupon cannot be overdrawn by two registers\nscanning at once.\n\n`customerId` and `transactionId` are optional links; without them the\nrecord still says which coupon, when, and who rang it up.\n\nRequired scope: `store.coupons.redeem` — narrower than the scope for\ncreating coupons, because issuing one is a head-office act and taking\none is a till act. A till needs `store.coupons.read` to check a code\nand `store.coupons.redeem` to accept it; it does not need\n`store.coupons.write` and should not be granted it.\n\n`store.coupons.write` is still accepted, so tokens issued before the\nsplit keep working. Ask for the narrow scope.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RedeemRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RedeemRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RedeemRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CouponRedeemResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponRedeemResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponRedeemResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (no `code`). No `reason` — nothing was checked.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The coupon could not be taken. The body is the same shape as the 200, with `succeeded: false` and `reason` saying why.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CouponRedeemResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponRedeemResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponRedeemResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.coupons.redeem"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/coupons/redemptions": {
      "get": {
        "tags": [
          "CouponsApi"
        ],
        "summary": "Redemption history",
        "description": "Newest first. `couponId` narrows it to one coupon.\n\nEach row keeps the coupon's terms as they stood when it was taken,\nso editing or withdrawing a coupon afterwards does not rewrite what\na customer was given.\n\nRequired scope: `store.coupons.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "couponId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "take",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CouponRedemptionListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponRedemptionListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CouponRedemptionListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.coupons.read"
            ]
          }
        ]
      }
    },
    "/api/v1/store/customers/{id}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get customer profile",
        "description": "Retrieves a customer's profile by internal ID or membership code, including demographics, membership info, and spend stats.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer profile retrieved.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Customer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.customers.read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Delete customer profile",
        "description": "Soft-deletes a customer record. Associated receipts remain stored for analytics.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Customer deleted."
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Customer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.customers.write"
            ]
          }
        ]
      }
    },
    "/api/v1/store/customers": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Search customers",
        "description": "Search customers by membership level, tag, or minimum lifetime spend.\n\n`q` matches name (kanji or kana), email, phone, membership code\nand tags. A phone number matches with or without hyphens.\n\nReturns a bare array. Page it with `skip` and `take`; the\n`X-Total-Count` header carries the number of matches before\npaging. Omitting `take` returns every match.",
        "parameters": [
          {
            "name": "loyaltyRank",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minSpend",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "take",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer list returned.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CustomerResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CustomerResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CustomerResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.customers.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create or update customer (upsert)",
        "description": "Creates a new customer or updates an existing record. Match is by Id (internal customer ID) when provided.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "Store the customer is registered at (UUID). Required for staff placed at more than one store and holding no role that covers customers (SuperUser, OperationsManager, CampaignManager); optional otherwise.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Customer created or updated.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.customers.write"
            ]
          }
        ]
      }
    },
    "/api/v1/store/customers/{id}/purchases": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get customer's purchase history",
        "description": "Returns per-receipt purchase history for the customer, newest first.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "take",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of receipts returned."
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Customer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.customers.read"
            ]
          }
        ]
      }
    },
    "/api/v1/displays/pair": {
      "post": {
        "tags": [
          "DisplaysApi"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PairRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PairRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PairRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MediaPairResultDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaPairResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaPairResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/displays/{displayId}/heartbeat": {
      "post": {
        "tags": [
          "DisplaysApi"
        ],
        "parameters": [
          {
            "name": "displayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HeartbeatResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeartbeatResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeartbeatResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/displays/{displayId}/playlist": {
      "get": {
        "tags": [
          "DisplaysApi"
        ],
        "parameters": [
          {
            "name": "displayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MediaPlaylistDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaPlaylistDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaPlaylistDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/displays/{displayId}/impressions": {
      "post": {
        "tags": [
          "DisplaysApi"
        ],
        "parameters": [
          {
            "name": "displayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImpressionBatchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ImpressionBatchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ImpressionBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ImpressionBatchResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImpressionBatchResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImpressionBatchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/google-business/reviews/unreplied": {
      "get": {
        "tags": [
          "GoogleBusinessApi"
        ],
        "summary": "List unanswered Google reviews across every location",
        "description": "Reads the newest 50 reviews of each location reachable through the business\naccount's Google connections and returns the ones nobody has answered yet,\nnewest first. A location Google could not be read for is named in\n`failedLocations` rather than failing the whole list.\n\n`aiDraftAvailable` says whether the plan includes AI reply drafts, so the app can\nshow or hide the button without a failed call.\n\nRequired scope: `sns.content.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "Only this store's location.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stars",
            "in": "query",
            "description": "Only these star counts (1–5); repeat the parameter for several.",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          {
            "name": "days",
            "in": "query",
            "description": "Only reviews from the last 7, 30 or 90 days.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "`low` for lowest stars first; newest first otherwise.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UnrepliedReviewsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnrepliedReviewsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnrepliedReviewsResponse"
                }
              }
            }
          },
          "402": {
            "description": "The plan does not include Google Business Profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "The store is not in this business account or not linked to Google.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.read"
            ]
          }
        ]
      }
    },
    "/api/v1/google-business/reviews/{reviewId}/reply": {
      "post": {
        "tags": [
          "GoogleBusinessApi"
        ],
        "summary": "Reply to a Google review",
        "description": "Publishes the reply on Google straight away, replacing any earlier reply. Every reply\nis sent by a person: nothing here answers a review on its own.\n\nRequired scope: `sns.content.write`.",
        "parameters": [
          {
            "name": "reviewId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReplyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReplyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Empty or too long, or Google refused the reply (`error` says why).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "The plan does not include Google Business Profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "The location is not reachable from this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.write"
            ]
          }
        ]
      }
    },
    "/api/v1/google-business/reviews/ai-draft": {
      "post": {
        "tags": [
          "GoogleBusinessApi"
        ],
        "summary": "Draft a reply to a Google review with AI",
        "description": "Writes a draft in the review's own language and the business account's brand voice,\nsigned with the name the location has on Google. It never uses the reviewer's name.\nThe draft is not sent: show it, let the person edit it, and send it with the reply\nendpoint.\n\nRequired scope: `sns.content.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiDraftRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AiDraftRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AiDraftRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AiDraftResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiDraftResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiDraftResponse"
                }
              }
            }
          },
          "402": {
            "description": "Neither the plan nor a product includes AI reply drafts (Growth and above, or MEO).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "The location is not reachable from this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.write"
            ]
          }
        ]
      }
    },
    "/api/v1/google-business/stores/{storeId}/insights": {
      "get": {
        "tags": [
          "GoogleBusinessApi"
        ],
        "summary": "Get a store's Google insights",
        "description": "Calls, direction requests, website clicks, and views in Google Search and Maps over\nthe last 7, 28, 90 or 365 days (28 by default), each against the same number of days\nbefore. Trends are null when those earlier days are not all known, so a gap never\nreads as a drop. Also the top search keywords of the months the period falls in.\n\nRead from ReceiptRoller's daily copy; before a location's first save, from Google.\n\nRequired scope: `sns.content.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleInsightsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleInsightsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleInsightsDto"
                }
              }
            }
          },
          "402": {
            "description": "The plan does not include Google Business Profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "The store is not in this business account or not linked to Google.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.read"
            ]
          }
        ]
      }
    },
    "/api/v1/inventory": {
      "get": {
        "tags": [
          "InventoryApi"
        ],
        "summary": "List stock levels in the business account",
        "description": "Returns one row per (location, product). All filters\noptional and AND-combined:\n- `locationId` — only this WMS location\n- `productId` — only this product (across locations)\n- `lowStock=true` — only rows at/below their reorder point\n\nRequired scope: `store.inventory.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lowStock",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or not a member of the business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.inventory.read"
            ]
          }
        ]
      }
    },
    "/api/v1/inventory/{locationId}/{productId}": {
      "get": {
        "tags": [
          "InventoryApi"
        ],
        "summary": "Get one stock row (location + product)",
        "description": "Required scope: `store.inventory.read`.",
        "parameters": [
          {
            "name": "locationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryStockRow"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryStockRow"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryStockRow"
                }
              }
            }
          },
          "404": {
            "description": "No stock record for this location + product.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.inventory.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.inventory.read"
            ]
          }
        ]
      }
    },
    "/api/v1/inventory/locations": {
      "get": {
        "tags": [
          "InventoryApi"
        ],
        "summary": "List WMS locations",
        "description": "Returns the business account's warehouse / backroom /\nstore-floor locations. Use the ids as `locationId` in\nthe stock + adjust endpoints.\n\n**Store scope:** SuperUser, OperationsManager, WarehouseManager and\nintegration tokens see every location. Anyone else sees the backroom\nand floor locations of the stores they are placed at, not warehouses.\nThe same applies to stock rows, movements and adjustments.\n\nRequired scope: `store.inventory.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLocationsResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.inventory.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.inventory.read"
            ]
          }
        ]
      }
    },
    "/api/v1/inventory/adjust": {
      "post": {
        "tags": [
          "InventoryApi"
        ],
        "summary": "Adjust a stock level",
        "description": "Applies a signed quantity change to one (location, product)\nstock row and writes a movement-log entry. When the\nlocation is mapped to a Shopify location, the adjustment\nis pushed to Shopify automatically (fire-and-forget).\n\nThe stock row must exist — rows are created when products\nare first received or counted at a location. 404 when no\nrow exists yet.\n\nRequired scope: `store.inventory.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryStockRow"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryStockRow"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryStockRow"
                }
              }
            }
          },
          "400": {
            "description": "Missing fields or zero quantityChange.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No stock record for this location + product.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.inventory.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.inventory.write"
            ]
          }
        ]
      }
    },
    "/api/v1/inventory/movements": {
      "get": {
        "tags": [
          "InventoryApi"
        ],
        "summary": "List recent stock movements",
        "description": "Returns the movement log (receiving, transfers, counts,\nadjustments — including Shopify-sync-originated changes),\nnewest first. Filter by `locationId` or `productId`;\n`limit` caps the unfiltered list (default 100).\n\nRequired scope: `store.inventory.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryMovementsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryMovementsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryMovementsResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.inventory.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.inventory.read"
            ]
          }
        ]
      }
    },
    "/api/v1/pos/lightspeed/webhook": {
      "post": {
        "tags": [
          "LightspeedWebhook"
        ],
        "parameters": [
          {
            "name": "account",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/sns/line/webhook/{organizationId}/{accountId}": {
      "post": {
        "tags": [
          "LineWebhook"
        ],
        "summary": "LINE webhook endpoint. LINE sends POST with JSON body and X-Line-Signature header.\nPOST /api/sns/line/webhook/{organizationId}/{accountId}",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/orders": {
      "get": {
        "tags": [
          "OrdersApi"
        ],
        "summary": "List orders in the business account",
        "description": "Returns the business account's orders. Optional\nclient-side filters (`status`, `channel`, `paymentStatus`)\nare applied in-memory after fetch — fine at typical OMS sizes.\n\n**Store scope:** SuperUser, OperationsManager, OrderManager and\nintegration tokens see every store. Anyone else sees only the stores\nthey are placed at, and rows that belong to no store are left out.\n\nRequired scope: `store.orders.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by order status (Pending / Confirmed / Processing / Shipped / Delivered / Cancelled / Refunded).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "description": "Filter by channel (Web / POS / Phone / Manual / Marketplace).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paymentStatus",
            "in": "query",
            "description": "Filter by payment status (Unpaid / Paid / Refunded / PartialRefund).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderListResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.orders.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "OrdersApi"
        ],
        "summary": "Create an order",
        "description": "Creates an order. The `organizationId` on the request body is\nignored — the resolved org from the token / query param always\nwins.\n\nRequired scope: `store.orders.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderCreateBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderCreateBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OrderCreateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.orders.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.write"
            ]
          }
        ]
      }
    },
    "/api/v1/orders/{orderId}": {
      "get": {
        "tags": [
          "OrdersApi"
        ],
        "summary": "Get a single order",
        "description": "Required scope: `store.orders.read`.",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.orders.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "OrdersApi"
        ],
        "summary": "Update an order",
        "description": "Updates the editable fields of an order (customer, shipping\naddress, items, amounts, notes). For status changes prefer the\ndedicated transition endpoints (`/confirm`, `/process`,\n`/cancel`) so the audit log records the action correctly.\n\nRequired scope: `store.orders.write`.",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderCreateBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderCreateBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OrderCreateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.orders.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "OrdersApi"
        ],
        "summary": "Delete an order",
        "description": "Required scope: `store.orders.write`.",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.orders.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.write"
            ]
          }
        ]
      }
    },
    "/api/v1/orders/{orderId}/confirm": {
      "post": {
        "tags": [
          "OrdersApi"
        ],
        "summary": "Confirm an order (Pending → Confirmed)",
        "description": "Required scope: `store.orders.write`.",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.orders.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.write"
            ]
          }
        ]
      }
    },
    "/api/v1/orders/{orderId}/process": {
      "post": {
        "tags": [
          "OrdersApi"
        ],
        "summary": "Move an order into processing (Confirmed → Processing)",
        "description": "Required scope: `store.orders.write`.",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.orders.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.write"
            ]
          }
        ]
      }
    },
    "/api/v1/orders/{orderId}/cancel": {
      "post": {
        "tags": [
          "OrdersApi"
        ],
        "summary": "Cancel an order",
        "description": "Required scope: `store.orders.write`.",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.orders.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.write"
            ]
          }
        ]
      }
    },
    "/api/v1/orders/{orderId}/fulfill-via-pos": {
      "post": {
        "tags": [
          "OrdersApi"
        ],
        "summary": "Mark an order as fulfilled by an in-store POS sale",
        "description": "Links this OMS order to the POS transaction that fulfilled it\nat the register (typical case: customer placed an online order,\nwalks into the store, picks up at counter, register rings it\nup). Stamps the link on both rows and auto-transitions the\norder to `Delivered` / `Paid`.\n\nIdempotent: calling with the same `posTransactionId` on an\nalready-linked order is a no-op.\n\nReturns 404 if either the OMS order or the POS transaction\ndoesn't exist in this business account, or if the POS\ntransaction is already linked to a DIFFERENT OMS order\n(conflict).\n\nRequired scope: `store.orders.write`.",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FulfillViaPosBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/FulfillViaPosBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/FulfillViaPosBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderResponse"
                }
              }
            }
          },
          "404": {
            "description": "Order or POS transaction not found, or conflict with existing link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.orders.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.write"
            ]
          }
        ]
      }
    },
    "/api/v1/orders/{orderId}/ship": {
      "post": {
        "tags": [
          "OrdersApi"
        ],
        "summary": "Ship an order (create shipment with carrier + tracking)",
        "description": "One-call shipping for API / MCP clients: creates an OMS\nshipment carrying the carrier + tracking number and\nimmediately marks it shipped. The order's own status\ntransitions through the shipment service's normal rules.\n\nFor multi-parcel flows (split shipments, partial items),\nuse the OMS web UI — this endpoint covers the common\nsingle-shipment case.\n\nRequired scope: `store.orders.write`.",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShipBody"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ShipBody"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ShipBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/OrderShipResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderShipResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderShipResponse"
                }
              }
            }
          },
          "404": {
            "description": "Order not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.orders.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.write"
            ]
          }
        ]
      }
    },
    "/api/v1/products": {
      "get": {
        "tags": [
          "ProductsApi"
        ],
        "summary": "List products in the business account",
        "description": "Returns every product registered under the business account.\nOptional `search` does a name/SKU/JAN substring match; `category`\nand `brand` filter exactly.\n\n**Pricing scope:** SuperUser, OperationsManager, ProductManager,\nFinanceManager and integration tokens see every store's prices and the\ncost prices. Anyone else sees the prices of the stores they are placed\nat, and cost prices read as 0. Creating, editing or deleting products\nneeds SuperUser, OperationsManager or ProductManager.\n\nRequired scope: `store.products.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Substring search across name / SKU / JAN.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Exact category filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brand",
            "in": "query",
            "description": "Exact brand filter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or not a member of the business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.products.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ProductsApi"
        ],
        "summary": "Create a product",
        "description": "Creates a product under the resolved business account. The\n`organizationId` on the request body is ignored — the resolved\norg from the token / query param wins, to prevent cross-tenant\nwrites.\n\nVariants and the fields only an import sets (Square, Shopify and\nbrand-catalog links) are ignored here. Add variants with\n`PUT /api/v1/products/{productId}/variants`.\n\nRequired scope: `store.products.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (e.g. missing productName).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or not a member of the business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A product with the supplied productId already exists, or did and was deleted (`deleted: true`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.products.write"
            ]
          }
        ]
      }
    },
    "/api/v1/products/{productId}": {
      "get": {
        "tags": [
          "ProductsApi"
        ],
        "summary": "Get a single product (with variants)",
        "description": "Required scope: `store.products.read`.",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              }
            }
          },
          "404": {
            "description": "Product not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.products.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.products.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "ProductsApi"
        ],
        "summary": "Update a product",
        "description": "Replaces the product's fields with the body. `productName` is\nrequired. Variants are left as they are: change them with\n`PUT /api/v1/products/{productId}/variants`.\n\nRequired scope: `store.products.write`.",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              }
            }
          },
          "400": {
            "description": "productName is missing, or status is not Active, Draft or Discontinued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Product not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.products.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.products.write"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "ProductsApi"
        ],
        "summary": "Partially update a product",
        "description": "Updates ONLY the supplied fields; everything else is\npreserved. Designed for API / MCP clients that want to\nchange one thing (e.g. price) without round-tripping the\nfull product document — PUT replaces all fields and can\nwipe data the caller didn't include.\n\nPrice changes propagate to Shopify automatically when the\nproduct is linked (same push-back as the web UI).\n\nRequired scope: `store.products.write`.",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchProductRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchProductRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PatchProductRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              }
            }
          },
          "404": {
            "description": "Product not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.products.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.products.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "ProductsApi"
        ],
        "summary": "Delete a product (soft)",
        "description": "Soft-deletes the product. Same behaviour as the web UI delete —\nthe row is hidden from list/search but retained in storage so\nhistorical POS line items keep resolving.\n\nRequired scope: `store.products.write`.",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Product not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.products.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.products.write"
            ]
          }
        ]
      }
    },
    "/api/v1/products/{productId}/variants": {
      "put": {
        "tags": [
          "ProductsApi"
        ],
        "summary": "Replace a product's variants",
        "description": "The body is the product's complete list of variants, the same as\nthe web edit screen saves. An entry with a `variantId` updates that\nvariant; one without creates a new variant; an existing variant that\nis not in the list is deleted. `variants` is required, and an empty\nlist removes every variant.\n\nOn an update, a field left out keeps its current value. A new\nvariant needs at least one attribute (e.g. `{\"サイズ\": \"M\"}`).\nThe product's options are built from the attributes, and\n`hasVariants` follows from whether any variants remain.\n\nSquare and Shopify links on an existing variant are kept.\n\nRequired scope: `store.products.write`.",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceVariantsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceVariantsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceVariantsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductResponse"
                }
              }
            }
          },
          "400": {
            "description": "`variants` is missing, or a variant has no attributes, an invalid status, or a variantId that is not this product's.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Product not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.products.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.products.write"
            ]
          }
        ]
      }
    },
    "/api/v1/products/{productId}/image": {
      "post": {
        "tags": [
          "ProductsApi"
        ],
        "summary": "Set a product's cover image",
        "description": "Upload the bytes as `multipart/form-data` under the field name\n`file`, and the product's `images.cover` is set to where they\nlanded.\n\nThis exists because there was no way to send a photo from a phone.\n`images.cover` took a URL that was already hosted somewhere, and\n`/api/v1/sns/media` fetches a URL server-side — neither is any use\nto somebody standing in front of the product holding a camera.\n\nJPEG, PNG or WebP, up to 5 MB.\n\n**Replacing the cover leaves the previous file where it is.** It\nsimply stops being referenced. Deleting on replace would break\nanything already showing it — a storefront page, a cached receipt,\na partner's copy of the URL — and that is not recoverable, whereas\nan unreferenced blob costs storage.\n\nRequired scope: `store.products.write` — the same scope as editing\nthe product, because that is what this is.",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UploadedFileResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadedFileResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadedFileResponse"
                }
              }
            }
          },
          "400": {
            "description": "No file, too large, or not an image we accept.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or not a member of the business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such product in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.products.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/analytics": {
      "get": {
        "tags": [
          "ReservationAnalyticsApi"
        ],
        "summary": "Get booking analytics",
        "description": "Totals for a store between `fromDate` and `toDate` (yyyy-MM-dd),\ninclusive.\n\n`repeatRate` is the share of customers who booked more than once\nin the period, and is null when nobody booked at all. `revenue`\ncounts what the bookings were priced at, in the store's currency\nmajor unit.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId, fromDate or toDate missing, or the range is backwards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/attendance/roster": {
      "get": {
        "tags": [
          "ReservationAttendanceApi"
        ],
        "summary": "Get a class register",
        "description": "Who is booked into one slot, with how each person has been\nmarked so far. `storeId` and `slotId` are required.\n\n`status` is the booking's own state; `attendance` is the mark —\nAttended / Excused / NoShow, or null when the class has not been\nrecorded yet. Stores that do not offer make-ups cannot tell an\nexcused absence from a no-show afterwards; those report NoShow.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slotId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RosterResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RosterResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RosterResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId or slotId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/attendance/record": {
      "post": {
        "tags": [
          "ReservationAttendanceApi"
        ],
        "summary": "Record a class register",
        "description": "Marks a whole class at once. Each entry is a `reservationId` and\nan `outcome` of Attended, Excused or NoShow.\n\nAn Excused absence may become a claimable make-up; a NoShow does\nnot. Re-recording overwrites the earlier mark, so this is safe to\ncall again after a correction.\n\nReturns how many rows actually changed — sending the same marks\ntwice reports zero, not an error.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RecordResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing, or no entries supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/attendance/makeups": {
      "get": {
        "tags": [
          "ReservationAttendanceApi"
        ],
        "summary": "List claimable make-up classes",
        "description": "Excused absences this customer can still claim a replacement\nfor. `customerId` is the CRM customer id — the same id a booking\nresolves to.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RosterResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RosterResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RosterResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId or customerId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/attendance/makeups/book": {
      "post": {
        "tags": [
          "ReservationAttendanceApi"
        ],
        "summary": "Book a make-up class",
        "description": "Books a replacement for a missed class. The new booking inherits\nthe original's pass, so the credit already spent covers it and\nthe customer is not charged twice.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MakeupRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MakeupRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MakeupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RosterEntry"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RosterEntry"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RosterEntry"
                }
              }
            }
          },
          "400": {
            "description": "storeId, sourceReservationId or newSlotId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The absence is not claimable, or the slot cannot take it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/attendance/summary": {
      "get": {
        "tags": [
          "ReservationAttendanceApi"
        ],
        "summary": "Get a customer's attendance summary",
        "description": "Counts of attended, excused and no-show classes, plus how many\nare still upcoming.\n\n`attendanceRate` covers only classes that have happened —\ncounting upcoming bookings as absences would make every new\ncustomer look unreliable. Null when nothing has happened yet.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId or customerId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/memberships/plans": {
      "get": {
        "tags": [
          "ReservationMembershipsApi"
        ],
        "summary": "List membership plans",
        "description": "The unlimited-attendance plans a store offers. `storeId` is\nrequired. Set `activeOnly=true` for only those currently on\nsale.\n\nRequired scope: `store.memberships.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activeOnly",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPlanListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPlanListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPlanListResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.memberships.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.memberships.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ReservationMembershipsApi"
        ],
        "summary": "Create or update a membership plan",
        "description": "Omit `membershipPlanId` to create, supply it to update.\n\n`price` is in the currency's major unit (a 4,980 yen plan is\n`4980`). `interval` is `month` or `year`; anything else is\ntreated as `month`.\n\nChanging the price does not re-price anyone already\nsubscribed — Stripe keeps billing existing members at the\namount they signed up for.\n\nRequired scope: `store.memberships.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipPlanRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipPlanRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipPlanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPlanResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPlanResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPlanResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId or name missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.memberships.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.memberships.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/memberships/plans/{planId}": {
      "get": {
        "tags": [
          "ReservationMembershipsApi"
        ],
        "summary": "Get a membership plan",
        "description": "Required scope: `store.memberships.read`.",
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPlanResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPlanResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPlanResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.memberships.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.memberships.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/memberships/plans/{planId}/deactivate": {
      "post": {
        "tags": [
          "ReservationMembershipsApi"
        ],
        "summary": "Stop selling a plan",
        "description": "Takes the plan off sale. Members already on it keep their\nmembership and go on being billed — use the member\ncancellation endpoint to stop a specific person's charges.\n\nRequired scope: `store.memberships.write`.",
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deactivated."
          },
          "404": {
            "description": "Not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.memberships.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.memberships.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/memberships/members": {
      "get": {
        "tags": [
          "ReservationMembershipsApi"
        ],
        "summary": "List members",
        "description": "Everyone who has subscribed at this store, newest first.\nLapsed and cancelled members are included so the list can\nanswer whether someone was ever charged; pass\n`currentOnly=true` for just those still entitled or still\nbeing billed.\n\n`cancelAtPeriodEnd` marks a member who has cancelled but is\nstill inside the period they paid for — they can still\nattend until `currentPeriodEnd`.\n\nRequired scope: `store.memberships.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currentOnly",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipMemberListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipMemberListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipMemberListResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.memberships.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.memberships.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ReservationMembershipsApi"
        ],
        "summary": "Start a membership paid at the terminal",
        "description": "Records one period of membership the customer has just paid for\nat the payment terminal (t-e9a2f1234). It is Active at once and\nruns one `interval` of the plan from `paidAt`.\n\n**Renewals.** A counter sale does not renew by itself — there is\nno card on file behind it. The member renews by paying at the\ncounter again and calling this again. The new period starts where\nthe current one ends, so renewing early loses nothing. Each\npayment is its own row in the member list. Moving a member onto\nautomatic card billing is done by them joining online.\n\nBecause nothing is billed, the cancel endpoint answers 409 for\nthese; the membership simply ends at `currentPeriodEnd`.\n\nIdempotent on `payment.terminalId` + `payment.slipNumber`, like\nthe pass sale: a retry returns the recorded membership with\n`replayed: true`.\n\nErrors carry a code in `error`: `plan_not_found`,\n`customer_not_found`, `plan_not_on_sale`, `slip_already_used`.\n\nRequired scope: `store.memberships.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipSaleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipSaleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipSaleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipSaleResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipSaleResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipSaleResponse"
                }
              }
            }
          },
          "400": {
            "description": "A required field is missing, or the plan is not on sale.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Plan or customer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "This slip was already recorded for another customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.memberships.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.memberships.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/memberships/members/{membershipId}/cancel": {
      "post": {
        "tags": [
          "ReservationMembershipsApi"
        ],
        "summary": "Cancel a member's subscription",
        "description": "Stops future billing at the end of the period already paid\nfor. Never immediate: the member paid for this period and\nkeeps access until `periodEnd`.\n\n`customerId` identifies which member — a membership id alone\nis not enough, because memberships are stored per customer.\n\nReturns 409 when the membership was never billed, and 503\nwhen the store's payment account cannot be reached. Both\nleave the membership untouched.\n\nRequired scope: `store.memberships.write`.",
        "parameters": [
          {
            "name": "membershipId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipCancelResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipCancelResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipCancelResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Nothing to cancel — never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Payments unavailable, or Stripe refused."
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.memberships.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.memberships.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/passes/products": {
      "get": {
        "tags": [
          "ReservationPassesApi"
        ],
        "summary": "List pass products",
        "description": "The pass products a store offers. `storeId` is required. Set\n`activeOnly=true` for only those currently on sale.\n\nRequired scope: `store.passes.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activeOnly",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PassProductListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassProductListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassProductListResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.passes.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.passes.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ReservationPassesApi"
        ],
        "summary": "Create or update a pass product",
        "description": "Omit `passProductId` to create, supply it to update.\n\n`price` is in the currency's major unit (a 12,000 yen pass is\n`12000`). `credits` is how many bookings it covers.\n\nEditing a product does not change passes already sold — name,\nprice and credits are copied onto a pass at purchase so history\nis not rewritten by a later edit.\n\nRequired scope: `store.passes.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassProductRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PassProductRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PassProductRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PassProductResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassProductResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassProductResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId or name missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "passProductId given but not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.passes.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.passes.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/passes/products/{passProductId}": {
      "get": {
        "tags": [
          "ReservationPassesApi"
        ],
        "summary": "Get a pass product",
        "description": "Required scope: `store.passes.read`.",
        "parameters": [
          {
            "name": "passProductId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PassProductResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassProductResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassProductResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.passes.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.passes.read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "ReservationPassesApi"
        ],
        "summary": "Delete a pass product",
        "description": "Takes the product off sale. Passes already bought keep working —\ntheir credits and expiry are held on the pass itself, not on the\nproduct.\n\nRequired scope: `store.passes.write`.",
        "parameters": [
          {
            "name": "passProductId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.passes.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.passes.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/passes/holders": {
      "get": {
        "tags": [
          "ReservationPassesApi"
        ],
        "summary": "List pass holders",
        "description": "Every pass sold at this store, newest first. Spent and expired\npasses are included so the list can answer whether a customer\never bought one; pass `usableOnly=true` for those with credits\nleft and not yet expired.\n\n`remainingCredits` is the balance; `status` is Pending / Active /\nExhausted / Expired / Cancelled. A Pending pass has been started\nbut not paid for and grants nothing.\n\nRequired scope: `store.passes.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "usableOnly",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PassHolderListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassHolderListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassHolderListResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.passes.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.passes.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/passes": {
      "post": {
        "tags": [
          "ReservationPassesApi"
        ],
        "summary": "Sell a pass paid at the terminal",
        "description": "Records a pass the customer has just paid for at the payment\nterminal. It is Active at once, with the product's full credits;\nexpiry is counted from `paidAt`.\n\n`payment.terminalId` and `payment.slipNumber` identify the sale. A\nretry with the same pair returns the pass already recorded, with\n`replayed: true`, instead of selling it again — so a request that\ntimed out can simply be sent again.\n\n`payment.amount` is what was charged, when it differs from the\nproduct price (a discount at the till). `paidAt` defaults to now.\n\nErrors carry a code in `error`: `pass_product_not_found`,\n`customer_not_found`, `pass_product_not_on_sale`, and\n`slip_already_used` when the slip was recorded for a different\ncustomer.\n\nRequired scope: `store.passes.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassSaleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PassSaleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PassSaleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PassSaleResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassSaleResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassSaleResponse"
                }
              }
            }
          },
          "400": {
            "description": "A required field is missing, or the product is not on sale.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Product or customer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "This slip was already recorded for another customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.passes.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.passes.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/passes/{passId}/redeem": {
      "post": {
        "tags": [
          "ReservationPassesApi"
        ],
        "summary": "Use one credit from a pass",
        "description": "Takes one credit off the pass — \"1回消化\" at the counter.\n\n**When a credit is taken.** A booking made by a pass holder\nalready takes a credit *when it is booked*, and cancelling the\nbooking gives it back; a no-show does not. Attendance takes\nnothing. So redeem is for a walk-in, or for a booking that was\nmade without a pass — check the booking's `passId` first.\n\nPass `reservationId` to tie the credit to a booking. The booking\nthen records the pass, so cancelling it returns the credit, and\nredeeming the same booking again returns `replayed: true` without\ntaking a second credit.\n\nFor a walk-in, send `idempotencyKey` — any unique string the\ndevice makes up per visit, such as a UUID. Retrying with the same\nkey returns `replayed: true` and takes nothing more. A refused\nredeem does not use the key up. Without a key or a booking, every\ncall takes a credit.\n\nRefusals carry a code in `error`: `pass_not_found`,\n`pass_not_active` (unpaid or cancelled), `pass_expired`,\n`pass_exhausted`, `reservation_not_found`, `reservation_cancelled`,\n`customer_mismatch`, `reservation_already_redeemed` (with the\n`passId` the booking already used), and `idempotency_key_reused`\nwhen the key was sent before for a different customer or booking.\n\nUndo with `/unredeem`.\n\nRequired scope: `store.passes.write`.",
        "parameters": [
          {
            "name": "passId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassCreditRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PassCreditRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PassCreditRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PassCreditResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassCreditResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassCreditResponse"
                }
              }
            }
          },
          "404": {
            "description": "Pass or reservation not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The pass cannot be used, or the booking cannot take it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Too many simultaneous writes to this pass; nothing changed, retry."
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.passes.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.passes.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/passes/{passId}/unredeem": {
      "post": {
        "tags": [
          "ReservationPassesApi"
        ],
        "summary": "Give back a credit",
        "description": "Undoes a redeem: returns one credit to the pass. Never raises the\nbalance above what was sold (`nothing_to_restore`). An expired\npass gets the credit back but stays expired.\n\nWith `reservationId`, the booking must be carrying this pass\n(`reservation_not_using_pass` otherwise); it is released from the\npass as the credit comes back. This also undoes the credit taken\nautomatically at booking, without cancelling the booking.\n\n`idempotencyKey` works as it does on redeem, so a retried undo\ndoes not give back two credits.\n\nRequired scope: `store.passes.write`.",
        "parameters": [
          {
            "name": "passId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PassCreditRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PassCreditRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PassCreditRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PassCreditResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassCreditResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassCreditResponse"
                }
              }
            }
          },
          "404": {
            "description": "Pass or reservation not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Nothing to give back, or the booking does not carry this pass.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Too many simultaneous writes to this pass; nothing changed, retry."
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.passes.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.passes.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/passes/import/preview": {
      "post": {
        "tags": [
          "ReservationPassesApi"
        ],
        "summary": "Check a pass import file",
        "description": "Reads a CSV and reports what would happen, changing nothing.\nEvery row comes back with its line number and, where it cannot\nbe used, the reason.\n\nColumns: name, nameKana, phone, email, passName, remainingCredits,\ntotalCredits, expiresAt (yyyy-MM-dd).\n\nWorth calling first. An import matches customers on phone and\nemail, and a column mapped wrongly quietly creates a second\nrecord for everyone in the file.\n\nRequired scope: `store.passes.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PassImportResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassImportResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassImportResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing, or no file supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.passes.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.passes.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/passes/import": {
      "post": {
        "tags": [
          "ReservationPassesApi"
        ],
        "summary": "Import passes",
        "description": "Creates the passes the preview described. Customers are matched\non phone and email, and created when no match is found.\n\nRows that cannot be used are skipped rather than failing the\nwhole file, so a single bad line does not cost the other two\nhundred. Check `errorCount` afterwards.\n\nRequired scope: `store.passes.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PassImportResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassImportResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassImportResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing, or no file supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.passes.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.passes.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/resources": {
      "get": {
        "tags": [
          "ReservationResourcesApi"
        ],
        "summary": "List bookable resources",
        "description": "Tables, rooms, counters and stations a booking can be assigned\nto, taken from the store layout. `storeId` is required.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceListResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/resources/staff": {
      "get": {
        "tags": [
          "ReservationResourcesApi"
        ],
        "summary": "List staff who can take a booking",
        "description": "Staff treated as bookable resources — the people a customer can\npick when a menu allows choosing one.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceListResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/resources/staff/availability": {
      "get": {
        "tags": [
          "ReservationResourcesApi"
        ],
        "summary": "Get staff working hours",
        "description": "When each member of staff is on shift between `fromDate` and\n`toDate` (yyyy-MM-dd). This is availability from the roster, not\nfree time — a window here may already be booked.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StaffAvailabilityResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffAvailabilityResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffAvailabilityResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId, fromDate or toDate missing, or the range is backwards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations": {
      "get": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "List reservations",
        "description": "Returns reservations for a store, earliest first. `storeId`\nis required. Optional filters:\n- `status` — Pending / Confirmed / Arrived / Completed / Cancelled / NoShow\n- `from` / `to` — reservation-date range (yyyy-MM-dd)\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationListResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing or malformed, or status not one of the six values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "Create a reservation",
        "description": "Creates a reservation. Minimum fields: storeId,\nreservationDate (yyyy-MM-dd), startTime / endTime (HH:mm),\ncustomerName. Status defaults to the store's auto-confirm\nsetting. `slotId` links the reservation to a published\nslot when supplied; capacity bookkeeping follows, and an\nunknown `slotId` answers 404 `slot_not_found`.\n`paymentStatus` is ignored: it is set by the payment itself.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing required fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Store or slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/{reservationId}": {
      "get": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "Get a reservation",
        "description": "Required scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "reservationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "Update a reservation (details and/or status)",
        "description": "Updates reservation fields. When `status` differs from the\ncurrent value, the transition is applied through the same\npath the web portal uses for capacity bookkeeping. The\ncustomer is not emailed or messaged about the change; a\ncancellation still offers the freed place to the store's\nwaitlist when it has one. Allowed status\nvalues: Pending / Confirmed / Arrived / Completed / Cancelled / NoShow.\n\n`Arrived` (来店済) is check-in: the customer is here but not yet\nfinished, and the booking keeps its seat. It can only be set on a\nPending or Confirmed booking. Set `Completed` when the visit is over\n(paid).\n\nA Cancelled, NoShow or Completed booking cannot be sent back to\nPending, Confirmed or Arrived — its seat was already released, so\nrebook instead. Corrections between those three are allowed.\nRefused changes answer 409 `invalid_transition`.\n\n**Partial update.** Only the fields present in the body change;\nanything left out keeps its value. `{\"storeId\": \"…\", \"status\":\n\"Arrived\"}` changes the status and nothing else. Send an empty\nstring to clear a field on purpose.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "reservationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationUpdateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationUpdateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/{reservationId}/move": {
      "post": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "Move a reservation to another time",
        "description": "Moves the booking to `slotId`, keeping its customer, notes, pass\ncredit and payment. The new slot is held before the old one is let\ngo, so a slot that fills in the meantime leaves the booking where it\nwas (409 `slot_unavailable`).\n\nA booking over several slots moves as a whole:\n- **A menu booking** is laid out again from `slotId` across as many\n  slots as the menu needs, on one resource — the times\n  `GET /menus/{menuId}/availability` offers. Send its\n  `primarySlotId`; the rest is worked out here.\n- **Joined tables** are seated again at the new time: on\n  `joinedSlotIds` when given, otherwise wherever the party fits (one\n  table, or a join the store has set up).\n\nOnly a Pending or Confirmed booking can move (409\n`invalid_transition`). Stays and rentals cannot — moving one changes\nthe nights charged — and answer 409 `not_movable`.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "reservationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveReservationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveReservationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MoveReservationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationResponse"
                }
              }
            }
          },
          "404": {
            "description": "Reservation or slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The slot cannot take it, or this booking cannot move.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/slots": {
      "get": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "List reservation slots in a date range",
        "description": "Returns published time slots with capacity + booked count.\nDefault range is today + 7 days when from/to omitted.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationSlotListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationSlotListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationSlotListResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "Create a reservation slot",
        "description": "Creates a single slot (date + start/end + capacity +\noptional assigned resource). For bulk creation across a\ndate range based on the store's reservation config, use\n/slots/generate instead.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSlotRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSlotRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSlotRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationSlotResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationSlotResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationSlotResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId, slotDate, startTime or endTime missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/slots/generate": {
      "post": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "Bulk-generate slots for a date range",
        "description": "Generates slots from the store's reservation configuration\n(slot duration, business hours, closed days). With\nperResource=true, generates one series per reservable\nresource (table / room / counter) from the store layout —\nthe same behaviour as the web portal's timeline view.\n\nReturns the number of slots created. Existing slots are\nnot duplicated. `from` and `to` are required and at most 366 days\napart.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateSlotsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateSlotsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateSlotsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SlotGenerateResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotGenerateResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlotGenerateResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/slots/{slotId}": {
      "delete": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "Delete a slot",
        "description": "A slot that still holds bookings is refused with 409\n`slot_has_bookings`: cancel or move those bookings first.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "slotId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Slot not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The slot still holds bookings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/config": {
      "get": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "Get the store's reservation configuration",
        "description": "Slot duration, booking window, auto-confirm, business\nhours, closed days, custom form fields, notification\nsettings — what the client needs to render a booking\neditor consistently with the web portal.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationConfigDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationConfigDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationConfigDto"
                }
              }
            }
          },
          "404": {
            "description": "No configuration for this store yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/tables": {
      "get": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "List reservable tables / seating resources",
        "description": "Returns the reservable resources (tables, rooms, counters,\nstations) extracted from the store's layout — the same set\nthe web portal's timeline view uses. Each carries id, name,\ntype, and seating capacity. Use the ids as\n`assignedResource` on slots and reservations.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationTablesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationTablesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationTablesResponse"
                }
              }
            }
          },
          "404": {
            "description": "Store not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/menus": {
      "get": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "List bookable services",
        "description": "Returns the store's bookable services — a cut, a filling, a\nconsultation — each with the duration it takes.\n\nA store that sells plain time slots has none of these, and\ngets an empty list.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationMenuListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationMenuListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationMenuListResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/menus/{menuId}/availability": {
      "get": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "Start times available for a service",
        "description": "Returns the times this service can start on `date` (today in\nJapan time when omitted), together with the slots each booking\nwould hold.\n\nA service is laid across as many consecutive slots as its\nduration needs, so a 30-minute and a 90-minute service offer\ndifferent start times from the same opening hours. A time is\nonly returned when the whole run is free on one resource.\n\nTo book, post a reservation with `slotId` set to\n`primarySlotId`, `joinedSlotIds` to the remaining ids, and\n`menuId` set — the run is then held in one transaction.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "menuId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "partySize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationMenuAvailabilityResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationMenuAvailabilityResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationMenuAvailabilityResponse"
                }
              }
            }
          },
          "404": {
            "description": "Menu not found or inactive.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/stats": {
      "get": {
        "tags": [
          "ReservationsApi"
        ],
        "summary": "Monthly reservation stats",
        "description": "Counts by status for the given month (default: current\nmonth), plus today / tomorrow totals — the numbers the\nweb portal dashboard shows.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationStatsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationStatsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationStatsDto"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/series": {
      "get": {
        "tags": [
          "ReservationSeriesApi"
        ],
        "summary": "List standing bookings",
        "description": "Every series for a store, including ended ones. `storeId` is\nrequired.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesListResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ReservationSeriesApi"
        ],
        "summary": "Create or update a standing booking",
        "description": "Omit `seriesId` to create, supply it to update.\n\n`dayOfWeek` is an English day name (Monday … Sunday) and\n`startTime` is HH:mm. `skipDates` is a comma-separated list of\nyyyy-MM-dd the customer is away.\n\nSaving records the intent only — call generate to turn it into\nbookings.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SeriesRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SeriesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SeriesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId or customerName missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "seriesId given but not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/series/{seriesId}": {
      "get": {
        "tags": [
          "ReservationSeriesApi"
        ],
        "summary": "Get a standing booking",
        "description": "Required scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "seriesId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/series/{seriesId}/generate": {
      "post": {
        "tags": [
          "ReservationSeriesApi"
        ],
        "summary": "Generate bookings from a series",
        "description": "Creates reservations up to `throughDate` (yyyy-MM-dd) wherever a\nmatching slot exists and is free. Weeks that cannot be booked are\ncounted rather than failing the call: `skipped` for ones passed\nover deliberately, `unavailable` for ones with no slot or no room.\n\nSafe to repeat: a week already booked is not booked twice.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "seriesId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "throughDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesGenerateResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesGenerateResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesGenerateResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId or throughDate missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/series/{seriesId}/end": {
      "post": {
        "tags": [
          "ReservationSeriesApi"
        ],
        "summary": "End a standing booking",
        "description": "Stops the series. Set `cancelFuture=true` to also cancel\nbookings it already created that have not happened yet; past\nbookings are never touched.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "seriesId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cancelFuture",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesEndResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesEndResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeriesEndResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/stock/types": {
      "get": {
        "tags": [
          "ReservationStockApi"
        ],
        "summary": "List stock types",
        "description": "What this store rents out. `storeId` is required. Retired types\nare excluded unless `activeOnly=false`.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activeOnly",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StockTypeListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockTypeListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockTypeListResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ReservationStockApi"
        ],
        "summary": "Create or update a stock type",
        "description": "Omit `stockTypeId` to create, supply it to update.\n\n`kind` is Night for things booked by the night (a room) or Day\nfor things booked by the day (a rental). `quantity` is how many\nexist; `maxOccupancy` how many people one holds.\n\nCreating a type does not make it bookable — generate inventory\nfor the dates it should be available.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockTypeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StockTypeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StockTypeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StockTypeResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockTypeResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockTypeResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId or name missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "stockTypeId given but not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/stock/types/{stockTypeId}": {
      "get": {
        "tags": [
          "ReservationStockApi"
        ],
        "summary": "Get a stock type",
        "description": "Required scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "stockTypeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StockTypeResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockTypeResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockTypeResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/stock/types/{stockTypeId}/retire": {
      "post": {
        "tags": [
          "ReservationStockApi"
        ],
        "summary": "Retire a stock type",
        "description": "Stops it being offered. Bookings already made against it are\nuntouched.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "stockTypeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/stock/types/{stockTypeId}/generate": {
      "post": {
        "tags": [
          "ReservationStockApi"
        ],
        "summary": "Generate inventory for a date range",
        "description": "Creates the day rows that make a type bookable between `fromDate`\nand `toDate` (yyyy-MM-dd). Dates that already have rows are left\nalone, so this is safe to repeat and safe to run past the\nexisting horizon.\n\nReturns how many days were created.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "stockTypeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StockGenerateResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockGenerateResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockGenerateResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId, fromDate or toDate missing, or the range is backwards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/stock/types/{stockTypeId}/horizon": {
      "get": {
        "tags": [
          "ReservationStockApi"
        ],
        "summary": "How far ahead a type is bookable",
        "description": "The last date with inventory. Nothing can be booked beyond it,\nso a horizon creeping towards today is the quiet failure worth\nwatching for — the store stops taking bookings without anything\nappearing to break.\n\nNull when no inventory has been generated at all.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "stockTypeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StockHorizonResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockHorizonResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockHorizonResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/waitlist": {
      "get": {
        "tags": [
          "ReservationWaitlistApi"
        ],
        "summary": "List everyone waiting",
        "description": "Active queue entries across the store, in the order they joined.\n`storeId` is required.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WaitlistListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaitlistListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaitlistListResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ReservationWaitlistApi"
        ],
        "summary": "Add someone to a queue",
        "description": "Joins the queue for a slot. This is not a booking and holds no\nseat — it records that someone wants one if it frees up.\n\n`customerName` and `slotId` are required. Contact details are\nhow the store reaches them when a place opens, so an entry with\nneither phone nor email is accepted but cannot be offered\nanything.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WaitlistJoinRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/WaitlistJoinRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/WaitlistJoinRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WaitlistEntryResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaitlistEntryResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaitlistEntryResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId, slotId or customerName missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/waitlist/slots/{slotId}": {
      "get": {
        "tags": [
          "ReservationWaitlistApi"
        ],
        "summary": "Get the queue for one slot",
        "description": "Everyone waiting on a single slot, with the totals the store\ndecides by — a queue is judged per sitting, not per person.\n\nRequired scope: `store.reservations.read`.",
        "parameters": [
          {
            "name": "slotId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WaitlistSlotResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaitlistSlotResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaitlistSlotResponse"
                }
              }
            }
          },
          "400": {
            "description": "storeId or slotId missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.read"
            ]
          }
        ]
      }
    },
    "/api/v1/reservations/waitlist/{waitlistId}/cancel": {
      "post": {
        "tags": [
          "ReservationWaitlistApi"
        ],
        "summary": "Remove someone from a queue",
        "description": "Takes an entry out of the queue — they phoned, or the store\nseated them another way.\n\nRequired scope: `store.reservations.write`.",
        "parameters": [
          {
            "name": "waitlistId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not found, or already dealt with.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.reservations.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.reservations.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/ad-spaces": {
      "get": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "List ad spaces",
        "description": "Every ad space the account has: one per signage screen, per store's\nreceipts (digital and, with a ReceiptRoller printer, printed), and the\napp's banner and notice slots. They follow the account's stores and\nscreens, so there is nothing to create or delete: a space is offered to\nadvertisers by opening it, and withdrawn by closing it.\n\nRequired scope: `store.media.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpacesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpacesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpacesResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.read"
            ]
          }
        ]
      }
    },
    "/api/v1/media/ad-spaces/{surfaceId}": {
      "get": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "Get an ad space",
        "description": "Required scope: `store.media.read`.",
        "parameters": [
          {
            "name": "surfaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "Change an ad space's own settings",
        "description": "Anything left null follows the account's selling rules. Values are\nkept in range the same way the web screen does: the share is 0–100,\nmasks with no bit set mean every day or hour, the print line limit\nis 1–6 and applies to printed receipts only, and the per-customer cap\napplies to app spaces only.\n\nRequired scope: `store.media.write`.",
        "parameters": [
          {
            "name": "surfaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdSpaceUpdateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdSpaceUpdateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdSpaceUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/ad-spaces/{surfaceId}/open": {
      "post": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "Open or close an ad space to advertisers",
        "description": "Opening needs a plan that includes selling ad space; without one the\nanswer is 402 and nothing changes. A closed space still plays the\nstore's own promotions.\n\nRequired scope: `store.media.write`.",
        "parameters": [
          {
            "name": "surfaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetOpenRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetOpenRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetOpenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/ad-spaces/{surfaceId}/pause": {
      "post": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "Pause or resume outside ads on one ad space",
        "description": "Required scope: `store.media.write`.",
        "parameters": [
          {
            "name": "surfaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPausedRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPausedRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetPausedRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdSpaceResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/selling-rules": {
      "get": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "Get the selling rules",
        "description": "Required scope: `store.media.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SellingRulesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellingRulesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellingRulesResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "Change the selling rules",
        "description": "Replaces the rules the body names. The stop switch, trusted and blocked\nadvertisers are changed through their own calls and are left as they are.\nOut-of-range values are brought into range as on the web screen;\nunknown categories and surface types are dropped.\n\nRequired scope: `store.media.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SellingRulesRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SellingRulesRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SellingRulesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SellingRulesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellingRulesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellingRulesResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/external-ads/pause": {
      "post": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "Stop or restart all outside ads",
        "description": "The one-tap stop: every ad space goes back to the store's own\npromotions at once, whatever each space is set to, until restarted.\n\nRequired scope: `store.media.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPausedRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPausedRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetPausedRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SellingRulesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellingRulesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellingRulesResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/reviews": {
      "get": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "List campaign reviews",
        "description": "Advertisers' campaigns that reach this account's ad spaces, waiting\nones first. A campaign runs only at the accounts that approve it.\n\nRequired scope: `store.media.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReviewResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReviewResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReviewResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.read"
            ]
          }
        ]
      }
    },
    "/api/v1/media/reviews/{campaignId}": {
      "get": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "Get a campaign to review",
        "description": "The campaign with its delivery units and ads, and a link to look at\neach creative. Creative links are short-lived; fetch them when shown.\n\nRequired scope: `store.media.read`.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDetailResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDetailResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDetailResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.read"
            ]
          }
        ]
      }
    },
    "/api/v1/media/reviews/{campaignId}/approve": {
      "post": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "Approve a campaign",
        "description": "It starts running on this account's ad spaces. 409 when it is not\nwaiting for this account's decision.\n\nRequired scope: `store.media.write`.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/reviews/{campaignId}/reject": {
      "post": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "Decline a campaign",
        "description": "It won't run on this account's ad spaces. The reason is shown to the\nadvertiser. 409 when it is not waiting for this account's decision.\n\nRequired scope: `store.media.write`.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RejectRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RejectRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RejectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/revenue": {
      "get": {
        "tags": [
          "RetailMediaApi"
        ],
        "summary": "Get ad revenue for a month",
        "description": "What the account's ad spaces earned in a Japan calendar month: its\nshare of what advertisers were charged plus the coupon discounts paid\nback, before tax, by ad space, by store and by ad. The running month\nis an estimate up to today; the monthly statement is the confirmed\nfigure. `month` is `yyyy-MM`, within the last 12 months; this month\nwhen left out.\n\nRequired scope: `store.media.read`.",
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RevenueResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevenueResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevenueResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sales/kpis": {
      "get": {
        "tags": [
          "SalesApi"
        ],
        "summary": "Get current-month KPIs with MoM comparison",
        "description": "Omit storeId for org-level KPIs; include it for a single store.\n\n**terminalId** — when supplied, returns terminal-scoped KPIs\ncomputed live from POS transactions (since snapshots only\ncarry store granularity). Only `Revenue` and `TransactionCount`\nare meaningful at the terminal level — the other KPI fields\n(StaffCount, ProductCount, etc.) are not terminal-scoped and\ncome back as zero. Requires `storeId`; the terminal must\nbelong to that store or the call returns 404.\n\n**Response shape depends on scope.** With `storeId` (or\n`terminalId`) the response is the store shape (`revenue`,\n`transactionCount`, `customerCount`, …). WITHOUT `storeId` the\nresponse is the ORG shape (`totalRevenue`, `totalTransactions`,\n`totalCustomers`, …) — different field names. Pass `storeId`\nto get the store shape documented below.\n\n**`customerCount` is not visitors.** It is the number of customers in\nthe store's customer list (CRM records assigned to this store), as\ncounted when the month's snapshot was taken — a register size, not\nhow many people shopped. A busy store whose customers were never\nassigned to it reads 0. Label it \"customers on file\" (顧客数), not\n\"visitors\" (客数); the web dashboard hides the card when it is 0\nthis month and last. `totalCustomers` in the org shape is the same\ncount across the whole business account. Terminal scope returns 0.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "terminalId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/StoreDashboardKpis"
                    },
                    {
                      "$ref": "#/components/schemas/OrgDashboardKpis"
                    }
                  ]
                }
              },
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/StoreDashboardKpis"
                    },
                    {
                      "$ref": "#/components/schemas/OrgDashboardKpis"
                    }
                  ]
                }
              },
              "text/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/StoreDashboardKpis"
                    },
                    {
                      "$ref": "#/components/schemas/OrgDashboardKpis"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sales.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sales.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sales/trend": {
      "get": {
        "tags": [
          "SalesApi"
        ],
        "summary": "Get monthly or daily trend data (revenue, transactions, customers, …)",
        "description": "Omit storeId for org-level trend; include it for one store.\nmonths defaults to 12, max 60.\n\n**granularity=day** — returns `DailySalesTrendReport` instead: revenue\nand transactions for each of the last `days` days (default 30, max 365),\ncomputed live from POS transactions. Days are Japan-time calendar days,\noldest first; a day with no sales reads 0 and today's point has\n`isPartial: true`. Works with or without `storeId`, and with\n`terminalId`. `months` is ignored. Default `granularity=month` keeps the\nmonthly responses below unchanged.\n\n**terminalId** — when supplied, returns terminal-scoped trend\ncomputed live from POS transactions. Only `RevenueTrend` and\n`TransactionsTrend` are populated; other trend series come\nback empty. Requires `storeId`; 404 if the terminal isn't at\nthis store.\n\n**Response shape depends on scope.** With `storeId` the\nresponse is `StoreMonthlyReport`. WITHOUT `storeId` it is\n`OrgMonthlyReport` (adds a `storesTrend` series).",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "months",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 12
            }
          },
          {
            "name": "terminalId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "description": "'month' (default) or 'day'.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "description": "With granularity=day: how many days, ending today. Default 30, max 365.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/StoreMonthlyReport"
                    },
                    {
                      "$ref": "#/components/schemas/OrgMonthlyReport"
                    },
                    {
                      "$ref": "#/components/schemas/DailySalesTrendReport"
                    }
                  ]
                }
              },
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/StoreMonthlyReport"
                    },
                    {
                      "$ref": "#/components/schemas/OrgMonthlyReport"
                    },
                    {
                      "$ref": "#/components/schemas/DailySalesTrendReport"
                    }
                  ]
                }
              },
              "text/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/StoreMonthlyReport"
                    },
                    {
                      "$ref": "#/components/schemas/OrgMonthlyReport"
                    },
                    {
                      "$ref": "#/components/schemas/DailySalesTrendReport"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sales.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sales.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sales/advice": {
      "get": {
        "tags": [
          "SalesApi"
        ],
        "summary": "Get business-intelligence advice cards",
        "description": "Returns the Intelligence-panel cards. Filter by severity (Action/Warning/Opportunity/Info) and/or category (Trend/AverageTicket/MixShift/Anomaly/Forecast/Comparison).",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesAdviceListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesAdviceListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesAdviceListResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sales.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sales.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sales/forecast": {
      "get": {
        "tags": [
          "SalesApi"
        ],
        "summary": "Get month-end forecast",
        "description": "Returns Forecast-category advice cards (projected month-end values with confidence ranges). Empty until the forecast generator ships.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesForecastListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesForecastListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesForecastListResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sales.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sales.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sales/products": {
      "get": {
        "tags": [
          "SalesApi"
        ],
        "summary": "Get product-level sales with ABC analysis",
        "description": "Aggregates POS line items in [since, until) and returns a\nranked product list with ABC groups (A ≤70% cumulative\nrevenue, B ≤90%, C the rest). Filter by category or product\nname search; sort by revenue or quantity.\n\n**terminalId** — when supplied, restricts the aggregation to\nline items from that single POS terminal. The terminal must\nbelong to the supplied storeId or the call returns 404\n(cross-store ID guessing defence).",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "terminalId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSalesReportDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSalesReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSalesReportDto"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sales.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sales.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sales/visitors": {
      "get": {
        "tags": [
          "SalesApi"
        ],
        "summary": "Get visitor analysis (hourly, day-of-week, conversion, new vs returning)",
        "description": "Aggregates Completed POS transactions for one store. Returns\nhourly distribution, day-of-week distribution, hour×day\nheatmap, conversion rate (% of transactions tied to a CRM\ncustomer), and the trailing 12-month new-vs-returning\nbreakdown.\n\n**terminalId** — when supplied, restricts the aggregation to\none POS terminal at the store (e.g. compare register-1 vs\nregister-2 traffic). 404 if the terminal isn't at this store.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "terminalId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/VisitorAnalysisReportDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitorAnalysisReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/VisitorAnalysisReportDto"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sales.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sales.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sales/multi-trend": {
      "get": {
        "tags": [
          "SalesApi"
        ],
        "summary": "Get monthly trends for several stores overlaid",
        "description": "Returns one StoreMonthlyReport per supplied storeId. Caller must be authorized for the org; per-store membership is implicit from org access. Useful for comparing store performance side-by-side.\n\n**Passing several stores.** Either form is accepted, and they can be mixed:\ncomma-separated in one parameter (`storeIds=A,B,C`), or the `storeIds`\nparameter repeated once per store. Duplicates are dropped.\n\n**At most 10 stores are compared.** When more are sent, the first 10\nare returned with `truncated: true`, and `omittedStoreIds` lists the\nrest; `requestedStoreCount` is the number sent. Send 10 or fewer:\nsending more is planned to become `400 too_many_stores`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeIds",
            "in": "query",
            "description": "Store ids to compare. Comma-separated (A,B,C) or repeated (storeIds=A&storeIds=B); up to 10.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "months",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 12
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesMultiTrendResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesMultiTrendResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesMultiTrendResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sales.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sales.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sales/churn": {
      "get": {
        "tags": [
          "SalesApi"
        ],
        "summary": "Score store customers on churn risk (RFM-lite)",
        "description": "Returns every CRM customer of the store scored 0–100 on how likely they are to stop coming, with bucket (high/medium/low/stable) and a recommended JA action.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lookbackDays",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 180
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerChurnReportDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerChurnReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerChurnReportDto"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sales.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sales.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sales/recommendations": {
      "get": {
        "tags": [
          "SalesApi"
        ],
        "summary": "Get product recommendations for one customer",
        "description": "Item co-occurrence scoring against the store's recent transactions: for each product the customer has bought, find products bought alongside it, rank, return top N.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topN",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 5
            }
          },
          {
            "name": "lookbackDays",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerRecommendationsDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerRecommendationsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerRecommendationsDto"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sales.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sales.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sales/products/narrative": {
      "get": {
        "tags": [
          "SalesApi"
        ],
        "summary": "Get the plain-language reading of the product report",
        "description": "The same paragraph the web analytics page shows above the product\ntable: what the numbers in that report actually say, in prose.\n\nTakes the same query as `/sales/products`, and describes the report\nthose arguments produce - pass what you passed there and the two\nagree. Omit `storeId` for the cross-store reading.\n\nKept apart from `/sales/products` on purpose. Writing the paragraph\nmeans calling a language model, which takes seconds, while the\nreport itself returns immediately. Folding it in would have made\nevery caller wait for prose they may not be showing yet - so fetch\nthe report, draw it, and fill this in when it arrives.\n\n`narrative` is null when the feature is switched off for the install\n(`Analytics:NarrativesEnabled`) or no model key is configured. That\nis not an error: `enabled` says which it is, and a client should\nsimply omit the panel, as the web page does.\n\nRepeated calls for the same report are served from a one-hour cache,\nso this is cheap to call again on a redraw.\n\nRequired scope: `sales.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesNarrativeResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesNarrativeResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesNarrativeResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sales.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sales.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sales/products/narrative/regenerate": {
      "post": {
        "tags": [
          "SalesApi"
        ],
        "summary": "Rewrite the reading of the product report",
        "description": "Drops the cached paragraph for this report and writes a fresh one -\nthe API side of the web page's regenerate button.\n\nTakes the same query as the GET above and returns the same shape.\nSince it deliberately skips the cache it pays the full model call\nevery time, so it belongs behind a button, not a refresh.\n\nRequired scope: `sales.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SalesNarrativeResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesNarrativeResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesNarrativeResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sales.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sales.read"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/shifts": {
      "get": {
        "tags": [
          "ShiftsApi"
        ],
        "summary": "List shifts for a store",
        "description": "Without `fromDate` / `toDate` this returns the store's whole rota.\nPass both to bound it — a busy store accumulates thousands of rows,\nand the app only ever draws one week.\n\nEach row carries the staff member's `hourlyRate` so the caller can\ntotal labour cost without a second request. Read the caveat on that\nfield before you rely on it.\n\nRequired scope: `store.staff.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Only one of fromDate / toDate given, or the range is backwards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such store in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.staff.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "ShiftsApi"
        ],
        "summary": "Add a shift",
        "description": "Required scope: `store.staff.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShiftRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShiftRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShiftRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftResponse"
                }
              }
            }
          },
          "400": {
            "description": "A required field is missing or malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such store, or no such staff member in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.staff.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.write"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/shifts/{shiftId}": {
      "delete": {
        "tags": [
          "ShiftsApi"
        ],
        "summary": "Remove a shift",
        "description": "Required scope: `store.staff.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "shiftId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "No such store, or no such shift in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.staff.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/displays": {
      "get": {
        "tags": [
          "SignageApi"
        ],
        "summary": "List signage screens",
        "description": "The account's screens with whether each is actually playing\n(`health`): a screen can be online and still stuck.\n\nRequired scope: `store.media.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DisplayResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DisplayResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DisplayResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "SignageApi"
        ],
        "summary": "Add a signage screen",
        "description": "Returns the screen and a 6-digit pairing code, valid 10 minutes, to\ntype into the ReceiptRoller display app on the device. The code is\nreturned only here and from `pairing-code`.\n\nRequired scope: `store.media.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisplayRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DisplayRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DisplayRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PairingResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairingResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/displays/{displayId}": {
      "put": {
        "tags": [
          "SignageApi"
        ],
        "summary": "Rename a screen or change its zone",
        "description": "An empty zone takes the screen out of its zone. Required scope: `store.media.write`.",
        "parameters": [
          {
            "name": "displayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisplayRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DisplayRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DisplayRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DisplayResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisplayResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisplayResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "SignageApi"
        ],
        "summary": "Remove a screen",
        "description": "The device stops receiving a playlist. Required scope: `store.media.write`.",
        "parameters": [
          {
            "name": "displayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/displays/{displayId}/pairing-code": {
      "post": {
        "tags": [
          "SignageApi"
        ],
        "summary": "Issue a new pairing code for a screen",
        "description": "For a replaced device, or when the first code ran out. Valid 10\nminutes; pairing with it gives the screen a new device token.\n\nRequired scope: `store.media.write`.",
        "parameters": [
          {
            "name": "displayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PairingResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairingResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairingResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/promotions": {
      "get": {
        "tags": [
          "SignageApi"
        ],
        "summary": "List the store's own promotions",
        "description": "Promotions the account plays on its own screens, alongside or instead\nof advertisers' ads. Required scope: `store.media.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PromotionResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "SignageApi"
        ],
        "summary": "Create a promotion",
        "description": "Starts as a draft with no creatives and plays nowhere; add creatives\nwith `PUT promotions/{id}` and where it plays with `placements`.\n\nRequired scope: `store.media.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewPromotionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/NewPromotionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/NewPromotionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/promotions/{promotionId}": {
      "get": {
        "tags": [
          "SignageApi"
        ],
        "summary": "Get a promotion and where it plays",
        "description": "Required scope: `store.media.read`.",
        "parameters": [
          {
            "name": "promotionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionDetailResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionDetailResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionDetailResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "SignageApi"
        ],
        "summary": "Change a promotion",
        "description": "Replaces its details, status and creatives. Only creatives of this\naccount that have a file are kept (see `GET creatives`). It plays\nonly while `Active`.\n\nRequired scope: `store.media.write`.",
        "parameters": [
          {
            "name": "promotionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromotionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PromotionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PromotionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "SignageApi"
        ],
        "summary": "Delete a promotion",
        "description": "Required scope: `store.media.write`.",
        "parameters": [
          {
            "name": "promotionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/promotions/{promotionId}/placements": {
      "post": {
        "tags": [
          "SignageApi"
        ],
        "summary": "Add where a promotion plays",
        "description": "Target every screen, chosen screens, the screens of chosen stores, or\nchosen zones. Screens, stores and zones that aren't this account's are\nignored. Days and hours are Japan time; none selected means every day\nor every hour, so a placement can't be made that never plays.\n\nRequired scope: `store.media.write`.",
        "parameters": [
          {
            "name": "promotionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlacementRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PlacementRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PlacementRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PlacementResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlacementResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlacementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/placements/{placementId}/active": {
      "post": {
        "tags": [
          "SignageApi"
        ],
        "summary": "Start or stop a placement",
        "description": "Required scope: `store.media.write`.",
        "parameters": [
          {
            "name": "placementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetActiveRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetActiveRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetActiveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PlacementResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlacementResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlacementResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/placements/{placementId}": {
      "delete": {
        "tags": [
          "SignageApi"
        ],
        "summary": "Remove a placement",
        "description": "Required scope: `store.media.write`.",
        "parameters": [
          {
            "name": "placementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.write"
            ]
          }
        ]
      }
    },
    "/api/v1/media/creatives": {
      "get": {
        "tags": [
          "SignageApi"
        ],
        "summary": "List creatives a promotion can play",
        "description": "The account's images and videos that have a file. Required scope: `store.media.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CreativeResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CreativeResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CreativeResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.media.read"
            ]
          }
        ]
      }
    },
    "/api/v1/pos/smaregi/webhook": {
      "post": {
        "tags": [
          "SmaregiWebhook"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sns/accounts": {
      "get": {
        "tags": [
          "SnsApi"
        ],
        "summary": "List connected SNS accounts",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SnsAccountsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsAccountsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsAccountsResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.audience.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.audience.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sns/accounts/{accountId}": {
      "get": {
        "tags": [
          "SnsApi"
        ],
        "summary": "Get a single SNS account",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SnsAccountSummary"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsAccountSummary"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsAccountSummary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.audience.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.audience.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sns/posts": {
      "get": {
        "tags": [
          "SnsApi"
        ],
        "summary": "List recent SNS posts",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostsResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "SnsApi"
        ],
        "summary": "Create a draft post (and optionally publish or schedule it)",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostMutationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostMutationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostMutationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.write"
            ]
          }
        ]
      }
    },
    "/api/v1/sns/posts/{contentId}": {
      "get": {
        "tags": [
          "SnsApi"
        ],
        "summary": "Get a single SNS post",
        "parameters": [
          {
            "name": "contentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostSummary"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostSummary"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostSummary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "SnsApi"
        ],
        "summary": "Update an existing draft post",
        "parameters": [
          {
            "name": "contentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "SnsApi"
        ],
        "summary": "Delete a draft / scheduled post",
        "parameters": [
          {
            "name": "contentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.write"
            ]
          }
        ]
      }
    },
    "/api/v1/sns/posts/{contentId}/analytics": {
      "get": {
        "tags": [
          "SnsApi"
        ],
        "summary": "Get cached analytics for a post",
        "parameters": [
          {
            "name": "contentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SnsAnalyticsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsAnalyticsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsAnalyticsResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `analytics.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "analytics.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sns/comments": {
      "get": {
        "tags": [
          "SnsApi"
        ],
        "summary": "List recent inbox comments",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sentiment",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyword",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SnsCommentsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsCommentsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsCommentsResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.read"
            ]
          }
        ]
      }
    },
    "/api/v1/sns/posts/{contentId}/publish": {
      "post": {
        "tags": [
          "SnsApi"
        ],
        "summary": "Publish a draft post immediately",
        "parameters": [
          {
            "name": "contentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPublishResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPublishResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPublishResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.write"
            ]
          }
        ]
      }
    },
    "/api/v1/sns/posts/{contentId}/schedule": {
      "post": {
        "tags": [
          "SnsApi"
        ],
        "summary": "Set or update the scheduled publish time for a draft post",
        "parameters": [
          {
            "name": "contentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SchedulePostRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SchedulePostRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SchedulePostRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsPostEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.write"
            ]
          }
        ]
      }
    },
    "/api/v1/sns/media": {
      "post": {
        "tags": [
          "SnsApi"
        ],
        "summary": "Fetch a public URL and re-host it as an SNS media attachment",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestMediaRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestMediaRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IngestMediaRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SnsMediaResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsMediaResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnsMediaResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `sns.content.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "sns.content.write"
            ]
          }
        ]
      }
    },
    "/api/v1/pos/square/webhook": {
      "post": {
        "tags": [
          "SquareWebhook"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/staff/announcements": {
      "get": {
        "tags": [
          "StaffAnnouncementsApi"
        ],
        "summary": "List announcements",
        "description": "Every announcement in the business account, newest first, pinned\nones on top.\n\n`storeId` narrows the list to what a person at that store would see:\nnotices sent to all staff, plus notices addressed to that store.\nNotices aimed at other stores are left out.\n\n`includeExpired=false` drops notices past their `expiresAt`.\n\nRequired scope: `store.staff.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeExpired",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AnnouncementListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnnouncementListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnnouncementListResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.staff.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "StaffAnnouncementsApi"
        ],
        "summary": "Post an announcement",
        "description": "With no `storeId` the notice goes to every member of staff in the\nbusiness account. With one, it goes to that store only.\n\nThe audience is fixed when the notice is created — the recipient\nlist is snapshotted then, so that read tracking has something stable\nto count against. Editing the title or body later is fine; changing\nwho it went to is not.\n\nRequired scope: `store.staff.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAnnouncementRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAnnouncementRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAnnouncementRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AnnouncementResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnnouncementResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnnouncementResponse"
                }
              }
            }
          },
          "400": {
            "description": "title or body missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.staff.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.write"
            ]
          }
        ]
      }
    },
    "/api/v1/staff/announcements/{announcementId}": {
      "delete": {
        "tags": [
          "StaffAnnouncementsApi"
        ],
        "summary": "Take an announcement down",
        "description": "Removes it from the list and from every recipient's inbox. The read\nreceipts are kept, so \"who had seen it\" survives the notice itself.\n\nPosting was reachable before this and taking down was not, which\nleaves a store able to publish a mistake to its whole payroll and\nunable to withdraw it (t-e9a2f962).\n\nRequired scope: `store.staff.write`.",
        "parameters": [
          {
            "name": "announcementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "No such announcement in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.staff.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.write"
            ]
          }
        ]
      }
    },
    "/api/v1/staff/announcements/{announcementId}/attachments": {
      "post": {
        "tags": [
          "StaffAnnouncementsApi"
        ],
        "summary": "Attach a file to a notice",
        "description": "Upload the bytes as `multipart/form-data` under the field name `file`.\nJPEG, PNG, WebP or PDF, up to 10 MB.\n\n**Attachments are not public.** They live in a private container and\neach listing hands back a link that expires in an hour. A notice to\nstaff — a rota change, a memo, a scan from head office — is not\nsomething to leave at a guessable address, which is the one way this\ndiffers from a product image.\n\nTaking a notice down does not delete its files. The notice is a soft\ndelete and its read receipts are kept, so the attachments stay with it;\nwhat stops is the listing that mints links, and the last one issued\nexpires within the hour.\n\nRequired scope: `store.staff.write` — the same scope as posting the\nnotice, because attaching to one is part of writing it.",
        "parameters": [
          {
            "name": "announcementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "No file, too large, or a type we do not accept.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such announcement in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.write"
            ]
          }
        ]
      }
    },
    "/api/v1/staff": {
      "get": {
        "tags": [
          "StaffApi"
        ],
        "summary": "List staff in the business account",
        "description": "Returns the business account's staff members.\n\n**Store scope:** SuperUser, OperationsManager and integration tokens\nsee everybody. Anyone else sees the people working at the stores they\nare placed at, including anyone assigned to all locations. Creating,\nediting or deleting needs StoreManager at every store the person\nworks at.\n\n**Filters** (all optional, AND-combined, applied in-memory\nafter fetch — fine at typical staff-roster sizes):\n- `storeId` — only staff assigned to this store (also returns\n  staff with `isAssignedToAllLocations=true`).\n- `position` — exact match on the legacy Position field.\n- `employmentType` — FullTime / PartTime / Contract / Other.\n- `status` — Active / Inactive / Pending.\n- `search` — case-insensitive contains across name (incl. kana),\n  DisplayName, EmployeeNumber, ReferenceId.\n\nRequired scope: `store.staff.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "Filter by assigned store. Includes all-locations staff.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "position",
            "in": "query",
            "description": "Exact match on Position.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employmentType",
            "in": "query",
            "description": "FullTime / PartTime / Contract / Other.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Active / Inactive / Pending.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Substring search across names + IDs.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "description": "Include soft-deleted staff. Default false.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StaffListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or not a member of the business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "StaffApi"
        ],
        "summary": "Create a staff member",
        "description": "Creates a staff member under the resolved business account.\nThe `organizationId` on the request body is ignored — the\nresolved org from the token / query param always wins.\n\nRequired scope: `store.staff.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StaffDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StaffResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.staff.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.write"
            ]
          }
        ]
      }
    },
    "/api/v1/staff/{staffId}": {
      "get": {
        "tags": [
          "StaffApi"
        ],
        "summary": "Get a single staff member",
        "description": "Required scope: `store.staff.read`.",
        "parameters": [
          {
            "name": "staffId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StaffResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.staff.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "StaffApi"
        ],
        "summary": "Update a staff member",
        "description": "Required scope: `store.staff.write`.",
        "parameters": [
          {
            "name": "staffId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StaffDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StaffResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffResponse"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.staff.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "StaffApi"
        ],
        "summary": "Delete a staff member (soft)",
        "description": "Soft-deletes the staff member. The row is retained so\nhistorical references (shift logs, POS transactions tied to\nthis staff) keep resolving — they just disappear from\nlist/search.\n\nRequired scope: `store.staff.write`.",
        "parameters": [
          {
            "name": "staffId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.staff.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.staff.write"
            ]
          }
        ]
      }
    },
    "/api/v1/organizations/{organizationId}/stores/{storeId}/flyers": {
      "get": {
        "tags": [
          "StoreFlyersApi"
        ],
        "summary": "List flyers for a store",
        "description": "Returns every flyer for the store (all sources, all states). Filter by state via ?state=Draft|Published|Expired.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of flyers."
          },
          "403": {
            "description": "Missing store.flyers.read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.flyers.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "StoreFlyersApi"
        ],
        "summary": "Upload a flyer",
        "description": "Creates a new flyer as Draft. Send multipart/form-data with 'image' (required) plus meta fields (title, validFrom, validUntil, aiSummaryText).",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "Title": {
                    "type": "string"
                  },
                  "ValidFrom": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "ValidUntil": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "AiSummaryText": {
                    "type": "string"
                  },
                  "Image": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Missing or invalid fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing store.flyers.write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.flyers.write"
            ]
          }
        ]
      }
    },
    "/api/v1/organizations/{organizationId}/stores/{storeId}/flyers/{flyerId}": {
      "get": {
        "tags": [
          "StoreFlyersApi"
        ],
        "summary": "Flyer detail",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "flyerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Flyer detail."
          },
          "404": {
            "description": "Flyer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.flyers.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.flyers.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "StoreFlyersApi"
        ],
        "summary": "Update flyer metadata (and optionally replace image)",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "flyerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "Title": {
                    "type": "string"
                  },
                  "ValidFrom": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "ValidUntil": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "AiSummaryText": {
                    "type": "string"
                  },
                  "Image": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated."
          },
          "404": {
            "description": "Flyer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing store.flyers.write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.flyers.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "StoreFlyersApi"
        ],
        "summary": "Hard-delete flyer",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "flyerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "Flyer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.flyers.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.flyers.write"
            ]
          }
        ]
      }
    },
    "/api/v1/organizations/{organizationId}/stores/{storeId}/flyers/{flyerId}/publish": {
      "post": {
        "tags": [
          "StoreFlyersApi"
        ],
        "summary": "Publish flyer (Draft → Published)",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "flyerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published."
          },
          "404": {
            "description": "Flyer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.flyers.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.flyers.write"
            ]
          }
        ]
      }
    },
    "/api/v1/organizations/{organizationId}/stores/{storeId}/flyers/{flyerId}/unpublish": {
      "post": {
        "tags": [
          "StoreFlyersApi"
        ],
        "summary": "Unpublish flyer (Published → Draft)",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "flyerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Unpublished."
          },
          "404": {
            "description": "Flyer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.flyers.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.flyers.write"
            ]
          }
        ]
      }
    },
    "/api/v1/organizations/{organizationId}/stores/{storeId}/flyers/{flyerId}/expire": {
      "post": {
        "tags": [
          "StoreFlyersApi"
        ],
        "summary": "Expire flyer (any → Expired)",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "flyerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Expired."
          },
          "404": {
            "description": "Flyer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.flyers.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.flyers.write"
            ]
          }
        ]
      }
    },
    "/api/v1/organizations/{organizationId}/posts": {
      "get": {
        "tags": [
          "StorePostsApi"
        ],
        "summary": "List posts, including drafts and scheduled ones",
        "description": "Filter with ?status=Draft|Scheduled|Published|Archived.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Posts, newest first.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PostResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PostResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PostResponse"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Missing store.posts.read scope, or the caller doesn't manage the business account's content.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.posts.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "StorePostsApi"
        ],
        "summary": "Create a post",
        "description": "Created as Draft, or as Scheduled when `scheduledAt` is in the future\n(store wall-clock time). Call `/publish` to publish a draft now.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PostRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PostRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              }
            }
          },
          "400": {
            "description": "title is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.posts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.posts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/organizations/{organizationId}/posts/{postId}": {
      "get": {
        "tags": [
          "StorePostsApi"
        ],
        "summary": "Post detail",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The post.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              }
            }
          },
          "404": {
            "description": "No such post in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.posts.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.posts.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "StorePostsApi"
        ],
        "summary": "Update a post",
        "description": "Fields left out of the body are unchanged.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PostRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PostRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              }
            }
          },
          "404": {
            "description": "No such post in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.posts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.posts.write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "StorePostsApi"
        ],
        "summary": "Delete a post",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "No such post in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.posts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.posts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/organizations/{organizationId}/posts/{postId}/publish": {
      "post": {
        "tags": [
          "StorePostsApi"
        ],
        "summary": "Publish a post now",
        "description": "Customers are not notified; the post appears in the app and on the store's site.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              }
            }
          },
          "404": {
            "description": "No such post in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.posts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.posts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/organizations/{organizationId}/posts/{postId}/archive": {
      "post": {
        "tags": [
          "StorePostsApi"
        ],
        "summary": "Archive a post (take it down without deleting it)",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Archived.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostResponse"
                }
              }
            }
          },
          "404": {
            "description": "No such post in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.posts.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.posts.write"
            ]
          }
        ]
      }
    },
    "/api/v1/devices/terminal/receipts": {
      "post": {
        "tags": [
          "TerminalReceiptsApi"
        ],
        "summary": "Record a payment taken on a stera terminal",
        "description": "Send every approved payment: お会計 for a booking, a pass or\nmembership sold at the counter, and cancels and returns.\n\n**Idempotent on `terminalId` + `slipNumber`.** Sending the same slip\nagain returns the sale already recorded, with `replayed: true`. If\nthat slip was recorded with a different amount or type, the answer\nis 409 `slip_already_used`.\n\n**Cancel and return.** Set `transactionType` to `cancel` or\n`return` and `originalSlipNumber` to the slip being reversed. The\nreversal is recorded, and the original sale is taken out of revenue\n(a partial return leaves it counting, with the return noted on it).\n`originalFound: false` means the original was never sent; the\nreversal is still recorded.\n\n**What it paid for.** Set one of:\n- `reservationId`: the booking is marked paid and, if it was\n  Pending, Confirmed or Arrived, Completed. Send it on a cancel or\n  return too, and the booking is marked refunded.\n- `passId` / `membershipId` with `customerId`: the sale made with\n  `POST /reservations/passes` or `/memberships/members` on the same\n  slip is pointed at this receipt. The money is counted here, once.\n\n`links` reports how each one went: `linked`, `not_found`,\n`slip_mismatch` (sold on another slip) or `none` (not sent). A\nfailed link never refuses the payment — the money was taken.\n\n`customerId` (CRM id) attaches the sale to the customer's history,\nand sends them the receipt once they have claimed one before.\n\nErrors carry a code in `error`: `missing_field`, `invalid_field`,\n`store_not_found`, `slip_already_used`.\n\nRequired scope: `store.terminal.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TerminalReceiptRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TerminalReceiptRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TerminalReceiptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TerminalReceiptResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TerminalReceiptResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TerminalReceiptResponse"
                }
              }
            }
          },
          "400": {
            "description": "A required field is missing or malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "The store is not in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "This slip was already recorded with a different amount or type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.terminal.write` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.terminal.write"
            ]
          }
        ]
      }
    },
    "/api/v1/devices/terminal/register": {
      "post": {
        "tags": [
          "TerminalRegistrationApi"
        ],
        "summary": "Register a stera terminal at a store",
        "description": "Call when the store is picked on the terminal, before taking any\npayment. Safe to call every time: a terminal that already holds a\nslot answers `registered: false` without touching the plan.\n\nA terminal removed on the web gets its slot, and its sales history,\nback when it registers again — if the plan has room.\n\nWhen the plan has no slot left the answer is 403\n`pos_limit_reached`, with `current` and `max`. The store must upgrade\nits plan or remove a terminal on the web.\n\nErrors carry a code in `error`: `missing_field`, `invalid_field`,\n`store_not_found`, `pos_limit_reached`.\n\nRequired scope: `store.terminal.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TerminalRegistrationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TerminalRegistrationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TerminalRegistrationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TerminalRegistrationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TerminalRegistrationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TerminalRegistrationResponse"
                }
              }
            }
          },
          "400": {
            "description": "A required field is missing or malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The plan has no POS slot left.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "The store is not in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.terminal.write"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/timecards/punch": {
      "post": {
        "tags": [
          "TimecardsApi"
        ],
        "summary": "Clock in, clock out, or start or end a break",
        "description": "`type` is `in`, `out`, `break_start` or `break_end`, and has to\nfollow the person's last punch: in → (break_start → break_end)* →\nout. Anything else answers 409 with `not_clocked_in`,\n`already_clocked_in`, `on_break` or `not_on_break`.\n\n`pin` is the person's time-clock PIN. Five wrong in a row lock their\npunching for 15 minutes (429 `pin_locked`, with `lockedUntil`).\n\n`idempotencyKey` is required: make one per tap. Sending the same body\nagain returns the punch already recorded with `replayed: true`.\n\n`at` is for punches the terminal queued while offline: up to 24 hours\nold, and not in the future (400 `at_out_of_range`). A punch can only\ncome after the person's latest one (409 `out_of_order`). Omit it to\npunch now.\n\nRequired scope: `store.timecards.write`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PunchApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PunchApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PunchApiRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PunchResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PunchResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PunchResponse"
                }
              }
            }
          },
          "400": {
            "description": "A field is missing or malformed, or `at` is out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Wrong PIN (`pin_incorrect`, with `remainingAttempts`) or none set (`pin_not_set`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Store or staff member not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The punch cannot follow the last one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Too many wrong PINs; punching is locked for a while.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.timecards.write"
            ]
          }
        ]
      }
    },
    "/api/v1/stores/{storeId}/timecards/today": {
      "get": {
        "tags": [
          "TimecardsApi"
        ],
        "summary": "Who is on today",
        "description": "Every active staff member of the store, with their state now\n(`off`, `on`, `on_break`), today's work sessions, and today's planned\nshifts for comparison. `hasPin` says whether they can punch yet.\n\nA session that began yesterday and is still open — a late shift —\nis included.\n\nRequired scope: `store.timecards.read`.",
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TodayResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TodayResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TodayResponse"
                }
              }
            }
          },
          "404": {
            "description": "Store not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The access token does not carry the `store.timecards.read` scope, or the signed-in user may not act for the business account or store named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.timecards.read"
            ]
          }
        ]
      }
    },
    "/api/v1/transactions": {
      "get": {
        "tags": [
          "TransactionsApi"
        ],
        "summary": "List transactions across POS + OMS (virtual union)",
        "description": "Returns the business account's sales as a single\npaged feed — POS register sales (face-to-face checkout) and\nOMS orders (web / phone / B2B / marketplace) merged together,\nnewest first.\n\n**Why this exists.** Sales API aggregates POS transactions\ninto KPIs. Orders API exposes OMS orders. Neither shows the\nother side. This endpoint is the closest thing to \"every\nsale across the business\" until the full POS→OMS\nmaterialization lands.\n\n**Source field.** Each row carries `source` = `\"pos\"` or\n`\"oms\"` so callers can render a tag or link back to the\norigin record. The `links` block carries the underlying\n`posTransactionId` / `omsOrderId` for follow-up fetches.\n\n**Pagination.** `pageSize` capped at 500. The endpoint pulls\nup to 5000 rows per source before merge — a hard ceiling to\nkeep memory bounded. Use the `since` / `until` window to\nscope tighter when needed.\n\n**Window.** Defaults to last 30 days, max 365. Wider windows\nreturn 400.\n\n**Scopes.** Either `store.orders.read` OR `sales.read` is\nsufficient — the feed is read-only and either domain scope\ncovers it.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "Optional store filter (UUID). When omitted, returns every store the caller may see: all stores for SuperUser, OperationsManager, POSManager and FinanceManager, otherwise the stores the caller is placed at.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "description": "ISO-8601 start. Defaults to 30 days ago.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "description": "ISO-8601 end. Defaults to now.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Source filter: 'pos', 'oms', or 'all' (default).",
            "schema": {
              "type": "string",
              "default": "all"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Window exceeds 365 days or invalid date.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or not a member of the business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.read"
            ]
          }
        ]
      }
    },
    "/api/v1/transactions/{id}": {
      "get": {
        "tags": [
          "TransactionsApi"
        ],
        "summary": "Get one transaction with line items + full breakdown",
        "description": "Returns the full detail for a single transaction — the line\nitems and amount breakdown the list feed omits. Pass the\ncomposite `id` exactly as it appears on a `/transactions` list\nrow:\n\n- `pos:{terminalId}:{transactionId}` — a POS register sale\n- `oms:{orderId}` — an OMS order\n\nThe detail is resolved from the matching source. Auth + scoping\nmatch the list endpoint: either `store.orders.read` OR\n`sales.read`, and the record must belong to the resolved\nbusiness account. An optional `storeId` further constrains the\nlookup (404 if the record isn't at that store).\n\n**Field availability differs by source.** POS line items carry\n`taxRate` and `category`; OMS items carry `unit`. POS rows have\n`staff` + `terminalId` and no payment status; OMS rows carry\npayment status + `paidAt` and the shipping amount. Fields that\ndon't apply to a given source come back null rather than zero,\nso the client can tell \"absent\" from \"zero\". Amounts reconcile\nwith the corresponding `/transactions` list row.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "Optional store filter (UUID). 404 if the record isn't at this store.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetailResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetailResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed id (must be pos:{terminalId}:{transactionId} or oms:{orderId}).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or not a member of the business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Transaction not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.read"
            ]
          }
        ]
      }
    },
    "/api/v1/transactions/{id}/claim-token": {
      "post": {
        "tags": [
          "TransactionsApi"
        ],
        "summary": "Issue a one-shot QR claim token for a transaction",
        "description": "Mints a single-use digital-receipt claim token for a POS\ntransaction and returns the URL to encode in a QR code. A\ncustomer who scans it receives this exact receipt — the same\nmechanism the web POS uses (`/rx/{token}`).\n\nPass the composite `id` from a /transactions row. Only POS\ntransactions (`pos:{terminalId}:{transactionId}`) are\nsupported — OMS orders have no register-claim flow and return\n400.\n\nThe QR payload is simply the returned `claimUrl`; render the QR\nclient-side with any QR library. Tokens are single-use and\nexpire after `ttlMinutes` in the body — default 1440 (24 hours),\nat most 10080 (7 days). Call again to mint a fresh token (e.g. if\nthe first wasn't scanned).\n\n**`claimUrl` is the credential.** Its path is the token itself\n(`https://receiptroller.io/rx/{token}`), so anyone holding the URL\nreceives the customer's receipt. Keep it out of logs, analytics and\ncrash reports — including its path alone.\n\n`storeId` is optional. When given, the call returns 404 unless the\ntransaction was rung up at that store; the token is always issued\nfor the transaction's own store either way.\n\nScope: `store.orders.read` OR `sales.read` (same as the feed).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "Optional store filter (UUID). 404 if the record isn't at this store.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/IssueClaimTokenBody"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/IssueClaimTokenBody"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/IssueClaimTokenBody"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimTokenResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimTokenResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed id, an OMS id (not supported), or `ttlMinutes` over 10080.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Missing scope or not a member of the business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Transaction not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.orders.read"
            ]
          }
        ]
      }
    },
    "/api/v1/account/merge/suggestions": {
      "post": {
        "tags": [
          "AccountMerge"
        ],
        "summary": "Another account that is probably the caller's",
        "description": "same_line: the same LINE id also holds another account — it comes with a mergeTicket,\nsince LINE already proves both. same_email: the email in the LINE ID token matches\nanother account — prove it with /email-code or its password as usual. Nothing is\nmerged until the person chooses to. An empty list when there is nothing to suggest.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuggestionsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SuggestionsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SuggestionsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/account/merge/email-code": {
      "post": {
        "tags": [
          "AccountMerge"
        ],
        "summary": "Send a code to the other account's email",
        "description": "Always 202 when accepted — it never says whether an account uses the address.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailCodeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailCodeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/EmailCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/account/merge/tickets": {
      "post": {
        "tags": [
          "AccountMerge"
        ],
        "summary": "Prove the other account and get a merge ticket",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TicketRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TicketRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TicketRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "mergeTicket (ten minutes) and a description of the other account."
          },
          "400": {
            "description": "invalid_credentials / invalid_code / invalid_grant / same_account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "reauth_required / proof_rejected — proof for the account signed in.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "other_account_not_found — no account uses that identity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "already_merged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "locked_out after repeated wrong passwords.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/account/merge/preview": {
      "post": {
        "tags": [
          "AccountMerge"
        ],
        "summary": "What a merge would move",
        "description": "keep: \"current\" (the account signed in) or \"other\". Omitted, the suggestion is used:\nkeep the account the person registered, not one made for them in LINE or on the phone;\nbetween two of a kind, the older.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/account/merge": {
      "post": {
        "tags": [
          "AccountMerge"
        ],
        "summary": "Merge the two accounts",
        "description": "Starts the merge and returns at once with its id and tokens for the account kept —\nswitch to them; the other account stops working when the merge finishes.\nSending the same ticket again returns the same merge.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StartRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StartRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "mergeId, status, and tokens for the account kept."
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/account/merge/{mergeId}": {
      "get": {
        "tags": [
          "AccountMerge"
        ],
        "summary": "How a merge is going",
        "parameters": [
          {
            "name": "mergeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/account/merge/{mergeId}/resume": {
      "post": {
        "tags": [
          "AccountMerge"
        ],
        "summary": "Resume a merge that failed or stopped",
        "parameters": [
          {
            "name": "mergeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/auth/token": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Issue access token",
        "description": "Exchange an authorization code or refresh token for an access token.\n\nFirst-party apps can also exchange an ID token they got from LINE, Apple or\nGoogle through the platform SDK (grant_type=urn:ietf:params:oauth:grant-type:token-exchange,\nsubject_token_type=urn:ietf:params:oauth:token-type:id_token, subject_issuer=line|apple|google,\noptional organization_id for a store's LINE channel, nonce, create_if_missing).",
        "responses": {
          "200": {
            "description": "Token issued successfully."
          },
          "400": {
            "description": "Malformed request, or (token exchange) an ID token that could not be verified.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials or code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Token exchange: no account uses this identity yet. May describe an existing account with the same verified email.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Token exchange: too many accounts created from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/verify": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Verify access token",
        "description": "Validates the provided access token and returns its scopes, expiry and the business account it is scoped to (null for a user-context token).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Token is valid."
          },
          "401": {
            "description": "Invalid or expired token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Refresh access token",
        "description": "Issues a new access token using a valid refresh token.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Token refreshed successfully."
          },
          "401": {
            "description": "Invalid refresh token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/revoke": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Revoke a token",
        "description": "Revokes an access token or refresh token.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Token revoked."
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/anonymous": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Issue an anonymous session token",
        "description": "Creates (or looks up) an anonymous AspNetUsers row for the given deviceId and returns an access token. No email or password required; IsAnonymous=true. Call POST /api/v1/auth/upgrade when the user later registers.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnonymousRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AnonymousRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AnonymousRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Anonymous token issued."
          },
          "400": {
            "description": "Missing clientId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Rate-limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/upgrade": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Upgrade anonymous session to full account",
        "description": "Sets email + password on the caller's anonymous AspNetUsers row, flips IsAnonymous=false, clears DeviceId. Requires the anonymous Bearer token in the Authorization header. Returns a fresh token pair.",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Upgrade succeeded."
          },
          "400": {
            "description": "Invalid request (missing fields, weak password, bad email).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Email already in use by a different account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/devices/register": {
      "post": {
        "tags": [
          "DeviceToken"
        ],
        "summary": "Register a store-app device for staff notifications",
        "description": "**For the staff store app.** Staff notifications — shifts, chat,\nnoticeboard, orders — are sent only to devices registered here. The\nconsumer app registers at `POST /api/v1/user/devices` instead; a\nstore device registered there receives no staff notifications.\n\nCall on sign-in and whenever the platform rotates the push token.\nRegistering the same `deviceId` again replaces its token.\n\n`platform` is `ios` or `android` (Android when omitted). `deviceId`\nis a stable per-install id generated by the app; when omitted, one is\nderived from the token, so a rotated token counts as a new device.\nThe business account comes from the token, or from `organizationId`\nfor a user-scoped token.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceRegisterRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceRegisterRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceRegisterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceRegisteredResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceRegisteredResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceRegisteredResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing `deviceToken`, unknown `platform`, or the business account could not be resolved.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/devices/unregister": {
      "post": {
        "tags": [
          "DeviceToken"
        ],
        "summary": "Unregister a store-app device",
        "description": "Call on sign-out, with the same `deviceToken` (and `deviceId`, if one\nwas sent) as at registration.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceUnregisterRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceUnregisterRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceUnregisterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/devices/test-push": {
      "post": {
        "tags": [
          "DeviceToken"
        ],
        "summary": "Send a test notification to the caller's own store-app devices",
        "description": "Sends one notification to every device the caller has registered at\n`POST /api/v1/devices/register`, and reports what happened.\n\n- `sent` &gt; 0 — delivery works.\n- `anyTokens` true but `sent` = 0 — the device is registered, but\n  the server could not deliver to it. That is a server-side problem,\n  not the app's; report it.\n- `anyTokens` false — nothing is registered for this user yet.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TestPushResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestPushResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestPushResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me": {
      "get": {
        "tags": [
          "Me"
        ],
        "summary": "Get the caller's user profile",
        "description": "Returns the authenticated user's profile (id, email, display name,\nprofile image URL, locale, time zone, roles).\n\nRequires a **user-scoped** token (one carrying a `user_id`). An\norganization-scoped token has no user context and receives 403.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              }
            }
          },
          "403": {
            "description": "`no_user_context` — the token is bound to one business account and carries no user (see `error_description`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "The user no longer exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Me"
        ],
        "summary": "Edit the caller's user profile",
        "description": "Changes the authenticated user's own display name, language and time\nzone (t-e9a2f626). Send only the fields to change; a field left out or\nnull keeps its value. The user comes from the token — there is no user\nid in the path.\n\n- `displayName`: 1–100 characters after trimming.\n- `locale`: one of `ja-JP`, `en`, `zh-Hant-TW`, `th-TH`.\n- `timeZone`: an IANA time zone id such as `Asia/Tokyo`.\n\nThe profile image is changed with `POST /api/v1/me/avatar`.\n\nScope: `user.profile.write`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMeProfileRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMeProfileRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMeProfileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The profile as saved.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_display_name` / `unsupported_locale` / `unknown_time_zone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The token lacks `user.profile.write`, or `no_user_context`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "The user no longer exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.profile.write"
            ]
          }
        ]
      }
    },
    "/api/v1/me/avatar": {
      "post": {
        "tags": [
          "Me"
        ],
        "summary": "Change the caller's profile image",
        "description": "Replaces the authenticated user's profile image (t-e9a2f626).\n`multipart/form-data` with one `file`: JPEG, PNG or WEBP, up to 5MB.\nThe previous image is deleted.\n\nScope: `user.profile.write`.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The profile as saved, with the new `profileImageUrl`.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDto"
                }
              }
            }
          },
          "400": {
            "description": "`no_file` / `unsupported_image`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The token lacks `user.profile.write`, or `no_user_context`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "The user no longer exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "The file is larger than 5MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "user.profile.write"
            ]
          }
        ]
      }
    },
    "/api/v1/me/organizations": {
      "get": {
        "tags": [
          "Me"
        ],
        "summary": "List the caller's organizations",
        "description": "Returns every organization the authenticated user is a member of,\nwith the user's role in each.\n\n**Pagination.** Results are paginated. Defaults: `page=1`,\n`pageSize=100`. The maximum `pageSize` is 1000 — larger values\nare silently capped. The response envelope includes\n`page`, `pageSize`, `totalCount`, and `totalPages` so clients\ncan detect when more pages are available.\n\nFor users belonging to many organizations (e.g. consultants\nor platform integrators) always check `totalPages` and loop\nuntil exhausted rather than assuming the first page is the\nfull set.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number, 1-based. Defaults to 1.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Page size, 1–1000. Defaults to 100; values above 1000 are capped.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MeOrganizationsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeOrganizationsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeOrganizationsResponse"
                }
              }
            }
          },
          "403": {
            "description": "`no_user_context` — the token is bound to one business account and carries no user. Apps with an in-app business-account switcher need RequiresOrgConsent turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/permissions": {
      "get": {
        "tags": [
          "Me"
        ],
        "summary": "What the signed-in user may do in a business account",
        "description": "Returns the capabilities the store API will honour for this user and\nthis token: once for the business as a whole, and once per store. The\nserver decides each one with the same check it enforces with, so an app\nthat shows a button only when its capability is listed never shows one\nthat is then refused (t-e9a2f996).\n\nBranch on the capability names (`reservations.write`,\n`customers.read`, …), not on role names. Roles are listed for display;\nwhat a role allows is the server's to decide and may change.\n\nA capability is listed only when the token also carries its scope. A\nstore is listed when the user is placed there or holds a capability\nthere.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "description": "The business account (UUID).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MePermissionsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MePermissionsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MePermissionsResponse"
                }
              }
            }
          },
          "403": {
            "description": "`not_a_member` — the caller holds no role and no placement in the business account (or `no_user_context`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/organizations/{organizationId}/stores": {
      "get": {
        "tags": [
          "Me"
        ],
        "summary": "List stores under a business account",
        "description": "Returns every store under the given business account that the\nauthenticated user has access to. The user must be a member of\nthe business account — otherwise the call returns 403.\n\nUse this together with `GET /api/v1/me/organizations` to power\na mobile-app picker: first list the user's business accounts,\nthen, when one is selected, list its stores.\n\nBy default deleted stores are excluded. Pass\n`includeDeleted=true` to include soft-deleted stores (useful\nfor admin tools that need to show history).",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "description": "Include soft-deleted stores. Default false.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MeStoresResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeStoresResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeStoresResponse"
                }
              }
            }
          },
          "403": {
            "description": "`not_a_member` — the caller is not an active member of the business account (or `no_user_context`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/organizations/{organizationId}/stores/{storeId}": {
      "get": {
        "tags": [
          "Me"
        ],
        "summary": "Get a single store's editable detail",
        "description": "Returns one store's full editable detail under the given\nbusiness account — the same `MeStore` shape returned by the\nlist endpoint. The caller must be a member of the business\naccount, and the store must belong to it (otherwise 404).\n\nPair with the matching `PUT` to power a store-information edit\nscreen: GET to populate the form, PUT to save.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MeStore"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeStore"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeStore"
                }
              }
            }
          },
          "403": {
            "description": "`not_a_member` — the caller is not an active member of the business account (or `no_user_context`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Store not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Me"
        ],
        "summary": "Update a store's basic profile / contact / address",
        "description": "Updates the editable basics of one store — name, store type,\nprimary category, status, phone, website, and postal address.\nOnly fields present in the request body are changed; omitted\n(null) fields are left untouched, so a partial update is safe.\nSend an empty string to clear an optional field.\n\n**Not edited here:** business hours / 定休日 / 就業可能時間\n(use the business-hours endpoints) and geo `country` /\n`latitude` / `longitude`, which are preserved as-is — address\nedits do NOT re-trigger geocoding server-side.\n\nAuth + scoping match the list/detail endpoints: the caller\nmust be a member of the business account and the store must\nbelong to it. Returns the updated store in the `MeStore` shape.\n\nWhen the store is linked to a Google location, the name, phone,\nwebsite and address this call changed are also sent to its Google\nlisting after the response, as from the web settings page. Empty\nfields are not sent. The store can turn this off on the web.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMeStoreRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMeStoreRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMeStoreRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MeStore"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeStore"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeStore"
                }
              }
            }
          },
          "403": {
            "description": "`not_a_member` — the caller is not an active member of the business account (or `no_user_context`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Store not found in this business account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "store.info.write"
            ]
          }
        ]
      }
    },
    "/api/v1/me/organizations/{organizationId}/stores/{storeId}/pos-terminals": {
      "get": {
        "tags": [
          "Me"
        ],
        "summary": "List POS terminals at a store",
        "description": "Returns every POS terminal registered at the given store under\nthe given business account. Requires the caller to be a member\nof the business account — otherwise 403.\n\nUse this after `GET /api/v1/me/organizations/{orgId}/stores`\nwhen you need to show the specific POS device the user wants\nto operate against (transaction lookups, terminal-bound QR\nscans, sync status indicators).\n\n**Sensitive vendor credentials (`apiKey`, `apiSecret`,\n`accessToken`, `refreshToken`) are NEVER returned.** The\nresponse only carries operational metadata — terminal name,\nvendor, integration type, last-sync state.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "description": "Include soft-deleted terminals. Default false.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MeStoreTerminalsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeStoreTerminalsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeStoreTerminalsResponse"
                }
              }
            }
          },
          "403": {
            "description": "`not_a_member` — the caller is not an active member of the business account (or `no_user_context`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/organizations/{organizationId}/pos-terminals": {
      "get": {
        "tags": [
          "Me"
        ],
        "summary": "List POS terminals across a business account",
        "description": "Returns every POS terminal across every store under the given\nbusiness account. Fans out via stores — terminals are tagged\nwith their `storeId` and `storeName` so callers can group\nthem in the UI without a second call.\n\nUseful for org-wide dashboards. For store-bound flows prefer\nthe per-store endpoint (`/stores/{storeId}/pos-terminals`).\n\nSensitive vendor credentials are NEVER returned (same as the\nper-store endpoint).",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "description": "Include soft-deleted terminals. Default false.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MeOrgTerminalsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeOrgTerminalsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeOrgTerminalsResponse"
                }
              }
            }
          },
          "403": {
            "description": "`not_a_member` — the caller is not an active member of the business account (or `no_user_context`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/identities": {
      "get": {
        "tags": [
          "MeIdentities"
        ],
        "summary": "List the caller's sign-in methods",
        "responses": {
          "200": {
            "description": "The account's email, whether its password works, and each linked identity."
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "MeIdentities"
        ],
        "summary": "Link a LINE, Apple or Google identity",
        "description": "Send a fresh ID token for the identity to add, and proof for the account.\nWhen another account already uses the identity, the response carries a\nmergeTicket for the account-merge flow instead.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkIdentityRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkIdentityRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LinkIdentityRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Already linked to this account."
          },
          "201": {
            "description": "Linked."
          },
          "400": {
            "description": "invalid_grant — the ID token was not verified.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "reauth_required / proof_rejected — see acceptedMethods.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "identity_belongs_to_other_account — with mergeTicket.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/identities/{id}": {
      "delete": {
        "tags": [
          "MeIdentities"
        ],
        "summary": "Remove a sign-in method",
        "description": "The proof must use a different sign-in method from the one being removed\n— it shows there is still a way in without it. The last method cannot be removed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/UnlinkIdentityRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/UnlinkIdentityRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/UnlinkIdentityRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Removed; the remaining methods."
          },
          "403": {
            "description": "reauth_required / proof_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such identity on this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "last_sign_in_method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/identities/password/code": {
      "post": {
        "tags": [
          "MeIdentities"
        ],
        "summary": "Send a confirmation code to the email to sign in with",
        "description": "For accounts without a working password (started on the phone or in LINE).\nAlways 202 when accepted — the response never says whether the email is already in use.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordCodeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordCodeRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "A code is on its way, if the address can receive mail."
          },
          "403": {
            "description": "reauth_required / proof_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "password_already_set — use PUT /api/v1/user/password.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Too many codes this hour.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/identities/password": {
      "post": {
        "tags": [
          "MeIdentities"
        ],
        "summary": "Add an email and password to the account",
        "description": "Confirms the code from /password/code. When another account already uses the\nemail, the confirmed code proves it is the caller's and a mergeTicket is returned.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPasswordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPasswordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AddPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Added; the account's sign-in methods."
          },
          "400": {
            "description": "invalid_code, or password_rejected with details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "reauth_required / proof_rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "password_already_set, or identity_belongs_to_other_account with mergeTicket.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/organizations/{organizationId}/stores/{storeId}/printers": {
      "get": {
        "tags": [
          "StorePrinters"
        ],
        "summary": "List a store's thermal printers",
        "description": "Returns the RR thermal printer devices registered to the store. Device keys are never returned.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "StorePrinters"
        ],
        "summary": "Register a thermal printer to the store",
        "description": "Registers an RR thermal printer (ESP32) to the store and mints a\ndevice key. The plaintext `deviceKey` is returned **once** in this\nresponse — capture it and provision it to the device; it cannot be\nretrieved again (only regenerated). Optionally link the printer to\na registered POS terminal via `posTerminalId`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterPrinterRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterPrinterRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterPrinterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The registered printer, including the one-time plaintext deviceKey."
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/organizations/{organizationId}/stores/{storeId}/printers/{deviceId}": {
      "get": {
        "tags": [
          "StorePrinters"
        ],
        "summary": "Get a single thermal printer",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "StorePrinters"
        ],
        "summary": "Update a thermal printer",
        "description": "Updates name / serial / firmware / POS link / active flag. Does not touch the device key.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrinterRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrinterRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePrinterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "StorePrinters"
        ],
        "summary": "Deactivate (remove) a thermal printer",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/organizations/{organizationId}/stores/{storeId}/printers/claim": {
      "post": {
        "tags": [
          "StorePrinters"
        ],
        "summary": "Claim a shipped printer for this store",
        "description": "Claims a pre-registered (Unassigned) RR thermal printer for the\nstore — used by the Staff app after it reads the device's id + key\n(e.g. over BLE / from a label) during pairing. Requires the\ndevice's `deviceKey` as proof of possession, so only whoever\nphysically has the printer can claim it. On success the printer\nbecomes `Assigned` to this store and can send receipts.\nIdempotent if it's already claimed by this store; returns 409 if\nit's claimed by a different store.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimPrinterRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimPrinterRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimPrinterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/organizations/{organizationId}/stores/{storeId}/printers/{deviceId}/regenerate-key": {
      "post": {
        "tags": [
          "StorePrinters"
        ],
        "summary": "Regenerate a printer's device key",
        "description": "Issues a new device key (invalidating the old one) for device replacement or after a suspected leak. Returns the new one-time plaintext `deviceKey`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/organizations/{organizationId}/stores/{storeId}/printers/receipts/latest": {
      "get": {
        "tags": [
          "StorePrinters"
        ],
        "summary": "Get the latest captured receipt for the store (or a POS terminal)",
        "description": "Returns the most recent thermal-printer receipt for the store, or for a specific POS terminal when `posTerminalId` is supplied. The `url` is the public receipt page (the same one the printer QR points to).",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "posTerminalId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/me/organizations/{organizationId}/stores/{storeId}/printers/receipt-settings": {
      "get": {
        "tags": [
          "StorePrinters"
        ],
        "summary": "Get the store's digital-receipt customization",
        "description": "Returns the per-store receipt-output settings (header / footer / logo / accent color / show-store-name) used to style the public receipt page (/r/...). Returns defaults if none have been saved.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "StorePrinters"
        ],
        "summary": "Update the store's digital-receipt customization",
        "description": "Saves the per-store receipt-output settings. Styles the public receipt page only; the physical ESC/POS print is POS-generated and unaffected.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReceiptSettingsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReceiptSettingsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReceiptSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/stripe/webhook": {
      "post": {
        "tags": [
          "StripeWebhook"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List registered webhooks",
        "description": "Returns all webhooks registered for the calling app. Signing secrets are masked.",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Register webhook",
        "description": "Registers a new webhook endpoint. The signing secret is returned **once** — store it securely.\n\n### Example request\n```json\n{\n  \"url\": \"https://your-app.example.com/hooks\",\n  \"eventTypes\": [\"order.created\", \"order.updated\"],\n  \"secret\": \"my-signing-secret\"\n}\n```\n\n### Example response\n```json\n{\n  \"id\": \"wh_aBcDeFgHiJkLmNoP\",\n  \"clientId\": \"app_xxxxxxxxxxxxxxxx\",\n  \"organizationId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"url\": \"https://your-app.example.com/hooks\",\n  \"eventTypes\": [\"order.created\", \"order.updated\"],\n  \"active\": true,\n  \"createdAt\": \"2026-04-14T09:00:00Z\",\n  \"secret\": \"my-signing-secret\"\n}\n```\n\n&gt; ⚠️ The `secret` field is only present in the creation response. It cannot be retrieved later.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Registered. Secret shown once."
          },
          "400": {
            "description": "Validation error — invalid URL, unknown event type, etc.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Get webhook",
        "description": "Returns configuration for a single webhook owned by the calling app.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Found.",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found or not owned by this app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update webhook",
        "description": "Update a webhook's subscribed event types or active status.\nOnly fields included in the request body are changed.\n\n### Pause delivery\n```json\n{ \"active\": false }\n```\n\n### Change subscribed events\n```json\n{ \"eventTypes\": [\"receipt.created\", \"receipt.updated\"] }\n```",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated.",
            "content": {
              "application/json": { }
            }
          },
          "400": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete webhook",
        "description": "Permanently deletes a webhook. Future events will not be delivered to this URL.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "description": "Missing or invalid Bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/webhooks/test/{id}": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send test ping",
        "description": "Sends a `test.ping` event to verify your endpoint is reachable and correctly configured.\n\n### Example payload delivered to your URL\n```json\n{\n  \"id\": \"evt_a1b2c3d4e5f6\",\n  \"event\": \"test.ping\",\n  \"timestamp\": \"2026-04-14T09:00:01Z\",\n  \"organization_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"data\": { \"message\": \"This is a test ping from Receipt Roller.\" }\n}\n```",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Test delivered.",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Get delivery logs",
        "description": "Returns the 50 most recent delivery attempts for a webhook, newest first.\n\nUse this to debug failed deliveries — each log entry shows the HTTP status your\nendpoint returned, the number of attempts made, and any connection error message.\n\n### Example response item\n```json\n{\n  \"id\": \"wdl_aBcDeFgHiJkL\",\n  \"webhookId\": \"wh_aBcDeFgHiJkLmNoP\",\n  \"eventType\": \"order.created\",\n  \"httpStatus\": 200,\n  \"success\": true,\n  \"attemptCount\": 1,\n  \"errorMessage\": null,\n  \"attemptedAt\": \"2026-04-14T09:00:05Z\"\n}\n```",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": { }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The signed-in user may not act on the resource named in the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [ ]
          }
        ]
      }
    },
    "/api/v1/advertiser/campaigns": {
      "get": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "The account's retail media campaigns.",
        "description": "Required scope: `advertiser.campaigns.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "Creates a draft campaign.",
        "description": "Required scope: `advertiser.campaigns.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.write"
            ]
          }
        ]
      }
    },
    "/api/v1/advertiser/campaigns/{campaignId}": {
      "get": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "One campaign with its delivery units, their ads and reach, and what is left before it can be submitted.",
        "description": "Required scope: `advertiser.campaigns.read`.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDetailResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDetailResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDetailResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "Changes a campaign's settings while it is a draft or was sent back.",
        "description": "Required scope: `advertiser.campaigns.write`.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.write"
            ]
          }
        ]
      }
    },
    "/api/v1/advertiser/campaigns/{campaignId}/submit": {
      "post": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "Submits a ready campaign for review. Submitted by an ad agency, it waits\nfor the client's approval first (status `AwaitingClient`).",
        "description": "Required scope: `advertiser.campaigns.write`.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.write"
            ]
          }
        ]
      }
    },
    "/api/v1/advertiser/campaigns/{campaignId}/{step}": {
      "post": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "Pauses, resumes or ends an approved campaign. A paused campaign stops delivering\nat every store until resumed; ending is final and brings a later end date forward to today (Japan).",
        "description": "Required scope: `advertiser.campaigns.write`. 409 when the campaign is not in a state the action applies to.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "step",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^(pause|resume|end)$",
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.write"
            ]
          }
        ]
      }
    },
    "/api/v1/advertiser/campaigns/{campaignId}/units": {
      "post": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "Adds a delivery unit to a campaign.",
        "description": "Required scope: `advertiser.campaigns.write`.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnitRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UnitRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UnitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/UnitCreatedResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitCreatedResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitCreatedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.write"
            ]
          }
        ]
      }
    },
    "/api/v1/advertiser/campaigns/{campaignId}/units/{unitId}/targeting": {
      "put": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "Sets a delivery unit's targeting and bid (CPM, yen per 1,000 impressions).",
        "description": "Required scope: `advertiser.campaigns.write`.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "unitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RetailMediaTargeting"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RetailMediaTargeting"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RetailMediaTargeting"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.write"
            ]
          }
        ]
      }
    },
    "/api/v1/advertiser/campaigns/{campaignId}/units/{unitId}/reach": {
      "get": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "How many ad spaces and stores a unit's targeting reaches right now, and an\nestimate of daily views. Spaces whose floor price is above the bid are counted apart.",
        "description": "Required scope: `advertiser.campaigns.read`.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "unitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReachResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReachResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReachResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.read"
            ]
          }
        ]
      }
    },
    "/api/v1/advertiser/campaigns/{campaignId}/units/{unitId}/ads": {
      "post": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "Puts an ad in a delivery unit: a creative for screens and banners, or a\nheadline for printed receipts and app notices, optionally with a coupon.",
        "description": "Required scope: `advertiser.campaigns.write`.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "unitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AdRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AdRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.write"
            ]
          }
        ]
      }
    },
    "/api/v1/advertiser/campaigns/{campaignId}/units/{unitId}/ads/{adId}": {
      "delete": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "Removes an ad from a delivery unit.",
        "description": "Required scope: `advertiser.campaigns.write`.",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "unitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "adId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.write"
            ]
          }
        ]
      }
    },
    "/api/v1/advertiser/creatives": {
      "get": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "Creatives that can be put in an ad, newest first.",
        "description": "Required scope: `advertiser.campaigns.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreativeListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreativeListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreativeListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "AdvertiserCampaignsApi"
        ],
        "summary": "Uploads an image or video creative (multipart field `file`, up to 100MB).\nIt is checked against each ad space's spec when put in an ad, and reviewed\nwith the campaign.",
        "description": "Required scope: `advertiser.campaigns.write`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "$ref": "#/components/schemas/IFormFile"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreativeResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreativeResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreativeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.campaigns.write"
            ]
          }
        ]
      }
    },
    "/api/v1/advertiser/reports": {
      "get": {
        "tags": [
          "AdvertiserReportsApi"
        ],
        "summary": "The account's retail media delivery over a period (Japan dates, both ends\nincluded; 7 to 366 days, the last 30 by default), overall or for one campaign.\nPurchase figures (coupon uses, discounts, sales, keyword-targeted impressions)\ncover the finished Monday-to-Sunday weeks around the period, given as\n`purchaseWeeksFrom`/`purchaseWeeksTo`, and are null where too small to show.",
        "description": "Required scope: `advertiser.reports.read`.",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ReportResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ApiError"
                    },
                    {
                      "$ref": "#/components/schemas/ProblemDetails"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired. Refresh it, or sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2": [
              "advertiser.reports.read"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AccountProofRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "`password` or `id_token`."
          },
          "password": {
            "type": [
              "null",
              "string"
            ],
            "description": "For `password`."
          },
          "issuer": {
            "type": [
              "null",
              "string"
            ],
            "description": "For `id_token`: line, apple or google."
          },
          "idToken": {
            "type": [
              "null",
              "string"
            ],
            "description": "For `id_token`: a fresh ID token for a sign-in method already on the account."
          },
          "nonce": {
            "type": [
              "null",
              "string"
            ]
          },
          "organizationId": {
            "type": [
              "null",
              "string"
            ],
            "description": "LINE only: the store whose LINE channel issued the token."
          }
        },
        "description": "Evidence that the caller can sign in to their account right now, sent with\nany change to how they sign in (t-e9a2f1248). A bearer token alone is not\nenough: a stolen one must not be able to add the thief's own way in, or\nremove the owner's."
      },
      "AdCouponCodeRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The code on the receipt (spaces, hyphens and lower case are fine), or what its QR holds."
          }
        }
      },
      "AdCouponMatchRequest": {
        "type": "object",
        "properties": {
          "terminalId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The POS terminal the sale was rung up on, as in the transactions API."
          },
          "transactionId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The sale's transaction id, as in the transactions API."
          },
          "code": {
            "type": "string",
            "description": "The code on the receipt (spaces, hyphens and lower case are fine), or what its QR holds."
          }
        }
      },
      "AdCouponOffer": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "headline": {
            "type": "string"
          },
          "offerType": {
            "enum": [
              "FixedAmount",
              "Percentage"
            ],
            "type": "string"
          },
          "offerValue": {
            "type": "number",
            "format": "double"
          },
          "minPurchaseYen": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "terms": {
            "type": "string"
          },
          "validUntilUtc": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "enum": [
              "Issued",
              "Used"
            ],
            "type": "string"
          },
          "usedAtUtc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "discountYen": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "matchedAtUtc": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the use was matched to its sale and charged; null while it waits for one.",
            "format": "date-time"
          }
        }
      },
      "AdCouponRedeemRequest": {
        "type": "object",
        "properties": {
          "purchaseYen": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "discountYen": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "terminalId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The POS terminal the sale was rung up on, as in the transactions API."
          },
          "transactionId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The sale's transaction id, as in the transactions API."
          },
          "code": {
            "type": "string",
            "description": "The code on the receipt (spaces, hyphens and lower case are fine), or what its QR holds."
          }
        }
      },
      "AdCouponResponse": {
        "type": "object",
        "properties": {
          "succeeded": {
            "type": "boolean"
          },
          "reason": {
            "enum": [
              "ok",
              "not_found",
              "other_account",
              "expired",
              "already_used",
              "min_purchase",
              "discount_required",
              "conflict",
              "sale_not_found",
              "sale_taken",
              "not_awaiting_sale"
            ],
            "type": "string"
          },
          "coupon": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "What the coupon gives. Null for `not_found` and `other_account`, which reveal nothing about another account's coupon.",
                "$ref": "#/components/schemas/AdCouponOffer"
              }
            ]
          }
        }
      },
      "AddPasswordRequest": {
        "required": [
          "email",
          "password",
          "code"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "The code from /password/code"
          },
          "proof": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AccountProofRequest"
              }
            ]
          }
        }
      },
      "AdjustRequest": {
        "type": "object",
        "properties": {
          "locationId": {
            "type": "string"
          },
          "productId": {
            "type": "string"
          },
          "quantityChange": {
            "type": "integer",
            "description": "Signed delta: +10 receives stock, -3 removes.",
            "format": "int32"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "AdRequest": {
        "type": "object",
        "properties": {
          "surfaceType": {
            "enum": [
              "signage",
              "receipt",
              "printed",
              "appbanner",
              "appnotice"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "The ad space type this ad is made for."
          },
          "creativeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "For screens and banners: an uploaded creative's id."
          },
          "headline": {
            "type": [
              "null",
              "string"
            ],
            "description": "For printed receipts and app notices: the text shown."
          },
          "destinationUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "offer": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "A coupon handed out with the ad (digital receipts and the app).",
                "$ref": "#/components/schemas/OfferRequest"
              }
            ]
          }
        }
      },
      "AdResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "surfaceType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "creativeId": {
            "type": "string"
          },
          "headline": {
            "type": "string"
          },
          "destinationUrl": {
            "type": "string"
          },
          "offerType": {
            "type": "string"
          },
          "offerValue": {
            "type": "number",
            "format": "double"
          },
          "offerMaxCoupons": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          }
        }
      },
      "AdSpaceResponse": {
        "type": "object",
        "properties": {
          "surfaceId": {
            "type": "string"
          },
          "surfaceType": {
            "enum": [
              "signage",
              "receipt",
              "printed",
              "appbanner",
              "appnotice"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "storeId": {
            "type": "string",
            "description": "Empty for the app spaces, which belong to the whole account."
          },
          "displayId": {
            "type": "string",
            "description": "The signage screen, for signage spaces."
          },
          "isOpen": {
            "type": "boolean"
          },
          "isPaused": {
            "type": "boolean"
          },
          "externalSharePercent": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "floorCpm": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "openDayOfWeekMask": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "openHourOfDayMask": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "printLineLimit": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "dailyCapPerCustomer": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AdSpacesResponse": {
        "type": "object",
        "properties": {
          "externalAdsPaused": {
            "type": "boolean",
            "description": "The one-tap stop is on: no outside ads anywhere."
          },
          "canSell": {
            "type": "boolean",
            "description": "The plan includes selling ad space; without it spaces can't be opened."
          },
          "adSpaces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdSpaceResponse"
            }
          }
        }
      },
      "AdSpaceUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "externalSharePercent": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "floorCpm": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "openDayOfWeekMask": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Days open to outside ads, bit 0 = Sunday.",
            "format": "int32"
          },
          "openHourOfDayMask": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Hours open to outside ads (Japan time), bit 0 = 00:00–01:00.",
            "format": "int32"
          },
          "printLineLimit": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Printed receipts only: lines the ad may take, 1–6.",
            "format": "int32"
          },
          "dailyCapPerCustomer": {
            "type": [
              "null",
              "integer"
            ],
            "description": "App spaces only: times one customer sees the same campaign per day.",
            "format": "int32"
          }
        },
        "description": "An ad space's own settings; null follows the account's selling rules."
      },
      "AiDraftRequest": {
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "reviewText": {
            "type": "string",
            "description": "The review's text as listed; may be empty for a rating without words."
          },
          "starCount": {
            "type": "integer",
            "format": "int32"
          },
          "culture": {
            "type": [
              "null",
              "string"
            ],
            "description": "The language for a review with stars only, e.g. `ja-JP` or `en`. Defaults to the request's Accept-Language."
          }
        }
      },
      "AiDraftResponse": {
        "type": "object",
        "properties": {
          "draft": {
            "type": "string"
          }
        }
      },
      "AnalyticsResponse": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string"
          },
          "fromDate": {
            "type": "string",
            "format": "date-time"
          },
          "toDate": {
            "type": "string",
            "format": "date-time"
          },
          "totalBookings": {
            "type": "integer",
            "format": "int32"
          },
          "completed": {
            "type": "integer",
            "format": "int32"
          },
          "cancelled": {
            "type": "integer",
            "format": "int32"
          },
          "noShow": {
            "type": "integer",
            "format": "int32"
          },
          "upcoming": {
            "type": "integer",
            "description": "Bookings in the range that have not happened yet.",
            "format": "int32"
          },
          "revenue": {
            "type": "number",
            "description": "Currency major unit.",
            "format": "double"
          },
          "uniqueCustomers": {
            "type": "integer",
            "format": "int32"
          },
          "repeatCustomers": {
            "type": "integer",
            "description": "Customers who booked more than once in the range.",
            "format": "int32"
          },
          "repeatRate": {
            "type": [
              "null",
              "number"
            ],
            "description": "Share of customers who came back. Null when nobody booked.",
            "format": "double"
          }
        }
      },
      "AnnouncementListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "announcements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnnouncementResponse"
            }
          }
        }
      },
      "AnnouncementResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "isPinned": {
            "type": "boolean",
            "description": "Pinned notices sort above the rest."
          },
          "audience": {
            "enum": [
              "AllStaff",
              "StorePosition",
              "SpecificStaff"
            ],
            "type": "string",
            "description": "AllStaff / StorePosition / SpecificStaff."
          },
          "storeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Stores this notice was addressed to. Empty when it went to all staff."
          },
          "attachments": {
            "type": "array",
            "description": "Files hung on the notice, each with a link that expires in an hour\n(t-e9a2f989). Empty for most notices."
          },
          "authorDisplayName": {
            "type": "string"
          },
          "audienceSize": {
            "type": "integer",
            "description": "How many people it was sent to.",
            "format": "int32"
          },
          "readCount": {
            "type": "integer",
            "description": "How many have read it. -1 when read counts were not asked for.",
            "format": "int32"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isExpired": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AnonymousRequest": {
        "required": [
          "clientId"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "Mobile app's registered client ID."
          },
          "deviceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Vendor-scoped device identifier (iOS identifierForVendor, Android equivalent). Optional but recommended — bootstraps idempotency across reinstalls."
          }
        }
      },
      "ApiError": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "error_description": {
            "type": "string"
          }
        },
        "description": "The error body of a refused request. `error` is a short code or message; `error_description` adds detail on /me and the OAuth endpoints.\n\nA 401 or 403 refused by authentication or a missing scope may have no body at all."
      },
      "AppAdResponse": {
        "required": [
          "label",
          "headline",
          "imageUrl",
          "clickUrl",
          "offerType",
          "offerValue",
          "couponUrl"
        ],
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "headline": {
            "type": "string"
          },
          "imageUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "clickUrl": {
            "type": "string"
          },
          "offerType": {
            "type": [
              "null",
              "string"
            ]
          },
          "offerValue": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "couponUrl": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "One ad. Show `Label` with it (RM-01 §5.1). `ImageUrl` is set for a\nbanner and stays valid for an hour. `OfferType` is FixedAmount (yen\noff) or Percentage; when it is set, `CouponUrl` opens the page that\nhands the customer their coupon."
      },
      "AppAdsResponse": {
        "required": [
          "banner",
          "notice"
        ],
        "type": "object",
        "properties": {
          "banner": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AppAdResponse"
              }
            ]
          },
          "notice": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AppAdResponse"
              }
            ]
          }
        },
        "description": "This visit's ads; either may be null, and the app leaves that slot out."
      },
      "AppClaimRequest": {
        "type": "object",
        "properties": {
          "channel": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"ios\" or \"android\"."
          },
          "claimToken": {
            "type": [
              "null",
              "string"
            ],
            "description": "Terminal QR only: the claimToken from last-receipt."
          },
          "autoDelivery": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Optional. true when the person ticked 「次回から自動で受け取る」: their\nnext receipt from this business account arrives by itself (LINE, then\nemail) when they pay as a member. Ignored when the sale carries no\nPOS customer. Default false. Withdrawn from the user's settings."
          }
        }
      },
      "BudgetHistoryLineDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "budget": {
            "type": "number",
            "format": "double"
          },
          "spent": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "BudgetHistoryMonthDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "budget": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "spent": {
            "type": "number",
            "format": "double"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetHistoryLineDto"
            }
          },
          "labels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetHistoryLineDto"
            }
          },
          "categorySpending": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetHistorySpendingDto"
            }
          },
          "labelSpending": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetHistorySpendingDto"
            }
          }
        }
      },
      "BudgetHistorySpendingDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "spent": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "BudgetLineDto": {
        "type": "object",
        "properties": {
          "budget": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "spent": {
            "type": "number",
            "format": "double"
          },
          "remaining": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "percentUsed": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "projected": {
            "type": "number",
            "format": "double"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "BudgetRequest": {
        "required": [
          "year",
          "month"
        ],
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "amount": {
            "type": [
              "null",
              "number"
            ],
            "description": "The whole month. Left out, the current value stays; null removes it.",
            "format": "double"
          },
          "categories": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/CategoryBudget"
            },
            "description": "Replaces every category budget. Left out, they stay; [] removes them all."
          },
          "labels": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LabelBudget"
            },
            "description": "Replaces every label budget. Left out, they stay; [] removes them all."
          }
        }
      },
      "BudgetResponse": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "amount": {
            "type": [
              "null",
              "number"
            ],
            "description": "The whole month. Null when only category or label budgets are set.",
            "format": "double"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CategoryBudget"
            }
          },
          "labels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelBudget"
            }
          },
          "isExplicitlySet": {
            "type": "boolean"
          },
          "currency": {
            "type": "string"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "BusinessHoursDto": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "dayOfWeek": {
            "type": "string"
          },
          "shiftIndex": {
            "type": "integer",
            "format": "int32"
          },
          "openTime": {
            "type": "string"
          },
          "closeTime": {
            "type": "string"
          },
          "isClosed": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "dayOfWeekJa": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BusinessHoursEntry": {
        "type": "object",
        "properties": {
          "open": {
            "type": "string"
          },
          "close": {
            "type": "string"
          },
          "closed": {
            "type": "boolean"
          },
          "ranges": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/BusinessHoursRange"
            }
          }
        }
      },
      "BusinessHoursRange": {
        "type": "object",
        "properties": {
          "open": {
            "type": "string"
          },
          "close": {
            "type": "string"
          }
        }
      },
      "BusinessHoursRow": {
        "type": "object",
        "properties": {
          "dayOfWeek": {
            "type": "string"
          },
          "shiftIndex": {
            "type": "integer",
            "format": "int32"
          },
          "openTime": {
            "type": "string"
          },
          "closeTime": {
            "type": "string"
          },
          "isClosed": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "CampaignDetailResponse": {
        "type": "object",
        "properties": {
          "units": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnitResponse"
            }
          },
          "readiness": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReadinessResponse"
            },
            "description": "What must be true before the campaign can be submitted."
          },
          "readyToSubmit": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Draft",
              "AwaitingClient",
              "InReview",
              "Rejected",
              "Approved",
              "Paused",
              "Ended"
            ],
            "type": "string"
          },
          "adCategory": {
            "type": "string"
          },
          "budget": {
            "type": "number",
            "format": "double"
          },
          "dailyBudget": {
            "type": "number",
            "format": "double"
          },
          "startDate": {
            "type": "string",
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "description": {
            "type": "string"
          },
          "reviewNote": {
            "type": "string",
            "description": "Why ReceiptRoller sent it back, when it did."
          },
          "dealId": {
            "type": "string",
            "description": "The private deal it fills, if any (RM-15)."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CampaignListResponse": {
        "type": "object",
        "properties": {
          "campaigns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CampaignResponse"
            }
          }
        }
      },
      "CampaignReportResponse": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "impressions": {
            "type": "integer",
            "format": "int64"
          },
          "clicks": {
            "type": "integer",
            "format": "int64"
          },
          "spend": {
            "type": "number",
            "format": "double"
          },
          "redemptions": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Coupon uses in the purchase weeks; null when 1 to 4.",
            "format": "int64"
          },
          "lift": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The latest sales-lift estimate for the whole campaign, worked out nightly; null until there is one.",
                "$ref": "#/components/schemas/LiftResponse"
              }
            ]
          }
        }
      },
      "CampaignRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "adCategory": {
            "type": [
              "null",
              "string"
            ],
            "description": "What is advertised, one of the ad category codes (e.g. `beverage`); stores refuse ads by category."
          },
          "budget": {
            "type": "number",
            "description": "Total budget in yen, tax excluded; delivery is never charged past it. Must be above 0 to submit, except for a fixed-amount private deal.",
            "format": "double"
          },
          "dailyBudget": {
            "type": "number",
            "description": "Daily budget in yen; 0 = only the total applies.",
            "format": "double"
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CampaignResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Draft",
              "AwaitingClient",
              "InReview",
              "Rejected",
              "Approved",
              "Paused",
              "Ended"
            ],
            "type": "string"
          },
          "adCategory": {
            "type": "string"
          },
          "budget": {
            "type": "number",
            "format": "double"
          },
          "dailyBudget": {
            "type": "number",
            "format": "double"
          },
          "startDate": {
            "type": "string",
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "description": {
            "type": "string"
          },
          "reviewNote": {
            "type": "string",
            "description": "Why ReceiptRoller sent it back, when it did."
          },
          "dealId": {
            "type": "string",
            "description": "The private deal it fills, if any (RM-15)."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CategoryBudget": {
        "required": [
          "categoryId"
        ],
        "type": "object",
        "properties": {
          "categoryId": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "CategoryBudgetLineDto": {
        "type": "object",
        "properties": {
          "categoryId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "budget": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "spent": {
            "type": "number",
            "format": "double"
          },
          "remaining": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "percentUsed": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "projected": {
            "type": "number",
            "format": "double"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "ChangePasswordRequest": {
        "required": [
          "currentPassword",
          "newPassword"
        ],
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string"
          },
          "newPassword": {
            "type": "string"
          }
        }
      },
      "ChannelListResponse": {
        "type": "object",
        "properties": {
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChannelResponse"
            }
          }
        }
      },
      "ChannelResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "enum": [
              "news",
              "weather",
              "entertainment",
              "local",
              "other"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "Pending",
              "Active",
              "Paused",
              "Rejected"
            ],
            "type": "string"
          },
          "imageSeconds": {
            "type": "integer",
            "description": "Seconds an image stays on screen; a video plays its own length.",
            "format": "int32"
          },
          "feedUrl": {
            "type": "string"
          },
          "feedCheckedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "feedError": {
            "type": [
              "null",
              "string"
            ],
            "description": "Why the last feed read failed, when it did (e.g. `Feed_ErrFetch`, `Feed_ErrFormat`)."
          },
          "feedSkipped": {
            "type": "integer",
            "description": "New feed entries the last read could not use.",
            "format": "int32"
          }
        }
      },
      "ClaimPrinterRequest": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string",
            "description": "The shipped printer's DeviceId (read from the device / label)."
          },
          "deviceKey": {
            "type": "string",
            "description": "The device key, as proof of physical possession."
          },
          "deviceName": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional friendly name to set on claim."
          },
          "posTerminalId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional POS terminal to link."
          }
        }
      },
      "ClaimRequest": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "description": "line / ios / android / web. `email` is refused (400 email_not_supported)."
          },
          "claimToken": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional — the claim token from last-receipt if not passed in header."
          },
          "deliveryTarget": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional — the LINE userId when channel is line."
          },
          "lineIdToken": {
            "type": [
              "null",
              "string"
            ],
            "description": "The LIFF ID token (liff.getIDToken()). For a LINE claim the receipt is pushed to the\nuser it proves, and DeliveryTarget is ignored (t-e9a2f1515)."
          }
        }
      },
      "ClaimTokenResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The transaction id, echoed."
          },
          "claimToken": {
            "type": "string",
            "description": "The single-use token. Treat it as a secret."
          },
          "claimUrl": {
            "type": "string",
            "description": "Encode this in the QR. Shaped `https://receiptroller.io/rx/{token}`\n— the path is the token, so do not log the URL or its path."
          },
          "expiresAt": {
            "type": "string",
            "description": "UTC.",
            "format": "date-time"
          }
        },
        "description": "Response of POST /api/v1/transactions/{id}/claim-token.\n    Encode `ClaimUrl` in a QR code. t-e9a2f615."
      },
      "CodeRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required. The code the customer presented."
          }
        }
      },
      "CouponDeletedResponse": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "boolean"
          }
        }
      },
      "CouponListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "coupons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CouponResponse"
            }
          }
        }
      },
      "CouponRedeemResponse": {
        "type": "object",
        "properties": {
          "succeeded": {
            "type": "boolean"
          },
          "reason": {
            "enum": [
              "ok",
              "not_found",
              "inactive",
              "not_yet_valid",
              "expired",
              "fully_used",
              "conflict"
            ],
            "type": "string",
            "description": "As verify's `reason`, plus `conflict` when another till took the\nlast use first."
          },
          "remainingUses": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Null when uncapped.",
            "format": "int32"
          },
          "redemption": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The record written. Present only when `succeeded` is true.",
                "$ref": "#/components/schemas/CouponRedemptionDto"
              }
            ]
          }
        },
        "description": "The body of both the 200 and the 409 from redeem."
      },
      "CouponRedemptionDto": {
        "type": "object",
        "properties": {
          "redemptionId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "couponId": {
            "type": "string"
          },
          "couponCode": {
            "type": "string"
          },
          "couponName": {
            "type": "string"
          },
          "discountType": {
            "type": "string"
          },
          "discountValue": {
            "type": "number",
            "format": "double"
          },
          "customerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "transactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "redeemedBy": {
            "type": "string"
          },
          "redeemedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CouponRedemptionListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "redemptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CouponRedemptionDto"
            }
          }
        }
      },
      "CouponRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required. What the customer sees, e.g. \"夏の20%OFF\"."
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "code": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required. What the customer presents, e.g. \"SUMMER20\". Matched\ncase-insensitively at the till, and unique within the store by\nconvention — a duplicate makes redemption ambiguous."
          },
          "discountType": {
            "enum": [
              "Percentage",
              "FixedAmount"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "Required."
          },
          "discountValue": {
            "type": "number",
            "description": "Required. Percent (1–100) or a cash amount, per `discountType`.",
            "format": "double"
          },
          "validFrom": {
            "type": [
              "null",
              "string"
            ],
            "description": "UTC. Null means \"already\".",
            "format": "date-time"
          },
          "validUntil": {
            "type": [
              "null",
              "string"
            ],
            "description": "UTC. Null means \"no end date\".",
            "format": "date-time"
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Defaults to true."
          },
          "maxUses": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Total redemptions allowed across all customers. Null means uncapped.",
            "format": "int32"
          }
        }
      },
      "CouponResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "discountType": {
            "enum": [
              "Percentage",
              "FixedAmount"
            ],
            "type": "string"
          },
          "discountValue": {
            "type": "number",
            "format": "double"
          },
          "validFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "validUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isActive": {
            "type": "boolean"
          },
          "maxUses": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Null means uncapped.",
            "format": "int32"
          },
          "currentUses": {
            "type": "integer",
            "format": "int32"
          },
          "remainingUses": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Null when uncapped. Never negative.",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CouponVerifyResponse": {
        "type": "object",
        "properties": {
          "isValid": {
            "type": "boolean"
          },
          "reason": {
            "enum": [
              "ok",
              "not_found",
              "inactive",
              "not_yet_valid",
              "expired",
              "fully_used"
            ],
            "type": "string",
            "description": "Why the code cannot be taken, or `ok`. A till shows a different\nmessage for each, so treat an unknown value as a generic refusal\nrather than displaying it."
          },
          "remainingUses": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Null when uncapped.",
            "format": "int32"
          },
          "coupon": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "The coupon the code matched. Null for `not_found`.",
                "$ref": "#/components/schemas/CouponResponse"
              }
            ]
          }
        }
      },
      "CreateAnnouncementRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": "string",
            "description": "Required."
          },
          "body": {
            "type": "string",
            "description": "Required."
          },
          "storeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Omit to address every member of staff in the business account."
          },
          "isPinned": {
            "type": "boolean",
            "description": "Keeps the notice at the top of the list."
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "After this the notice stops appearing. Null to keep it indefinitely.",
            "format": "date-time"
          }
        }
      },
      "CreateCheckInRequest": {
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "method": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"QR\" (default) or \"NFC\"."
          },
          "deviceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional opaque device id for fraud triage."
          }
        }
      },
      "CreatePostRequest": {
        "type": "object",
        "properties": {
          "accountIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "body": {
            "type": [
              "null",
              "string"
            ]
          },
          "hashtags": {
            "type": [
              "null",
              "string"
            ]
          },
          "imageUrls": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "videoUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "campaignId": {
            "type": [
              "null",
              "string"
            ]
          },
          "scheduledAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "platformOverrides": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "$ref": "#/components/schemas/PlatformContentOverride"
            },
            "description": "Per-platform body/hashtags/title overrides keyed by platform name (e.g. \"X\", \"Instagram\")."
          },
          "youTubePrivacy": {
            "type": [
              "null",
              "string"
            ],
            "description": "YouTube only — \"public\" | \"unlisted\" | \"private\". Defaults to \"unlisted\"."
          },
          "publishNow": {
            "type": "boolean",
            "description": "If true, publish immediately after creating the draft."
          }
        }
      },
      "CreateShiftRequest": {
        "type": "object",
        "properties": {
          "staffId": {
            "type": "string",
            "description": "Required. Must be a staff member of this store."
          },
          "date": {
            "type": "string",
            "description": "Required. yyyy-MM-dd."
          },
          "startTime": {
            "type": "string",
            "description": "Required. HH:mm."
          },
          "endTime": {
            "type": "string",
            "description": "Required. HH:mm, after startTime."
          },
          "breakMinutes": {
            "type": "integer",
            "description": "Unpaid break inside the shift. Defaults to none.",
            "format": "int32"
          },
          "position": {
            "type": [
              "null",
              "string"
            ],
            "description": "Defaults to the staff member's usual position."
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "colorCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "Colour for the rota grid, e.g. \"#4285F4\"."
          }
        }
      },
      "CreateSlotRequest": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string",
            "description": "Required."
          },
          "slotDate": {
            "type": "string",
            "description": "Required. The day the slot is on (yyyy-MM-dd).",
            "format": "date-time"
          },
          "startTime": {
            "type": "string",
            "description": "Required. HH:mm."
          },
          "endTime": {
            "type": "string",
            "description": "Required. HH:mm."
          },
          "durationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "capacity": {
            "type": "integer",
            "description": "How much the slot can take, in string CreateSlotRequest.CapacityUnit. Defaults to 1.",
            "format": "int32"
          },
          "capacityUnit": {
            "enum": [
              "Bookings",
              "Seats"
            ],
            "type": "string",
            "description": "What Capacity counts. Defaults to Bookings."
          },
          "assignedResource": {
            "type": "string",
            "description": "Display name of the table, room or staff member this slot is for."
          },
          "staffId": {
            "type": "string",
            "description": "The staff member this slot belongs to. Empty for tables and rooms."
          },
          "resourceCategory": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "notes": {
            "type": "string"
          }
        },
        "description": "What creating one slot actually takes."
      },
      "CreateWebhookRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "HTTPS URL to deliver event payloads to. Must be publicly reachable.\nLocalhost and private IP ranges are rejected.",
            "example": "https://your-app.example.com/hooks"
          },
          "eventTypes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "One or more event types to subscribe to.\nValid values: receipt.created, receipt.updated, receipt.deleted,\norder.created, order.updated, coupon.redeemed, coupon.expired,\ncustomer.visited, test.ping",
            "example": [
              "order.created",
              "order.updated"
            ]
          },
          "secret": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional signing secret used to compute X-RR-Signature, 16 to 64\ncharacters. Auto-generated if omitted. Shown only once on creation.",
            "example": "my-signing-secret"
          }
        },
        "description": "Request body for registering a new webhook."
      },
      "CreativeListResponse": {
        "type": "object",
        "properties": {
          "creatives": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreativeResponse"
            }
          }
        }
      },
      "CreativeResponse": {
        "type": "object",
        "properties": {
          "creativeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "enum": [
              "Image",
              "Video"
            ],
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "CustomerChurnReportDto": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "asOfUtc": {
            "type": "string",
            "format": "date-time"
          },
          "totalCustomersScored": {
            "type": "integer",
            "format": "int32"
          },
          "highRiskCount": {
            "type": "integer",
            "format": "int32"
          },
          "mediumRiskCount": {
            "type": "integer",
            "format": "int32"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerChurnRiskDto"
            }
          }
        }
      },
      "CustomerChurnRiskDto": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "lastPurchaseAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "daysSinceLastPurchase": {
            "type": "integer",
            "format": "int32"
          },
          "purchaseCount": {
            "type": "integer",
            "format": "int32"
          },
          "avgIntervalDays": {
            "type": "number",
            "format": "double"
          },
          "totalSpend": {
            "type": "number",
            "format": "double"
          },
          "riskScore": {
            "type": "integer",
            "format": "int32"
          },
          "riskBucket": {
            "type": "string"
          },
          "recommendedAction": {
            "type": "string"
          }
        }
      },
      "CustomerRecommendationsDto": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "asOfUtc": {
            "type": "string",
            "format": "date-time"
          },
          "customerHistory": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recommendations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductRecommendationDto"
            }
          }
        }
      },
      "CustomerRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ],
            "description": "Unique customer ID (optional for new customers).",
            "example": "CUS-001"
          },
          "name": {
            "type": "string",
            "description": "Full name of the customer (\"LastName FirstName\")."
          },
          "email": {
            "type": [
              "null",
              "string"
            ],
            "description": "Email address."
          },
          "phone": {
            "type": [
              "null",
              "string"
            ],
            "description": "Phone number, as entered."
          },
          "gender": {
            "type": [
              "null",
              "string"
            ],
            "description": "Gender (male/female/other)."
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Birth date (optional).",
            "format": "date-time"
          },
          "loyaltyRank": {
            "type": [
              "null",
              "string"
            ],
            "description": "Membership level (e.g., Standard, Silver, Gold, Platinum)."
          },
          "tags": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Tags representing customer segments or behaviors."
          }
        }
      },
      "CustomerResponse": {
        "type": "object",
        "properties": {
          "totalSpend": {
            "type": "number",
            "description": "Total lifetime spend of the customer.",
            "format": "double"
          },
          "purchaseCount": {
            "type": "integer",
            "description": "Total number of visits/purchases.",
            "format": "int32"
          },
          "lastPurchaseAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Date and time of the last visit/purchase.",
            "format": "date-time"
          },
          "id": {
            "type": [
              "null",
              "string"
            ],
            "description": "Unique customer ID (optional for new customers).",
            "example": "CUS-001"
          },
          "name": {
            "type": "string",
            "description": "Full name of the customer (\"LastName FirstName\")."
          },
          "email": {
            "type": [
              "null",
              "string"
            ],
            "description": "Email address."
          },
          "phone": {
            "type": [
              "null",
              "string"
            ],
            "description": "Phone number, as entered."
          },
          "gender": {
            "type": [
              "null",
              "string"
            ],
            "description": "Gender (male/female/other)."
          },
          "birthDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Birth date (optional).",
            "format": "date-time"
          },
          "loyaltyRank": {
            "type": [
              "null",
              "string"
            ],
            "description": "Membership level (e.g., Standard, Silver, Gold, Platinum)."
          },
          "tags": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Tags representing customer segments or behaviors."
          }
        }
      },
      "DailyNoteEntry": {
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "feeling": {
            "type": [
              "null",
              "string"
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DailyNoteListItem": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "feeling": {
            "type": [
              "null",
              "string"
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DailyNoteRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "feeling": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DailySalesTrendReport": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "terminalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "days": {
            "type": "integer",
            "format": "int32"
          },
          "revenueTrend": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DailyTrendPoint"
            }
          },
          "transactionsTrend": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DailyTrendPoint"
            }
          }
        }
      },
      "DailyTrendPoint": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "value": {
            "type": "number",
            "format": "double"
          },
          "isPartial": {
            "type": "boolean"
          }
        }
      },
      "DayOfWeekBucketDto": {
        "type": "object",
        "properties": {
          "dayOfWeek": {
            "type": "integer",
            "format": "int32"
          },
          "label": {
            "type": "string"
          },
          "transactionCount": {
            "type": "integer",
            "format": "int32"
          },
          "revenue": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "DayResponse": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "impressions": {
            "type": "integer",
            "format": "int64"
          },
          "clicks": {
            "type": "integer",
            "format": "int64"
          },
          "spend": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "DeleteAccountRequest": {
        "required": [
          "confirm"
        ],
        "type": "object",
        "properties": {
          "confirm": {
            "type": "boolean",
            "description": "Must be true to proceed — makes accidental deletion harder."
          },
          "password": {
            "type": [
              "null",
              "string"
            ],
            "description": "For accounts that sign in with a password. Same as proof {type: password}."
          },
          "proof": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Proof the caller can sign in now — a password, or an ID token for a LINE,\nApple or Google sign-in on the account. Not needed for a fresh phone account.",
                "$ref": "#/components/schemas/AccountProofRequest"
              }
            ]
          }
        }
      },
      "DeviceRegisteredResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          }
        }
      },
      "DeviceRegisterRequest": {
        "type": "object",
        "properties": {
          "deviceToken": {
            "type": "string",
            "description": "Required. The APNs or FCM token."
          },
          "platform": {
            "enum": [
              "ios",
              "android"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "`ios` or `android`. Android when omitted."
          },
          "userId": {
            "type": [
              "null",
              "string"
            ]
          },
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "deviceId": {
            "type": [
              "null",
              "string"
            ]
          },
          "appVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "osVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "deviceModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DeviceUnregisterRequest": {
        "type": "object",
        "properties": {
          "deviceToken": {
            "type": "string"
          },
          "platform": {
            "type": [
              "null",
              "string"
            ]
          },
          "userId": {
            "type": [
              "null",
              "string"
            ]
          },
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "deviceId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DisplayRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "storeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The store the screen stands in; set when the screen is added."
          },
          "zone": {
            "type": [
              "null",
              "string"
            ],
            "description": "A free-text area such as a mall floor, for placing promotions by zone."
          }
        }
      },
      "DisplayResponse": {
        "type": "object",
        "properties": {
          "displayId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "zone": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Pending until a device pairs."
          },
          "health": {
            "enum": [
              "Pending",
              "Disabled",
              "Offline",
              "NotPlaying",
              "Playing"
            ],
            "type": "string",
            "description": "Whether the screen is actually playing, not only switched on."
          },
          "isOnline": {
            "type": "boolean"
          },
          "lastHeartbeatAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastPlayedAtUtc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "screenWidth": {
            "type": "integer",
            "format": "int32"
          },
          "screenHeight": {
            "type": "integer",
            "format": "int32"
          },
          "supportsVideo": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "EmailCodeRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "proof": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AccountProofRequest"
              }
            ]
          }
        }
      },
      "EmergencyFundSuggestionDto": {
        "type": "object",
        "properties": {
          "averageMonthlySpending": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "monthsCounted": {
            "type": "integer",
            "format": "int32"
          },
          "minimumAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "recommendedAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "FeedRequest": {
        "type": "object",
        "properties": {
          "feedUrl": {
            "type": [
              "null",
              "string"
            ],
            "description": "An RSS 2.0 or Atom feed at a public https address; empty to stop reading a feed."
          }
        }
      },
      "FulfillViaPosBody": {
        "type": "object",
        "properties": {
          "posTerminalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "posTransactionId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "GenerateSlotsRequest": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "perResource": {
            "type": "boolean",
            "description": "true = one slot series per reservable resource\n    (table/room) from the store layout; false = plain\n    capacity-based slots from the reservation config."
          }
        }
      },
      "GoogleDailyValueDto": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "value": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "GoogleInsightsDto": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "format": "date"
          },
          "daysWithData": {
            "type": "integer",
            "format": "int32"
          },
          "savedFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "totalCalls": {
            "type": "integer",
            "format": "int32"
          },
          "totalDirections": {
            "type": "integer",
            "format": "int32"
          },
          "totalWebsiteClicks": {
            "type": "integer",
            "format": "int32"
          },
          "totalSearchImpressions": {
            "type": "integer",
            "format": "int32"
          },
          "totalMapsImpressions": {
            "type": "integer",
            "format": "int32"
          },
          "callsTrend": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "directionsTrend": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "websiteTrend": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "searchTrend": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "mapsTrend": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "callSeries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleDailyValueDto"
            }
          },
          "directionSeries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleDailyValueDto"
            }
          },
          "websiteSeries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleDailyValueDto"
            }
          },
          "searchSeries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleDailyValueDto"
            }
          },
          "mapsSeries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleDailyValueDto"
            }
          },
          "topKeywords": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GoogleSearchKeywordDto"
            }
          },
          "keywordsFromMonth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          },
          "keywordsToMonth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date"
          }
        }
      },
      "GoogleSearchKeywordDto": {
        "type": "object",
        "properties": {
          "keyword": {
            "type": "string"
          },
          "impressions": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "HeartbeatResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "serverTimeUtc": {
            "type": "string",
            "format": "date-time"
          },
          "nextHeartbeatSeconds": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "HeatmapCellDto": {
        "type": "object",
        "properties": {
          "dayOfWeek": {
            "type": "integer",
            "format": "int32"
          },
          "hour": {
            "type": "integer",
            "format": "int32"
          },
          "transactionCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "HourlyBucketDto": {
        "type": "object",
        "properties": {
          "hour": {
            "type": "integer",
            "format": "int32"
          },
          "transactionCount": {
            "type": "integer",
            "format": "int32"
          },
          "revenue": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "ImpressionBatchRequest": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Item"
            }
          }
        }
      },
      "ImpressionBatchResponse": {
        "type": "object",
        "properties": {
          "accepted": {
            "type": "integer",
            "format": "int32"
          },
          "duplicates": {
            "type": "integer",
            "format": "int32"
          },
          "rejected": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "IncomeAllocationDto": {
        "type": "object",
        "properties": {
          "goalId": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "percent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "IncomeAllocationRequest": {
        "type": "object",
        "properties": {
          "goalId": {
            "type": [
              "null",
              "string"
            ],
            "description": "A savings goal or 特別費 id."
          },
          "amount": {
            "type": [
              "null",
              "number"
            ],
            "description": "Yen. Send this or percent.",
            "format": "double"
          },
          "percent": {
            "type": [
              "null",
              "number"
            ],
            "description": "Of the entry's amount, above 0 up to 100. Send this or amount.",
            "format": "double"
          }
        }
      },
      "IncomeRecordRequest": {
        "required": [
          "date",
          "source",
          "amount"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "kind": {
            "type": [
              "null",
              "string"
            ],
            "description": "salary, bonus, irregular or side_job. Default salary."
          },
          "memo": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "IncomeRequest": {
        "required": [
          "year",
          "month",
          "amount"
        ],
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "amount": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "IngestMediaRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "InsightMessageDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "value": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "InventoryListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "stock": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryStockRow"
            }
          }
        }
      },
      "InventoryLocationRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "linkedStoreId": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "InventoryLocationsResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryLocationRow"
            }
          }
        }
      },
      "InventoryMovementRow": {
        "type": "object",
        "properties": {
          "movementType": {
            "type": "string"
          },
          "productId": {
            "type": "string"
          },
          "productName": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "fromLocationId": {
            "type": "string"
          },
          "toLocationId": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "previousQuantity": {
            "type": "integer",
            "format": "int32"
          },
          "newQuantity": {
            "type": "integer",
            "format": "int32"
          },
          "referenceType": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "userName": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InventoryMovementsResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "movements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryMovementRow"
            }
          }
        }
      },
      "InventoryStockRow": {
        "type": "object",
        "properties": {
          "locationId": {
            "type": "string"
          },
          "locationName": {
            "type": "string"
          },
          "productId": {
            "type": "string"
          },
          "productName": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "janCode": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "reservedQuantity": {
            "type": "integer",
            "format": "int32"
          },
          "availableQuantity": {
            "type": "integer",
            "format": "int32"
          },
          "minStockLevel": {
            "type": "integer",
            "format": "int32"
          },
          "maxStockLevel": {
            "type": "integer",
            "format": "int32"
          },
          "isLowStock": {
            "type": "boolean"
          },
          "unit": {
            "type": "string"
          },
          "lastCountedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastMovementAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IssueClaimTokenBody": {
        "type": "object",
        "properties": {
          "ttlMinutes": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Token lifetime in minutes. Default 1440 (24 hours); at most 10080 (7 days).",
            "format": "int32"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional reason recorded in the audit log."
          }
        }
      },
      "Item": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string"
          },
          "creativeId": {
            "type": "string"
          },
          "campaignId": {
            "type": "string"
          },
          "placementId": {
            "type": "string"
          },
          "advertiserId": {
            "type": "string"
          },
          "playedAtUtc": {
            "type": "string",
            "format": "date-time"
          },
          "durationPlayedMs": {
            "type": "integer",
            "format": "int32"
          },
          "completed": {
            "type": "boolean"
          }
        }
      },
      "ItemListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ItemResponse"
            }
          }
        }
      },
      "ItemPriceChangeDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "fromYear": {
            "type": "integer",
            "format": "int32"
          },
          "fromMonth": {
            "type": "integer",
            "format": "int32"
          },
          "fromPrice": {
            "type": "number",
            "format": "double"
          },
          "toYear": {
            "type": "integer",
            "format": "int32"
          },
          "toMonth": {
            "type": "integer",
            "format": "int32"
          },
          "toPrice": {
            "type": "number",
            "format": "double"
          },
          "changePercent": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ItemPriceHistoryDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "months": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ItemPriceMonthDto"
            }
          }
        }
      },
      "ItemPriceMonthDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "averagePrice": {
            "type": "number",
            "format": "double"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "lastStoreName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ItemRankingDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "spent": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ItemResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "enum": [
              "Image",
              "Video"
            ],
            "type": "string"
          },
          "width": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "height": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "durationSeconds": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "validUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "source": {
            "enum": [
              "upload",
              "feed",
              "api"
            ],
            "type": "string"
          },
          "externalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "JobAssignmentDto": {
        "type": "object",
        "properties": {
          "jobTitle": {
            "type": "string"
          },
          "payType": {
            "type": "string"
          },
          "hourlyRate": {
            "type": "number",
            "format": "double"
          },
          "annualRate": {
            "type": "number",
            "format": "double"
          },
          "weeklyHours": {
            "type": "number",
            "format": "double"
          },
          "locationIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "JournalSettingsInput": {
        "type": "object",
        "properties": {
          "aiUse": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "noticeSeen": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "KpiValue": {
        "type": "object",
        "properties": {
          "current": {
            "type": "number",
            "format": "double"
          },
          "previous": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "isMeasured": {
            "type": "boolean"
          },
          "change": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "changePercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "isPositive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "trendColor": {
            "type": [
              "null",
              "string"
            ]
          },
          "trendIcon": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "LabelBudget": {
        "required": [
          "labelId"
        ],
        "type": "object",
        "properties": {
          "labelId": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "LabelBudgetLineDto": {
        "type": "object",
        "properties": {
          "labelId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "budget": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "spent": {
            "type": "number",
            "format": "double"
          },
          "remaining": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "percentUsed": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "projected": {
            "type": "number",
            "format": "double"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "LiftResponse": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "actualYen": {
            "type": "number",
            "format": "double"
          },
          "expectedYen": {
            "type": "number",
            "format": "double"
          },
          "extraYen": {
            "type": "number",
            "format": "double"
          },
          "deliveringStores": {
            "type": "integer",
            "format": "int32"
          },
          "controlStores": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "LinkIdentityRequest": {
        "required": [
          "issuer",
          "idToken"
        ],
        "type": "object",
        "properties": {
          "issuer": {
            "type": "string",
            "description": "line, apple or google"
          },
          "idToken": {
            "type": "string",
            "description": "A fresh ID token for the identity to add"
          },
          "nonce": {
            "type": [
              "null",
              "string"
            ]
          },
          "organizationId": {
            "type": [
              "null",
              "string"
            ],
            "description": "LINE only: the store whose LINE channel issued the token"
          },
          "proof": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Proof for the account; not needed while it has no other way in",
                "$ref": "#/components/schemas/AccountProofRequest"
              }
            ]
          }
        }
      },
      "MakeupRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string"
          },
          "sourceReservationId": {
            "type": "string",
            "description": "The excused absence being claimed."
          },
          "newSlotId": {
            "type": "string",
            "description": "The slot to attend instead."
          }
        }
      },
      "MediaPairResultDto": {
        "type": "object",
        "properties": {
          "displayId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "deviceToken": {
            "type": "string"
          }
        }
      },
      "MediaPlaylistDto": {
        "type": "object",
        "properties": {
          "displayId": {
            "type": "string"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "pollIntervalSeconds": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaPlaylistItemDto"
            }
          }
        }
      },
      "MediaPlaylistItemDto": {
        "type": "object",
        "properties": {
          "creativeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "mediaUrl": {
            "type": "string"
          },
          "durationSeconds": {
            "type": "number",
            "format": "double"
          },
          "hashHint": {
            "type": "string"
          },
          "campaignId": {
            "type": "string"
          },
          "placementId": {
            "type": "string"
          },
          "advertiserId": {
            "type": "string"
          },
          "isSponsored": {
            "type": "boolean"
          },
          "sponsorLabel": {
            "type": "string"
          }
        }
      },
      "MembershipCancelResponse": {
        "type": "object",
        "properties": {
          "membershipId": {
            "type": "string"
          },
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "periodEnd": {
            "type": [
              "null",
              "string"
            ],
            "description": "Access ends here. Null when Stripe did not report one.",
            "format": "date-time"
          }
        }
      },
      "MembershipMemberListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MembershipMemberResponse"
            }
          }
        }
      },
      "MembershipMemberResponse": {
        "type": "object",
        "properties": {
          "membershipId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "CRM customer id — the same id a booking resolves to."
          },
          "planName": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Pending",
              "Active",
              "PastDue",
              "Cancelled"
            ],
            "type": "string",
            "description": "Pending / Active / PastDue / Cancelled."
          },
          "currentPeriodEnd": {
            "type": [
              "null",
              "string"
            ],
            "description": "Access runs to here even after cancellation.",
            "format": "date-time"
          },
          "cancelAtPeriodEnd": {
            "type": "boolean",
            "description": "Cancelled, but still inside the paid period."
          },
          "paymentSource": {
            "type": "string",
            "description": "\"Terminal\" when paid at the counter (does not renew itself); empty for a card subscription."
          },
          "membershipPlanId": {
            "type": "string",
            "description": "Set on counter sales."
          },
          "paidAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the terminal took the payment. Counter sales only.",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MembershipPlanListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MembershipPlanResponse"
            }
          }
        }
      },
      "MembershipPlanRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string"
          },
          "membershipPlanId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Omit to create."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "price": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "currency": {
            "type": [
              "null",
              "string"
            ]
          },
          "interval": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "sortOrder": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          }
        }
      },
      "MembershipPlanResponse": {
        "type": "object",
        "properties": {
          "membershipPlanId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "description": "Major unit — a 4,980 yen plan is 4980.",
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "interval": {
            "type": "string",
            "description": "`month` or `year`."
          },
          "isActive": {
            "type": "boolean"
          },
          "isSellable": {
            "type": "boolean",
            "description": "On sale right now: active, priced, and named."
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MembershipSaleRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string",
            "description": "Required."
          },
          "membershipPlanId": {
            "type": "string",
            "description": "Required. The plan being sold."
          },
          "customerId": {
            "type": "string",
            "description": "Required. CRM customer id — find it with `GET /store/customers?q=`."
          },
          "paidAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the terminal took the payment. Defaults to now.",
            "format": "date-time"
          },
          "payment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Required, with terminalId and slipNumber.",
                "$ref": "#/components/schemas/TerminalPayment"
              }
            ]
          }
        }
      },
      "MembershipSaleResponse": {
        "type": "object",
        "properties": {
          "replayed": {
            "type": "boolean",
            "description": "True when this slip had already been recorded; nothing new was sold."
          },
          "member": {
            "$ref": "#/components/schemas/MembershipMemberResponse"
          }
        }
      },
      "MeOrganizationRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "The member's first role. **Deprecated — read `roles`.**"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every role the member holds, normalised to the values the server\nenforces. Legacy strings are migrated on read: `Owner` and `Admin`\narrive as `SuperUser`, `Member` as `StoreStaff`."
          }
        }
      },
      "MeOrganizationsResponse": {
        "type": "object",
        "properties": {
          "organizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MeOrganizationRow"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "MeOrgTerminalRow": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string"
          },
          "storeName": {
            "type": "string"
          },
          "terminal": {
            "$ref": "#/components/schemas/MeTerminal"
          }
        }
      },
      "MeOrgTerminalsResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "The member's first role. **Deprecated — read `roles`.**"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every role the member holds, normalised."
          },
          "terminals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MeOrgTerminalRow"
            }
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "MePermissionsResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Organization roles held, normalised. For display — branch on capabilities."
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Capabilities granted for the business as a whole, and so at every store."
          },
          "stores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MePermissionsStore"
            }
          }
        }
      },
      "MePermissionsStore": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "storeRoles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Store roles held at this store. Empty when access comes from an organization role."
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every capability granted at this store, the business-wide ones included."
          }
        }
      },
      "MeStore": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "storeType": {
            "type": "string"
          },
          "primaryCategory": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "isDeleted": {
            "type": "boolean"
          },
          "isPosConnected": {
            "type": "boolean"
          },
          "address": {
            "$ref": "#/components/schemas/MeStoreAddressView"
          },
          "phone": {
            "type": "string"
          },
          "websiteUrl": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MeStoreAddressView": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string"
          },
          "prefecture": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "latitude": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "longitude": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "MeStoresResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "The member's first role. **Deprecated — read `roles`.**"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every role the member holds, normalised."
          },
          "stores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MeStore"
            }
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "MeStoreTerminalsResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "terminals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MeTerminal"
            }
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "MeTerminal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "vendor": {
            "type": "string"
          },
          "integrationType": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "serialNumber": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "publicTerminalId": {
            "type": "string"
          },
          "transactionCount": {
            "type": "integer",
            "format": "int32"
          },
          "lastSyncAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastSyncStatus": {
            "type": "string"
          },
          "lastTransactionAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MonthlyReportCategory": {
        "type": "object",
        "properties": {
          "categoryId": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "percent": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "MonthlyReportFigures": {
        "type": "object",
        "properties": {
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "receiptCount": {
            "type": "integer",
            "format": "int32"
          },
          "previousMonthTotal": {
            "type": "number",
            "format": "double"
          },
          "differenceAmount": {
            "type": "number",
            "format": "double"
          },
          "differencePercent": {
            "type": "number",
            "format": "double"
          },
          "budgetAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "budgetRemaining": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "budgetAchieved": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "specialExpenseSpent": {
            "type": "number",
            "format": "double"
          },
          "incomeAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "incomeSource": {
            "type": [
              "null",
              "string"
            ]
          },
          "regularIncome": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "bonusIncome": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "irregularIncome": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "regularSavingsRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "savingsAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "savingsRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonthlyReportCategory"
            }
          },
          "topStores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonthlyReportStore"
            }
          },
          "fixedAmount": {
            "type": "number",
            "format": "double"
          },
          "variableAmount": {
            "type": "number",
            "format": "double"
          },
          "topItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ItemRankingDto"
            }
          },
          "savingsContributed": {
            "type": "number",
            "format": "double"
          },
          "savingsGoals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavingsGoalMonthLine"
            }
          }
        }
      },
      "MonthlyReportSection": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          }
        }
      },
      "MonthlyReportStore": {
        "type": "object",
        "properties": {
          "storeName": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "MoveReservationRequest": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string",
            "description": "Required."
          },
          "slotId": {
            "type": "string",
            "description": "Required. Where the booking starts now."
          },
          "joinedSlotIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Joined tables only: the other tables to seat the party at. Omit to let the server seat them."
          }
        }
      },
      "NewPromotionRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "tenantName": {
            "type": [
              "null",
              "string"
            ],
            "description": "For malls: the tenant whose promotion this is."
          }
        }
      },
      "NewVsReturningMonthlyDto": {
        "type": "object",
        "properties": {
          "yearMonth": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "newCustomerTransactions": {
            "type": "integer",
            "format": "int32"
          },
          "returningCustomerTransactions": {
            "type": "integer",
            "format": "int32"
          },
          "anonymousTransactions": {
            "type": "integer",
            "format": "int32"
          },
          "distinctNewCustomers": {
            "type": "integer",
            "format": "int32"
          },
          "distinctReturningCustomers": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "OfferRequest": {
        "type": "object",
        "properties": {
          "type": {
            "enum": [
              "FixedAmount",
              "Percentage"
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "value": {
            "type": "number",
            "description": "Yen off for a fixed amount, or percent off.",
            "format": "double"
          },
          "validDays": {
            "type": "integer",
            "format": "int32"
          },
          "minPurchaseYen": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "maxCoupons": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The most coupons handed out; required, so spend on discounts has a ceiling.",
            "format": "int32"
          },
          "terms": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OmsOrderItemDto": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string"
          },
          "productName": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "unitPrice": {
            "type": "integer",
            "format": "int32"
          },
          "subtotal": {
            "type": "integer",
            "format": "int32"
          },
          "unit": {
            "type": "string"
          },
          "variantId": {
            "type": [
              "null",
              "string"
            ]
          },
          "variantLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "stockMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "reservedQuantity": {
            "type": "integer",
            "format": "int32"
          },
          "backorderQuantity": {
            "type": "integer",
            "format": "int32"
          },
          "shippedQuantity": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "OpenStatusResponse": {
        "type": "object",
        "properties": {
          "isOpen": {
            "type": "boolean"
          },
          "source": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "closesAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "nextOpensAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrderAmounts": {
        "type": "object",
        "properties": {
          "subtotal": {
            "type": "integer",
            "format": "int32"
          },
          "tax": {
            "type": "integer",
            "format": "int32"
          },
          "shipping": {
            "type": "integer",
            "format": "int32"
          },
          "discount": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "OrderCreateBody": {
        "type": "object",
        "properties": {
          "orderNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "channel": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingAddress": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ShippingAddressBody"
              }
            ]
          },
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OmsOrderItemDto"
            }
          },
          "paymentMethod": {
            "type": [
              "null",
              "string"
            ]
          },
          "paymentStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "subtotalAmount": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "taxAmount": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "shippingAmount": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "discountAmount": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "totalAmount": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "linkedStoreId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "isPreOrder": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "preOrderTargetShipDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        },
        "description": "Inbound shape for create / update. Keeps the JSON surface flatter\nthan the internal DTO and avoids exposing computed display fields\n(StatusDisplayJa, badge classes)."
      },
      "OrderCustomer": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        }
      },
      "OrderLinkedPos": {
        "type": "object",
        "properties": {
          "terminalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "transactionId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OrderLinkedStore": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OrderListResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderResponse"
            }
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "OrderPayment": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "paidAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "OrderPreOrder": {
        "type": "object",
        "properties": {
          "isPreOrder": {
            "type": "boolean"
          },
          "targetShipDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "OrderResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "orderNumber": {
            "type": "string"
          },
          "channel": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "customer": {
            "$ref": "#/components/schemas/OrderCustomer"
          },
          "shippingAddress": {
            "$ref": "#/components/schemas/OrderShippingAddress"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OmsOrderItemDto"
            }
          },
          "itemCount": {
            "type": "integer",
            "format": "int32"
          },
          "payment": {
            "$ref": "#/components/schemas/OrderPayment"
          },
          "amounts": {
            "$ref": "#/components/schemas/OrderAmounts"
          },
          "linkedStore": {
            "$ref": "#/components/schemas/OrderLinkedStore"
          },
          "linkedPosTransaction": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OrderLinkedPos"
              }
            ]
          },
          "notes": {
            "type": "string"
          },
          "preOrder": {
            "$ref": "#/components/schemas/OrderPreOrder"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrderShipment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "shipmentNumber": {
            "type": "string"
          },
          "carrier": {
            "type": "string"
          },
          "trackingNumber": {
            "type": "string"
          },
          "trackingUrl": {
            "type": "string"
          }
        }
      },
      "OrderShippingAddress": {
        "type": "object",
        "properties": {
          "postalCode": {
            "type": "string"
          },
          "prefecture": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "line": {
            "type": "string"
          }
        }
      },
      "OrderShipResponse": {
        "type": "object",
        "properties": {
          "order": {
            "$ref": "#/components/schemas/OrderResponse"
          },
          "shipment": {
            "$ref": "#/components/schemas/OrderShipment"
          }
        }
      },
      "OrgDashboardKpis": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "currentMonth": {
            "type": "string"
          },
          "previousMonth": {
            "type": [
              "null",
              "string"
            ]
          },
          "totalStores": {
            "$ref": "#/components/schemas/KpiValue"
          },
          "totalStaff": {
            "$ref": "#/components/schemas/KpiValue"
          },
          "totalProducts": {
            "$ref": "#/components/schemas/KpiValue"
          },
          "totalCustomers": {
            "$ref": "#/components/schemas/KpiValue"
          },
          "totalRevenue": {
            "$ref": "#/components/schemas/KpiValue"
          },
          "totalTransactions": {
            "$ref": "#/components/schemas/KpiValue"
          },
          "averageTicket": {
            "$ref": "#/components/schemas/KpiValue"
          },
          "avgGoogleRating": {
            "$ref": "#/components/schemas/KpiValue"
          },
          "totalReservations": {
            "$ref": "#/components/schemas/KpiValue"
          }
        }
      },
      "OrgMonthlyReport": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "months": {
            "type": "integer",
            "format": "int32"
          },
          "storesTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "staffTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "revenueTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "transactionsTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "customersTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "reservationsTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "googleRatingTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "productsTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          }
        }
      },
      "OtherAccountProof": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "id_token, password or email_code"
          },
          "issuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "idToken": {
            "type": [
              "null",
              "string"
            ]
          },
          "nonce": {
            "type": [
              "null",
              "string"
            ]
          },
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "password": {
            "type": [
              "null",
              "string"
            ]
          },
          "code": {
            "type": [
              "null",
              "string"
            ],
            "description": "From /email-code"
          }
        }
      },
      "PairingResponse": {
        "type": "object",
        "properties": {
          "display": {
            "$ref": "#/components/schemas/DisplayResponse"
          },
          "pairingCode": {
            "type": "string",
            "description": "6 digits, typed into the display app on the device."
          },
          "pairingExpiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PairRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "screenWidth": {
            "type": "integer",
            "format": "int32"
          },
          "screenHeight": {
            "type": "integer",
            "format": "int32"
          },
          "supportsVideo": {
            "type": "boolean"
          },
          "supportsAudio": {
            "type": "boolean"
          }
        }
      },
      "PassCreditRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string",
            "description": "Required."
          },
          "customerId": {
            "type": "string",
            "description": "Required. The pass holder."
          },
          "reservationId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The booking this visit is for. Omit for a walk-in."
          },
          "idempotencyKey": {
            "maxLength": 200,
            "type": [
              "null",
              "string"
            ],
            "description": "Unique per visit, made up by the device (a UUID will do). A retry\nwith the same key changes nothing. Recommended for walk-ins."
          }
        }
      },
      "PassCreditResponse": {
        "type": "object",
        "properties": {
          "passId": {
            "type": "string"
          },
          "remainingCredits": {
            "type": "integer",
            "format": "int32"
          },
          "totalCredits": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string",
            "description": "Active / Exhausted / Expired — after the change."
          },
          "reservationId": {
            "type": "string"
          },
          "replayed": {
            "type": "boolean",
            "description": "True when this was a retry — same key, or a booking that already used this pass. Nothing changed."
          }
        }
      },
      "PassHolderListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "passes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PassHolderResponse"
            }
          }
        }
      },
      "PassHolderResponse": {
        "type": "object",
        "properties": {
          "passId": {
            "type": "string"
          },
          "passProductId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "description": "CRM customer id — the same id a booking resolves to."
          },
          "name": {
            "type": "string",
            "description": "Copied at purchase, so a later rename does not rewrite history."
          },
          "totalCredits": {
            "type": "integer",
            "format": "int32"
          },
          "remainingCredits": {
            "type": "integer",
            "format": "int32"
          },
          "pricePaid": {
            "type": "number",
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Pending",
              "Active",
              "Exhausted",
              "Expired",
              "Cancelled"
            ],
            "type": "string",
            "description": "Pending / Active / Exhausted / Expired / Cancelled."
          },
          "purchasedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Null when the product had no expiry.",
            "format": "date-time"
          },
          "paymentSource": {
            "type": "string",
            "description": "\"Terminal\" when sold at the counter; empty for online checkout."
          },
          "terminalId": {
            "type": "string"
          },
          "slipNumber": {
            "type": "string"
          }
        }
      },
      "PassImportResponse": {
        "type": "object",
        "properties": {
          "applied": {
            "type": "boolean",
            "description": "False for a preview — nothing was written."
          },
          "validCount": {
            "type": "integer",
            "format": "int32"
          },
          "errorCount": {
            "type": "integer",
            "format": "int32"
          },
          "customersCreated": {
            "type": "integer",
            "format": "int32"
          },
          "customersMatched": {
            "type": "integer",
            "format": "int32"
          },
          "passesCreated": {
            "type": "integer",
            "format": "int32"
          },
          "skipped": {
            "type": "integer",
            "description": "Rows passed over. Always zero on a preview.",
            "format": "int32"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PassImportRowResponse"
            }
          }
        }
      },
      "PassImportRowResponse": {
        "type": "object",
        "properties": {
          "lineNumber": {
            "type": "integer",
            "description": "Line in the uploaded file, so an error can be found.",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "passName": {
            "type": "string"
          },
          "remainingCredits": {
            "type": "integer",
            "format": "int32"
          },
          "totalCredits": {
            "type": "integer",
            "format": "int32"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "action": {
            "type": "string",
            "description": "What would happen, or did — matched, created, skipped."
          },
          "error": {
            "type": "string",
            "description": "Why the row cannot be used. Empty when it can."
          }
        }
      },
      "PassProductListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PassProductResponse"
            }
          }
        }
      },
      "PassProductRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string"
          },
          "passProductId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Omit to create."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "credits": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "price": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "currency": {
            "type": [
              "null",
              "string"
            ]
          },
          "validDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "sortOrder": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          }
        }
      },
      "PassProductResponse": {
        "type": "object",
        "properties": {
          "passProductId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "credits": {
            "type": "integer",
            "description": "How many bookings the pass covers.",
            "format": "int32"
          },
          "price": {
            "type": "number",
            "description": "Major unit — a 12,000 yen pass is 12000.",
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "validDays": {
            "type": "integer",
            "description": "Days until expiry from purchase. 0 means no expiry.",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PassSaleRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string",
            "description": "Required."
          },
          "passProductId": {
            "type": "string",
            "description": "Required. The product being sold."
          },
          "customerId": {
            "type": "string",
            "description": "Required. CRM customer id — find it with `GET /store/customers?q=`."
          },
          "paidAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the terminal took the payment. Defaults to now.",
            "format": "date-time"
          },
          "payment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Required, with terminalId and slipNumber.",
                "$ref": "#/components/schemas/TerminalPayment"
              }
            ]
          }
        }
      },
      "PassSaleResponse": {
        "type": "object",
        "properties": {
          "replayed": {
            "type": "boolean",
            "description": "True when this slip had already been recorded; nothing new was sold."
          },
          "pass": {
            "$ref": "#/components/schemas/PassHolderResponse"
          }
        }
      },
      "PasswordCodeRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "proof": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AccountProofRequest"
              }
            ]
          }
        }
      },
      "PatchProductRequest": {
        "type": "object",
        "properties": {
          "productName": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "brand": {
            "type": [
              "null",
              "string"
            ]
          },
          "supplier": {
            "type": [
              "null",
              "string"
            ]
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "janCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "basePrice": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "baseCostPrice": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "taxRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PlacementRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "target": {
            "enum": [
              "all",
              "displays",
              "stores",
              "zones"
            ],
            "type": "string"
          },
          "displayIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "storeIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "zones": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "startDateUtc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endDateUtc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "dayOfWeekMask": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Days to play, bit 0 = Sunday; none means every day.",
            "format": "int32"
          },
          "hourOfDayMask": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Hours to play (Japan time), bit 0 = 00:00–01:00; none means every hour.",
            "format": "int32"
          },
          "weight": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How often it comes round relative to other promotions, 1 or more.",
            "format": "int32"
          },
          "frequencyCapPerHour": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Most plays per screen per hour; 0 for no limit.",
            "format": "int32"
          }
        }
      },
      "PlacementResponse": {
        "type": "object",
        "properties": {
          "placementId": {
            "type": "string"
          },
          "promotionId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "target": {
            "enum": [
              "all",
              "displays",
              "stores",
              "zones"
            ],
            "type": "string"
          },
          "displayIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "storeIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "zones": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "startDateUtc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endDateUtc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "dayOfWeekMask": {
            "type": "integer",
            "format": "int32"
          },
          "hourOfDayMask": {
            "type": "integer",
            "format": "int32"
          },
          "weight": {
            "type": "integer",
            "format": "int32"
          },
          "frequencyCapPerHour": {
            "type": "integer",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "PlannedShiftResponse": {
        "type": "object",
        "properties": {
          "shiftId": {
            "type": "string"
          },
          "startTime": {
            "type": "string"
          },
          "endTime": {
            "type": "string"
          },
          "workStartTime": {
            "type": "string"
          },
          "workEndTime": {
            "type": "string"
          },
          "position": {
            "type": "string"
          }
        }
      },
      "PlatformContentOverride": {
        "type": "object",
        "properties": {
          "body": {
            "type": [
              "null",
              "string"
            ]
          },
          "hashtags": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PostRequest": {
        "type": "object",
        "properties": {
          "title": {
            "maxLength": 200,
            "type": [
              "null",
              "string"
            ]
          },
          "summary": {
            "maxLength": 500,
            "type": [
              "null",
              "string"
            ]
          },
          "body": {
            "type": [
              "null",
              "string"
            ],
            "description": "HTML. Sanitized on save the same way as the web editor."
          },
          "coverImageUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ],
            "description": "Free text."
          },
          "tags": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "isSticky": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "scheduledAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Store wall-clock time. In the future on create → Scheduled.",
            "format": "date-time"
          }
        }
      },
      "PostResponse": {
        "type": "object",
        "properties": {
          "postId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "coverImageUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isSticky": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "description": "Draft, Scheduled, Published or Archived."
          },
          "scheduledAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "publishedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PreviewRequest": {
        "required": [
          "mergeTicket"
        ],
        "type": "object",
        "properties": {
          "mergeTicket": {
            "type": "string"
          },
          "keep": {
            "type": [
              "null",
              "string"
            ],
            "description": "current or other; omitted = suggestedKeep"
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProductDto": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "productName": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "janCode": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "supplier": {
            "type": "string"
          },
          "modelNumber": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "size": {
            "type": "string"
          },
          "weight": {
            "type": "string"
          },
          "contentVolume": {
            "type": "string"
          },
          "material": {
            "type": "string"
          },
          "specification": {
            "type": "string"
          },
          "countryOfOrigin": {
            "type": "string"
          },
          "casePackSize": {
            "type": "string"
          },
          "minimumOrderQuantity": {
            "type": "string"
          },
          "orderByCase": {
            "type": "boolean"
          },
          "leadTimeDays": {
            "type": "string"
          },
          "hsCode": {
            "type": "string"
          },
          "storageRequirements": {
            "type": "string"
          },
          "certifications": {
            "type": "string"
          },
          "internalMemo": {
            "type": "string"
          },
          "basePrice": {
            "type": "number",
            "format": "double"
          },
          "baseCostPrice": {
            "type": "number",
            "format": "double"
          },
          "taxRate": {
            "type": "number",
            "format": "double"
          },
          "storePricesJson": {
            "type": "string"
          },
          "imageUrl": {
            "type": "string"
          },
          "imageUrlsJson": {
            "type": "string"
          },
          "imageUrls": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "hasVariants": {
            "type": "boolean"
          },
          "variantOptionsJson": {
            "type": "string"
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductVariantDto"
            }
          },
          "variantOptions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/VariantOptionDto"
            }
          },
          "minVariantPrice": {
            "type": "number",
            "format": "double"
          },
          "maxVariantPrice": {
            "type": "number",
            "format": "double"
          },
          "squareCatalogObjectId": {
            "type": "string"
          },
          "squareVariationId": {
            "type": "string"
          },
          "squareVersion": {
            "type": "integer",
            "format": "int64"
          },
          "squarePushedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "squarePushError": {
            "type": "string"
          },
          "isLinkedToSquare": {
            "type": "boolean"
          },
          "smaregiProductId": {
            "type": "string"
          },
          "shopifyProductGid": {
            "type": "string"
          },
          "shopifyShopDomain": {
            "type": "string"
          },
          "shopifyUpdatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isFromShopify": {
            "type": "boolean"
          },
          "isPreOrder": {
            "type": "boolean"
          },
          "preOrderReleaseDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "preOrderNote": {
            "type": "string"
          },
          "b2becStockMode": {
            "type": "string"
          },
          "preOrderReleaseDateDisplay": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceBrandOrgId": {
            "type": "string"
          },
          "sourceBrandProductId": {
            "type": "string"
          },
          "allowSubscriptions": {
            "type": "boolean"
          },
          "sourceBrandSyncedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isFromBrand": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "isDeleted": {
            "type": "boolean"
          },
          "storePrices": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/StorePriceDto"
            }
          },
          "formattedBasePrice": {
            "type": [
              "null",
              "string"
            ]
          },
          "formattedBaseCostPrice": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxIncludedPrice": {
            "type": "number",
            "format": "double"
          },
          "formattedTaxIncludedPrice": {
            "type": [
              "null",
              "string"
            ]
          },
          "profitMargin": {
            "type": "number",
            "format": "double"
          },
          "taxRateDisplay": {
            "type": [
              "null",
              "string"
            ]
          },
          "statusDisplayJa": {
            "type": [
              "null",
              "string"
            ]
          },
          "statusBadgeClass": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProductImages": {
        "type": "object",
        "properties": {
          "cover": {
            "type": "string"
          },
          "gallery": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ProductIntegrations": {
        "type": "object",
        "properties": {
          "squareCatalogObjectId": {
            "type": "string"
          },
          "squareVariationId": {
            "type": "string"
          },
          "smaregiProductId": {
            "type": "string"
          }
        }
      },
      "ProductListResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductResponse"
            }
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ProductPreOrder": {
        "type": "object",
        "properties": {
          "isPreOrder": {
            "type": "boolean"
          },
          "releaseDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "ProductPricing": {
        "type": "object",
        "properties": {
          "basePrice": {
            "type": "number",
            "format": "double"
          },
          "baseCostPrice": {
            "type": "number",
            "format": "double"
          },
          "taxRate": {
            "type": "number",
            "format": "double"
          },
          "storePrices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StorePriceDto"
            }
          }
        }
      },
      "ProductRecommendationDto": {
        "type": "object",
        "properties": {
          "productName": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "score": {
            "type": "number",
            "format": "double"
          },
          "basedOn": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ProductResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "productName": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "janCode": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "supplier": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "modelNumber": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "size": {
            "type": "string"
          },
          "weight": {
            "type": "string"
          },
          "contentVolume": {
            "type": "string"
          },
          "material": {
            "type": "string"
          },
          "countryOfOrigin": {
            "type": "string"
          },
          "casePackSize": {
            "type": "string"
          },
          "minimumOrderQuantity": {
            "type": "string"
          },
          "leadTimeDays": {
            "type": "string"
          },
          "hsCode": {
            "type": "string"
          },
          "storageRequirements": {
            "type": "string"
          },
          "certifications": {
            "type": "string"
          },
          "internalMemo": {
            "type": "string"
          },
          "specification": {
            "type": "string",
            "description": "規格. Returned so that a GET followed by a PUT keeps it (t-e9a2f1567)."
          },
          "orderByCase": {
            "type": "boolean"
          },
          "b2becStockMode": {
            "type": "string"
          },
          "allowSubscriptions": {
            "type": "boolean"
          },
          "pricing": {
            "$ref": "#/components/schemas/ProductPricing"
          },
          "images": {
            "$ref": "#/components/schemas/ProductImages"
          },
          "status": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "variants": {
            "$ref": "#/components/schemas/ProductVariantsInfo"
          },
          "preOrder": {
            "$ref": "#/components/schemas/ProductPreOrder"
          },
          "integrations": {
            "$ref": "#/components/schemas/ProductIntegrations"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProductSalesInsightDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "actionUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "actionLabel": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProductSalesReportDto": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "sinceUtc": {
            "type": "string",
            "format": "date-time"
          },
          "untilUtc": {
            "type": "string",
            "format": "date-time"
          },
          "sortBy": {
            "type": "string"
          },
          "categoryFilter": {
            "type": "string"
          },
          "search": {
            "type": "string"
          },
          "totalRevenue": {
            "type": "number",
            "format": "double"
          },
          "totalQuantity": {
            "type": "integer",
            "format": "int32"
          },
          "totalCost": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "totalGrossProfit": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "totalGrossMarginPct": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductSalesRowDto"
            }
          },
          "transactionsWithEmptyLineItems": {
            "type": "integer",
            "format": "int32"
          },
          "transactionsIncluded": {
            "type": "integer",
            "format": "int32"
          },
          "lastSyncedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isLikelyStale": {
            "type": "boolean"
          },
          "insights": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductSalesInsightDto"
            }
          }
        }
      },
      "ProductSalesRowDto": {
        "type": "object",
        "properties": {
          "productName": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "revenue": {
            "type": "number",
            "format": "double"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "revenueSharePct": {
            "type": "number",
            "format": "double"
          },
          "cumulativeRevenueSharePct": {
            "type": "number",
            "format": "double"
          },
          "abcGroup": {
            "type": "string"
          },
          "cost": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "grossProfit": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "grossMarginPct": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "costCoverageRatio": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ProductVariantDto": {
        "type": "object",
        "properties": {
          "variantId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "parentProductId": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "janCode": {
            "type": "string"
          },
          "imageUrl": {
            "type": "string"
          },
          "attributesJson": {
            "type": "string"
          },
          "basePrice": {
            "type": "number",
            "format": "double"
          },
          "baseCostPrice": {
            "type": "number",
            "format": "double"
          },
          "taxRate": {
            "type": "number",
            "format": "double"
          },
          "storePricesJson": {
            "type": "string"
          },
          "squareVariationId": {
            "type": "string"
          },
          "shopifyVariantGid": {
            "type": "string"
          },
          "shopifyInventoryItemId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "attributes": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          },
          "displayLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "storePrices": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/StorePriceDto"
            }
          },
          "formattedBasePrice": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxIncludedPrice": {
            "type": "number",
            "format": "double"
          },
          "formattedTaxIncludedPrice": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxRateDisplay": {
            "type": [
              "null",
              "string"
            ]
          },
          "statusDisplayJa": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProductVariantsInfo": {
        "type": "object",
        "properties": {
          "hasVariants": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VariantOptionDto"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VariantResponse"
            }
          }
        }
      },
      "PromotionDetailResponse": {
        "type": "object",
        "properties": {
          "promotion": {
            "$ref": "#/components/schemas/PromotionResponse"
          },
          "placements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlacementResponse"
            }
          }
        }
      },
      "PromotionRequest": {
        "type": "object",
        "properties": {
          "status": {
            "enum": [
              "Draft",
              "Active",
              "Paused"
            ],
            "type": "string"
          },
          "defaultSlotDurationSeconds": {
            "type": "integer",
            "description": "Seconds each still image shows; videos play their length.",
            "format": "int32"
          },
          "creativeIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "tenantName": {
            "type": [
              "null",
              "string"
            ],
            "description": "For malls: the tenant whose promotion this is."
          }
        }
      },
      "PromotionResponse": {
        "type": "object",
        "properties": {
          "promotionId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "tenantName": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Draft",
              "Active",
              "Paused"
            ],
            "type": "string"
          },
          "creativeIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "defaultSlotDurationSeconds": {
            "type": "integer",
            "format": "int32"
          },
          "placementCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalPlays": {
            "type": "integer",
            "format": "int64"
          },
          "lastPlayedAtUtc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PunchApiRequest": {
        "type": "object",
        "properties": {
          "staffId": {
            "type": "string",
            "description": "Required."
          },
          "pin": {
            "type": "string",
            "description": "Required. The staff member's time-clock PIN."
          },
          "type": {
            "enum": [
              "in",
              "out",
              "break_start",
              "break_end"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "Required."
          },
          "at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When it happened, for a punch queued offline. Omit to punch now.",
            "format": "date-time"
          },
          "terminalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "idempotencyKey": {
            "type": "string",
            "description": "Required. One per tap; resend it unchanged on retry."
          }
        }
      },
      "PunchResponse": {
        "type": "object",
        "properties": {
          "replayed": {
            "type": "boolean",
            "description": "True when this key was already recorded; nothing new was written."
          },
          "staffId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "enum": [
              "off",
              "on",
              "on_break"
            ],
            "type": "string",
            "description": "off / on / on_break — after this punch."
          }
        }
      },
      "ReachResponse": {
        "type": "object",
        "properties": {
          "surfaceCount": {
            "type": "integer",
            "format": "int32"
          },
          "storeCount": {
            "type": "integer",
            "format": "int32"
          },
          "estimatedDailyViews": {
            "type": "integer",
            "format": "int64"
          },
          "belowFloorCount": {
            "type": "integer",
            "description": "Spaces that match but whose floor price is above the bid, so the bid won't win them.",
            "format": "int32"
          }
        }
      },
      "ReadinessResponse": {
        "type": "object",
        "properties": {
          "check": {
            "enum": [
              "Category",
              "Budget",
              "Unit",
              "Bid",
              "Ads",
              "Reach",
              "Payment"
            ],
            "type": "string"
          },
          "passed": {
            "type": "boolean"
          },
          "failingUnits": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The units that fail a unit-level check, by name."
          }
        }
      },
      "ReceiptItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "itemName": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "quantityDisplay": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ReceiptTaxonomyOrderRequest": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ReceiptTaxonomyWriteRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "icon": {
            "type": [
              "null",
              "string"
            ]
          },
          "isHidden": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "costType": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ReceiptUpdateRequest": {
        "type": "object",
        "properties": {
          "storeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "totalAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "taxAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "paymentMethod": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxRegistrationNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "receiptDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ReceiptItemDto"
            }
          },
          "linkedStoreId": {
            "type": [
              "null",
              "string"
            ]
          },
          "categoryId": {
            "type": [
              "null",
              "string"
            ]
          },
          "labelIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "specialExpenseId": {
            "type": [
              "null",
              "string"
            ]
          },
          "refundOfReceiptId": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "changesStoreIssuedFields": {
            "type": "boolean"
          }
        }
      },
      "RecordEntry": {
        "type": "object",
        "properties": {
          "reservationId": {
            "type": "string"
          },
          "outcome": {
            "enum": [
              "Attended",
              "Excused",
              "NoShow"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "Attended / Excused / NoShow."
          }
        }
      },
      "RecordRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordEntry"
            }
          }
        }
      },
      "RecordResponse": {
        "type": "object",
        "properties": {
          "submitted": {
            "type": "integer",
            "format": "int32"
          },
          "changed": {
            "type": "integer",
            "description": "Rows that actually changed. Zero when re-sending the same marks.",
            "format": "int32"
          }
        }
      },
      "RecurringCategoryTotalDto": {
        "type": "object",
        "properties": {
          "categoryId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": [
              "null",
              "string"
            ]
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "monthlyAmount": {
            "type": "number",
            "format": "double"
          },
          "yearlyAmount": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "RecurringPaymentRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "amount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "cycle": {
            "type": [
              "null",
              "string"
            ],
            "description": "monthly or yearly."
          },
          "nextDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "categoryId": {
            "type": [
              "null",
              "string"
            ],
            "description": "From GET /api/v1/user/receipt-categories."
          },
          "status": {
            "type": [
              "null",
              "string"
            ],
            "description": "PATCH only: candidate, confirmed or dismissed."
          }
        }
      },
      "RedeemRequest": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional. Who it was for, if the till knows."
          },
          "transactionId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional. The sale it was applied to."
          },
          "note": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional. Free text kept on the record."
          },
          "code": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required. The code the customer presented."
          }
        }
      },
      "RefreshRequest": {
        "required": [
          "refreshToken",
          "clientId"
        ],
        "type": "object",
        "properties": {
          "refreshToken": {
            "type": "string",
            "description": "Refresh token issued previously"
          },
          "clientId": {
            "type": "string",
            "description": "Client ID"
          },
          "clientSecret": {
            "type": "string",
            "description": "Client secret — required for confidential clients only; public (PKCE) clients omit it (t-e9a2f755)"
          }
        }
      },
      "RefundCandidate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "storeName": {
            "type": "string"
          },
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "receiptDate": {
            "type": "string",
            "format": "date-time"
          },
          "categoryId": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": "string"
          }
        }
      },
      "RegisterDeviceRequest": {
        "required": [
          "platform",
          "token"
        ],
        "type": "object",
        "properties": {
          "platform": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "appVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RegisterPrinterRequest": {
        "type": "object",
        "properties": {
          "deviceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "serialNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "firmwareVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "posTerminalId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RegisterTokenRequest": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string"
          },
          "channel": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "lineIdToken": {
            "type": [
              "null",
              "string"
            ],
            "description": "The LIFF ID token, required on the LINE channel (t-e9a2f811).\nObtained client-side from liff.getIDToken()."
          },
          "appVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "osVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "deviceModel": {
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RejectRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Shown to the advertiser."
          }
        }
      },
      "ReplaceVariantsRequest": {
        "type": "object",
        "properties": {
          "variants": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/VariantRequest"
            },
            "description": "Required. No default on purpose: a body without this key, or with\nit misspelled, read as an empty list and deleted every variant\n(t-e9a2f1777). Only an explicit [] removes them."
          }
        },
        "description": "The complete list of a product's variants."
      },
      "ReplyRequest": {
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string",
            "description": "The Google connection the review came through (`connectionId` in the list)."
          },
          "locationId": {
            "type": "string",
            "description": "The location the review was left on (`locationId` in the list)."
          },
          "text": {
            "type": "string",
            "description": "The reply, up to 1,000 characters. It is published on Google as the business's answer."
          }
        }
      },
      "ReplyResponse": {
        "type": "object",
        "properties": {
          "reviewId": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "repliedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ReportResponse": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "totals": {
            "$ref": "#/components/schemas/TotalsResponse"
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DayResponse"
            },
            "description": "On-screen delivery by day. Ads targeted by purchase keywords are left out here and counted in `weeks`."
          },
          "weeks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WeekResponse"
            },
            "description": "Purchase figures by finished week, Monday to Sunday."
          },
          "bySurface": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SliceResponse"
            }
          },
          "byStore": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SliceResponse"
            },
            "description": "By store, on-screen delivery only. Stores that are not publicly listed carry no name."
          },
          "campaigns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CampaignReportResponse"
            }
          }
        }
      },
      "ReservationConfigDto": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "storeName": {
            "type": "string"
          },
          "storeType": {
            "type": "string"
          },
          "defaultSlotDurationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "maxConcurrentBookings": {
            "type": "integer",
            "format": "int32"
          },
          "slotCapacityUnit": {
            "type": "string"
          },
          "bookingWindowDays": {
            "type": "integer",
            "format": "int32"
          },
          "minAdvanceHours": {
            "type": "integer",
            "format": "int32"
          },
          "pricingRulesJson": {
            "type": "string"
          },
          "defaultPrice": {
            "type": "number",
            "format": "double"
          },
          "pricingUnit": {
            "type": "string"
          },
          "paymentMode": {
            "type": "string"
          },
          "depositAmount": {
            "type": "number",
            "format": "double"
          },
          "noShowFeeAmount": {
            "type": "number",
            "format": "double"
          },
          "pricingRules": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ReservationPricingRule"
            }
          },
          "cancellationDeadlineHours": {
            "type": "integer",
            "format": "int32"
          },
          "autoConfirm": {
            "type": "boolean"
          },
          "holdEnabled": {
            "type": "boolean"
          },
          "holdMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "turnHoldEnabled": {
            "type": "boolean"
          },
          "turnMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "turnPairs": {
            "type": "string"
          },
          "businessHoursJson": {
            "type": "string"
          },
          "closedDays": {
            "type": "string"
          },
          "customFieldsJson": {
            "type": "string"
          },
          "welcomeMessage": {
            "type": "string"
          },
          "cancellationPolicy": {
            "type": "string"
          },
          "customNotes": {
            "type": "string"
          },
          "notifyCustomerByLine": {
            "type": "boolean"
          },
          "nominationEnabled": {
            "type": "boolean"
          },
          "nominationFee": {
            "type": "number",
            "format": "double"
          },
          "confirmationEmailEnabled": {
            "type": "boolean"
          },
          "cancellationEmailEnabled": {
            "type": "boolean"
          },
          "reminderEnabled": {
            "type": "boolean"
          },
          "reminderHoursBefore": {
            "type": "integer",
            "format": "int32"
          },
          "notifyOnBooking": {
            "type": "boolean"
          },
          "notifyOnCancellation": {
            "type": "boolean"
          },
          "notifyByEmail": {
            "type": "boolean"
          },
          "notifyByPush": {
            "type": "boolean"
          },
          "notifyEmail": {
            "type": "string"
          },
          "notifyFrequency": {
            "type": "string"
          },
          "linkBookingsToCrm": {
            "type": "boolean"
          },
          "followUpEnabled": {
            "type": "boolean"
          },
          "winBackEnabled": {
            "type": "boolean"
          },
          "winBackAfterDays": {
            "type": "integer",
            "format": "int32"
          },
          "winBackCouponId": {
            "type": "string"
          },
          "passReminderEnabled": {
            "type": "boolean"
          },
          "passLowCreditThreshold": {
            "type": "integer",
            "format": "int32"
          },
          "passExpiryNoticeDays": {
            "type": "integer",
            "format": "int32"
          },
          "membersOnlyConditions": {
            "type": "string"
          },
          "waitlistEnabled": {
            "type": "boolean"
          },
          "waitlistOfferMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "pacingEnabled": {
            "type": "boolean"
          },
          "pacingWindowMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "pacingRulesJson": {
            "type": "string"
          },
          "tableJoinEnabled": {
            "type": "boolean"
          },
          "tableJoinGroupsJson": {
            "type": "string"
          },
          "tableJoinGroups": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TableJoinGroup"
            }
          },
          "pacingRules": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ReservationPacingRule"
            }
          },
          "makeupDeadlineDays": {
            "type": "integer",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "customFields": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ReservationCustomField"
            }
          },
          "businessHours": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "$ref": "#/components/schemas/BusinessHoursEntry"
            }
          },
          "closedDayList": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ReservationCustomer": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        }
      },
      "ReservationCustomField": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "options": {
            "type": [
              "null",
              "string"
            ]
          },
          "placeholder": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ReservationDto": {
        "type": "object",
        "properties": {
          "reservationId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "slotId": {
            "type": "string"
          },
          "reservationDate": {
            "type": "string",
            "format": "date-time"
          },
          "startTime": {
            "type": "string"
          },
          "endTime": {
            "type": "string"
          },
          "durationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "customerName": {
            "type": "string"
          },
          "customerPhone": {
            "type": "string"
          },
          "customerEmail": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "lineUserId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "paymentStatus": {
            "type": "string"
          },
          "paidAmount": {
            "type": "number",
            "format": "double"
          },
          "refundedAmount": {
            "type": "number",
            "format": "double"
          },
          "refundedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "stripeSessionId": {
            "type": "string"
          },
          "stripePaymentIntentId": {
            "type": "string"
          },
          "stripeCustomerId": {
            "type": "string"
          },
          "paidAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "receiptTransactionId": {
            "type": "string"
          },
          "receiptAmount": {
            "type": "number",
            "format": "double"
          },
          "receiptLinkedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "passId": {
            "type": "string"
          },
          "seriesId": {
            "type": "string"
          },
          "joinedSlotIds": { },
          "joinedSlotIdList": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "staffId": {
            "type": "string"
          },
          "attendanceRecordedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "makeupStatus": {
            "type": "string"
          },
          "makeupExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "makeupSourceReservationId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "partySize": {
            "type": "integer",
            "format": "int32"
          },
          "customFieldsJson": {
            "type": "string"
          },
          "assignedResource": {
            "type": "string"
          },
          "customerNotes": {
            "type": "string"
          },
          "staffNotes": {
            "type": "string"
          },
          "cancellationReason": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "menuId": {
            "type": "string"
          },
          "menuName": {
            "type": "string"
          },
          "stockTypeId": {
            "type": "string"
          },
          "stockTypeName": {
            "type": "string"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "billablePeriods": {
            "type": "integer",
            "format": "int32"
          },
          "holdExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "nights": {
            "type": "integer",
            "format": "int32"
          },
          "bookingSource": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "type": "string"
          },
          "manageToken": {
            "type": "string"
          },
          "customFieldValues": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          },
          "statusDisplayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "statusBadgeClass": {
            "type": [
              "null",
              "string"
            ]
          },
          "sourceDisplayName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ReservationListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "reservations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReservationResponse"
            }
          }
        }
      },
      "ReservationMenuAvailabilityResponse": {
        "type": "object",
        "properties": {
          "menuId": {
            "type": "string"
          },
          "menuName": {
            "type": "string"
          },
          "durationMinutes": {
            "type": "integer",
            "description": "What the customer is quoted, excluding any turnaround.",
            "format": "int32"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "startTimes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReservationMenuStartRow"
            }
          }
        }
      },
      "ReservationMenuDto": {
        "type": "object",
        "properties": {
          "menuId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "durationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "bufferMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "holdsStartSlotOnly": {
            "type": "boolean"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "eligibleStaffIds": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          },
          "visibility": {
            "type": "integer",
            "format": "int32"
          },
          "isListed": {
            "type": "boolean"
          },
          "requiresMembership": {
            "type": "boolean"
          },
          "occupiedMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "eligibleStaffIdList": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ReservationMenuListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "menus": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReservationMenuDto"
            }
          }
        }
      },
      "ReservationMenuStartRow": {
        "type": "object",
        "properties": {
          "startTime": {
            "type": "string"
          },
          "endTime": {
            "type": "string"
          },
          "staffId": {
            "type": "string"
          },
          "assignedResource": {
            "type": "string"
          },
          "primarySlotId": {
            "type": "string",
            "description": "Post this as `slotId`."
          },
          "joinedSlotIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Post these as `joinedSlotIds`; they are held with the first."
          }
        }
      },
      "ReservationNotes": {
        "type": "object",
        "properties": {
          "customer": {
            "type": "string"
          },
          "staff": {
            "type": "string"
          }
        }
      },
      "ReservationPacingRule": {
        "type": "object",
        "properties": {
          "days": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "maxBookings": {
            "type": "integer",
            "format": "int32"
          },
          "maxCovers": {
            "type": "integer",
            "format": "int32"
          },
          "stayMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "ReservationPricingRule": {
        "type": "object",
        "properties": {
          "days": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "adjustment": {
            "type": "number",
            "format": "double"
          },
          "adjustmentPercent": {
            "type": "number",
            "format": "double"
          },
          "staffIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "label": {
            "type": "string"
          },
          "hasStaffRestriction": {
            "type": "boolean"
          },
          "hasSeason": {
            "type": "boolean"
          }
        }
      },
      "ReservationResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "slotId": {
            "type": [
              "null",
              "string"
            ]
          },
          "reservationDate": {
            "type": "string"
          },
          "startTime": {
            "type": "string"
          },
          "endTime": {
            "type": "string"
          },
          "durationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "enum": [
              "Pending",
              "Confirmed",
              "Arrived",
              "Completed",
              "Cancelled",
              "NoShow"
            ],
            "type": "string",
            "description": "Arrived (来店済) means checked in but not yet finished."
          },
          "customerId": {
            "type": "string",
            "description": "CRM customer id the booking is linked to. Empty when unlinked."
          },
          "passId": {
            "type": "string",
            "description": "Pass a credit was taken from for this booking. Empty when none —\nno pass, or an unlimited membership covered it (t-e9a2f1234)."
          },
          "paymentStatus": {
            "type": "string",
            "description": "None / Paid / CardRegistered / Refunded / PartiallyRefunded. Paid\ncovers both online prepayment and a payment on the stera terminal\n(t-e9a2f1237), so \"arrived, not yet paid\" is Arrived with None."
          },
          "paidAmount": {
            "type": "number",
            "format": "double"
          },
          "paidAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "customer": {
            "$ref": "#/components/schemas/ReservationCustomer"
          },
          "partySize": {
            "type": "integer",
            "format": "int32"
          },
          "partySizeFields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Same as customFields. Kept under this older, misleading name for existing clients."
          },
          "customFields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "The answers to the store's custom booking form."
          },
          "assignedResource": {
            "type": "string"
          },
          "joinedSlotIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Other slots the booking holds: joined tables, or the rest of a menu's run."
          },
          "menuId": {
            "type": "string",
            "description": "The menu booked. Empty when the booking is not for a menu."
          },
          "menuName": {
            "type": "string",
            "description": "The menu's name as it stood when booked."
          },
          "staffId": {
            "type": "string",
            "description": "Staff member serving the booking. Empty when none is assigned."
          },
          "notes": {
            "$ref": "#/components/schemas/ReservationNotes"
          },
          "cancellationReason": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "bookingSource": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ReservationSlotListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReservationSlotResponse"
            }
          }
        }
      },
      "ReservationSlotResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "startTime": {
            "type": "string"
          },
          "endTime": {
            "type": "string"
          },
          "durationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "capacity": {
            "type": "integer",
            "format": "int32"
          },
          "capacityUnit": {
            "type": "string",
            "description": "\"Bookings\" (each reservation takes 1) or \"Seats\" (each takes its party size)."
          },
          "bookedCount": {
            "type": "integer",
            "format": "int32"
          },
          "remainingCapacity": {
            "type": "integer",
            "format": "int32"
          },
          "isAvailable": {
            "type": "boolean"
          },
          "assignedResource": {
            "type": "string"
          },
          "resourceCategory": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "status": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "ReservationStatsDto": {
        "type": "object",
        "properties": {
          "totalReservations": {
            "type": "integer",
            "format": "int32"
          },
          "confirmed": {
            "type": "integer",
            "format": "int32"
          },
          "pending": {
            "type": "integer",
            "format": "int32"
          },
          "arrived": {
            "type": "integer",
            "format": "int32"
          },
          "completed": {
            "type": "integer",
            "format": "int32"
          },
          "cancelled": {
            "type": "integer",
            "format": "int32"
          },
          "noShow": {
            "type": "integer",
            "format": "int32"
          },
          "todayCount": {
            "type": "integer",
            "format": "int32"
          },
          "tomorrowCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ReservationTableRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "typeDisplayName": {
            "type": "string"
          },
          "capacity": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ReservationTablesResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "tables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReservationTableRow"
            }
          }
        }
      },
      "ReservationUpdateRequest": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string",
            "description": "Required."
          },
          "status": {
            "enum": [
              "Pending",
              "Confirmed",
              "Arrived",
              "Completed",
              "Cancelled",
              "NoShow"
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "cancellationReason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Recorded with a change to Cancelled."
          },
          "customerName": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "staffNotes": {
            "type": [
              "null",
              "string"
            ]
          },
          "assignedResource": {
            "type": [
              "null",
              "string"
            ]
          },
          "customFields": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "Custom form answers, keyed as GET returns them in customFields. Replaces the whole set."
          },
          "customFieldsJson": {
            "type": [
              "null",
              "string"
            ],
            "description": "Older form of customFields, as a JSON string. Ignored when customFields is sent."
          }
        },
        "description": "What PUT may change. Every field is optional, and one left out keeps\nits value — held apart from ReservationDto, whose fields default to\nempty strings and so could not tell \"not sent\" from \"cleared\"."
      },
      "ResourceListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResourceResponse"
            }
          }
        }
      },
      "ResourceResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "table, room, counter or station."
          },
          "capacity": {
            "type": "integer",
            "description": "How many people it seats.",
            "format": "int32"
          }
        }
      },
      "RetailMediaTargeting": {
        "type": "object",
        "properties": {
          "surfaceTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "prefectures": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "industryGroups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "storeKeys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "carryingStoresOnly": {
            "type": "boolean"
          },
          "dayOfWeekMask": {
            "type": "integer",
            "format": "int32"
          },
          "hourOfDayMask": {
            "type": "integer",
            "format": "int32"
          },
          "bidCpm": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "purchaseKeywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RevenueLineResponse": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The surface type, store id (\"account\" for the app), or campaign id the line is for."
          },
          "name": {
            "type": "string",
            "description": "A display name: the store or ad name (\"app\" for the app line)."
          },
          "advertiserName": {
            "type": [
              "null",
              "string"
            ],
            "description": "The advertiser, on ad lines."
          },
          "impressions": {
            "type": "integer",
            "format": "int64"
          },
          "clicks": {
            "type": "integer",
            "format": "int64"
          },
          "couponUses": {
            "type": "integer",
            "format": "int64"
          },
          "adRevenueYen": {
            "type": "integer",
            "description": "The account's share of what advertisers were charged, yen before tax.",
            "format": "int64"
          },
          "couponRefundYen": {
            "type": "integer",
            "description": "Coupon discounts the stores gave, paid back in full.",
            "format": "int64"
          },
          "totalYen": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "RevenueResponse": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string",
            "description": "yyyy-MM."
          },
          "isEstimate": {
            "type": "boolean",
            "description": "The month is still running: figures are up to today and not yet confirmed."
          },
          "total": {
            "$ref": "#/components/schemas/RevenueLineResponse"
          },
          "bySurface": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RevenueLineResponse"
            }
          },
          "byStore": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RevenueLineResponse"
            }
          },
          "byAd": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RevenueLineResponse"
            }
          }
        }
      },
      "ReviewAdResponse": {
        "type": "object",
        "properties": {
          "headline": {
            "type": "string"
          },
          "destinationUrl": {
            "type": "string"
          },
          "surfaceType": {
            "type": "string"
          },
          "creativeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "creativeType": {
            "enum": [
              "Image",
              "Video"
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "creativeUrl": {
            "type": [
              "null",
              "string"
            ],
            "description": "A short-lived link to the creative."
          }
        }
      },
      "ReviewDetailResponse": {
        "type": "object",
        "properties": {
          "review": {
            "$ref": "#/components/schemas/ReviewResponse"
          },
          "description": {
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "advertiserTrusted": {
            "type": "boolean"
          },
          "advertiserBlocked": {
            "type": "boolean"
          },
          "units": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewUnitResponse"
            }
          }
        }
      },
      "ReviewResponse": {
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string"
          },
          "campaignName": {
            "type": "string"
          },
          "advertiserName": {
            "type": "string"
          },
          "adCategory": {
            "type": "string"
          },
          "adCount": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "enum": [
              "Pending",
              "Approved",
              "Rejected"
            ],
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "autoApproved": {
            "type": "boolean",
            "description": "Approved without waiting because this account trusts the advertiser."
          },
          "decidedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ReviewUnitResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "surfaceTypes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Surface types the unit is aimed at; empty means all."
          },
          "ads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewAdResponse"
            }
          }
        }
      },
      "RevokeRequest": {
        "required": [
          "token",
          "clientId"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Access token or refresh token to revoke"
          },
          "clientId": {
            "type": "string",
            "description": "Client ID of the app that issued the token"
          }
        }
      },
      "RosterEntry": {
        "type": "object",
        "properties": {
          "reservationId": {
            "type": "string"
          },
          "slotId": {
            "type": "string"
          },
          "reservationDate": {
            "type": "string",
            "format": "date-time"
          },
          "startTime": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "customerName": {
            "type": "string"
          },
          "partySize": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "enum": [
              "Pending",
              "Confirmed",
              "Arrived",
              "Completed",
              "Cancelled",
              "NoShow"
            ],
            "type": "string",
            "description": "The booking's own state."
          },
          "attendance": {
            "enum": [
              "Attended",
              "Excused",
              "NoShow"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "Attended / Excused / NoShow, or null if not recorded yet.\nA store that does not offer make-ups cannot distinguish\nExcused from NoShow after the fact; those report NoShow."
          },
          "makeupStatus": {
            "enum": [
              "None",
              "Eligible",
              "Used"
            ],
            "type": "string",
            "description": "None / Eligible / Used — whether a make-up can be claimed."
          },
          "passId": {
            "type": "string",
            "description": "The pass this booking spent a credit from, if any."
          }
        }
      },
      "RosterResponse": {
        "type": "object",
        "properties": {
          "slotId": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RosterEntry"
            }
          }
        }
      },
      "SalesAdviceDto": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "adviceId": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "metricKey": {
            "type": "string"
          },
          "metricCurrent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "metricPrevious": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "changePercent": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "dataJson": {
            "type": "string"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "actionUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "actionLabel": {
            "type": [
              "null",
              "string"
            ]
          },
          "isOrgScoped": {
            "type": "boolean"
          }
        }
      },
      "SalesAdviceListResponse": {
        "type": "object",
        "properties": {
          "advice": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesAdviceDto"
            }
          }
        }
      },
      "SalesForecastListResponse": {
        "type": "object",
        "properties": {
          "forecast": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesAdviceDto"
            }
          }
        }
      },
      "SalesMultiTrendResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "months": {
            "type": "integer",
            "format": "int32"
          },
          "stores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesMultiTrendStore"
            }
          },
          "requestedStoreCount": {
            "type": "integer",
            "format": "int32"
          },
          "truncated": {
            "type": "boolean"
          },
          "omittedStoreIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SalesMultiTrendStore": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string"
          },
          "report": {
            "$ref": "#/components/schemas/StoreMonthlyReport"
          }
        }
      },
      "SalesNarrativeResponse": {
        "type": "object",
        "properties": {
          "narrative": {
            "type": [
              "null",
              "string"
            ],
            "description": "The paragraph, or null when narratives are switched off for this\ninstall. Null is not a failure - see `enabled`."
          },
          "enabled": {
            "type": "boolean",
            "description": "False when the install has narratives disabled or no model key,\nso a client can hide the panel rather than show an empty one."
          }
        }
      },
      "SavingsContributionRequest": {
        "required": [
          "amount"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Not 0. Negative records a withdrawal.",
            "format": "double"
          },
          "date": {
            "type": [
              "null",
              "string"
            ],
            "description": "Default today in Japan time.",
            "format": "date-time"
          },
          "memo": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SavingsGoalMonthLine": {
        "type": "object",
        "properties": {
          "goalId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "targetAmount": {
            "type": "number",
            "format": "double"
          },
          "targetDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "monthlyAmount": {
            "type": "number",
            "format": "double"
          },
          "savedAmount": {
            "type": "number",
            "format": "double"
          },
          "contributedInMonth": {
            "type": "number",
            "format": "double"
          },
          "allocatedInMonth": {
            "type": "number",
            "format": "double"
          },
          "percentSaved": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "SavingsGoalRequest": {
        "required": [
          "targetAmount",
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "kind": {
            "type": [
              "null",
              "string"
            ],
            "description": "emergency_fund or custom. Default custom."
          },
          "icon": {
            "type": [
              "null",
              "string"
            ]
          },
          "targetAmount": {
            "type": "number",
            "format": "double"
          },
          "targetDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "monthlyAmount": {
            "type": "number",
            "description": "The 先取り額 planned each month. Default 0.",
            "format": "double"
          },
          "autoContribute": {
            "type": "boolean",
            "description": "自動積立. Needs monthlyAmount above 0."
          }
        }
      },
      "SavingsYearMonthDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "SchedulePostRequest": {
        "type": "object",
        "properties": {
          "scheduledAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SellingRulesRequest": {
        "type": "object",
        "properties": {
          "externalSharePercent": {
            "type": "integer",
            "description": "Share of each space's time or slots offered to outside ads, 0–100.",
            "format": "int32"
          },
          "openDayOfWeekMask": {
            "type": "integer",
            "description": "Days open to outside ads, bit 0 = Sunday.",
            "format": "int32"
          },
          "openHourOfDayMask": {
            "type": "integer",
            "description": "Hours open to outside ads (Japan time), bit 0 = 00:00–01:00.",
            "format": "int32"
          },
          "floorCpmByType": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Lowest price per 1,000 impressions (yen) by surface type: signage, receipt, printed, appbanner, appnotice."
          },
          "openBiddingEnabled": {
            "type": "boolean"
          },
          "privateDealsEnabled": {
            "type": "boolean"
          },
          "blockedCategories": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Ad categories this account refuses."
          },
          "reviewMode": {
            "enum": [
              "ReviewAll",
              "AutoApproveTrusted"
            ],
            "type": "string"
          }
        }
      },
      "SellingRulesResponse": {
        "type": "object",
        "properties": {
          "externalSharePercent": {
            "type": "integer",
            "format": "int32"
          },
          "openDayOfWeekMask": {
            "type": "integer",
            "format": "int32"
          },
          "openHourOfDayMask": {
            "type": "integer",
            "format": "int32"
          },
          "floorCpmByType": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int32"
            }
          },
          "openBiddingEnabled": {
            "type": "boolean"
          },
          "privateDealsEnabled": {
            "type": "boolean"
          },
          "externalAdsPaused": {
            "type": "boolean"
          },
          "blockedCategories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reviewMode": {
            "enum": [
              "ReviewAll",
              "AutoApproveTrusted"
            ],
            "type": "string"
          },
          "trustedAdvertiserCount": {
            "type": "integer",
            "format": "int32"
          },
          "blockedAdvertiserCount": {
            "type": "integer",
            "format": "int32"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SeriesEndResponse": {
        "type": "object",
        "properties": {
          "seriesId": {
            "type": "string"
          },
          "cancelledReservations": {
            "type": "integer",
            "description": "Future bookings cancelled. Zero unless cancelFuture was set.",
            "format": "int32"
          }
        }
      },
      "SeriesGenerateResponse": {
        "type": "object",
        "properties": {
          "seriesId": {
            "type": "string"
          },
          "created": {
            "type": "integer",
            "format": "int32"
          },
          "skipped": {
            "type": "integer",
            "description": "Weeks deliberately passed over — a skip date, or already booked.",
            "format": "int32"
          },
          "unavailable": {
            "type": "integer",
            "description": "Weeks with no matching slot, or no room left in one.",
            "format": "int32"
          },
          "reservationIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SeriesListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SeriesResponse"
            }
          }
        }
      },
      "SeriesRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string"
          },
          "seriesId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Omit to create."
          },
          "customerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerName": {
            "type": "string"
          },
          "customerPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "dayOfWeek": {
            "enum": [
              "Monday",
              "Tuesday",
              "Wednesday",
              "Thursday",
              "Friday",
              "Saturday",
              "Sunday"
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "startTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "partySize": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "startDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "skipDates": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SeriesResponse": {
        "type": "object",
        "properties": {
          "seriesId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "customerName": {
            "type": "string"
          },
          "customerPhone": {
            "type": "string"
          },
          "customerEmail": {
            "type": "string"
          },
          "dayOfWeek": {
            "enum": [
              "Monday",
              "Tuesday",
              "Wednesday",
              "Thursday",
              "Friday",
              "Saturday",
              "Sunday"
            ],
            "type": "string",
            "description": "English day name — Monday … Sunday."
          },
          "startTime": {
            "type": "string",
            "description": "HH:mm."
          },
          "partySize": {
            "type": "integer",
            "format": "int32"
          },
          "startDate": {
            "type": "string",
            "format": "date-time"
          },
          "endDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Null when the series runs until ended.",
            "format": "date-time"
          },
          "skipDates": {
            "type": "string",
            "description": "Comma-separated yyyy-MM-dd the customer is away."
          },
          "status": {
            "enum": [
              "Active",
              "Ended"
            ],
            "type": "string",
            "description": "Active / Ended."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SessionResponse": {
        "type": "object",
        "properties": {
          "in": {
            "type": "string",
            "format": "date-time"
          },
          "out": {
            "type": [
              "null",
              "string"
            ],
            "description": "Null while still clocked in.",
            "format": "date-time"
          },
          "breakMinutes": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "SetActiveRequest": {
        "type": "object",
        "properties": {
          "active": {
            "type": "boolean"
          }
        }
      },
      "SetEveryRequest": {
        "type": "object",
        "properties": {
          "choice": {
            "enum": [
              "in",
              "default",
              "out"
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "atSignUp": {
            "type": "boolean",
            "description": "True when sent from the account-creation checkbox."
          }
        }
      },
      "SetOpenRequest": {
        "type": "object",
        "properties": {
          "open": {
            "type": "boolean"
          }
        }
      },
      "SetPausedRequest": {
        "type": "object",
        "properties": {
          "paused": {
            "type": "boolean"
          }
        }
      },
      "SetStoreRequest": {
        "type": "object",
        "properties": {
          "receive": {
            "type": "boolean"
          }
        }
      },
      "ShiftListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "shifts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShiftResponse"
            }
          }
        }
      },
      "ShiftResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "staffId": {
            "type": "string"
          },
          "staffName": {
            "type": "string",
            "description": "The staff member's display name, for drawing the rota."
          },
          "date": {
            "type": "string",
            "description": "yyyy-MM-dd."
          },
          "startTime": {
            "type": "string",
            "description": "HH:mm."
          },
          "endTime": {
            "type": "string",
            "description": "HH:mm."
          },
          "breakMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "position": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "colorCode": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "hourlyRate": {
            "type": [
              "null",
              "number"
            ],
            "description": "The staff member's hourly rate **as it stands now** — the shift\ndoes not record what they were paid on the day. Fine for costing\nan upcoming week, wrong for costing a past one after a pay\nchange. 0 when the staff member is not paid hourly, or has left\nthe store.",
            "format": "double"
          }
        }
      },
      "ShipBody": {
        "type": "object",
        "properties": {
          "carrier": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackingNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "trackingUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "shippingMethod": {
            "type": [
              "null",
              "string"
            ]
          },
          "estimatedDeliveryDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ShippingAddressBody": {
        "type": "object",
        "properties": {
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "prefecture": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "line": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SliceResponse": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "surfaceType": {
            "type": "string"
          },
          "impressions": {
            "type": "integer",
            "format": "int64"
          },
          "clicks": {
            "type": "integer",
            "format": "int64"
          },
          "spend": {
            "type": "number",
            "format": "double"
          },
          "redemptions": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Coupon uses in the purchase weeks; null when 1 to 4.",
            "format": "int64"
          },
          "matchedImpressions": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Impressions of ads targeted by purchase keywords in the purchase weeks; null when 1 to 4.",
            "format": "int64"
          }
        }
      },
      "SlotGenerateResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "SmallSpendingDto": {
        "type": "object",
        "properties": {
          "thresholdAmount": {
            "type": "number",
            "format": "double"
          },
          "smallCount": {
            "type": "integer",
            "format": "int32"
          },
          "smallTotal": {
            "type": "number",
            "format": "double"
          },
          "byStoreKind": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreKindSpendingDto"
            }
          }
        }
      },
      "SnsAccountsResponse": {
        "type": "object",
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SnsAccountSummary"
            }
          }
        }
      },
      "SnsAccountSummary": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "accountName": {
            "type": "string"
          },
          "externalAccountId": {
            "type": "string"
          },
          "profileUrl": {
            "type": "string"
          },
          "profileImageUrl": {
            "type": "string"
          },
          "tokenExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isConnected": {
            "type": "boolean"
          },
          "needsReconnect": {
            "type": "boolean"
          }
        }
      },
      "SnsAnalyticsResponse": {
        "type": "object",
        "properties": {
          "analytics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SnsAnalyticsRow"
            }
          }
        }
      },
      "SnsAnalyticsRow": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "externalPostId": {
            "type": "string"
          },
          "impressions": {
            "type": "integer",
            "format": "int64"
          },
          "reach": {
            "type": "integer",
            "format": "int64"
          },
          "likes": {
            "type": "integer",
            "format": "int64"
          },
          "comments": {
            "type": "integer",
            "format": "int64"
          },
          "shares": {
            "type": "integer",
            "format": "int64"
          },
          "clicks": {
            "type": "integer",
            "format": "int64"
          },
          "engagements": {
            "type": "integer",
            "format": "int64"
          },
          "fetchedAt": {
            "type": "string",
            "format": "date-time"
          },
          "fetchError": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SnsCommentRow": {
        "type": "object",
        "properties": {
          "inboxId": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "contentId": {
            "type": "string"
          },
          "postTitle": {
            "type": "string"
          },
          "authorName": {
            "type": "string"
          },
          "commentText": {
            "type": "string"
          },
          "commentedAt": {
            "type": "string",
            "format": "date-time"
          },
          "sentiment": {
            "type": "string"
          }
        }
      },
      "SnsCommentsResponse": {
        "type": "object",
        "properties": {
          "comments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SnsCommentRow"
            }
          }
        }
      },
      "SnsMediaResponse": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "bytes": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "SnsPostEnvelope": {
        "type": "object",
        "properties": {
          "post": {
            "$ref": "#/components/schemas/SnsPostSummary"
          }
        }
      },
      "SnsPostMutationResponse": {
        "type": "object",
        "properties": {
          "post": {
            "$ref": "#/components/schemas/SnsPostSummary"
          },
          "publishStatus": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SnsPostsResponse": {
        "type": "object",
        "properties": {
          "posts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SnsPostSummary"
            }
          }
        }
      },
      "SnsPostSummary": {
        "type": "object",
        "properties": {
          "contentId": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "campaignId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "hashtags": {
            "type": "string"
          },
          "imageUrls": {
            "type": "string"
          },
          "videoUrl": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "scheduledAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "publishedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "youTubePrivacy": {
            "type": "string"
          },
          "externalPostIds": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          }
        }
      },
      "SnsPublishResponse": {
        "type": "object",
        "properties": {
          "post": {
            "$ref": "#/components/schemas/SnsPostSummary"
          },
          "publishStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "errorMessage": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SpecialBusinessDayDto": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "openTime": {
            "type": "string"
          },
          "closeTime": {
            "type": "string"
          },
          "isClosed": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SpecialDayRow": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "openTime": {
            "type": "string"
          },
          "closeTime": {
            "type": "string"
          },
          "isClosed": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SpecialExpenseRequest": {
        "required": [
          "name",
          "annualAmount"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "year": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Default the current year.",
            "format": "int32"
          },
          "template": {
            "type": [
              "null",
              "string"
            ]
          },
          "icon": {
            "type": [
              "null",
              "string"
            ]
          },
          "annualAmount": {
            "type": "number",
            "format": "double"
          },
          "plannedMonth": {
            "type": [
              "null",
              "integer"
            ],
            "description": "1 to 12.",
            "format": "int32"
          },
          "autoContribute": {
            "type": "boolean"
          }
        }
      },
      "SpecialExpenseTemplateDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "StaffAssignments": {
        "type": "object",
        "properties": {
          "storeIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allLocations": {
            "type": "boolean"
          }
        }
      },
      "StaffAvailabilityResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "windows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StaffWindow"
            }
          }
        }
      },
      "StaffContact": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        }
      },
      "StaffDto": {
        "type": "object",
        "properties": {
          "staffId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "employeeNumber": {
            "type": "string"
          },
          "referenceId": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "firstNameKana": {
            "type": "string"
          },
          "lastNameKana": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "position": {
            "type": "string"
          },
          "employmentType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "isOwner": {
            "type": "boolean"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "hourlyRate": {
            "type": "number",
            "format": "double"
          },
          "hireDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "address": {
            "type": "string"
          },
          "jobAssignmentsJson": {
            "type": "string"
          },
          "isOvertimeExempt": {
            "type": "boolean"
          },
          "tipEligible": {
            "type": "boolean"
          },
          "profileImageUrl": {
            "type": "string"
          },
          "emergencyContactName": {
            "type": "string"
          },
          "emergencyContactPhone": {
            "type": "string"
          },
          "emergencyContactRelation": {
            "type": "string"
          },
          "assignedStoreIds": {
            "type": [
              "null",
              "string"
            ]
          },
          "isAssignedToAllLocations": {
            "type": "boolean"
          },
          "squareTeamMemberId": {
            "type": "string"
          },
          "smaregiStaffId": {
            "type": "string"
          },
          "squareWriteRefusedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "assignedStoreIdList": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "jobAssignments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobAssignmentDto"
            }
          },
          "primaryJob": {
            "$ref": "#/components/schemas/JobAssignmentDto"
          },
          "isLinkedToUser": {
            "type": "boolean"
          },
          "fullName": {
            "type": [
              "null",
              "string"
            ]
          },
          "fullNameKana": {
            "type": [
              "null",
              "string"
            ]
          },
          "employmentTypeDisplayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "employmentTypeBadgeClass": {
            "type": [
              "null",
              "string"
            ]
          },
          "statusDisplayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "statusBadgeClass": {
            "type": [
              "null",
              "string"
            ]
          },
          "formattedHourlyRate": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "StaffEmergency": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "relation": {
            "type": "string"
          }
        }
      },
      "StaffHr": {
        "type": "object",
        "properties": {
          "hireDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "dateOfBirth": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "address": {
            "type": "string"
          }
        },
        "description": "Pay, and the details a personnel file holds. **Null when the caller\nmay not see them** — a manager-tier role, an org-scoped integration\ntoken, or the staff member's own record (t-e9a2f997)."
      },
      "StaffIntegrations": {
        "type": "object",
        "properties": {
          "squareTeamMemberId": {
            "type": "string"
          },
          "smaregiStaffId": {
            "type": "string"
          }
        }
      },
      "StaffListResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "staff": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StaffResponse"
            }
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "StaffName": {
        "type": "object",
        "properties": {
          "first": {
            "type": "string"
          },
          "last": {
            "type": "string"
          },
          "firstKana": {
            "type": "string"
          },
          "lastKana": {
            "type": "string"
          },
          "display": {
            "type": "string"
          }
        }
      },
      "StaffPay": {
        "type": "object",
        "properties": {
          "hourlyRate": {
            "type": "number",
            "format": "double"
          },
          "isOvertimeExempt": {
            "type": "boolean"
          },
          "tipEligible": {
            "type": "boolean"
          },
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobAssignmentDto"
            }
          }
        }
      },
      "StaffResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "employeeNumber": {
            "type": "string"
          },
          "referenceId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "name": {
            "$ref": "#/components/schemas/StaffName"
          },
          "role": {
            "$ref": "#/components/schemas/StaffRole"
          },
          "status": {
            "type": "string"
          },
          "contact": {
            "$ref": "#/components/schemas/StaffContact"
          },
          "hr": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Null when the caller may not see personal details (t-e9a2f997).",
                "$ref": "#/components/schemas/StaffHr"
              }
            ]
          },
          "pay": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Null when the caller may not see pay (t-e9a2f997).",
                "$ref": "#/components/schemas/StaffPay"
              }
            ]
          },
          "assignments": {
            "$ref": "#/components/schemas/StaffAssignments"
          },
          "emergency": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Null when the caller may not see personal details (t-e9a2f997).",
                "$ref": "#/components/schemas/StaffEmergency"
              }
            ]
          },
          "integrations": {
            "$ref": "#/components/schemas/StaffIntegrations"
          },
          "profileImageUrl": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "StaffRole": {
        "type": "object",
        "properties": {
          "position": {
            "type": "string"
          },
          "employmentType": {
            "type": "string"
          },
          "isOwner": {
            "type": "boolean"
          }
        }
      },
      "StaffTodayResponse": {
        "type": "object",
        "properties": {
          "staffId": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "hasPin": {
            "type": "boolean",
            "description": "False until a manager sets their PIN; they cannot punch before then."
          },
          "status": {
            "enum": [
              "off",
              "on",
              "on_break"
            ],
            "type": "string"
          },
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionResponse"
            }
          },
          "plannedShifts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlannedShiftResponse"
            }
          }
        }
      },
      "StaffWindow": {
        "type": "object",
        "properties": {
          "staffId": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "startTime": {
            "type": "string",
            "description": "HH:mm."
          },
          "endTime": {
            "type": "string",
            "description": "HH:mm."
          }
        }
      },
      "StartRequest": {
        "required": [
          "mergeTicket"
        ],
        "type": "object",
        "properties": {
          "mergeTicket": {
            "type": "string"
          },
          "keep": {
            "type": [
              "null",
              "string"
            ]
          },
          "confirm": {
            "type": "boolean"
          }
        }
      },
      "StatementImportRequest": {
        "type": "object",
        "properties": {
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "issuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatementImportTransaction"
            }
          }
        }
      },
      "StatementImportResult": {
        "type": "object",
        "properties": {
          "savedCount": {
            "type": "integer",
            "format": "int32"
          },
          "duplicateCount": {
            "type": "integer",
            "format": "int32"
          },
          "skippedCount": {
            "type": "integer",
            "format": "int32"
          },
          "failedCount": {
            "type": "integer",
            "format": "int32"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatementImportRowResult"
            }
          }
        }
      },
      "StatementImportRowResult": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "recordedAs": {
            "type": [
              "null",
              "string"
            ]
          },
          "receiptId": {
            "type": [
              "null",
              "string"
            ]
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "StatementImportTransaction": {
        "type": "object",
        "properties": {
          "date": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "merchantName": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "matchedStoreId": {
            "type": [
              "null",
              "string"
            ]
          },
          "specialExpenseId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "StockGenerateResponse": {
        "type": "object",
        "properties": {
          "stockTypeId": {
            "type": "string"
          },
          "daysCreated": {
            "type": "integer",
            "description": "Days created. Dates that already had rows are not counted.",
            "format": "int32"
          }
        }
      },
      "StockHorizonResponse": {
        "type": "object",
        "properties": {
          "stockTypeId": {
            "type": "string"
          },
          "bookableThrough": {
            "type": [
              "null",
              "string"
            ],
            "description": "Last bookable date, or null when no inventory exists.",
            "format": "date-time"
          }
        }
      },
      "StockTypeListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockTypeResponse"
            }
          }
        }
      },
      "StockTypeRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string"
          },
          "stockTypeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Omit to create."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "kind": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "maxOccupancy": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "basePrice": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "currency": {
            "type": [
              "null",
              "string"
            ]
          },
          "consumesEndDate": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "turnaroundDays": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "sortOrder": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "StockTypeResponse": {
        "type": "object",
        "properties": {
          "stockTypeId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "Night or Day."
          },
          "quantity": {
            "type": "integer",
            "description": "How many of this thing exist.",
            "format": "int32"
          },
          "maxOccupancy": {
            "type": "integer",
            "description": "How many people one holds.",
            "format": "int32"
          },
          "basePrice": {
            "type": "number",
            "description": "Major unit — a 12,000 yen room is 12000.",
            "format": "double"
          },
          "currency": {
            "type": "string"
          },
          "consumesEndDate": {
            "type": "boolean",
            "description": "False for accommodation, true for rentals: whether the last day is used up."
          },
          "turnaroundDays": {
            "type": "integer",
            "description": "Days held after a booking before it can be let again.",
            "format": "int32"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "isActive": {
            "type": "boolean"
          }
        }
      },
      "StoreDashboardKpis": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string"
          },
          "storeName": {
            "type": "string"
          },
          "currentMonth": {
            "type": "string"
          },
          "staffCount": {
            "type": "object",
            "properties": {
              "current": {
                "type": "number",
                "format": "double"
              },
              "previous": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isMeasured": {
                "type": "boolean"
              },
              "change": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "changePercent": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isPositive": {
                "type": [
                  "null",
                  "boolean"
                ]
              },
              "trendColor": {
                "type": [
                  "null",
                  "string"
                ]
              },
              "trendIcon": {
                "type": [
                  "null",
                  "string"
                ]
              }
            }
          },
          "revenue": {
            "type": "object",
            "properties": {
              "current": {
                "type": "number",
                "format": "double"
              },
              "previous": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isMeasured": {
                "type": "boolean"
              },
              "change": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "changePercent": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isPositive": {
                "type": [
                  "null",
                  "boolean"
                ]
              },
              "trendColor": {
                "type": [
                  "null",
                  "string"
                ]
              },
              "trendIcon": {
                "type": [
                  "null",
                  "string"
                ]
              }
            }
          },
          "transactionCount": {
            "type": "object",
            "properties": {
              "current": {
                "type": "number",
                "format": "double"
              },
              "previous": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isMeasured": {
                "type": "boolean"
              },
              "change": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "changePercent": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isPositive": {
                "type": [
                  "null",
                  "boolean"
                ]
              },
              "trendColor": {
                "type": [
                  "null",
                  "string"
                ]
              },
              "trendIcon": {
                "type": [
                  "null",
                  "string"
                ]
              }
            }
          },
          "averageTicket": {
            "type": "object",
            "properties": {
              "current": {
                "type": "number",
                "format": "double"
              },
              "previous": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isMeasured": {
                "type": "boolean"
              },
              "change": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "changePercent": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isPositive": {
                "type": [
                  "null",
                  "boolean"
                ]
              },
              "trendColor": {
                "type": [
                  "null",
                  "string"
                ]
              },
              "trendIcon": {
                "type": [
                  "null",
                  "string"
                ]
              }
            }
          },
          "reservationCount": {
            "type": "object",
            "properties": {
              "current": {
                "type": "number",
                "format": "double"
              },
              "previous": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isMeasured": {
                "type": "boolean"
              },
              "change": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "changePercent": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isPositive": {
                "type": [
                  "null",
                  "boolean"
                ]
              },
              "trendColor": {
                "type": [
                  "null",
                  "string"
                ]
              },
              "trendIcon": {
                "type": [
                  "null",
                  "string"
                ]
              }
            }
          },
          "googleRating": {
            "type": "object",
            "properties": {
              "current": {
                "type": "number",
                "format": "double"
              },
              "previous": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isMeasured": {
                "type": "boolean"
              },
              "change": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "changePercent": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isPositive": {
                "type": [
                  "null",
                  "boolean"
                ]
              },
              "trendColor": {
                "type": [
                  "null",
                  "string"
                ]
              },
              "trendIcon": {
                "type": [
                  "null",
                  "string"
                ]
              }
            }
          },
          "productCount": {
            "type": "object",
            "properties": {
              "current": {
                "type": "number",
                "format": "double"
              },
              "previous": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isMeasured": {
                "type": "boolean"
              },
              "change": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "changePercent": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isPositive": {
                "type": [
                  "null",
                  "boolean"
                ]
              },
              "trendColor": {
                "type": [
                  "null",
                  "string"
                ]
              },
              "trendIcon": {
                "type": [
                  "null",
                  "string"
                ]
              }
            }
          },
          "customerCount": {
            "type": "object",
            "properties": {
              "current": {
                "type": "number",
                "format": "double"
              },
              "previous": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isMeasured": {
                "type": "boolean"
              },
              "change": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "changePercent": {
                "type": [
                  "null",
                  "number"
                ],
                "format": "double"
              },
              "isPositive": {
                "type": [
                  "null",
                  "boolean"
                ]
              },
              "trendColor": {
                "type": [
                  "null",
                  "string"
                ]
              },
              "trendIcon": {
                "type": [
                  "null",
                  "string"
                ]
              }
            }
          }
        }
      },
      "StoreKindSpendingDto": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "total": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "StoreMailSettingsResponse": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "The address these settings belong to."
          },
          "everyStore": {
            "enum": [
              "in",
              "default",
              "out"
            ],
            "type": "string"
          },
          "stores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreMailStoreItem"
            }
          }
        }
      },
      "StoreMailStoreItem": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string"
          },
          "storeName": {
            "type": "string",
            "description": "Empty when the store can no longer be found."
          },
          "receives": {
            "type": "boolean",
            "description": "Whether this store may email the customer now."
          }
        }
      },
      "StoreMonthlyReport": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "months": {
            "type": "integer",
            "format": "int32"
          },
          "staffTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "revenueTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "transactionsTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "reservationsTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "customersTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "googleRatingTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          },
          "productsTrend": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "yearMonth": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "number",
                  "format": "double"
                },
                "isProjected": {
                  "type": "boolean"
                },
                "actualToDate": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "previousYearValue": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                },
                "yoyChangePct": {
                  "type": [
                    "null",
                    "number"
                  ],
                  "format": "double"
                }
              }
            }
          }
        }
      },
      "StorePriceDto": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string"
          },
          "storeName": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "costPrice": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "SubmitResponse": {
        "type": "object",
        "properties": {
          "submitted": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReadinessResponse"
            }
          }
        }
      },
      "SubmitSurveyRequest": {
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "answers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyAnswerInput"
            }
          },
          "deviceId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required when the caller is anonymous — used for response dedup."
          }
        }
      },
      "SuggestionsRequest": {
        "type": "object",
        "properties": {
          "proof": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Proof for the account signed in; a LINE ID token also lets its email be matched.",
                "$ref": "#/components/schemas/AccountProofRequest"
              }
            ]
          }
        }
      },
      "SummaryResponse": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string"
          },
          "attended": {
            "type": "integer",
            "format": "int32"
          },
          "excused": {
            "type": "integer",
            "format": "int32"
          },
          "noShow": {
            "type": "integer",
            "format": "int32"
          },
          "upcoming": {
            "type": "integer",
            "format": "int32"
          },
          "attendanceRate": {
            "type": [
              "null",
              "number"
            ],
            "description": "Over classes that have happened. Null when none have.",
            "format": "double"
          }
        }
      },
      "SurveyAnswerInput": {
        "type": "object",
        "properties": {
          "questionId": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "TableJoinGroup": {
        "type": "object",
        "properties": {
          "tables": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "capacity": {
            "type": "integer",
            "format": "int32"
          },
          "label": {
            "type": "string"
          },
          "isUsable": {
            "type": "boolean"
          }
        }
      },
      "TerminalLineRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "TerminalPayment": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "slipNumber": {
            "type": "string"
          },
          "terminalId": {
            "type": "string"
          },
          "amount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "TerminalPaymentRequest": {
        "type": "object",
        "properties": {
          "method": {
            "enum": [
              "card",
              "emoney",
              "qr"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "Required. card, emoney or qr."
          },
          "brand": {
            "type": [
              "null",
              "string"
            ]
          },
          "last4": {
            "type": [
              "null",
              "string"
            ]
          },
          "maskedPan": {
            "type": [
              "null",
              "string"
            ],
            "description": "Accepted instead of last4; only its last four digits are kept."
          }
        }
      },
      "TerminalReceiptLinks": {
        "type": "object",
        "properties": {
          "reservation": {
            "type": "string",
            "description": "linked, not_found, slip_mismatch or none."
          },
          "pass": {
            "type": "string"
          },
          "membership": {
            "type": "string"
          }
        }
      },
      "TerminalReceiptRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string",
            "description": "Required."
          },
          "terminalId": {
            "type": "string",
            "description": "Required. The stera TID, or the app's install id until the SDK provides one."
          },
          "slipNumber": {
            "type": "string",
            "description": "Required. The terminal's slip number."
          },
          "transactionType": {
            "enum": [
              "sale",
              "cancel",
              "return"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "sale (default), cancel or return."
          },
          "originalSlipNumber": {
            "type": [
              "null",
              "string"
            ],
            "description": "Required for cancel and return: the slip being reversed."
          },
          "paidAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the terminal took the payment. Defaults to now.",
            "format": "date-time"
          },
          "amount": {
            "type": "number",
            "description": "Required. Whole yen, tax included.",
            "format": "double"
          },
          "tax": {
            "type": "number",
            "description": "The consumption tax included in amount.",
            "format": "double"
          },
          "payment": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Required.",
                "$ref": "#/components/schemas/TerminalPaymentRequest"
              }
            ]
          },
          "lines": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TerminalLineRequest"
            },
            "description": "What was paid for — the stera result has no line items. Optional."
          },
          "reservationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "passId": {
            "type": [
              "null",
              "string"
            ]
          },
          "membershipId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerId": {
            "type": [
              "null",
              "string"
            ],
            "description": "CRM customer id. Required with passId or membershipId."
          }
        }
      },
      "TerminalReceiptResponse": {
        "type": "object",
        "properties": {
          "replayed": {
            "type": "boolean",
            "description": "True when this slip was already recorded; nothing new was written."
          },
          "transactionId": {
            "type": "string"
          },
          "terminalId": {
            "type": "string",
            "description": "ReceiptRoller's terminal record for this device at this store."
          },
          "status": {
            "type": "string",
            "description": "Completed for a sale; Voided for a cancel; Refunded for a return."
          },
          "originalFound": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Cancel and return only: whether the original sale was found. Null for a sale."
          },
          "links": {
            "$ref": "#/components/schemas/TerminalReceiptLinks"
          }
        }
      },
      "TerminalRegistrationRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string",
            "description": "Required."
          },
          "terminalId": {
            "type": "string",
            "description": "Required. The stera TID, or the app's install id until the SDK provides one. Send the same value as on receipts."
          }
        }
      },
      "TerminalRegistrationResponse": {
        "type": "object",
        "properties": {
          "registered": {
            "type": "boolean",
            "description": "True when this call took a slot; false when the terminal already held one."
          },
          "terminalId": {
            "type": "string",
            "description": "ReceiptRoller's terminal record for this device at this store."
          }
        }
      },
      "TestPushResponse": {
        "type": "object",
        "properties": {
          "sent": {
            "type": "integer",
            "description": "Devices the notification was delivered to.",
            "format": "int32"
          },
          "failed": {
            "type": "integer",
            "description": "Devices it could not be delivered to.",
            "format": "int32"
          },
          "anyTokens": {
            "type": "boolean",
            "description": "Whether the caller has any store-app device registered at all."
          }
        }
      },
      "TicketRequest": {
        "required": [
          "other"
        ],
        "type": "object",
        "properties": {
          "proof": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Proof for the account signed in",
                "$ref": "#/components/schemas/AccountProofRequest"
              }
            ]
          },
          "other": {
            "description": "Proof for the other account",
            "$ref": "#/components/schemas/OtherAccountProof"
          }
        }
      },
      "TodayResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "staff": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StaffTodayResponse"
            }
          }
        }
      },
      "TotalsResponse": {
        "type": "object",
        "properties": {
          "impressions": {
            "type": "integer",
            "format": "int64"
          },
          "clicks": {
            "type": "integer",
            "format": "int64"
          },
          "ctrPercent": {
            "type": "number",
            "format": "double"
          },
          "spend": {
            "type": "number",
            "description": "Yen charged for delivery, tax excluded.",
            "format": "double"
          },
          "couponsIssued": {
            "type": "integer",
            "format": "int64"
          },
          "stores": {
            "type": "integer",
            "format": "int32"
          },
          "purchaseWeeksFrom": {
            "type": [
              "null",
              "string"
            ],
            "description": "First day (a Monday) of the weeks the purchase figures cover; null until a week of the period has finished.",
            "format": "date"
          },
          "purchaseWeeksTo": {
            "type": [
              "null",
              "string"
            ],
            "description": "Last day (a Sunday) of the weeks the purchase figures cover.",
            "format": "date"
          },
          "redemptions": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Coupon uses in those weeks; null when 1 to 4, too few to show safely.",
            "format": "int64"
          },
          "couponDiscountYen": {
            "type": [
              "null",
              "number"
            ],
            "description": "Coupon discounts given at tills in those weeks, in yen; null below the privacy threshold (too few stores or uses).",
            "format": "double"
          },
          "couponSalesYen": {
            "type": [
              "null",
              "number"
            ],
            "description": "Sales on receipts where a coupon was used in those weeks; null below the privacy threshold.",
            "format": "double"
          },
          "matchedImpressions": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Impressions of ads targeted by purchase keywords in those weeks; null when 1 to 4.",
            "format": "int64"
          }
        }
      },
      "TransactionDetailResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "storeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeName": {
            "type": [
              "null",
              "string"
            ]
          },
          "channel": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "receiptNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "receiptUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "lineItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TxDetailLineItem"
            }
          },
          "itemCount": {
            "type": "integer",
            "format": "int32"
          },
          "amounts": {
            "$ref": "#/components/schemas/TxAmounts"
          },
          "tipAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "payment": {
            "$ref": "#/components/schemas/TxPayment"
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TxPaymentLine"
            }
          },
          "refund": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TxRefund"
              }
            ]
          },
          "customer": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TxDetailCustomer"
              }
            ]
          },
          "staff": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TxStaff"
              }
            ]
          },
          "terminalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "externalIds": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TxExternalIds"
              }
            ]
          },
          "links": {
            "$ref": "#/components/schemas/TxLinks"
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TransactionQrClaimRequest": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "description": "line / ios / android / web / email"
          },
          "deliveryTarget": {
            "type": [
              "null",
              "string"
            ],
            "description": "Optional — delivery target (email / LINE userId) when channel demands one."
          },
          "lineIdToken": {
            "type": [
              "null",
              "string"
            ],
            "description": "The LIFF ID token (liff.getIDToken()). For a LINE claim the receipt is pushed to the\nuser it proves, and DeliveryTarget is ignored (t-e9a2f1515)."
          }
        }
      },
      "TransactionsListResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "window": {
            "$ref": "#/components/schemas/TxWindow"
          },
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnifiedTx"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "TxAmounts": {
        "type": "object",
        "properties": {
          "subtotal": {
            "type": "integer",
            "format": "int32"
          },
          "tax": {
            "type": "integer",
            "format": "int32"
          },
          "shipping": {
            "type": "integer",
            "format": "int32"
          },
          "discount": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Null for a POS sale recorded before discounts were indexed (t-e9a2f1570).",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "TxCustomer": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TxDetailCustomer": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "membershipCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerCustomerId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TxDetailLineItem": {
        "type": "object",
        "properties": {
          "productName": {
            "type": "string"
          },
          "productId": {
            "type": [
              "null",
              "string"
            ]
          },
          "catalogObjectId": {
            "type": [
              "null",
              "string"
            ]
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "unit": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "unitPrice": {
            "type": "number",
            "format": "double"
          },
          "lineTotal": {
            "type": "number",
            "format": "double"
          },
          "taxRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "taxAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "discount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "modifiers": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TxModifier"
            }
          }
        }
      },
      "TxExternalIds": {
        "type": "object",
        "properties": {
          "providerOrderId": {
            "type": [
              "null",
              "string"
            ]
          },
          "locationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "providerCustomerId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TxLinks": {
        "type": "object",
        "properties": {
          "posTransactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "posTerminalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "omsOrderId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TxModifier": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "TxPayment": {
        "type": "object",
        "properties": {
          "method": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "paidAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "TxPaymentLine": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "tenderedAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "changeAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "brand": {
            "type": [
              "null",
              "string"
            ]
          },
          "last4": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "One tender of a (possibly split) payment. t-e9a2f619."
      },
      "TxRefund": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "isPartial": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "originalTransactionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "refundedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "TxStaff": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TxWindow": {
        "type": "object",
        "properties": {
          "since": {
            "type": "string",
            "format": "date-time"
          },
          "until": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UnifiedTx": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "storeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "channel": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "amounts": {
            "$ref": "#/components/schemas/TxAmounts"
          },
          "itemCount": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Null for a POS sale recorded before item counts were indexed (t-e9a2f1570).",
            "format": "int32"
          },
          "customer": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TxCustomer"
              }
            ]
          },
          "links": {
            "$ref": "#/components/schemas/TxLinks"
          }
        }
      },
      "UnitCreatedResponse": {
        "type": "object",
        "properties": {
          "unitId": {
            "type": "string"
          }
        }
      },
      "UnitRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UnitResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "targeting": {
            "$ref": "#/components/schemas/RetailMediaTargeting"
          },
          "ads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdResponse"
            }
          },
          "reach": {
            "$ref": "#/components/schemas/ReachResponse"
          }
        }
      },
      "UnlinkIdentityRequest": {
        "type": "object",
        "properties": {
          "proof": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Proof with a sign-in method other than the one being removed",
                "$ref": "#/components/schemas/AccountProofRequest"
              }
            ]
          }
        }
      },
      "UnregisterTokenRequest": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string"
          },
          "channel": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          }
        }
      },
      "UnrepliedReviewRow": {
        "type": "object",
        "properties": {
          "reviewId": {
            "type": "string"
          },
          "connectionId": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "storeId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The store linked to the location; null for a location no store is linked to."
          },
          "locationName": {
            "type": "string",
            "description": "The store's name, or the location's name on Google."
          },
          "reviewerName": {
            "type": "string"
          },
          "reviewerPhotoUrl": {
            "type": "string"
          },
          "starCount": {
            "type": "integer",
            "format": "int32"
          },
          "comment": {
            "type": "string",
            "description": "As Google sends it; a translated review carries both the translation and the original."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UnrepliedReviewsResponse": {
        "type": "object",
        "properties": {
          "reviews": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnrepliedReviewRow"
            }
          },
          "failedLocations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Locations Google could not be read for this time; their reviews are missing from the list."
          },
          "aiDraftAvailable": {
            "type": "boolean",
            "description": "Whether the plan includes AI reply drafts."
          }
        }
      },
      "UpdateMeProfileRequest": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "timeZone": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Body of PATCH /api/v1/me. Null leaves a field unchanged."
      },
      "UpdateMeStoreAddress": {
        "type": "object",
        "properties": {
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "prefecture": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "line1": {
            "type": [
              "null",
              "string"
            ]
          },
          "line2": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateMeStoreRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeType": {
            "type": [
              "null",
              "string"
            ]
          },
          "primaryCategory": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "websiteUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateMeStoreAddress"
              }
            ]
          }
        }
      },
      "UpdatePrinterRequest": {
        "type": "object",
        "properties": {
          "deviceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "serialNumber": {
            "type": [
              "null",
              "string"
            ]
          },
          "firmwareVersion": {
            "type": [
              "null",
              "string"
            ]
          },
          "posTerminalId": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UpdateReceiptSettingsRequest": {
        "type": "object",
        "properties": {
          "headerText": {
            "type": [
              "null",
              "string"
            ]
          },
          "footerText": {
            "type": [
              "null",
              "string"
            ]
          },
          "logoUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "accentColor": {
            "type": [
              "null",
              "string"
            ],
            "description": "Accent color hex, e.g. \"#06C755\". Empty falls back to the default."
          },
          "showStoreName": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UpdateWebhookRequest": {
        "type": "object",
        "properties": {
          "eventTypes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Replaces the full list of subscribed event types.\nMust contain at least one event if provided.",
            "example": [
              "receipt.created"
            ]
          },
          "active": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Set to false to pause delivery without deleting the webhook.\nSet to true to resume.",
            "example": false
          }
        },
        "description": "Request body for updating an existing webhook."
      },
      "UpgradeRequest": {
        "required": [
          "email",
          "password"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "displayName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UploadedFileResponse": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Where the file now lives. Directly renderable."
          },
          "contentType": {
            "type": "string"
          },
          "bytes": {
            "type": "integer",
            "description": "Size of what was stored, in bytes.",
            "format": "int64"
          }
        },
        "description": "What an upload returns, in the shape `/api/v1/sns/media` already\nuses so a caller handles both the same way."
      },
      "UserBudgetStatusDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "daysInMonth": {
            "type": "integer",
            "format": "int32"
          },
          "daysElapsed": {
            "type": "integer",
            "format": "int32"
          },
          "overall": {
            "$ref": "#/components/schemas/BudgetLineDto"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CategoryBudgetLineDto"
            }
          },
          "unbudgetedSpent": {
            "type": "number",
            "format": "double"
          },
          "specialExpenseSpent": {
            "type": "number",
            "format": "double"
          },
          "fixedSpent": {
            "type": "number",
            "format": "double"
          },
          "variableSpent": {
            "type": "number",
            "format": "double"
          },
          "unallocatedBudget": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "labels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelBudgetLineDto"
            }
          },
          "income": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "incomeSource": {
            "type": [
              "null",
              "string"
            ]
          },
          "oneOffIncome": {
            "type": "number",
            "format": "double"
          },
          "savingsSetAside": {
            "type": "number",
            "format": "double"
          },
          "savingsContributed": {
            "type": "number",
            "format": "double"
          },
          "spendable": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "spendableRemaining": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetHistoryMonthDto"
            }
          }
        }
      },
      "UserCouponItem": {
        "type": "object",
        "properties": {
          "storeId": {
            "type": "string"
          },
          "storeName": {
            "type": "string"
          },
          "couponId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "discountType": {
            "enum": [
              "Percentage",
              "FixedAmount"
            ],
            "type": "string"
          },
          "discountValue": {
            "type": "number",
            "format": "double"
          },
          "validFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "validUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isExpired": {
            "type": "boolean"
          },
          "isFullyUsed": {
            "type": "boolean"
          },
          "isReusable": {
            "type": "boolean",
            "description": "Shown, never spent — no \"use\" button and no used state."
          }
        }
      },
      "UserDailyNoteDto": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "spent": {
            "type": "number",
            "format": "double"
          },
          "receiptCount": {
            "type": "integer",
            "format": "int32"
          },
          "entry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DailyNoteEntry"
              }
            ]
          },
          "daysWrittenThisMonth": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "UserDailyNoteListDto": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DailyNoteListItem"
            }
          }
        }
      },
      "UserDeviceResponse": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "registeredAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastSeenAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UserDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "emailConfirmed": {
            "type": "boolean"
          },
          "displayName": {
            "type": "string"
          },
          "profileImageUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "timeZone": {
            "type": [
              "null",
              "string"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastLoginAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "lastOrganizationId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UserGoalAdviceDto": {
        "type": "object",
        "properties": {
          "goalId": {
            "type": "string"
          },
          "available": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "tips": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locale": {
            "type": "string"
          },
          "generatedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "UserHeldCoupon": {
        "type": "object",
        "properties": {
          "issuedCode": {
            "type": "string",
            "description": "This account's own code — what staff look up or the till scans."
          },
          "status": {
            "enum": [
              "Issued",
              "Used"
            ],
            "type": "string"
          },
          "isUsed": {
            "type": "boolean"
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time"
          },
          "usedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "UTC. Drives the \"just now / 3 minutes ago\" display.",
            "format": "date-time"
          },
          "undoUntil": {
            "type": [
              "null",
              "string"
            ],
            "description": "UTC. Until when a use can be taken back; null when unused.",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "When this account's copy lapses, if sooner than the coupon itself.",
            "format": "date-time"
          },
          "storeId": {
            "type": "string"
          },
          "storeName": {
            "type": "string"
          },
          "couponId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "discountType": {
            "enum": [
              "Percentage",
              "FixedAmount"
            ],
            "type": "string"
          },
          "discountValue": {
            "type": "number",
            "format": "double"
          },
          "validFrom": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "validUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "isExpired": {
            "type": "boolean"
          },
          "isFullyUsed": {
            "type": "boolean"
          },
          "isReusable": {
            "type": "boolean",
            "description": "Shown, never spent — no \"use\" button and no used state."
          }
        },
        "description": "A coupon this account holds (t-e9a2f1428)."
      },
      "UserIncomeMonthDto": {
        "type": "object",
        "properties": {
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "salary": {
            "type": "number",
            "format": "double"
          },
          "sideJob": {
            "type": "number",
            "format": "double"
          },
          "bonus": {
            "type": "number",
            "format": "double"
          },
          "irregular": {
            "type": "number",
            "format": "double"
          },
          "regular": {
            "type": "number",
            "format": "double"
          },
          "total": {
            "type": "number",
            "format": "double"
          },
          "spent": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "UserIncomeRecordDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "issuer": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "memo": {
            "type": [
              "null",
              "string"
            ]
          },
          "origin": {
            "type": "string"
          },
          "allocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncomeAllocationDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UserIncomeYearDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "months": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserIncomeMonthDto"
            }
          },
          "salary": {
            "type": "number",
            "format": "double"
          },
          "sideJob": {
            "type": "number",
            "format": "double"
          },
          "bonus": {
            "type": "number",
            "format": "double"
          },
          "irregular": {
            "type": "number",
            "format": "double"
          },
          "regular": {
            "type": "number",
            "format": "double"
          },
          "total": {
            "type": "number",
            "format": "double"
          },
          "spent": {
            "type": "number",
            "format": "double"
          },
          "regularSavingsRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "annualSavingsRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "UserInsightsDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "smallSpending": {
            "$ref": "#/components/schemas/SmallSpendingDto"
          },
          "priceChanges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ItemPriceChangeDto"
            }
          },
          "topItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ItemRankingDto"
            }
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InsightMessageDto"
            }
          }
        }
      },
      "UserJournalSettingsDto": {
        "type": "object",
        "properties": {
          "aiUse": {
            "type": "boolean"
          },
          "noticeSeen": {
            "type": "boolean"
          }
        }
      },
      "UserMonthlyReportDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "format": "int32"
          },
          "hasData": {
            "type": "boolean"
          },
          "figures": {
            "$ref": "#/components/schemas/MonthlyReportFigures"
          },
          "headline": {
            "type": [
              "null",
              "string"
            ]
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonthlyReportSection"
            }
          },
          "advice": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "aiGenerated": {
            "type": "boolean"
          },
          "locale": {
            "type": "string"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "version": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "UserRecurringPaymentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "previousAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "cycle": {
            "type": "string"
          },
          "nextDate": {
            "type": "string",
            "format": "date-time"
          },
          "lastPaidDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "monthlyAmount": {
            "type": "number",
            "format": "double"
          },
          "yearlyAmount": {
            "type": "number",
            "format": "double"
          },
          "categoryId": {
            "type": "string"
          },
          "categoryName": {
            "type": "string"
          },
          "categoryColor": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "occurrenceCount": {
            "type": "integer",
            "format": "int32"
          },
          "reviewReasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UserRecurringPaymentSummaryDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserRecurringPaymentDto"
            }
          },
          "confirmedCount": {
            "type": "integer",
            "format": "int32"
          },
          "candidateCount": {
            "type": "integer",
            "format": "int32"
          },
          "monthlyTotal": {
            "type": "number",
            "format": "double"
          },
          "yearlyTotal": {
            "type": "number",
            "format": "double"
          },
          "byCategory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecurringCategoryTotalDto"
            }
          }
        }
      },
      "UserSavingsContributionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "goalId": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "memo": {
            "type": [
              "null",
              "string"
            ]
          },
          "origin": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UserSavingsGoalDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "icon": {
            "type": [
              "null",
              "string"
            ]
          },
          "targetAmount": {
            "type": "number",
            "format": "double"
          },
          "targetDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "monthlyAmount": {
            "type": "number",
            "format": "double"
          },
          "autoContribute": {
            "type": "boolean"
          },
          "savedAmount": {
            "type": "number",
            "format": "double"
          },
          "remaining": {
            "type": "number",
            "format": "double"
          },
          "percentSaved": {
            "type": "number",
            "format": "double"
          },
          "contributedThisMonth": {
            "type": "number",
            "format": "double"
          },
          "requiredMonthly": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "projectedCompletion": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SavingsYearMonthDto"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "year": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "plannedMonth": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "template": {
            "type": [
              "null",
              "string"
            ]
          },
          "contributions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/UserSavingsContributionDto"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UserSavingsSummaryDto": {
        "type": "object",
        "properties": {
          "goals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserSavingsGoalDto"
            }
          },
          "totalSaved": {
            "type": "number",
            "format": "double"
          },
          "monthlyAmount": {
            "type": "number",
            "format": "double"
          },
          "contributedThisMonth": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "UserSpecialExpenseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "template": {
            "type": [
              "null",
              "string"
            ]
          },
          "icon": {
            "type": [
              "null",
              "string"
            ]
          },
          "annualAmount": {
            "type": "number",
            "format": "double"
          },
          "plannedMonth": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "monthlyAmount": {
            "type": "number",
            "format": "double"
          },
          "autoContribute": {
            "type": "boolean"
          },
          "savedAmount": {
            "type": "number",
            "format": "double"
          },
          "spentAmount": {
            "type": "number",
            "format": "double"
          },
          "remaining": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "UserSpecialExpenseSummaryDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserSpecialExpenseDto"
            }
          },
          "annualTotal": {
            "type": "number",
            "format": "double"
          },
          "monthlyTotal": {
            "type": "number",
            "format": "double"
          },
          "savedTotal": {
            "type": "number",
            "format": "double"
          },
          "spentTotal": {
            "type": "number",
            "format": "double"
          },
          "remainingTotal": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "UserWeeklyReviewDto": {
        "type": "object",
        "properties": {
          "weekStart": {
            "type": "string",
            "format": "date-time"
          },
          "weekEnd": {
            "type": "string",
            "format": "date-time"
          },
          "spent": {
            "type": "number",
            "format": "double"
          },
          "budget": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "previousWeekSpent": {
            "type": "number",
            "format": "double"
          },
          "specialSpent": {
            "type": "number",
            "format": "double"
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WeeklyReviewDay"
            }
          },
          "noSpendDays": {
            "type": "integer",
            "format": "int32"
          },
          "topCategories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WeeklyReviewCategory"
            }
          },
          "smallPurchases": {
            "$ref": "#/components/schemas/WeeklyReviewSmallPurchases"
          },
          "entry": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WeeklyReviewEntry"
              }
            ]
          },
          "previousNextAction": {
            "type": [
              "null",
              "string"
            ]
          },
          "reviewedWeeksThisYear": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "UserWeeklyReviewListDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "weeks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WeeklyReviewListItem"
            }
          }
        }
      },
      "VariantOptionDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "values": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "VariantRequest": {
        "type": "object",
        "properties": {
          "variantId": {
            "type": [
              "null",
              "string"
            ],
            "description": "An existing variant to update. Leave out to create one."
          },
          "sku": {
            "type": [
              "null",
              "string"
            ]
          },
          "janCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "imageUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "attributes": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            },
            "description": "What makes this variant different, e.g. {\"サイズ\": \"M\", \"色\": \"レッド\"}."
          },
          "basePrice": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "baseCostPrice": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "taxRate": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "storePrices": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/StorePriceDto"
            }
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "sortOrder": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "isUpdate": {
            "type": "boolean"
          }
        },
        "description": "One variant. Every field is optional on an update: what is left out\nkeeps its current value (t-e9a2f1777). A new variant starts from the\ndefaults and needs attributes."
      },
      "VariantResponse": {
        "type": "object",
        "properties": {
          "variantId": {
            "type": "string"
          },
          "parentProductId": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "janCode": {
            "type": "string"
          },
          "imageUrl": {
            "type": "string"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "attributesJson": {
            "type": "string"
          },
          "displayLabel": {
            "type": "string"
          },
          "basePrice": {
            "type": "number",
            "format": "double"
          },
          "baseCostPrice": {
            "type": "number",
            "format": "double"
          },
          "taxRate": {
            "type": "number",
            "format": "double"
          },
          "storePrices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StorePriceDto"
            }
          },
          "status": {
            "type": "string"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          },
          "squareVariationId": {
            "type": "string"
          },
          "shopifyVariantGid": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "A variant as the API returns it. The DTO's display helpers\n(formatted prices, the Japanese status label, badge classes) stay\nout, as they do for the product itself."
      },
      "VerifyRequest": {
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string",
            "description": "Access token to validate"
          }
        }
      },
      "VisitorAnalysisReportDto": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "sinceUtc": {
            "type": "string",
            "format": "date-time"
          },
          "untilUtc": {
            "type": "string",
            "format": "date-time"
          },
          "totalTransactions": {
            "type": "integer",
            "format": "int32"
          },
          "transactionsWithCustomer": {
            "type": "integer",
            "format": "int32"
          },
          "conversionRatePct": {
            "type": "number",
            "format": "double"
          },
          "hourly": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HourlyBucketDto"
            }
          },
          "dayOfWeek": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DayOfWeekBucketDto"
            }
          },
          "heatmap": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HeatmapCellDto"
            }
          },
          "peakHour": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "quietHour": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "peakDayOfWeek": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "monthlyNewVsReturning": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NewVsReturningMonthlyDto"
            }
          }
        }
      },
      "WaitlistEntryResponse": {
        "type": "object",
        "properties": {
          "waitlistId": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "slotId": {
            "type": "string"
          },
          "slotDate": {
            "type": "string",
            "format": "date-time"
          },
          "startTime": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "customerName": {
            "type": "string"
          },
          "customerPhone": {
            "type": "string"
          },
          "customerEmail": {
            "type": "string"
          },
          "partySize": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "enum": [
              "Waiting",
              "Offered",
              "Converted",
              "Cancelled",
              "Expired"
            ],
            "type": "string",
            "description": "Waiting / Offered / Converted / Cancelled / Expired."
          }
        }
      },
      "WaitlistJoinRequest": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "storeId": {
            "type": "string"
          },
          "slotId": {
            "type": "string"
          },
          "slotDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "startTime": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerId": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerName": {
            "type": "string"
          },
          "customerPhone": {
            "type": [
              "null",
              "string"
            ]
          },
          "customerEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "partySize": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          }
        }
      },
      "WaitlistListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WaitlistEntryResponse"
            }
          }
        }
      },
      "WaitlistSlotResponse": {
        "type": "object",
        "properties": {
          "slotId": {
            "type": "string"
          },
          "waiting": {
            "type": "integer",
            "description": "Groups still hoping for a place.",
            "format": "int32"
          },
          "offered": {
            "type": "integer",
            "description": "Groups already offered one and yet to answer.",
            "format": "int32"
          },
          "waitingCovers": {
            "type": "integer",
            "description": "People those waiting groups add up to — what decides whether to open another sitting.",
            "format": "int32"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WaitlistEntryResponse"
            }
          }
        }
      },
      "WeeklyReviewCategory": {
        "type": "object",
        "properties": {
          "categoryId": {
            "type": [
              "null",
              "string"
            ]
          },
          "category": {
            "type": [
              "null",
              "string"
            ]
          },
          "amount": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "WeeklyReviewDay": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "spent": {
            "type": "number",
            "format": "double"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "feeling": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WeeklyReviewEntry": {
        "type": "object",
        "properties": {
          "good": {
            "type": [
              "null",
              "string"
            ]
          },
          "concern": {
            "type": [
              "null",
              "string"
            ]
          },
          "nextAction": {
            "type": [
              "null",
              "string"
            ]
          },
          "previousActionResult": {
            "type": [
              "null",
              "string"
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WeeklyReviewListItem": {
        "type": "object",
        "properties": {
          "weekStart": {
            "type": "string",
            "format": "date-time"
          },
          "hasNextAction": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WeeklyReviewRequest": {
        "type": "object",
        "properties": {
          "good": {
            "type": [
              "null",
              "string"
            ]
          },
          "concern": {
            "type": [
              "null",
              "string"
            ]
          },
          "nextAction": {
            "type": [
              "null",
              "string"
            ]
          },
          "previousActionResult": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WeeklyReviewSmallPurchases": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "amount": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "WeekResponse": {
        "type": "object",
        "properties": {
          "monday": {
            "type": "string",
            "format": "date"
          },
          "redemptions": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Null when 1 to 4.",
            "format": "int64"
          },
          "matchedImpressions": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Impressions of ads targeted by purchase keywords; null when 1 to 4.",
            "format": "int64"
          }
        }
      },
      "WorkHoursLimitRequest": {
        "type": "object",
        "properties": {
          "standardWorkStartTime": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"HH:mm\" 24h, or empty to clear the limit."
          },
          "standardWorkEndTime": {
            "type": [
              "null",
              "string"
            ],
            "description": "\"HH:mm\" 24h, or empty to clear the limit."
          }
        }
      },
      "WorkHoursLimitResponse": {
        "type": "object",
        "properties": {
          "standardWorkStartTime": {
            "type": "string"
          },
          "standardWorkEndTime": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "description": "Authorization-code flow. An operation's `security` entry names the scope its access token must carry; a token without it is refused with 403.\n\nScopes are fixed when the token is issued, so an app granted new scopes keeps being refused until the user signs in again and a fresh token is minted.\n\nAn operation whose `security` entry lists no scope needs a valid token but no particular scope (the signed-in user's own account, devices and settings). Operations with no `security` entry at all take no token: public pages, vendor webhooks verified by signature, and device endpoints keyed by their own credentials.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://receiptroller.io/oauth/authorize",
            "tokenUrl": "https://receiptroller.io/api/v1/auth/token",
            "scopes": {
              "store.products.read": "商品・在庫情報を取得します",
              "store.products.write": "商品の作成・更新を行います",
              "store.orders.read": "注文データを取得します",
              "store.orders.write": "注文ステータスを更新します",
              "store.customers.read": "顧客データを取得します",
              "store.customers.write": "顧客の作成・更新・削除を行います",
              "store.coupons.read": "クーポンデータを取得します",
              "store.coupons.write": "クーポンの作成・更新を行います",
              "store.coupons.redeem": "レジでクーポンを利用済みにします。発行はできません。",
              "store.inventory.read": "倉庫・在庫データを取得します",
              "store.inventory.write": "在庫数の調整・棚卸し反映を行います",
              "store.flyers.read": "店舗のチラシを取得します",
              "store.flyers.write": "店舗のチラシの作成・公開・削除を行います",
              "store.posts.read": "下書き・予約を含むお知らせを取得します",
              "store.posts.write": "お知らせの作成・公開・アーカイブ・削除を行います",
              "store.staff.read": "従業員・スタッフ情報を取得します",
              "store.staff.write": "従業員の作成・更新・削除を行います",
              "store.business-hours.read": "店舗の営業時間と特例営業日を取得します",
              "store.business-hours.write": "店舗の営業時間と特例営業日を更新します",
              "store.reservations.read": "予約・予約枠・席情報を取得します",
              "store.reservations.write": "予約の作成・変更・ステータス更新を行います",
              "store.memberships.read": "通い放題プランとご加入者の一覧を取得します",
              "store.memberships.write": "プランの作成・更新と、ご加入者の解約を行います",
              "store.passes.read": "回数券の商品とご購入者の一覧を取得します",
              "store.passes.write": "回数券商品の作成・更新・削除を行います",
              "store.terminal.write": "決済端末で受けた支払いを売上とレシートとして登録します",
              "store.timecards.read": "スタッフの出勤状況と当日の打刻を取得します",
              "store.timecards.write": "スタッフの出勤・退勤・休憩を打刻します",
              "store.info.read": "店舗の基本情報（店舗名・連絡先・住所）を取得します",
              "store.info.write": "店舗の基本情報（店舗名・連絡先・住所）を更新します",
              "store.media.read": "広告面・販売ルール・広告の審査待ち・広告収益を取得します",
              "store.media.write": "広告面の開放・一時停止、販売ルールの変更、広告の承認・却下を行います",
              "advertiser.campaigns.read": "リテールメディアのキャンペーン・配信ユニット・広告・クリエイティブを取得します",
              "advertiser.campaigns.write": "キャンペーンの作成・変更、配信条件の設定、広告の入稿、審査への提出を行います",
              "advertiser.reports.read": "配信実績・クーポン利用・売上リフトのレポートを取得します",
              "media.channels.read": "コンテンツチャンネルと、その画像・動画を取得します",
              "media.channels.write": "チャンネルへの画像・動画の追加と削除、フィードの設定を行います",
              "crm.profiles.read": "CRM顧客プロフィールを取得します",
              "crm.segments.read": "CRMセグメント・ランクを取得します",
              "sns.content.read": "SNS投稿データと、Googleの口コミ・インサイトを取得します",
              "sns.content.write": "SNS投稿の作成・更新・公開・予約・削除と、Googleの口コミへの返信を行います",
              "sns.audience.read": "SNSオーディエンスデータを取得します",
              "analytics.read": "分析スナップショットを取得します",
              "sales.read": "売上・取引データとビジネスインサイトを取得します",
              "user.profile.read": "ユーザーの基本情報を取得します",
              "user.profile.write": "ユーザーの基本情報を更新します",
              "user.receipts.read": "ユーザーのレシートデータを取得します",
              "user.receipts.write": "レシートの保存・変更・削除と、カテゴリ・ラベルの管理を行います",
              "user.spending.read": "ユーザーの月別支出データを取得します",
              "user.spending.write": "月次予算などユーザーの支出関連データを更新します",
              "user.coupons.read": "お気に入り店舗のクーポン情報を取得します",
              "user.coupons.write": "クーポンの受け取り、お会計での使用と、その取り消しを行います",
              "user.favorites.read": "お気に入り登録済みの店舗一覧を取得します",
              "user.favorites.write": "お気に入り店舗の追加・削除を行います"
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "ShopifyWebhook"
    },
    {
      "name": "AppAdsApi"
    },
    {
      "name": "NotificationTokenApi"
    },
    {
      "name": "PublicStoreDirectory"
    },
    {
      "name": "QrImageApi"
    },
    {
      "name": "ReceiptAdApi"
    },
    {
      "name": "StoreAppApi"
    },
    {
      "name": "TerminalReceiptApi"
    },
    {
      "name": "TransactionReceiptApi"
    },
    {
      "name": "WalletPassApi"
    },
    {
      "name": "CheckInApi"
    },
    {
      "name": "SurveyApi"
    },
    {
      "name": "UserAccount"
    },
    {
      "name": "UserBudget"
    },
    {
      "name": "UserCoupons"
    },
    {
      "name": "UserDailyNotes"
    },
    {
      "name": "UserDevices"
    },
    {
      "name": "UserFavoriteStores"
    },
    {
      "name": "UserFlyers"
    },
    {
      "name": "UserIncome"
    },
    {
      "name": "UserIncomeRecords"
    },
    {
      "name": "UserInsights"
    },
    {
      "name": "UserJournalSettings"
    },
    {
      "name": "UserReceiptCategories"
    },
    {
      "name": "UserReceiptClaim"
    },
    {
      "name": "UserReceiptLabels"
    },
    {
      "name": "UserReceipts"
    },
    {
      "name": "UserRecurringPayments"
    },
    {
      "name": "UserReports"
    },
    {
      "name": "UserSavingsGoals"
    },
    {
      "name": "UserScan"
    },
    {
      "name": "UserSpecialExpenses"
    },
    {
      "name": "UserStatements"
    },
    {
      "name": "UserStoreMail"
    },
    {
      "name": "UserWeeklyReviews"
    },
    {
      "name": "AdCouponsApi"
    },
    {
      "name": "BusinessHoursApi"
    },
    {
      "name": "ContentChannelsApi"
    },
    {
      "name": "CouponsApi"
    },
    {
      "name": "Customers"
    },
    {
      "name": "DisplaysApi"
    },
    {
      "name": "GoogleBusinessApi"
    },
    {
      "name": "InventoryApi"
    },
    {
      "name": "LightspeedWebhook"
    },
    {
      "name": "LineWebhook"
    },
    {
      "name": "OrdersApi"
    },
    {
      "name": "ProductsApi"
    },
    {
      "name": "ReservationAnalyticsApi"
    },
    {
      "name": "ReservationAttendanceApi"
    },
    {
      "name": "ReservationMembershipsApi"
    },
    {
      "name": "ReservationPassesApi"
    },
    {
      "name": "ReservationResourcesApi"
    },
    {
      "name": "ReservationsApi"
    },
    {
      "name": "ReservationSeriesApi"
    },
    {
      "name": "ReservationStockApi"
    },
    {
      "name": "ReservationWaitlistApi"
    },
    {
      "name": "RetailMediaApi"
    },
    {
      "name": "SalesApi"
    },
    {
      "name": "ShiftsApi"
    },
    {
      "name": "SignageApi"
    },
    {
      "name": "SmaregiWebhook"
    },
    {
      "name": "SnsApi"
    },
    {
      "name": "SquareWebhook"
    },
    {
      "name": "StaffAnnouncementsApi"
    },
    {
      "name": "StaffApi"
    },
    {
      "name": "StoreFlyersApi"
    },
    {
      "name": "StorePostsApi"
    },
    {
      "name": "TerminalReceiptsApi"
    },
    {
      "name": "TerminalRegistrationApi"
    },
    {
      "name": "TimecardsApi"
    },
    {
      "name": "TransactionsApi"
    },
    {
      "name": "AccountMerge"
    },
    {
      "name": "Auth"
    },
    {
      "name": "DeviceToken"
    },
    {
      "name": "Me"
    },
    {
      "name": "MeIdentities"
    },
    {
      "name": "StorePrinters"
    },
    {
      "name": "StripeWebhook"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "AdvertiserCampaignsApi"
    },
    {
      "name": "AdvertiserReportsApi"
    }
  ]
}