{
  "openapi": "3.1.0",
  "info": {
    "title": "ODINMAX Shop API",
    "version": "1.1.0",
    "description": "Run your ODINMAX shop from your own system: listings, stock, orders and delivery, chat, reviews, disputes, promotions, finance and webhooks. Every call follows the same rules as the Seller Center. /v1/shop is the full API; /v1/public is the older, smaller set and keeps working."
  },
  "servers": [
    {
      "url": "https://api.odinmax.com",
      "description": "Production"
    },
    {
      "url": "https://demo-api.odinmax.com",
      "description": "Sandbox (test data, odx_test_ keys)"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Shop",
      "description": "The calling key, your shop profile, opening hours and breaks"
    },
    {
      "name": "Listings",
      "description": "Create, edit, submit, pause and remove listings, one at a time or up to 200 at once"
    },
    {
      "name": "Stock",
      "description": "Codes and accounts for automatic delivery"
    },
    {
      "name": "Orders",
      "description": "Orders, delivery and cancellations (no buyer contact details)"
    },
    {
      "name": "Chat",
      "description": "Order chats and questions before buying"
    },
    {
      "name": "Reviews",
      "description": "Read reviews and reply"
    },
    {
      "name": "Disputes",
      "description": "Disputes, appeals and warranty claims"
    },
    {
      "name": "Promotions",
      "description": "Bumps and featured places"
    },
    {
      "name": "Finance",
      "description": "Balances, statement and withdrawal requests"
    },
    {
      "name": "Team",
      "description": "Who works in your shop (read only)"
    },
    {
      "name": "Webhooks",
      "description": "Your webhooks and their delivery history"
    },
    {
      "name": "Uploads",
      "description": "Images and files for listings, delivery evidence and chat"
    },
    {
      "name": "Older endpoints",
      "description": "The first /v1/public set: still working, same keys. New work should use /v1/shop"
    }
  ],
  "paths": {
    "/v1/shop/me": {
      "get": {
        "tags": [
          "Shop"
        ],
        "summary": "The calling key: shop, scopes and rate limit",
        "operationId": "shop_get_me",
        "x-scope": "shop.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/profile": {
      "get": {
        "tags": [
          "Shop"
        ],
        "summary": "Your shop profile and dashboard figures",
        "operationId": "shop_get_profile",
        "x-scope": "shop.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Shop"
        ],
        "summary": "Change name, bio, avatar or banner",
        "operationId": "shop_patch_profile",
        "x-scope": "shop.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopName": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 40
                  },
                  "bio": {
                    "type": "object",
                    "properties": {
                      "th": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "en": {
                        "type": "string",
                        "maxLength": 1000
                      }
                    }
                  },
                  "avatarId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "bannerId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/business-hours": {
      "put": {
        "tags": [
          "Shop"
        ],
        "summary": "Set opening hours (null clears them)",
        "operationId": "shop_put_business_hours",
        "x-scope": "shop.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "businessHours"
                ],
                "properties": {
                  "businessHours": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "tz": {
                            "type": "string",
                            "examples": [
                              "Asia/Bangkok"
                            ]
                          },
                          "days": {
                            "type": "object",
                            "properties": {
                              "mon": {
                                "type": "array",
                                "items": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^\\d{2}:\\d{2}$"
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/vacation": {
      "post": {
        "tags": [
          "Shop"
        ],
        "summary": "Take a break until a date",
        "operationId": "shop_post_vacation",
        "x-scope": "shop.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "until"
                ],
                "properties": {
                  "until": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Shop"
        ],
        "summary": "End the break now",
        "operationId": "shop_delete_vacation",
        "x-scope": "shop.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/quick-replies": {
      "get": {
        "tags": [
          "Chat"
        ],
        "summary": "Your saved quick replies",
        "operationId": "shop_get_quick_replies",
        "x-scope": "chat.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Save a quick reply",
        "operationId": "shop_post_quick_replies",
        "x-scope": "chat.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title",
                  "body"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "body": {
                    "type": "string",
                    "maxLength": 1000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/quick-replies/{id}": {
      "delete": {
        "tags": [
          "Chat"
        ],
        "summary": "Delete a quick reply",
        "operationId": "shop_delete_quick_replies_id",
        "x-scope": "chat.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/listings": {
      "get": {
        "tags": [
          "Listings"
        ],
        "summary": "All your listings",
        "operationId": "shop_get_listings",
        "x-scope": "listings.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Listing"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Listings"
        ],
        "summary": "Create a listing (a draft until you submit it)",
        "operationId": "shop_post_listings",
        "x-scope": "listings.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListingInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/listings/{shortId}": {
      "get": {
        "tags": [
          "Listings"
        ],
        "summary": "One listing with everything you can edit",
        "operationId": "shop_get_listings_shortId",
        "x-scope": "listings.read",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not a listing of your shop (LISTING_NOT_FOUND)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Listings"
        ],
        "summary": "Replace a listing",
        "operationId": "shop_put_listings_shortId",
        "x-scope": "listings.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListingInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not a listing of your shop (LISTING_NOT_FOUND)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Listings"
        ],
        "summary": "Change price, quantity or pause",
        "operationId": "shop_patch_listings_shortId",
        "x-scope": "listings.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListingUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingUpdated"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not a listing of your shop (LISTING_NOT_FOUND)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Listings"
        ],
        "summary": "Remove a listing",
        "operationId": "shop_delete_listings_shortId",
        "x-scope": "listings.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/pricing": {
      "get": {
        "tags": [
          "Listings"
        ],
        "summary": "Price rules for your shop: currencies, limits and fees",
        "operationId": "shop_get_pricing",
        "x-scope": "listings.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/listings/{shortId}/submit": {
      "post": {
        "tags": [
          "Listings"
        ],
        "summary": "Send a draft for review (or live, when your shop may skip review)",
        "operationId": "shop_post_listings_shortId_submit",
        "x-scope": "listings.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/listings/{shortId}/duplicate": {
      "post": {
        "tags": [
          "Listings"
        ],
        "summary": "Copy a listing as a new draft",
        "operationId": "shop_post_listings_shortId_duplicate",
        "x-scope": "listings.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/listings/bulk": {
      "post": {
        "tags": [
          "Listings"
        ],
        "summary": "Pause, resume or change the price of up to 200 listings",
        "operationId": "shop_post_listings_bulk",
        "x-scope": "listings.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "shortIds",
                  "action"
                ],
                "properties": {
                  "shortIds": {
                    "type": "array",
                    "maxItems": 200,
                    "items": {
                      "type": "string"
                    }
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "pause",
                      "resume",
                      "price"
                    ]
                  },
                  "percent": {
                    "type": "number",
                    "minimum": -50,
                    "maximum": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "done": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "failed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "shortId": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/uploads": {
      "post": {
        "tags": [
          "Uploads"
        ],
        "summary": "Start an upload; send the file to the returned URL, then complete it. The scope follows the purpose: listings.write, orders.fulfill, chat.write or shop.write",
        "operationId": "shop_post_uploads",
        "x-scope": "listings.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "purpose",
                  "contentType",
                  "size"
                ],
                "properties": {
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "LISTING_IMAGE",
                      "DELIVERY_EVIDENCE",
                      "CHAT",
                      "SHOP_AVATAR",
                      "SHOP_BANNER"
                    ]
                  },
                  "contentType": {
                    "type": "string"
                  },
                  "size": {
                    "type": "integer"
                  },
                  "orderId": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/uploads/{id}/complete": {
      "post": {
        "tags": [
          "Uploads"
        ],
        "summary": "Finish an upload after the file was sent",
        "operationId": "shop_post_uploads_id_complete",
        "x-scope": "listings.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/bumps": {
      "get": {
        "tags": [
          "Promotions"
        ],
        "summary": "Bumps left today",
        "operationId": "shop_get_bumps",
        "x-scope": "promotions.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/listings/{shortId}/bump": {
      "post": {
        "tags": [
          "Promotions"
        ],
        "summary": "Bump a listing to the top of its list",
        "operationId": "shop_post_listings_shortId_bump",
        "x-scope": "promotions.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/featured": {
      "get": {
        "tags": [
          "Promotions"
        ],
        "summary": "Featured places: packages, yours and their state",
        "operationId": "shop_get_featured",
        "x-scope": "promotions.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Promotions"
        ],
        "summary": "Book a featured place with shop credit (off unless enabled for your shop); a code is emailed to the key owner",
        "operationId": "shop_post_featured",
        "x-scope": "promotions.spend",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "shortId",
                  "packageId",
                  "currency"
                ],
                "properties": {
                  "shortId": {
                    "type": "string"
                  },
                  "packageId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "THB",
                      "USD"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/featured/{id}/confirm": {
      "post": {
        "tags": [
          "Promotions"
        ],
        "summary": "Confirm a booking with the emailed code",
        "operationId": "shop_post_featured_id_confirm",
        "x-scope": "promotions.spend",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^\\d{6}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/stock": {
      "get": {
        "tags": [
          "Stock"
        ],
        "summary": "Stock of every automatic-delivery listing (counts, never the codes)",
        "operationId": "shop_get_stock",
        "x-scope": "stock.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/listings/{shortId}/stock": {
      "get": {
        "tags": [
          "Stock"
        ],
        "summary": "Units of one listing with masked hints",
        "operationId": "shop_get_listings_shortId_stock",
        "x-scope": "stock.read",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not a listing of your shop (LISTING_NOT_FOUND)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Stock"
        ],
        "summary": "Add codes or accounts (up to 200 per call)",
        "operationId": "shop_post_listings_shortId_stock",
        "x-scope": "stock.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 200,
                    "items": {
                      "type": "string",
                      "maxLength": 2000
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not a listing of your shop (LISTING_NOT_FOUND)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/listings/{shortId}/stock/{id}": {
      "delete": {
        "tags": [
          "Stock"
        ],
        "summary": "Take back one unsold unit",
        "operationId": "shop_delete_listings_shortId_stock_id",
        "x-scope": "stock.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          },
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/orders": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Orders, newest first, in pages",
        "operationId": "shop_get_orders",
        "x-scope": "orders.read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "PAID",
                "DELIVERED",
                "COMPLETED",
                "DISPUTED",
                "REFUNDED"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^OM[0-9A-Z]{10}$",
              "description": "nextCursor of the previous page"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Order"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/orders/{code}": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "One order",
        "operationId": "shop_get_orders_code",
        "x-scope": "orders.read",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrderCode"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not an order of your shop (ORDER_NOT_FOUND)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/orders/{code}/deliver": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Mark a manual order delivered, with evidence uploads",
        "operationId": "shop_post_orders_code_deliver",
        "x-scope": "orders.fulfill",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrderCode"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "evidenceIds"
                ],
                "properties": {
                  "evidenceIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not an order of your shop (ORDER_NOT_FOUND)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/orders/{code}/cancel": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Cancel a paid order you cannot fulfil (the buyer is refunded)",
        "operationId": "shop_post_orders_code_cancel",
        "x-scope": "orders.fulfill",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrderCode"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/orders/{code}/cancel-request/answer": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Answer the buyer's cancel request",
        "operationId": "shop_post_orders_code_cancel_request_answer",
        "x-scope": "orders.fulfill",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrderCode"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "accept"
                ],
                "properties": {
                  "accept": {
                    "type": "boolean"
                  },
                  "answer": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/chats": {
      "get": {
        "tags": [
          "Chat"
        ],
        "summary": "Your chats with the latest message and unread count",
        "operationId": "shop_get_chats",
        "x-scope": "chat.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/orders/{code}/chat": {
      "get": {
        "tags": [
          "Chat"
        ],
        "summary": "An order's chat, older pages with before",
        "operationId": "shop_get_orders_code_chat",
        "x-scope": "chat.read",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrderCode"
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/orders/{code}/chat/messages": {
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Send a message in an order chat",
        "operationId": "shop_post_orders_code_chat_messages",
        "x-scope": "chat.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrderCode"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatMessageInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/orders/{code}/chat/read": {
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Mark the chat read up to a time",
        "operationId": "shop_post_orders_code_chat_read",
        "x-scope": "chat.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrderCode"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "at"
                ],
                "properties": {
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/inquiries/{id}": {
      "get": {
        "tags": [
          "Chat"
        ],
        "summary": "A question from a buyer before buying",
        "operationId": "shop_get_inquiries_id",
        "x-scope": "chat.read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/inquiries/{id}/messages": {
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Answer a question",
        "operationId": "shop_post_inquiries_id_messages",
        "x-scope": "chat.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatMessageInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/inquiries/{id}/read": {
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Mark a question read",
        "operationId": "shop_post_inquiries_id_read",
        "x-scope": "chat.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "at"
                ],
                "properties": {
                  "at": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/reviews": {
      "get": {
        "tags": [
          "Reviews"
        ],
        "summary": "Reviews of your shop",
        "operationId": "shop_get_reviews",
        "x-scope": "reviews.read",
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "unanswered",
                "low",
                "appealed"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/reviews/{id}/reply": {
      "post": {
        "tags": [
          "Reviews"
        ],
        "summary": "Reply to a review (once)",
        "operationId": "shop_post_reviews_id_reply",
        "x-scope": "reviews.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "body"
                ],
                "properties": {
                  "body": {
                    "type": "string",
                    "maxLength": 1000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/disputes": {
      "get": {
        "tags": [
          "Disputes"
        ],
        "summary": "Open and recent disputes and warranty claims",
        "operationId": "shop_get_disputes",
        "x-scope": "disputes.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/orders/{code}/dispute": {
      "get": {
        "tags": [
          "Disputes"
        ],
        "summary": "The dispute on one order",
        "operationId": "shop_get_orders_code_dispute",
        "x-scope": "disputes.read",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrderCode"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not an order of your shop (ORDER_NOT_FOUND)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/orders/{code}/dispute/appeal": {
      "post": {
        "tags": [
          "Disputes"
        ],
        "summary": "Appeal a ruling once, within the appeal window",
        "operationId": "shop_post_orders_code_dispute_appeal",
        "x-scope": "disputes.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrderCode"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 1000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/orders/{code}/warranty-claims/{id}/resolve": {
      "post": {
        "tags": [
          "Disputes"
        ],
        "summary": "Answer a warranty claim: replace, refund or ask for help",
        "operationId": "shop_post_orders_code_warranty_claims_id_resolve",
        "x-scope": "disputes.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrderCode"
          },
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "REPLACE",
                      "REFUND",
                      "ESCALATE"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/analytics": {
      "get": {
        "tags": [
          "Shop"
        ],
        "summary": "Views, sales and conversion",
        "operationId": "shop_get_analytics",
        "x-scope": "analytics.read",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 7,
              "maximum": 90,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/balances": {
      "get": {
        "tags": [
          "Finance"
        ],
        "summary": "Shop credit: available, held and pending, per currency",
        "operationId": "shop_get_balances",
        "x-scope": "finance.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/statement": {
      "get": {
        "tags": [
          "Finance"
        ],
        "summary": "Every credit movement, newest first",
        "operationId": "shop_get_statement",
        "x-scope": "finance.read",
        "parameters": [
          {
            "name": "currency",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "THB",
                "USD"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/withdrawals": {
      "post": {
        "tags": [
          "Finance"
        ],
        "summary": "Ask for a withdrawal (off unless enabled for your shop). Nothing moves until the shop owner confirms it in the Seller Center with an emailed code",
        "operationId": "shop_post_withdrawals",
        "x-scope": "finance.withdraw",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "currency",
                  "amount",
                  "payoutAccountId"
                ],
                "properties": {
                  "currency": {
                    "type": "string",
                    "enum": [
                      "THB",
                      "USD"
                    ]
                  },
                  "amount": {
                    "type": "string",
                    "pattern": "^\\d{1,12}$"
                  },
                  "payoutAccountId": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WithdrawalRequest"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Finance"
        ],
        "summary": "Withdrawal requests made through the API",
        "operationId": "shop_get_withdrawals",
        "x-scope": "finance.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WithdrawalRequest"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/team": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Names and roles of your team (no emails)",
        "operationId": "shop_get_team",
        "x-scope": "team.read",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Your webhooks",
        "operationId": "shop_get_webhooks",
        "x-scope": "webhooks.manage",
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Webhook"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Add a webhook; the signing secret is returned once",
        "operationId": "shop_post_webhooks",
        "x-scope": "webhooks.manage",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreated"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/webhooks/{id}": {
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Change the address or the events",
        "operationId": "shop_patch_webhooks_id",
        "x-scope": "webhooks.manage",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook",
        "operationId": "shop_delete_webhooks_id",
        "x-scope": "webhooks.manage",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/webhooks/{id}/enable": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Turn a webhook back on after failures",
        "operationId": "shop_post_webhooks_id_enable",
        "x-scope": "webhooks.manage",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a ping now (5 a minute)",
        "operationId": "shop_post_webhooks_id_test",
        "x-scope": "webhooks.manage",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/webhook-deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delivery history of the last 30 days, newest first",
        "operationId": "shop_get_webhook_deliveries",
        "x-scope": "webhooks.manage",
        "parameters": [
          {
            "name": "webhookId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "DELIVERED",
                "FAILED"
              ]
            }
          },
          {
            "name": "event",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "order.created",
                "order.paid",
                "order.delivered",
                "order.completed",
                "order.cancelled",
                "order.refunded",
                "dispute.opened",
                "dispute.updated",
                "dispute.resolved",
                "warranty.claimed",
                "chat.message",
                "review.created",
                "listing.approved",
                "listing.rejected",
                "listing.out_of_stock",
                "stock.low",
                "payout.paid",
                "payout.failed",
                "shop.restricted",
                "shop.reinstated",
                "api_key.revoked"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/webhook-deliveries/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "One delivery with the body that was sent",
        "operationId": "shop_get_webhook_deliveries_id",
        "x-scope": "webhooks.manage",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shop/webhook-deliveries/{id}/redeliver": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a delivery again (10 a minute)",
        "operationId": "shop_post_webhook_deliveries_id_redeliver",
        "x-scope": "webhooks.manage",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Done. A repeated write with the same Idempotency-Key returns this answer again with the header idempotent-replayed: true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED), or the Idempotency-Key header is missing or malformed (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown, revoked or expired key (API_KEY_INVALID, API_KEY_EXPIRED), or a key of the other environment (API_KEY_WRONG_ENVIRONMENT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope (API_SCOPE_MISSING), the shop may not give it (API_SCOPE_NOT_ALLOWED), the person who made the key lost that permission (API_KEY_CREATOR_FORBIDDEN), the address is not on the key's list (API_KEY_IP_DENIED), API access is not approved or paused (API_ACCESS_NOT_APPROVED, SHOP_API_SUSPENDED), or the shop is restricted or paused (SHOP_RESTRICTED, SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The same Idempotency-Key is still being handled (IDEMPOTENCY_IN_PROGRESS), or the change is not possible now (the code says why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was used for a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (RATE_LIMITED): per key by your shop rank (120 a minute to start), all keys of a shop together 5 times that, 300 a minute per address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The API is paused for maintenance (API_DISABLED) or answers reads only for now (API_READ_ONLY)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/listings": {
      "get": {
        "tags": [
          "Older endpoints"
        ],
        "summary": "List your listings",
        "operationId": "listListings",
        "x-scope": "listings.read",
        "responses": {
          "200": {
            "description": "All listings of the shop",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Listing"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or the shop is restricted (SHOP_RESTRICTED) or paused for writes (SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: per key by your shop rank (120 a minute to start), 5 times that per shop, 300 per IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/listings/{shortId}": {
      "patch": {
        "tags": [
          "Older endpoints"
        ],
        "summary": "Change price, quantity or pause a listing",
        "operationId": "updateListing",
        "x-scope": "listings.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListingUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingUpdated"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or the shop is restricted (SHOP_RESTRICTED) or paused for writes (SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not your listing (LISTING_NOT_FOUND)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: per key by your shop rank (120 a minute to start), 5 times that per shop, 300 per IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/listings/{shortId}/stock": {
      "post": {
        "tags": [
          "Older endpoints"
        ],
        "summary": "Add delivery codes to an automatic-delivery listing",
        "operationId": "addStock",
        "x-scope": "stock.write",
        "parameters": [
          {
            "$ref": "#/components/parameters/ShortId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAdd"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Codes added (duplicates in the request are counted once)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "added"
                  ],
                  "properties": {
                    "added": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (VALIDATION_FAILED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or the shop is restricted (SHOP_RESTRICTED) or paused for writes (SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not your listing (LISTING_NOT_FOUND)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Not an automatic-delivery listing (STOCK_NOT_AUTO)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: per key by your shop rank (120 a minute to start), 5 times that per shop, 300 per IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/orders": {
      "get": {
        "tags": [
          "Older endpoints"
        ],
        "summary": "List orders, newest first",
        "operationId": "listOrders",
        "x-scope": "orders.read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "PAID",
                "DELIVERED",
                "COMPLETED",
                "DISPUTED",
                "REFUNDED"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Order"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or the shop is restricted (SHOP_RESTRICTED) or paused for writes (SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: per key by your shop rank (120 a minute to start), 5 times that per shop, 300 per IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/orders/{code}": {
      "get": {
        "tags": [
          "Older endpoints"
        ],
        "summary": "One order",
        "operationId": "getOrder",
        "x-scope": "orders.read",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z0-9-]{4,24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks the scope, or the shop is restricted (SHOP_RESTRICTED) or paused for writes (SHOP_PAUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not an order of your shop (ORDER_NOT_FOUND)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: per key by your shop rank (120 a minute to start), 5 times that per shop, 300 per IP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "order.created": {
      "post": {
        "summary": "order.created event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "order.created"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "order.paid": {
      "post": {
        "summary": "order.paid event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "order.paid"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "order.delivered": {
      "post": {
        "summary": "order.delivered event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "order.delivered"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "order.completed": {
      "post": {
        "summary": "order.completed event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "order.completed"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "order.cancelled": {
      "post": {
        "summary": "order.cancelled event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "order.cancelled"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "order.refunded": {
      "post": {
        "summary": "order.refunded event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "order.refunded"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "dispute.opened": {
      "post": {
        "summary": "dispute.opened event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "dispute.opened"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "dispute.updated": {
      "post": {
        "summary": "dispute.updated event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "dispute.updated"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "dispute.resolved": {
      "post": {
        "summary": "dispute.resolved event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "dispute.resolved"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "warranty.claimed": {
      "post": {
        "summary": "warranty.claimed event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "warranty.claimed"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "chat.message": {
      "post": {
        "summary": "chat.message event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "chat.message"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "review.created": {
      "post": {
        "summary": "review.created event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "review.created"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "listing.approved": {
      "post": {
        "summary": "listing.approved event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "listing.approved"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "listing.rejected": {
      "post": {
        "summary": "listing.rejected event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "listing.rejected"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "listing.out_of_stock": {
      "post": {
        "summary": "listing.out_of_stock event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "listing.out_of_stock"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "stock.low": {
      "post": {
        "summary": "stock.low event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "stock.low"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "payout.paid": {
      "post": {
        "summary": "payout.paid event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "payout.paid"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "payout.failed": {
      "post": {
        "summary": "payout.failed event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "payout.failed"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "shop.restricted": {
      "post": {
        "summary": "shop.restricted event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "shop.restricted"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "shop.reinstated": {
      "post": {
        "summary": "shop.reinstated event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "shop.reinstated"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "api_key.revoked": {
      "post": {
        "summary": "api_key.revoked event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "api_key.revoked"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    },
    "ping": {
      "post": {
        "summary": "ping event",
        "description": "Signed with X-Odinmax-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"t.body\" with your whsec_ secret>. Reply 2xx within 10 seconds; failures are retried 8 times over about two days. Every delivery is kept for 30 days and can be sent again.",
        "parameters": [
          {
            "name": "X-Odinmax-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Odinmax-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "ping"
            }
          },
          {
            "name": "X-Odinmax-Delivery",
            "in": "header",
            "required": true,
            "description": "Unique per delivery: use it to ignore repeats",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer odx_live_... (production) or odx_test_... (sandbox). Make keys in the Seller Center under API, after your shop is approved for the API. Scopes: shop.read, shop.write, listings.read, listings.write, stock.read, stock.write, orders.read, orders.fulfill, chat.read, chat.write, reviews.read, reviews.write, disputes.read, disputes.write, promotions.read, promotions.write, promotions.spend, analytics.read, finance.read, finance.withdraw, team.read, webhooks.manage."
      }
    },
    "parameters": {
      "OrderCode": {
        "name": "code",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^OM[0-9A-Z]{10}$"
        }
      },
      "Id": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "Any unique string (letters, digits, _ . : -), up to 255. A repeat within 24 hours returns the first answer.",
        "schema": {
          "type": "string",
          "maxLength": 255,
          "pattern": "^[A-Za-z0-9_.:-]{1,255}$"
        }
      },
      "ShortId": {
        "name": "shortId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9]{4,12}$"
        }
      }
    },
    "schemas": {
      "Me": {
        "type": "object",
        "properties": {
          "shop": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "shopSlug": {
                "type": "string"
              },
              "shopName": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "OPEN",
                  "PAUSED",
                  "CLOSED"
                ]
              }
            }
          },
          "key": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "prefix": {
                "type": "string",
                "examples": [
                  "odx_live_aB3dE9f"
                ]
              },
              "environment": {
                "type": "string",
                "enum": [
                  "live",
                  "test"
                ]
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "shop.read",
                    "shop.write",
                    "listings.read",
                    "listings.write",
                    "stock.read",
                    "stock.write",
                    "orders.read",
                    "orders.fulfill",
                    "chat.read",
                    "chat.write",
                    "reviews.read",
                    "reviews.write",
                    "disputes.read",
                    "disputes.write",
                    "promotions.read",
                    "promotions.write",
                    "promotions.spend",
                    "analytics.read",
                    "finance.read",
                    "finance.withdraw",
                    "team.read",
                    "webhooks.manage"
                  ]
                }
              }
            }
          },
          "rateLimit": {
            "type": "object",
            "properties": {
              "requestsPerMinute": {
                "type": "integer",
                "examples": [
                  120
                ]
              }
            }
          }
        }
      },
      "ListingInput": {
        "type": "object",
        "description": "The same fields as the Seller Center listing form. Also: tags, warrantyHours, autoReplace, attributes (per category), priceTiers, saleBps, saleEndsAt, mapId, mapCustom.",
        "required": [
          "categoryFullSlug",
          "type",
          "deliveryMode",
          "title",
          "quantity",
          "imageIds",
          "attributes"
        ],
        "properties": {
          "categoryFullSlug": {
            "type": "string",
            "examples": [
              "genshin-impact/accounts/all/general"
            ]
          },
          "topupMode": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "DIRECT",
              "EPIN",
              null
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "TOPUP",
              "ACCOUNT",
              "ITEM",
              "COIN",
              "SERVICE"
            ]
          },
          "deliveryMode": {
            "type": "string",
            "enum": [
              "AUTO",
              "MANUAL",
              "ORDER"
            ]
          },
          "title": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per language: th, en, ..."
          },
          "description": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "price": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "enum": [
                  "THB",
                  "USD",
                  "EUR",
                  "PHP",
                  "IDR",
                  "CNY"
                ]
              },
              "amount": {
                "type": "string",
                "pattern": "^\\d{1,12}$"
              }
            }
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9999
          },
          "imageIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 15,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "attributes": {
            "type": "object"
          }
        }
      },
      "ChatMessageInput": {
        "type": "object",
        "required": [
          "clientId"
        ],
        "properties": {
          "clientId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{8,64}$",
            "description": "Yours; sending the same id again never makes a second message"
          },
          "body": {
            "type": "string",
            "maxLength": 2000
          },
          "attachmentIds": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "WebhookInput": {
        "type": "object",
        "required": [
          "url",
          "events"
        ],
        "properties": {
          "url": {
            "type": "string",
            "examples": [
              "https://hooks.your-shop.example/odinmax"
            ]
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "order.created",
                "order.paid",
                "order.delivered",
                "order.completed",
                "order.cancelled",
                "order.refunded",
                "dispute.opened",
                "dispute.updated",
                "dispute.resolved",
                "warranty.claimed",
                "chat.message",
                "review.created",
                "listing.approved",
                "listing.rejected",
                "listing.out_of_stock",
                "stock.low",
                "payout.paid",
                "payout.failed",
                "shop.restricted",
                "shop.reinstated",
                "api_key.revoked"
              ]
            }
          }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isActive": {
            "type": "boolean"
          },
          "disabledReason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "FAILURES",
              "ACCESS_REVOKED",
              "SHOP_CLOSED",
              null
            ]
          },
          "lastDeliveryAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastStatus": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "WebhookCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "secret": {
            "type": "string",
            "examples": [
              "whsec_..."
            ],
            "description": "Shown once"
          }
        }
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "webhookId": {
            "type": "string"
          },
          "event": {
            "type": "string",
            "enum": [
              "order.created",
              "order.paid",
              "order.delivered",
              "order.completed",
              "order.cancelled",
              "order.refunded",
              "dispute.opened",
              "dispute.updated",
              "dispute.resolved",
              "warranty.claimed",
              "chat.message",
              "review.created",
              "listing.approved",
              "listing.rejected",
              "listing.out_of_stock",
              "stock.low",
              "payout.paid",
              "payout.failed",
              "shop.restricted",
              "shop.reinstated",
              "api_key.revoked",
              "ping"
            ]
          },
          "eventId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "DELIVERED",
              "FAILED"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "lastStatus": {
            "type": [
              "integer",
              "null"
            ]
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "nextAttemptAt": {
            "type": "string",
            "format": "date-time"
          },
          "deliveredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WithdrawalRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING_OWNER",
              "CONFIRMED",
              "DECLINED",
              "EXPIRED"
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "THB",
              "USD"
            ]
          },
          "amount": {
            "type": "string",
            "pattern": "^[0-9]+$",
            "description": "Minor units"
          },
          "payoutAccountId": {
            "type": "string"
          },
          "withdrawalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Money": {
        "type": "object",
        "required": [
          "amount",
          "currency"
        ],
        "description": "Money in minor units (satang / cents) as a string, never a float.",
        "properties": {
          "amount": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "examples": [
              "35500"
            ]
          },
          "currency": {
            "type": "string",
            "enum": [
              "THB",
              "USD"
            ]
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "code"
        ],
        "description": "Errors carry a stable code, never a sentence.",
        "properties": {
          "code": {
            "type": "string",
            "examples": [
              "RATE_LIMITED"
            ]
          }
        }
      },
      "Listing": {
        "type": "object",
        "required": [
          "shortId",
          "status",
          "title",
          "type",
          "deliveryMode",
          "priceTh",
          "priceIntl",
          "quantityAvailable"
        ],
        "properties": {
          "shortId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PENDING_REVIEW",
              "ACTIVE",
              "HIDDEN",
              "SOLD_OUT",
              "SOLD",
              "REJECTED"
            ]
          },
          "title": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per language: th, en, ..."
          },
          "type": {
            "type": "string",
            "enum": [
              "TOPUP",
              "ACCOUNT",
              "ITEM",
              "COIN",
              "SERVICE"
            ]
          },
          "deliveryMode": {
            "type": "string",
            "enum": [
              "AUTO",
              "MANUAL",
              "ORDER"
            ]
          },
          "priceTh": {
            "$ref": "#/components/schemas/Money"
          },
          "priceIntl": {
            "$ref": "#/components/schemas/Money"
          },
          "price": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "type": "null"
              }
            ],
            "description": "The price as the shop set it, in any supported currency. priceTh and priceIntl are converted from it at the current exchange rate."
          },
          "priceThCustom": {
            "type": "boolean",
            "description": "True when the shop set its own THB price for Thai payment methods."
          },
          "quantityAvailable": {
            "type": "integer"
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "salesCount": {
            "type": "integer"
          },
          "moderationNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ListingUpdate": {
        "type": "object",
        "description": "Only the fields you send change.",
        "properties": {
          "price": {
            "type": "object",
            "required": [
              "currency",
              "amount"
            ],
            "description": "The new price in any supported currency, in its minor units (e.g. \"1250\" EUR = 12.50). THB and USD prices follow the exchange rate.",
            "properties": {
              "currency": {
                "type": "string",
                "enum": [
                  "THB",
                  "USD",
                  "EUR",
                  "PHP",
                  "IDR",
                  "CNY"
                ]
              },
              "amount": {
                "type": "string",
                "pattern": "^\\d{1,12}$"
              }
            }
          },
          "priceTh": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{1,12}$",
            "description": "Your own THB price in satang for Thai payment methods, where the platform allows it; null goes back to the converted price."
          },
          "priceIntl": {
            "type": "string",
            "pattern": "^\\d{1,12}$",
            "description": "Older form: a USD price in cents (the same as price with currency USD)."
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9999,
            "description": "Manual-delivery listings"
          },
          "paused": {
            "type": "boolean"
          }
        }
      },
      "ListingUpdated": {
        "type": "object",
        "required": [
          "shortId",
          "status",
          "quantityAvailable"
        ],
        "properties": {
          "shortId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "quantityAvailable": {
            "type": "integer"
          }
        }
      },
      "StockAdd": {
        "type": "object",
        "required": [
          "codes"
        ],
        "properties": {
          "codes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          }
        }
      },
      "Order": {
        "type": "object",
        "required": [
          "code",
          "status",
          "subtotal",
          "commission",
          "createdAt",
          "items"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "subtotal": {
            "$ref": "#/components/schemas/Money"
          },
          "commission": {
            "$ref": "#/components/schemas/Money"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "paidAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deliveredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "autoConfirmAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "shortId": {
                  "type": "string"
                },
                "title": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "quantity": {
                  "type": "integer"
                },
                "unitPrice": {
                  "$ref": "#/components/schemas/Money"
                }
              }
            }
          }
        }
      },
      "WebhookEvent": {
        "type": "object",
        "required": [
          "id",
          "type",
          "createdAt",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "order.created",
              "order.paid",
              "order.delivered",
              "order.completed",
              "order.cancelled",
              "order.refunded",
              "dispute.opened",
              "dispute.updated",
              "dispute.resolved",
              "warranty.claimed",
              "chat.message",
              "review.created",
              "listing.approved",
              "listing.rejected",
              "listing.out_of_stock",
              "stock.low",
              "payout.paid",
              "payout.failed",
              "shop.restricted",
              "shop.reinstated",
              "api_key.revoked",
              "ping"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "description": "No buyer email or name",
            "properties": {
              "order": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  },
                  "subtotal": {
                    "$ref": "#/components/schemas/Money"
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
