{
  "openapi": "3.1.0",
  "info": {
    "title": "EasyOrders Admin API",
    "version": "v1",
    "summary": "Read and write a merchant's store data from your app.",
    "description": "The EasyOrders Admin API lets an installed app work with one merchant's\nstore: its orders, shipping settings and shipping areas, within the\nscopes the merchant approved.\n\n- Every request needs an access token (`Authorization: Bearer eo_at_...`)\n  from the OAuth flow. A token works on one store only.\n- Request and response bodies are JSON. Unknown fields and query\n  parameters are refused.\n- Errors share one shape: `{\"error\": {\"code\", \"message\", \"details\"}}`.\n- `v1` is stable: new fields and endpoints are added to it; a breaking\n  change ships as a new version.\n",
    "contact": {
      "name": "EasyOrders developers",
      "url": "https://easyorders.eg"
    }
  },
  "servers": [
    {
      "url": "https://api.easy-orders.net/api/partners-apps/v1",
      "description": "Production"
    }
  ],
  "security": [
    {
      "accessToken": []
    }
  ],
  "tags": [
    {
      "name": "Article categories",
      "description": "The categories of the store's blog, which articles name in their `category_ids`."
    },
    {
      "name": "Articles",
      "description": "The articles of the store's blog, with HTML content, tags and categories."
    },
    {
      "name": "Billing",
      "description": "Your app's plan subscription and usage wallet on the store, and debiting the wallet by usage."
    },
    {
      "name": "Categories",
      "description": "The store's product categories and subcategories."
    },
    {
      "name": "Checkout fields",
      "description": "The fields of the store's checkout form, their labels, order, and whether they show and are required."
    },
    {
      "name": "Coupons",
      "description": "The store's coupons, by code or automatic, and the products, variants and categories they apply to."
    },
    {
      "name": "Labels",
      "description": "Your app's short colored words on orders and products, shown in the merchant's orders and products tables."
    },
    {
      "name": "Missed orders",
      "description": "Checkouts the shopper started and did not finish, to follow up and recover."
    },
    {
      "name": "Orders",
      "description": "The store's orders, their status, payment status and notes."
    },
    {
      "name": "Pages",
      "description": "The store's pages, such as About us or the return policy, with HTML content."
    },
    {
      "name": "Products",
      "description": "The store's products, their options, variants and stock."
    },
    {
      "name": "Reviews",
      "description": "The reviews of the store's products, and which of them the product page shows."
    },
    {
      "name": "Shipping",
      "description": "The store's shipping settings and shipping areas (governorates)."
    },
    {
      "name": "Store",
      "description": "The store the access token belongs to, its addresses, currency, language and plan."
    }
  ],
  "paths": {
    "/article-categories": {
      "get": {
        "tags": [
          "Article categories"
        ],
        "operationId": "listArticleCategories",
        "summary": "List article categories",
        "description": "**Scope:** [`read_content`](/scopes)\n\nLists the store's article categories, oldest first unless\n`sort=created_at,DESC`.\n\nFilter with `filter=field||$op||value` (repeatable, all must match):\n\n| Field | Operators |\n|---|---|\n| `slug` | `$eq`, `$in` |\n| `name` | `$eq`, `$cont` |\n| `created_at` | `$gt`, `$gte`, `$lt`, `$lte` |\n\n`$in` takes comma-separated values, up to 50. Up to 10 filters per\nrequest. To list the articles of a category, use\n[List articles](/api-reference/articles/list-articles) with\n`filter=category_id||$eq||<id>`.\n",
        "x-scope": "read_content",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Sort"
          },
          {
            "$ref": "#/components/parameters/CreatedSince"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "A filter, `field||$op||value`. Repeat it to combine filters.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "example": [
              "name||$cont||guide"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "A page of article categories.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ArticleCategory"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as `cursor` for the next page; `null` on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20",
                      "name": "Buying guides",
                      "slug": "buying-guides",
                      "description": "How to pick the right product for you.",
                      "created_at": "2026-11-15T10:00:00Z",
                      "updated_at": "2026-11-15T10:00:00Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/article-categories\" \\\n  --data-urlencode \"limit=20\" \\\n  --data-urlencode \"filter=name||\\$cont||guide\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['limit', '20'],\n  ['filter', 'name||$cont||guide'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/article-categories?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"limit\", \"20\")\n\tquery.Add(\"filter\", \"name||$cont||guide\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/article-categories?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'limit' => '20',\n    'filter' => 'name||$cont||guide',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/article-categories?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/article-categories\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"limit\", \"20\"),\n        (\"filter\", \"name||$cont||guide\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Article categories"
        ],
        "operationId": "createArticleCategory",
        "summary": "Create an article category",
        "description": "**Scope:** [`write_content`](/scopes)\n\nCreates an article category. `name` is required.\n\n- Without `slug`, one is made from the name. A `slug` another article\n  category of the store has answers `409 slug_taken`.\n- `description` is plain text: `<` is refused.\n\nSend an `Idempotency-Key` to retry safely.\n",
        "x-scope": "write_content",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "$ref": "#/components/schemas/ArticleCategoryName"
                  },
                  "slug": {
                    "$ref": "#/components/schemas/ArticleCategorySlug"
                  },
                  "description": {
                    "$ref": "#/components/schemas/ArticleCategoryDescription"
                  }
                }
              },
              "example": {
                "name": "Buying guides",
                "description": "How to pick the right product for you."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The category created. `Location` is its path.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the saved answer of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "article_category"
                  ],
                  "properties": {
                    "article_category": {
                      "$ref": "#/components/schemas/ArticleCategory"
                    }
                  }
                },
                "example": {
                  "article_category": {
                    "id": "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20",
                    "name": "Buying guides",
                    "slug": "buying-guides",
                    "description": "How to pick the right product for you.",
                    "created_at": "2026-11-15T10:00:00Z",
                    "updated_at": "2026-11-15T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "description": "`slug_taken`, or `idempotency_in_progress` while a request with the same `Idempotency-Key` is still running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "slug_taken",
                    "message": "Another article category of the store has this slug"
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/article-categories\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: blog-category-buying-guides\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"Buying guides\",\n  \"description\": \"How to pick the right product for you.\"\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/article-categories', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'blog-category-buying-guides',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    name: 'Buying guides',\n    description: 'How to pick the right product for you.',\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { article_category } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"name\": \"Buying guides\",\n\t  \"description\": \"How to pick the right product for you.\"\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/article-categories\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"blog-category-buying-guides\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"article_category\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/article-categories');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: blog-category-buying-guides',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'Buying guides',\n        'description' => 'How to pick the right product for you.',\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$articleCategory = $answer['article_category'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/article-categories\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"blog-category-buying-guides\",\n    },\n    json={\n        \"name\": \"Buying guides\",\n        \"description\": \"How to pick the right product for you.\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\narticle_category = answer[\"article_category\"]"
          }
        ]
      }
    },
    "/article-categories/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ArticleCategoryID"
        }
      ],
      "get": {
        "tags": [
          "Article categories"
        ],
        "operationId": "getArticleCategory",
        "summary": "Get an article category",
        "description": "**Scope:** [`read_content`](/scopes)\n\nReads one article category.",
        "x-scope": "read_content",
        "responses": {
          "200": {
            "$ref": "#/components/responses/ArticleCategoryOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "The request has a query parameter; this endpoint takes none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "validation_failed",
                    "message": "Validation failed",
                    "details": {
                      "fields": [
                        {
                          "field": "join",
                          "rule": "unknown"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { article_category } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"article_category\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$articleCategory = $answer['article_category'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\narticle_category = answer[\"article_category\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Article categories"
        ],
        "operationId": "updateArticleCategory",
        "summary": "Update an article category",
        "description": "**Scope:** [`write_content`](/scopes)\n\nChanges only the fields you send; `null` is refused. Changing the\nname does not change the slug: send `slug` to change it. A `slug`\nanother article category of the store has answers `409 slug_taken`.\n",
        "x-scope": "write_content",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "$ref": "#/components/schemas/ArticleCategoryName"
                  },
                  "slug": {
                    "$ref": "#/components/schemas/ArticleCategorySlug"
                  },
                  "description": {
                    "$ref": "#/components/schemas/ArticleCategoryDescription"
                  }
                }
              },
              "example": {
                "description": "Short guides to help you pick the right product."
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ArticleCategoryOK"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`slug_taken`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "slug_taken",
                    "message": "Another article category of the store has this slug"
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"description\": \"Short guides to help you pick the right product.\"\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    description: 'Short guides to help you pick the right product.',\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { article_category } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"description\": \"Short guides to help you pick the right product.\"\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"article_category\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'description' => 'Short guides to help you pick the right product.',\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$articleCategory = $answer['article_category'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"description\": \"Short guides to help you pick the right product.\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\narticle_category = answer[\"article_category\"]"
          }
        ]
      },
      "delete": {
        "tags": [
          "Article categories"
        ],
        "operationId": "deleteArticleCategory",
        "summary": "Delete an article category",
        "description": "**Scope:** [`write_content`](/scopes)\n\nDeletes the category for good, as the merchant's dashboard does.\nIts articles stay: the category leaves their `category_ids`. There\nis no undo.\n",
        "x-scope": "write_content",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nif (!response.ok) {\n  const { error } = await response.json()\n  throw new Error(`${error.code}: ${error.message}`)\n}"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode >= 300 {\n\t\tvar answer map[string]any\n\t\t_ = json.NewDecoder(res.Body).Decode(&answer)\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(res.Status)\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.easy-orders.net/api/partners-apps/v1/article-categories/4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nif not response.ok:\n    error = response.json()[\"error\"]\n    raise RuntimeError(f\"{error['code']}: {error['message']}\")"
          }
        ]
      }
    },
    "/articles": {
      "get": {
        "tags": [
          "Articles"
        ],
        "operationId": "listArticles",
        "summary": "List articles",
        "description": "**Scope:** [`read_content`](/scopes)\n\nLists the store's articles, oldest first unless\n`sort=created_at,DESC`. A list leaves out each article's `content`:\nread it with [Get an article](/api-reference/articles/get-an-article).\n\nFilter with `filter=field||$op||value` (repeatable, all must match):\n\n| Field | Operators |\n|---|---|\n| `slug` | `$eq`, `$in` |\n| `title` | `$eq`, `$cont` |\n| `published` | `$eq` |\n| `is_need_review` | `$eq` |\n| `category_id` | `$eq`, `$in` |\n| `created_at` | `$gt`, `$gte`, `$lt`, `$lte` |\n\n`category_id` keeps the articles in that category (or in one of\nthem, with `$in`). `$in` takes comma-separated values, up to 50. Up\nto 10 filters per request.\n\nEvery article has its `category_ids`; `join=categories` adds\n`categories`, each with its `id`, `name` and `slug`.\n",
        "x-scope": "read_content",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Sort"
          },
          {
            "$ref": "#/components/parameters/CreatedSince"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "A filter, `field||$op||value`. Repeat it to combine filters.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "example": [
              "published||$eq||true"
            ]
          },
          {
            "$ref": "#/components/parameters/ArticleJoin"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of articles, without their content.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Article"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as `cursor` for the next page; `null` on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50",
                      "title": "How to choose a winter jacket",
                      "slug": "how-to-choose-a-winter-jacket",
                      "description": "Five things to check before you buy a jacket for the cold months.",
                      "meta_description": "A short guide to choosing a warm, waterproof winter jacket.",
                      "thumbnail": "https://cdn.example.com/blog/winter-jacket.jpg",
                      "tags": [
                        "winter",
                        "guides"
                      ],
                      "published": true,
                      "is_need_review": false,
                      "category_ids": [
                        "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20"
                      ],
                      "categories": [
                        {
                          "id": "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20",
                          "name": "Buying guides",
                          "slug": "buying-guides"
                        }
                      ],
                      "created_at": "2026-11-28T08:00:00Z",
                      "updated_at": "2026-12-02T14:10:00Z"
                    }
                  ],
                  "next_cursor": "Ab3kZ2l..."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/articles\" \\\n  --data-urlencode \"limit=20\" \\\n  --data-urlencode \"filter=published||\\$eq||true\" \\\n  --data-urlencode \"join=categories\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['limit', '20'],\n  ['filter', 'published||$eq||true'],\n  ['join', 'categories'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/articles?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"limit\", \"20\")\n\tquery.Add(\"filter\", \"published||$eq||true\")\n\tquery.Add(\"join\", \"categories\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/articles?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'limit' => '20',\n    'filter' => 'published||$eq||true',\n    'join' => 'categories',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/articles?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/articles\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"limit\", \"20\"),\n        (\"filter\", \"published||$eq||true\"),\n        (\"join\", \"categories\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Articles"
        ],
        "operationId": "createArticle",
        "summary": "Create an article",
        "description": "**Scope:** [`write_content`](/scopes)\n\nCreates an article. `title`, `description` and `content` are\nrequired. It starts unpublished unless you send `published: true`.\n\n- `content` is HTML, up to 51,200 bytes as sent. Unsafe HTML is\n  removed before it is saved, and the answer holds the cleaned\n  content. Content that cleaning leaves empty is refused. See\n  [HTML content](/api-reference/articles/overview#html-content).\n- `description` and `meta_description` are plain text: `<` is refused.\n- Without `slug`, one is made from the title. A `slug` another\n  article of the store has answers `409 slug_taken`.\n- Each of `category_ids` must be an article category of the store,\n  or the answer is `422` with the rule `article_category`.\n- The text goes through an AI content check, which can take up to 15\n  seconds. When it flags the text, the article is saved anyway, as\n  sent, with `is_need_review: true`.\n\nSend an `Idempotency-Key` to retry safely.\n",
        "x-scope": "write_content",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArticleCreate"
              },
              "example": {
                "title": "How to choose a winter jacket",
                "description": "Five things to check before you buy a jacket for the cold months.",
                "content": "<h2>1. Insulation</h2><p>Down keeps you warmest for its weight.</p><img src=\"https://cdn.example.com/blog/down.jpg\" alt=\"Down jacket\">",
                "meta_description": "A short guide to choosing a warm, waterproof winter jacket.",
                "thumbnail": "https://cdn.example.com/blog/winter-jacket.jpg",
                "tags": [
                  "winter",
                  "guides"
                ],
                "published": true,
                "category_ids": [
                  "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The article created. `Location` is its path.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the saved answer of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "article"
                  ],
                  "properties": {
                    "article": {
                      "$ref": "#/components/schemas/Article"
                    }
                  }
                },
                "example": {
                  "article": {
                    "id": "8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50",
                    "title": "How to choose a winter jacket",
                    "slug": "how-to-choose-a-winter-jacket",
                    "description": "Five things to check before you buy a jacket for the cold months.",
                    "content": "<h2>1. Insulation</h2><p>Down keeps you warmest for its weight.</p><img src=\"https://cdn.example.com/blog/down.jpg\" alt=\"Down jacket\">",
                    "meta_description": "A short guide to choosing a warm, waterproof winter jacket.",
                    "thumbnail": "https://cdn.example.com/blog/winter-jacket.jpg",
                    "tags": [
                      "winter",
                      "guides"
                    ],
                    "published": true,
                    "is_need_review": false,
                    "category_ids": [
                      "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20"
                    ],
                    "created_at": "2026-11-28T08:00:00Z",
                    "updated_at": "2026-11-28T08:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "description": "`slug_taken`, or `idempotency_in_progress` while a request with the same `Idempotency-Key` is still running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "slug_taken",
                    "message": "Another article of the store has this slug"
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ArticleBodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ArticleValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/articles\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: post-winter-jacket-guide\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"title\": \"How to choose a winter jacket\",\n  \"description\": \"Five things to check before you buy a jacket for the cold months.\",\n  \"content\": \"<h2>1. Insulation</h2><p>Down keeps you warmest for its weight.</p><img src=\\\"https://cdn.example.com/blog/down.jpg\\\" alt=\\\"Down jacket\\\">\",\n  \"meta_description\": \"A short guide to choosing a warm, waterproof winter jacket.\",\n  \"thumbnail\": \"https://cdn.example.com/blog/winter-jacket.jpg\",\n  \"tags\": [\n    \"winter\",\n    \"guides\"\n  ],\n  \"published\": true,\n  \"category_ids\": [\n    \"4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\"\n  ]\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/articles', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'post-winter-jacket-guide',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    title: 'How to choose a winter jacket',\n    description: 'Five things to check before you buy a jacket for the cold months.',\n    content: '<h2>1. Insulation</h2><p>Down keeps you warmest for its weight.</p><img src=\"https://cdn.example.com/blog/down.jpg\" alt=\"Down jacket\">',\n    meta_description: 'A short guide to choosing a warm, waterproof winter jacket.',\n    thumbnail: 'https://cdn.example.com/blog/winter-jacket.jpg',\n    tags: [\n      'winter',\n      'guides',\n    ],\n    published: true,\n    category_ids: [\n      '4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20',\n    ],\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { article } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"title\": \"How to choose a winter jacket\",\n\t  \"description\": \"Five things to check before you buy a jacket for the cold months.\",\n\t  \"content\": \"<h2>1. Insulation</h2><p>Down keeps you warmest for its weight.</p><img src=\\\"https://cdn.example.com/blog/down.jpg\\\" alt=\\\"Down jacket\\\">\",\n\t  \"meta_description\": \"A short guide to choosing a warm, waterproof winter jacket.\",\n\t  \"thumbnail\": \"https://cdn.example.com/blog/winter-jacket.jpg\",\n\t  \"tags\": [\n\t    \"winter\",\n\t    \"guides\"\n\t  ],\n\t  \"published\": true,\n\t  \"category_ids\": [\n\t    \"4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\"\n\t  ]\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/articles\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"post-winter-jacket-guide\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"article\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/articles');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: post-winter-jacket-guide',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'title' => 'How to choose a winter jacket',\n        'description' => 'Five things to check before you buy a jacket for the cold months.',\n        'content' => '<h2>1. Insulation</h2><p>Down keeps you warmest for its weight.</p><img src=\"https://cdn.example.com/blog/down.jpg\" alt=\"Down jacket\">',\n        'meta_description' => 'A short guide to choosing a warm, waterproof winter jacket.',\n        'thumbnail' => 'https://cdn.example.com/blog/winter-jacket.jpg',\n        'tags' => [\n            'winter',\n            'guides',\n        ],\n        'published' => true,\n        'category_ids' => [\n            '4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20',\n        ],\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$article = $answer['article'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/articles\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"post-winter-jacket-guide\",\n    },\n    json={\n        \"title\": \"How to choose a winter jacket\",\n        \"description\": \"Five things to check before you buy a jacket for the cold months.\",\n        \"content\": \"<h2>1. Insulation</h2><p>Down keeps you warmest for its weight.</p><img src=\\\"https://cdn.example.com/blog/down.jpg\\\" alt=\\\"Down jacket\\\">\",\n        \"meta_description\": \"A short guide to choosing a warm, waterproof winter jacket.\",\n        \"thumbnail\": \"https://cdn.example.com/blog/winter-jacket.jpg\",\n        \"tags\": [\n            \"winter\",\n            \"guides\",\n        ],\n        \"published\": True,\n        \"category_ids\": [\n            \"4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\",\n        ],\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\narticle = answer[\"article\"]"
          }
        ]
      }
    },
    "/articles/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ArticleID"
        }
      ],
      "get": {
        "tags": [
          "Articles"
        ],
        "operationId": "getArticle",
        "summary": "Get an article",
        "description": "**Scope:** [`read_content`](/scopes)\n\nReads one article, with its `content`. `join=categories` adds its\n`categories`.\n",
        "x-scope": "read_content",
        "parameters": [
          {
            "$ref": "#/components/parameters/ArticleJoin"
          }
        ],
        "responses": {
          "200": {
            "description": "The article, with its content.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "article"
                  ],
                  "properties": {
                    "article": {
                      "$ref": "#/components/schemas/Article"
                    }
                  }
                },
                "example": {
                  "article": {
                    "id": "8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50",
                    "title": "How to choose a winter jacket",
                    "slug": "how-to-choose-a-winter-jacket",
                    "description": "Five things to check before you buy a jacket for the cold months.",
                    "content": "<h2>1. Insulation</h2><p>Down keeps you warmest for its weight.</p><img src=\"https://cdn.example.com/blog/down.jpg\" alt=\"Down jacket\">",
                    "meta_description": "A short guide to choosing a warm, waterproof winter jacket.",
                    "thumbnail": "https://cdn.example.com/blog/winter-jacket.jpg",
                    "tags": [
                      "winter",
                      "guides"
                    ],
                    "published": true,
                    "is_need_review": false,
                    "category_ids": [
                      "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20"
                    ],
                    "categories": [
                      {
                        "id": "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20",
                        "name": "Buying guides",
                        "slug": "buying-guides"
                      }
                    ],
                    "created_at": "2026-11-28T08:00:00Z",
                    "updated_at": "2026-11-28T08:00:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50\" \\\n  --data-urlencode \"join=categories\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['join', 'categories'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { article } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"join\", \"categories\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"article\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'join' => 'categories',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$article = $answer['article'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"join\", \"categories\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\narticle = answer[\"article\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Articles"
        ],
        "operationId": "updateArticle",
        "summary": "Update an article",
        "description": "**Scope:** [`write_content`](/scopes)\n\nChanges only the fields you send; `null` is refused.\n\n- `tags` and `category_ids` replace the article's whole list; `[]`\n  empties it.\n- `content` is cleaned of unsafe HTML, as on create, and the answer\n  holds the cleaned content.\n- Changing the title does not change the slug: send `slug` to change\n  it. A `slug` another article of the store has answers\n  `409 slug_taken`.\n- `thumbnail: \"\"` removes the thumbnail.\n- Changing the title, description, meta description, tags or content\n  runs the AI content check again. A flag sets `is_need_review: true`;\n  a passing check never sets it back to `false`.\n",
        "x-scope": "write_content",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArticleUpdate"
              },
              "example": {
                "tags": [
                  "winter",
                  "guides",
                  "jackets"
                ],
                "category_ids": [
                  "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The article, with its content.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "article"
                  ],
                  "properties": {
                    "article": {
                      "$ref": "#/components/schemas/Article"
                    }
                  }
                },
                "example": {
                  "article": {
                    "id": "8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50",
                    "title": "How to choose a winter jacket",
                    "slug": "how-to-choose-a-winter-jacket",
                    "description": "Five things to check before you buy a jacket for the cold months.",
                    "content": "<h2>1. Insulation</h2><p>Down keeps you warmest for its weight.</p><img src=\"https://cdn.example.com/blog/down.jpg\" alt=\"Down jacket\">",
                    "meta_description": "A short guide to choosing a warm, waterproof winter jacket.",
                    "thumbnail": "https://cdn.example.com/blog/winter-jacket.jpg",
                    "tags": [
                      "winter",
                      "guides"
                    ],
                    "published": true,
                    "is_need_review": false,
                    "category_ids": [
                      "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20"
                    ],
                    "created_at": "2026-11-28T08:00:00Z",
                    "updated_at": "2026-11-28T08:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`slug_taken`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "slug_taken",
                    "message": "Another article of the store has this slug"
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ArticleBodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ArticleValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"tags\": [\n    \"winter\",\n    \"guides\",\n    \"jackets\"\n  ],\n  \"category_ids\": [\n    \"4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\"\n  ]\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    tags: [\n      'winter',\n      'guides',\n      'jackets',\n    ],\n    category_ids: [\n      '4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20',\n    ],\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { article } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"tags\": [\n\t    \"winter\",\n\t    \"guides\",\n\t    \"jackets\"\n\t  ],\n\t  \"category_ids\": [\n\t    \"4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\"\n\t  ]\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"article\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'tags' => [\n            'winter',\n            'guides',\n            'jackets',\n        ],\n        'category_ids' => [\n            '4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20',\n        ],\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$article = $answer['article'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"tags\": [\n            \"winter\",\n            \"guides\",\n            \"jackets\",\n        ],\n        \"category_ids\": [\n            \"4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20\",\n        ],\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\narticle = answer[\"article\"]"
          }
        ]
      },
      "delete": {
        "tags": [
          "Articles"
        ],
        "operationId": "deleteArticle",
        "summary": "Delete an article",
        "description": "**Scope:** [`write_content`](/scopes)\n\nDeletes the article for good, with its links to its categories, as\nthe merchant's dashboard does. The categories stay. There is no\nundo; to take an article off the blog and keep it, set\n`published: false` instead.\n",
        "x-scope": "write_content",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nif (!response.ok) {\n  const { error } = await response.json()\n  throw new Error(`${error.code}: ${error.message}`)\n}"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode >= 300 {\n\t\tvar answer map[string]any\n\t\t_ = json.NewDecoder(res.Body).Decode(&answer)\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(res.Status)\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.easy-orders.net/api/partners-apps/v1/articles/8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nif not response.ok:\n    error = response.json()[\"error\"]\n    raise RuntimeError(f\"{error['code']}: {error['message']}\")"
          }
        ]
      }
    },
    "/billing": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "getBilling",
        "summary": "Get billing",
        "description": "**Scope:** none. Every app can call it.\n\nYour app's subscription on the store (`null` when your app has no\nplans) and its usage wallet. Takes no query parameters.\n\nWorks while the subscription is `suspended`, when the rest of the API\nanswers `402`, so your app can see why.\n",
        "x-scope": "none",
        "responses": {
          "200": {
            "description": "Your app's billing on the store.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "billing"
                  ],
                  "properties": {
                    "billing": {
                      "$ref": "#/components/schemas/Billing"
                    }
                  }
                },
                "example": {
                  "billing": {
                    "subscription": {
                      "plan_id": "plan_pro",
                      "plan_name": "Pro",
                      "price": "19.00",
                      "status": "active",
                      "trial_ends_at": null,
                      "current_period_start": "2026-11-20T10:00:00Z",
                      "current_period_end": "2026-12-20T10:00:00Z",
                      "pending_plan_id": null,
                      "pending_plan_price": null,
                      "price_change": null
                    },
                    "wallet": {
                      "enabled": true,
                      "balance": "19.95"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/billing\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/billing', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { billing } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/billing\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"billing\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/billing');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$billing = $answer['billing'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/billing\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nbilling = answer[\"billing\"]"
          }
        ]
      }
    },
    "/billing/wallet/transactions": {
      "get": {
        "tags": [
          "Billing"
        ],
        "operationId": "listBillingWalletTransactions",
        "summary": "List wallet transactions",
        "description": "**Scope:** none. Every app can call it.\n\nThe moves of your app's wallet on the store: the merchant's top-ups,\nyour debits, and the return of the balance when the app was removed.\nOldest first unless `sort=created_at,DESC`.\n\nFilter with `filter=type||$op||value` (repeatable, all must match):\n\n| Field | Operators |\n|---|---|\n| `type` | `$eq`, `$in` |\n\n`$in` takes comma-separated values, up to 50. Works while the\nsubscription is `suspended`.\n",
        "x-scope": "none",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Sort"
          },
          {
            "$ref": "#/components/parameters/CreatedSince"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "A filter, `field||$op||value`. Repeat it to combine filters.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "example": [
              "type||$eq||wallet_debit"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "A page of transactions.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BillingWalletTransaction"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as `cursor` for the next page; `null` on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "2b7e9c1d-4f3a-4e8b-9a6c-5d0e1f2a3b40",
                      "type": "wallet_topup",
                      "amount": "20.00",
                      "balance_after": "20.00",
                      "description": "شحن محفظة تطبيق SMS Notify",
                      "created_at": "2026-12-01T09:00:00Z"
                    },
                    {
                      "id": "7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                      "type": "wallet_debit",
                      "amount": "0.05",
                      "balance_after": "19.95",
                      "description": "خصم من محفظة تطبيق SMS Notify: SMS for order 1043",
                      "created_at": "2026-12-03T10:00:00Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/billing/wallet/transactions\" \\\n  --data-urlencode \"limit=20\" \\\n  --data-urlencode \"filter=type||\\$eq||wallet_debit\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['limit', '20'],\n  ['filter', 'type||$eq||wallet_debit'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/billing/wallet/transactions?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"limit\", \"20\")\n\tquery.Add(\"filter\", \"type||$eq||wallet_debit\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/billing/wallet/transactions?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'limit' => '20',\n    'filter' => 'type||$eq||wallet_debit',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/billing/wallet/transactions?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/billing/wallet/transactions\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"limit\", \"20\"),\n        (\"filter\", \"type||$eq||wallet_debit\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      }
    },
    "/billing/wallet/debits": {
      "post": {
        "tags": [
          "Billing"
        ],
        "operationId": "createBillingWalletDebit",
        "summary": "Debit the wallet",
        "description": "**Scope:** none. Every app can call it.\n\nTakes `amount` from your app's wallet on the store, for usage your\napp charges as it sees fit. The merchant reads `description` in the\nwallet's transactions, after your app's name.\n\n- `amount` is a string of US dollars, more than zero, with up to 6\n  decimals (`\"0.05\"`, `\"0.000001\"`).\n- The `Idempotency-Key` header is required. The same key again\n  answers `201` with the first debit and `Idempotent-Replayed: true`,\n  and takes nothing, even if the wallet, the subscription or your\n  app changed since. The same key with another `amount` or\n  `description` answers `422 idempotency_key_reused`.\n- The balance never goes below zero: a wallet that does not cover the\n  amount answers `402 insufficient_balance`.\n- A new debit is refused while the subscription is `suspended`\n  (`402 payment_required`).\n- Your app can never add to the wallet: only the merchant tops it up.\n",
        "x-scope": "none",
        "parameters": [
          {
            "$ref": "#/components/parameters/BillingDebitIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount",
                  "description"
                ],
                "additionalProperties": false,
                "properties": {
                  "amount": {
                    "$ref": "#/components/schemas/BillingAmount"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "description": "One line the merchant reads after your app's name, with at\nleast one character that shows. No `<`, and no control or\ninvisible characters.\n"
                  }
                }
              },
              "example": {
                "amount": "0.05",
                "description": "SMS for order 1043"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The debit. On a replay, the first debit, with `Idempotent-Replayed: true`.",
            "headers": {
              "Idempotent-Replayed": {
                "description": "`true` when the key was used before and this is the first debit again.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "debit"
                  ],
                  "properties": {
                    "debit": {
                      "$ref": "#/components/schemas/BillingDebit"
                    }
                  }
                },
                "example": {
                  "debit": {
                    "id": "7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                    "amount": "0.05",
                    "balance_after": "19.95",
                    "description": "خصم من محفظة تطبيق SMS Notify: SMS for order 1043",
                    "created_at": "2026-12-03T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "`insufficient_balance`: the wallet does not cover the amount; or\n`payment_required`: the subscription is suspended.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_balance",
                    "message": "The app's wallet balance is not enough"
                  }
                }
              }
            }
          },
          "409": {
            "description": "`wallet_not_enabled`: your app has no usage wallet; or\n`app_suspended`: your app is suspended and is being removed from\nthe store.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "wallet_not_enabled",
                    "message": "The app has no usage wallet"
                  }
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed` (a missing `Idempotency-Key` too, with the\nrule `printable_ascii`), or `idempotency_key_reused`: the key was\nused for a debit with another amount or description.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "idempotency_key_reused",
                    "message": "This Idempotency-Key was used with a different request"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/billing/wallet/debits\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: sms-order-1043\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"amount\": \"0.05\",\n  \"description\": \"SMS for order 1043\"\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/billing/wallet/debits', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'sms-order-1043',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    amount: '0.05',\n    description: 'SMS for order 1043',\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { debit } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"amount\": \"0.05\",\n\t  \"description\": \"SMS for order 1043\"\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/billing/wallet/debits\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"sms-order-1043\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"debit\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/billing/wallet/debits');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: sms-order-1043',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'amount' => '0.05',\n        'description' => 'SMS for order 1043',\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$debit = $answer['debit'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/billing/wallet/debits\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"sms-order-1043\",\n    },\n    json={\n        \"amount\": \"0.05\",\n        \"description\": \"SMS for order 1043\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndebit = answer[\"debit\"]"
          }
        ]
      }
    },
    "/categories": {
      "get": {
        "tags": [
          "Categories"
        ],
        "operationId": "listCategories",
        "summary": "List categories",
        "description": "**Scope:** [`read_products`](/scopes)\n\nLists the store's categories, subcategories included, oldest first\nunless `sort=created_at,DESC`.\n\nFilter with `filter=field||$op||value` (repeatable, all must match):\n\n| Field | Operators |\n|---|---|\n| `parent_id` | `$eq`, `$in`, `$isnull`, `$notnull` |\n| `slug` | `$eq`, `$in` |\n| `name` | `$eq`, `$cont` (any letter case) |\n| `hidden` | `$eq` (`true` or `false`) |\n| `show_in_header` | `$eq` (`true` or `false`) |\n| `created_at` | `$gt`, `$gte`, `$lt`, `$lte` (RFC 3339) |\n\n`$in` takes comma-separated values, up to 50. Up to 10 filters per\nrequest. `filter=parent_id||$isnull` lists the top-level categories;\n`filter=parent_id||$eq||<id>` lists one category's subcategories.\n",
        "x-scope": "read_products",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Sort"
          },
          {
            "$ref": "#/components/parameters/CreatedSince"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "A filter, `field||$op||value`. Repeat it to combine filters.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "example": [
              "parent_id||$isnull"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "A page of categories.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Category"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as `cursor` for the next page; `null` on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                      "name": "T-Shirts",
                      "slug": "t-shirts",
                      "thumb": "https://cdn.example.com/categories/t-shirts.jpg",
                      "parent_id": "3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d",
                      "position": 0,
                      "hidden": false,
                      "show_in_header": true,
                      "created_at": "2026-12-04T09:00:00Z",
                      "updated_at": "2026-12-04T09:00:00Z"
                    }
                  ],
                  "next_cursor": "Ab3kZ2l..."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/categories\" \\\n  --data-urlencode \"limit=20\" \\\n  --data-urlencode \"filter=parent_id||\\$isnull\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['limit', '20'],\n  ['filter', 'parent_id||$isnull'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/categories?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"limit\", \"20\")\n\tquery.Add(\"filter\", \"parent_id||$isnull\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/categories?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'limit' => '20',\n    'filter' => 'parent_id||$isnull',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/categories?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/categories\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"limit\", \"20\"),\n        (\"filter\", \"parent_id||$isnull\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Categories"
        ],
        "operationId": "createCategory",
        "summary": "Create a category",
        "description": "**Scope:** [`write_products`](/scopes)\n\nCreates a category. `name`, `slug` and `thumb` are required.\n\n- `slug` must be free among the store's categories (`409 slug_taken`).\n- With `parent_id`, the category is a subcategory of that one, which\n  must be a category of the store (`422`, rule `parent`).\n- The category's HTML content is not part of the API: a new category\n  starts with none, as in the dashboard.\n\nSend an `Idempotency-Key` to retry safely.\n",
        "x-scope": "write_products",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryCreate"
              },
              "example": {
                "name": "T-Shirts",
                "slug": "t-shirts",
                "thumb": "https://cdn.example.com/categories/t-shirts.jpg",
                "parent_id": "3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d",
                "show_in_header": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The category created. `Location` is its path.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the saved answer of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "category"
                  ],
                  "properties": {
                    "category": {
                      "$ref": "#/components/schemas/Category"
                    }
                  }
                },
                "example": {
                  "category": {
                    "id": "5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                    "name": "T-Shirts",
                    "slug": "t-shirts",
                    "thumb": "https://cdn.example.com/categories/t-shirts.jpg",
                    "parent_id": "3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d",
                    "position": 0,
                    "hidden": false,
                    "show_in_header": true,
                    "created_at": "2026-12-04T09:00:00Z",
                    "updated_at": "2026-12-04T09:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "description": "`slug_taken` or `idempotency_in_progress`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "slug_taken",
                    "message": "Another category of the store has this slug"
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/categories\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: ERP-CAT-T-SHIRTS\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"T-Shirts\",\n  \"slug\": \"t-shirts\",\n  \"thumb\": \"https://cdn.example.com/categories/t-shirts.jpg\",\n  \"parent_id\": \"3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d\",\n  \"show_in_header\": true\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/categories', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'ERP-CAT-T-SHIRTS',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    name: 'T-Shirts',\n    slug: 't-shirts',\n    thumb: 'https://cdn.example.com/categories/t-shirts.jpg',\n    parent_id: '3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d',\n    show_in_header: true,\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { category } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"name\": \"T-Shirts\",\n\t  \"slug\": \"t-shirts\",\n\t  \"thumb\": \"https://cdn.example.com/categories/t-shirts.jpg\",\n\t  \"parent_id\": \"3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d\",\n\t  \"show_in_header\": true\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/categories\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"ERP-CAT-T-SHIRTS\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"category\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/categories');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: ERP-CAT-T-SHIRTS',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'T-Shirts',\n        'slug' => 't-shirts',\n        'thumb' => 'https://cdn.example.com/categories/t-shirts.jpg',\n        'parent_id' => '3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d',\n        'show_in_header' => true,\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$category = $answer['category'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/categories\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"ERP-CAT-T-SHIRTS\",\n    },\n    json={\n        \"name\": \"T-Shirts\",\n        \"slug\": \"t-shirts\",\n        \"thumb\": \"https://cdn.example.com/categories/t-shirts.jpg\",\n        \"parent_id\": \"3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d\",\n        \"show_in_header\": True,\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ncategory = answer[\"category\"]"
          }
        ]
      }
    },
    "/categories/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CategoryID"
        }
      ],
      "get": {
        "tags": [
          "Categories"
        ],
        "operationId": "getCategory",
        "summary": "Get a category",
        "description": "**Scope:** [`read_products`](/scopes)\n\nReads one category.\n\n`join` adds its subcategories as `children`, up to three levels deep:\n`children`, `children.children` or `children.children.children`.\nSubcategories come highest `position` first. One read joins at most\n100 subcategories over all levels; more answers `422 join_too_large`:\nlist them with `filter=parent_id||$eq||<id>` instead.\n",
        "x-scope": "read_products",
        "parameters": [
          {
            "name": "join",
            "in": "query",
            "description": "How many levels of subcategories to add.",
            "schema": {
              "type": "string",
              "enum": [
                "children",
                "children.children",
                "children.children.children"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The category.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "category"
                  ],
                  "properties": {
                    "category": {
                      "$ref": "#/components/schemas/Category"
                    }
                  }
                },
                "example": {
                  "category": {
                    "id": "3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d",
                    "name": "Men",
                    "slug": "men",
                    "thumb": "https://cdn.example.com/categories/men.jpg",
                    "parent_id": null,
                    "position": 10,
                    "hidden": false,
                    "show_in_header": true,
                    "created_at": "2026-11-20T08:00:00Z",
                    "updated_at": "2026-11-20T08:00:00Z",
                    "children": [
                      {
                        "id": "5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                        "name": "T-Shirts",
                        "slug": "t-shirts",
                        "thumb": "https://cdn.example.com/categories/t-shirts.jpg",
                        "parent_id": "3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d",
                        "position": 0,
                        "hidden": false,
                        "show_in_header": true,
                        "created_at": "2026-12-04T09:00:00Z",
                        "updated_at": "2026-12-04T09:00:00Z",
                        "children": []
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "`validation_failed`, or `join_too_large` when the category has more than 100 subcategories to join.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "join_too_large",
                    "message": "More than 100 subcategories to join: list them with filter=parent_id||$eq||<id> instead"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\" \\\n  --data-urlencode \"join=children\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['join', 'children'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { category } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"join\", \"children\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"category\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'join' => 'children',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$category = $answer['category'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"join\", \"children\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ncategory = answer[\"category\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Categories"
        ],
        "operationId": "updateCategory",
        "summary": "Update a category",
        "description": "**Scope:** [`write_products`](/scopes)\n\nChanges only the fields you send. `null` is refused, except for\n`parent_id`, where it makes the category a top-level one.\n\n- `slug` must be free among the store's categories (`409 slug_taken`).\n- `parent_id` must be another category of the store, and not one of\n  this category's own subcategories (`422`, rule `parent`).\n- The category's HTML content is not part of the API; an update\n  leaves what the merchant wrote.\n",
        "x-scope": "write_products",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryUpdate"
              },
              "example": {
                "name": "Cotton T-Shirts",
                "hidden": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The category, without subcategories.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "category"
                  ],
                  "properties": {
                    "category": {
                      "$ref": "#/components/schemas/Category"
                    }
                  }
                },
                "example": {
                  "category": {
                    "id": "5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                    "name": "T-Shirts",
                    "slug": "t-shirts",
                    "thumb": "https://cdn.example.com/categories/t-shirts.jpg",
                    "parent_id": "3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d",
                    "position": 0,
                    "hidden": false,
                    "show_in_header": true,
                    "created_at": "2026-12-04T09:00:00Z",
                    "updated_at": "2026-12-04T09:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`slug_taken`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "slug_taken",
                    "message": "Another category of the store has this slug"
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"Cotton T-Shirts\",\n  \"hidden\": false\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    name: 'Cotton T-Shirts',\n    hidden: false,\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { category } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"name\": \"Cotton T-Shirts\",\n\t  \"hidden\": false\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"category\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'Cotton T-Shirts',\n        'hidden' => false,\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$category = $answer['category'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"name\": \"Cotton T-Shirts\",\n        \"hidden\": False,\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ncategory = answer[\"category\"]"
          }
        ]
      },
      "delete": {
        "tags": [
          "Categories"
        ],
        "operationId": "deleteCategory",
        "summary": "Delete a category",
        "description": "**Scope:** [`write_products`](/scopes)\n\nDeletes a category: it no longer shows in lists, reading it answers\n`404`, and products stop listing it in their `category_ids`. A\ndeleted category cannot be restored through the API.\n\nA category with subcategories answers `409 category_has_children`:\ndelete them first, or move them with a new `parent_id`.\n",
        "x-scope": "write_products",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`category_has_children`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "category_has_children",
                    "message": "Delete or move the subcategories first"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nif (!response.ok) {\n  const { error } = await response.json()\n  throw new Error(`${error.code}: ${error.message}`)\n}"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode >= 300 {\n\t\tvar answer map[string]any\n\t\t_ = json.NewDecoder(res.Body).Decode(&answer)\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(res.Status)\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.easy-orders.net/api/partners-apps/v1/categories/5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nif not response.ok:\n    error = response.json()[\"error\"]\n    raise RuntimeError(f\"{error['code']}: {error['message']}\")"
          }
        ]
      }
    },
    "/checkout-fields": {
      "get": {
        "tags": [
          "Checkout fields"
        ],
        "operationId": "listCheckoutFields",
        "summary": "List checkout fields",
        "description": "**Scope:** [`read_checkout_form`](/scopes)\n\nEvery field of the store's checkout form, in the order the shopper\nsees them (by `position`). Not paginated: a form has a handful of\nfields, so `next_cursor` is always `null`. It takes no parameters.\n",
        "x-scope": "read_checkout_form",
        "responses": {
          "200": {
            "description": "Every field of the form, in order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CheckoutField"
                      }
                    },
                    "next_cursor": {
                      "type": "null",
                      "description": "Always `null`; the list is one page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "4b1e7c2a-9d3f-4a6e-8b5c-1f2e3d4c5b60",
                      "key": "full_name",
                      "name": "Full name",
                      "type": "input",
                      "placeholder": "Your full name",
                      "position": 0,
                      "is_active": true,
                      "is_required": true
                    },
                    {
                      "id": "6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70",
                      "key": "phone",
                      "name": "Phone",
                      "type": "input",
                      "placeholder": "",
                      "position": 1,
                      "is_active": true,
                      "is_required": true
                    },
                    {
                      "id": "7d3a9e4c-1f5b-4c8a-8d7e-3b4c5d6e7f80",
                      "key": "address",
                      "name": "Address",
                      "type": "textarea",
                      "placeholder": "Street, building and floor",
                      "position": 2,
                      "is_active": true,
                      "is_required": true
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/checkout-fields', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/checkout-fields');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Checkout fields"
        ],
        "operationId": "createCheckoutField",
        "summary": "Add a checkout field",
        "description": "**Scope:** [`write_checkout_form`](/scopes)\n\nAdds one of the optional fields to the form, by its `key`:\n`phone_alt`, `note` or `sa_national_address`. Each key can be added\nonce; a key the form already has answers `409 checkout_field_exists`:\nchange that field with [Update a checkout field](/api-reference/checkout-fields/update-a-checkout-field).\n\nEvery field but `key` can be left out. The field then starts hidden\nand optional (`is_active: false`, `is_required: false`), last in the\nform, with the dashboard's default label and an empty placeholder.\nIts `type` follows the key: `textarea` for `note`, `input` for the\nothers.\n\nSend an `Idempotency-Key` to retry safely.\n",
        "x-scope": "write_checkout_form",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutFieldCreate"
              },
              "example": {
                "key": "phone_alt",
                "name": "Second phone",
                "placeholder": "Another number we can reach you on",
                "is_active": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The field added. `Location` is its path.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the saved answer of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "checkout_field"
                  ],
                  "properties": {
                    "checkout_field": {
                      "$ref": "#/components/schemas/CheckoutField"
                    }
                  }
                },
                "example": {
                  "checkout_field": {
                    "id": "9e4b0f5d-2a6c-4d9b-8e8f-4c5d6e7f8a90",
                    "key": "phone_alt",
                    "name": "Second phone",
                    "type": "input",
                    "placeholder": "Another number we can reach you on",
                    "position": 6,
                    "is_active": true,
                    "is_required": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "description": "`checkout_field_exists` or `idempotency_in_progress`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "checkout_field_exists",
                    "message": "The store's form already has a field with this key: change it with PATCH /checkout-fields/:id"
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: enable-phone-alt\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"key\": \"phone_alt\",\n  \"name\": \"Second phone\",\n  \"placeholder\": \"Another number we can reach you on\",\n  \"is_active\": true\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/checkout-fields', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'enable-phone-alt',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    key: 'phone_alt',\n    name: 'Second phone',\n    placeholder: 'Another number we can reach you on',\n    is_active: true,\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { checkout_field } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"key\": \"phone_alt\",\n\t  \"name\": \"Second phone\",\n\t  \"placeholder\": \"Another number we can reach you on\",\n\t  \"is_active\": true\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"enable-phone-alt\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"checkout_field\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/checkout-fields');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: enable-phone-alt',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'key' => 'phone_alt',\n        'name' => 'Second phone',\n        'placeholder' => 'Another number we can reach you on',\n        'is_active' => true,\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$checkoutField = $answer['checkout_field'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"enable-phone-alt\",\n    },\n    json={\n        \"key\": \"phone_alt\",\n        \"name\": \"Second phone\",\n        \"placeholder\": \"Another number we can reach you on\",\n        \"is_active\": True,\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ncheckout_field = answer[\"checkout_field\"]"
          }
        ]
      }
    },
    "/checkout-fields/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CheckoutFieldID"
        }
      ],
      "get": {
        "tags": [
          "Checkout fields"
        ],
        "operationId": "getCheckoutField",
        "summary": "Get a checkout field",
        "description": "**Scope:** [`read_checkout_form`](/scopes)\n\nReads one field of the store's checkout form. It takes no parameters.",
        "x-scope": "read_checkout_form",
        "responses": {
          "200": {
            "$ref": "#/components/responses/CheckoutFieldOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields/6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/checkout-fields/6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { checkout_field } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields/6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"checkout_field\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/checkout-fields/6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$checkoutField = $answer['checkout_field'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields/6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ncheckout_field = answer[\"checkout_field\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Checkout fields"
        ],
        "operationId": "updateCheckoutField",
        "summary": "Update a checkout field",
        "description": "**Scope:** [`write_checkout_form`](/scopes)\n\nChanges the field's label (`name`), `placeholder`, `position`, and\nwhether it shows (`is_active`) and is required (`is_required`). Only\nthe fields you send change; `null` is refused. `key` and `type`\ncannot change: sending them answers `400`.\n\n`full_name` and `phone` are needed by every order: they stay shown\nand required. Setting `is_active` or `is_required` to `false` on them\nanswers `422` with the rule `always_required`.\n\nThe storefront's checkout shows the change at once.\n",
        "x-scope": "write_checkout_form",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutFieldUpdate"
              },
              "example": {
                "name": "Mobile number",
                "placeholder": "01xxxxxxxxx",
                "position": 1
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CheckoutFieldOK"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "`validation_failed`: a rule below, or `always_required` for hiding or making optional `full_name` or `phone`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "validation_failed",
                    "message": "Validation failed",
                    "details": {
                      "fields": [
                        {
                          "field": "is_required",
                          "rule": "always_required",
                          "param": "phone"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields/6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"Mobile number\",\n  \"placeholder\": \"01xxxxxxxxx\",\n  \"position\": 1\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/checkout-fields/6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    name: 'Mobile number',\n    placeholder: '01xxxxxxxxx',\n    position: 1,\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { checkout_field } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"name\": \"Mobile number\",\n\t  \"placeholder\": \"01xxxxxxxxx\",\n\t  \"position\": 1\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields/6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"checkout_field\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/checkout-fields/6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'Mobile number',\n        'placeholder' => '01xxxxxxxxx',\n        'position' => 1,\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$checkoutField = $answer['checkout_field'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/checkout-fields/6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"name\": \"Mobile number\",\n        \"placeholder\": \"01xxxxxxxxx\",\n        \"position\": 1,\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ncheckout_field = answer[\"checkout_field\"]"
          }
        ]
      }
    },
    "/coupons": {
      "get": {
        "tags": [
          "Coupons"
        ],
        "operationId": "listCoupons",
        "summary": "List coupons",
        "description": "**Scope:** [`read_discounts`](/scopes)\n\nLists the store's coupons, each with its applicable items, oldest\nfirst unless `sort=created_at,DESC`. Deleted coupons are not listed.\n\nFilter with `filter=field||$op||value` (repeatable, all must match):\n\n| Field | Operators |\n|---|---|\n| `method` | `$eq`, `$in` |\n| `discount_type` | `$eq`, `$in` |\n| `applies_to` | `$eq`, `$in` |\n| `is_active` | `$eq` |\n| `code` | `$eq`, `$in`, `$cont` |\n| `title` | `$eq`, `$cont` |\n| `starts_at` | `$gt`, `$gte`, `$lt`, `$lte`, `$isnull`, `$notnull` |\n| `expires_at` | `$gt`, `$gte`, `$lt`, `$lte`, `$isnull`, `$notnull` |\n| `created_at` | `$gt`, `$gte`, `$lt`, `$lte` |\n\nCodes are saved lowercased, so `code||$eq` takes the code in lower\ncase; `$cont` ignores letter case. `$in` takes comma-separated\nvalues, up to 50. Up to 10 filters per request.\n",
        "x-scope": "read_discounts",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Sort"
          },
          {
            "$ref": "#/components/parameters/CreatedSince"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "A filter, `field||$op||value`. Repeat it to combine filters.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "example": [
              "is_active||$eq||true"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "A page of coupons.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Coupon"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as `cursor` for the next page; `null` on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a",
                      "method": "code",
                      "code": "summer15",
                      "title": "",
                      "discount_type": "amount_off_products",
                      "value_type": "percentage",
                      "value": 15,
                      "min_order_amount": 0,
                      "min_quantity": 0,
                      "max_discount_amount": 200,
                      "usage_limit": 500,
                      "usage_count": 37,
                      "is_active": true,
                      "starts_at": null,
                      "expires_at": "2027-09-01T00:00:00Z",
                      "applies_to": "specific_categories",
                      "buy_quantity": 0,
                      "buy_requirement_type": "quantity",
                      "buy_amount": 0,
                      "get_quantity": 0,
                      "get_value_type": "free",
                      "get_value": 0,
                      "max_uses_per_order": 0,
                      "max_shipping_discount": 0,
                      "exclude_shipping_over": 0,
                      "combines_with_product": false,
                      "combines_with_order": false,
                      "combines_with_shipping": true,
                      "applicable_items": [
                        {
                          "item_type": "category",
                          "item_id": "8d2f4b6a-1c3e-4a5b-9d7f-0e1a2b3c4d5e",
                          "is_buy_item": false
                        }
                      ],
                      "created_at": "2026-12-01T09:00:00Z",
                      "updated_at": "2026-12-03T14:30:00Z"
                    },
                    {
                      "id": "9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
                      "method": "automatic",
                      "code": "",
                      "title": "Free shipping over 1000",
                      "discount_type": "free_shipping",
                      "value_type": "fixed",
                      "value": 0,
                      "min_order_amount": 1000,
                      "min_quantity": 0,
                      "max_discount_amount": 0,
                      "usage_limit": 0,
                      "usage_count": 112,
                      "is_active": true,
                      "starts_at": null,
                      "expires_at": null,
                      "applies_to": "all",
                      "buy_quantity": 0,
                      "buy_requirement_type": "quantity",
                      "buy_amount": 0,
                      "get_quantity": 0,
                      "get_value_type": "free",
                      "get_value": 0,
                      "max_uses_per_order": 0,
                      "max_shipping_discount": 0,
                      "exclude_shipping_over": 0,
                      "combines_with_product": true,
                      "combines_with_order": false,
                      "combines_with_shipping": false,
                      "applicable_items": [],
                      "created_at": "2026-12-02T08:00:00Z",
                      "updated_at": "2026-12-02T08:00:00Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/coupons\" \\\n  --data-urlencode \"limit=20\" \\\n  --data-urlencode \"filter=is_active||\\$eq||true\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['limit', '20'],\n  ['filter', 'is_active||$eq||true'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/coupons?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"limit\", \"20\")\n\tquery.Add(\"filter\", \"is_active||$eq||true\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/coupons?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'limit' => '20',\n    'filter' => 'is_active||$eq||true',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/coupons?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/coupons\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"limit\", \"20\"),\n        (\"filter\", \"is_active||$eq||true\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Coupons"
        ],
        "operationId": "createCoupon",
        "summary": "Create a coupon",
        "description": "**Scope:** [`write_discounts`](/scopes)\n\nCreates a coupon. Only `method` and `discount_type` are required;\nevery other field takes its default. The whole coupon must then\nfollow the [coupon rules](/api-reference/coupons/overview#rules):\na `code` coupon needs a `code`, an `automatic` one needs a `title`\nand no code, and so on.\n\n- The code is trimmed and saved lowercased. Another live coupon of\n  the store with the same code answers `409 code_taken`.\n- Each applicable item must be a product, variant or category of\n  this store; one that is not answers `422` on its `item_id`, with\n  its type as the rule.\n\nSend an `Idempotency-Key` to retry safely.\n",
        "x-scope": "write_discounts",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CouponCreate"
              },
              "example": {
                "method": "code",
                "code": "SUMMER15",
                "discount_type": "amount_off_products",
                "value_type": "percentage",
                "value": 15,
                "max_discount_amount": 200,
                "usage_limit": 500,
                "expires_at": "2027-09-01T00:00:00Z",
                "applies_to": "specific_categories",
                "applicable_items": [
                  {
                    "item_type": "category",
                    "item_id": "8d2f4b6a-1c3e-4a5b-9d7f-0e1a2b3c4d5e"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The coupon created. `Location` is its path.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the saved answer of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "coupon"
                  ],
                  "properties": {
                    "coupon": {
                      "$ref": "#/components/schemas/Coupon"
                    }
                  }
                },
                "example": {
                  "coupon": {
                    "id": "4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a",
                    "method": "code",
                    "code": "summer15",
                    "title": "",
                    "discount_type": "amount_off_products",
                    "value_type": "percentage",
                    "value": 15,
                    "min_order_amount": 0,
                    "min_quantity": 0,
                    "max_discount_amount": 200,
                    "usage_limit": 500,
                    "usage_count": 37,
                    "is_active": true,
                    "starts_at": null,
                    "expires_at": "2027-09-01T00:00:00Z",
                    "applies_to": "specific_categories",
                    "buy_quantity": 0,
                    "buy_requirement_type": "quantity",
                    "buy_amount": 0,
                    "get_quantity": 0,
                    "get_value_type": "free",
                    "get_value": 0,
                    "max_uses_per_order": 0,
                    "max_shipping_discount": 0,
                    "exclude_shipping_over": 0,
                    "combines_with_product": false,
                    "combines_with_order": false,
                    "combines_with_shipping": true,
                    "applicable_items": [
                      {
                        "item_type": "category",
                        "item_id": "8d2f4b6a-1c3e-4a5b-9d7f-0e1a2b3c4d5e",
                        "is_buy_item": false
                      }
                    ],
                    "created_at": "2026-12-01T09:00:00Z",
                    "updated_at": "2026-12-03T14:30:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "description": "`code_taken` or `idempotency_in_progress`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "code_taken",
                    "message": "Another coupon of the store has this code"
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/coupons\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: promo-summer-2027\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"method\": \"code\",\n  \"code\": \"SUMMER15\",\n  \"discount_type\": \"amount_off_products\",\n  \"value_type\": \"percentage\",\n  \"value\": 15,\n  \"max_discount_amount\": 200,\n  \"usage_limit\": 500,\n  \"expires_at\": \"2027-09-01T00:00:00Z\",\n  \"applies_to\": \"specific_categories\",\n  \"applicable_items\": [\n    {\n      \"item_type\": \"category\",\n      \"item_id\": \"8d2f4b6a-1c3e-4a5b-9d7f-0e1a2b3c4d5e\"\n    }\n  ]\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/coupons', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'promo-summer-2027',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    method: 'code',\n    code: 'SUMMER15',\n    discount_type: 'amount_off_products',\n    value_type: 'percentage',\n    value: 15,\n    max_discount_amount: 200,\n    usage_limit: 500,\n    expires_at: '2027-09-01T00:00:00Z',\n    applies_to: 'specific_categories',\n    applicable_items: [\n      {\n        item_type: 'category',\n        item_id: '8d2f4b6a-1c3e-4a5b-9d7f-0e1a2b3c4d5e',\n      },\n    ],\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { coupon } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"method\": \"code\",\n\t  \"code\": \"SUMMER15\",\n\t  \"discount_type\": \"amount_off_products\",\n\t  \"value_type\": \"percentage\",\n\t  \"value\": 15,\n\t  \"max_discount_amount\": 200,\n\t  \"usage_limit\": 500,\n\t  \"expires_at\": \"2027-09-01T00:00:00Z\",\n\t  \"applies_to\": \"specific_categories\",\n\t  \"applicable_items\": [\n\t    {\n\t      \"item_type\": \"category\",\n\t      \"item_id\": \"8d2f4b6a-1c3e-4a5b-9d7f-0e1a2b3c4d5e\"\n\t    }\n\t  ]\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/coupons\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"promo-summer-2027\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"coupon\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/coupons');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: promo-summer-2027',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'method' => 'code',\n        'code' => 'SUMMER15',\n        'discount_type' => 'amount_off_products',\n        'value_type' => 'percentage',\n        'value' => 15,\n        'max_discount_amount' => 200,\n        'usage_limit' => 500,\n        'expires_at' => '2027-09-01T00:00:00Z',\n        'applies_to' => 'specific_categories',\n        'applicable_items' => [\n            [\n                'item_type' => 'category',\n                'item_id' => '8d2f4b6a-1c3e-4a5b-9d7f-0e1a2b3c4d5e',\n            ],\n        ],\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$coupon = $answer['coupon'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/coupons\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"promo-summer-2027\",\n    },\n    json={\n        \"method\": \"code\",\n        \"code\": \"SUMMER15\",\n        \"discount_type\": \"amount_off_products\",\n        \"value_type\": \"percentage\",\n        \"value\": 15,\n        \"max_discount_amount\": 200,\n        \"usage_limit\": 500,\n        \"expires_at\": \"2027-09-01T00:00:00Z\",\n        \"applies_to\": \"specific_categories\",\n        \"applicable_items\": [\n            {\n                \"item_type\": \"category\",\n                \"item_id\": \"8d2f4b6a-1c3e-4a5b-9d7f-0e1a2b3c4d5e\",\n            },\n        ],\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ncoupon = answer[\"coupon\"]"
          }
        ]
      }
    },
    "/coupons/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CouponID"
        }
      ],
      "get": {
        "tags": [
          "Coupons"
        ],
        "operationId": "getCoupon",
        "summary": "Get a coupon",
        "description": "**Scope:** [`read_discounts`](/scopes)\n\nReads one coupon with its applicable items. It takes no query parameters.",
        "x-scope": "read_discounts",
        "responses": {
          "200": {
            "$ref": "#/components/responses/CouponOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { coupon } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"coupon\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$coupon = $answer['coupon'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ncoupon = answer[\"coupon\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Coupons"
        ],
        "operationId": "updateCoupon",
        "summary": "Update a coupon",
        "description": "**Scope:** [`write_discounts`](/scopes)\n\nChanges only the fields you send. The [coupon rules](/api-reference/coupons/overview#rules)\nare checked on the coupon the change leaves, the saved one with\nyour changes, so a `PATCH` can never reach a coupon a create could\nnot make. For example, turning a code coupon `automatic` needs\n`code: \"\"` and a `title` in the same request.\n\n- `null` clears `starts_at` (no start) or `expires_at` (no expiry);\n  any other field refuses `null`. Leaving a field out keeps it.\n- `applicable_items`, when sent, replaces every item of the coupon;\n  `[]` removes them all.\n- A new code taken by another live coupon of the store answers\n  `409 code_taken`.\n- `usage_count` is read only: sending it answers `400`.\n",
        "x-scope": "write_discounts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CouponUpdate"
              },
              "example": {
                "usage_limit": 1000,
                "expires_at": null
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CouponOK"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`code_taken`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "code_taken",
                    "message": "Another coupon of the store has this code"
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"usage_limit\": 1000,\n  \"expires_at\": null\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    usage_limit: 1000,\n    expires_at: null,\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { coupon } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"usage_limit\": 1000,\n\t  \"expires_at\": null\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"coupon\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'usage_limit' => 1000,\n        'expires_at' => null,\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$coupon = $answer['coupon'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"usage_limit\": 1000,\n        \"expires_at\": None,\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ncoupon = answer[\"coupon\"]"
          }
        ]
      },
      "delete": {
        "tags": [
          "Coupons"
        ],
        "operationId": "deleteCoupon",
        "summary": "Delete a coupon",
        "description": "**Scope:** [`write_discounts`](/scopes)\n\nDeletes a coupon, as the dashboard does: it stops applying and is\nno longer listed or readable (`404`), while the orders that used it\nkeep their discount. Its code is free again for a new coupon.\n",
        "x-scope": "write_discounts",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nif (!response.ok) {\n  const { error } = await response.json()\n  throw new Error(`${error.code}: ${error.message}`)\n}"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode >= 300 {\n\t\tvar answer map[string]any\n\t\t_ = json.NewDecoder(res.Body).Decode(&answer)\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(res.Status)\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.easy-orders.net/api/partners-apps/v1/coupons/4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nif not response.ok:\n    error = response.json()[\"error\"]\n    raise RuntimeError(f\"{error['code']}: {error['message']}\")"
          }
        ]
      }
    },
    "/orders/{id}/labels": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LabelOrderID"
        }
      ],
      "get": {
        "tags": [
          "Labels"
        ],
        "operationId": "listOrderLabels",
        "summary": "List order labels",
        "description": "**Scope:** [`read_orders`](/scopes)\n\nYour app's labels on the order, oldest first. Another app's labels\nare never listed. Not paginated, and takes no query parameters: an\napp has at most 5 labels on an order.\n\nA deleted order answers `404 not_found`.\n",
        "x-scope": "read_orders",
        "responses": {
          "200": {
            "$ref": "#/components/responses/LabelListOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { labels } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"labels\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$labels = $answer['labels'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nlabels = answer[\"labels\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Labels"
        ],
        "operationId": "createOrderLabel",
        "summary": "Add an order label",
        "description": "**Scope:** [`write_orders`](/scopes)\n\nPuts a label on the order. Your app can have up to 5 labels on one\norder (`422 limit_exceeded`), each with a different text, letter\ncase aside (`409 label_exists`). The text is checked first: with 5\nlabels already, a text you have answers `409`, not `422`.\n\nAdding a label sends no event and leaves the order as it is, its\n`updated_at` too.\n\nSend an `Idempotency-Key` to retry safely.\n",
        "x-scope": "write_orders",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelCreate"
              },
              "example": {
                "text": "VIP",
                "color": "purple"
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/LabelCreated"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/LabelConflict"
          },
          "422": {
            "$ref": "#/components/responses/LabelUnprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: order-1042-vip\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"text\": \"VIP\",\n  \"color\": \"purple\"\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'order-1042-vip',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    text: 'VIP',\n    color: 'purple',\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { label } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"text\": \"VIP\",\n\t  \"color\": \"purple\"\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"order-1042-vip\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"label\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: order-1042-vip',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'text' => 'VIP',\n        'color' => 'purple',\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$label = $answer['label'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"order-1042-vip\",\n    },\n    json={\n        \"text\": \"VIP\",\n        \"color\": \"purple\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nlabel = answer[\"label\"]"
          }
        ]
      }
    },
    "/orders/{id}/labels/{label_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LabelOrderID"
        },
        {
          "$ref": "#/components/parameters/LabelID"
        }
      ],
      "delete": {
        "tags": [
          "Labels"
        ],
        "operationId": "deleteOrderLabel",
        "summary": "Delete an order label",
        "description": "**Scope:** [`write_orders`](/scopes)\n\nDeletes one of your app's labels from the order, for good. It\nanswers `404 not_found` when the label is not your app's, is on\nanother order, was deleted already, or the order is deleted.\n\nDeleting a label sends no event and leaves the order as it is.\n",
        "x-scope": "write_orders",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels/5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels/5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nif (!response.ok) {\n  const { error } = await response.json()\n  throw new Error(`${error.code}: ${error.message}`)\n}"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels/5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode >= 300 {\n\t\tvar answer map[string]any\n\t\t_ = json.NewDecoder(res.Body).Decode(&answer)\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(res.Status)\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels/5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/labels/5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nif not response.ok:\n    error = response.json()[\"error\"]\n    raise RuntimeError(f\"{error['code']}: {error['message']}\")"
          }
        ]
      }
    },
    "/products/{id}/labels": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LabelProductID"
        }
      ],
      "get": {
        "tags": [
          "Labels"
        ],
        "operationId": "listProductLabels",
        "summary": "List product labels",
        "description": "**Scope:** [`read_products`](/scopes)\n\nYour app's labels on the product, oldest first. Another app's labels\nare never listed. Not paginated, and takes no query parameters: an\napp has at most 5 labels on a product.\n\nA deleted product answers `404 not_found`.\n",
        "x-scope": "read_products",
        "responses": {
          "200": {
            "$ref": "#/components/responses/LabelListOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { labels } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"labels\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$labels = $answer['labels'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nlabels = answer[\"labels\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Labels"
        ],
        "operationId": "createProductLabel",
        "summary": "Add a product label",
        "description": "**Scope:** [`write_products`](/scopes)\n\nPuts a label on the product. Your app can have up to 5 labels on one\nproduct (`422 limit_exceeded`), each with a different text, letter\ncase aside (`409 label_exists`). The text is checked first: with 5\nlabels already, a text you have answers `409`, not `422`.\n\nAdding a label sends no event and leaves the product as it is, its\n`updated_at` too.\n\nSend an `Idempotency-Key` to retry safely.\n",
        "x-scope": "write_products",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelCreate"
              },
              "example": {
                "text": "Low stock",
                "color": "red"
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/LabelCreated"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/LabelConflict"
          },
          "422": {
            "$ref": "#/components/responses/LabelUnprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: sku-hoodie-low-stock\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"text\": \"Low stock\",\n  \"color\": \"red\"\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'sku-hoodie-low-stock',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    text: 'Low stock',\n    color: 'red',\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { label } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"text\": \"Low stock\",\n\t  \"color\": \"red\"\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"sku-hoodie-low-stock\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"label\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: sku-hoodie-low-stock',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'text' => 'Low stock',\n        'color' => 'red',\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$label = $answer['label'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"sku-hoodie-low-stock\",\n    },\n    json={\n        \"text\": \"Low stock\",\n        \"color\": \"red\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nlabel = answer[\"label\"]"
          }
        ]
      }
    },
    "/products/{id}/labels/{label_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/LabelProductID"
        },
        {
          "$ref": "#/components/parameters/LabelID"
        }
      ],
      "delete": {
        "tags": [
          "Labels"
        ],
        "operationId": "deleteProductLabel",
        "summary": "Delete a product label",
        "description": "**Scope:** [`write_products`](/scopes)\n\nDeletes one of your app's labels from the product, for good. It\nanswers `404 not_found` when the label is not your app's, is on\nanother product, was deleted already, or the product is deleted.\n\nDeleting a label sends no event and leaves the product as it is.\n",
        "x-scope": "write_products",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels/5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels/5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nif (!response.ok) {\n  const { error } = await response.json()\n  throw new Error(`${error.code}: ${error.message}`)\n}"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels/5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode >= 300 {\n\t\tvar answer map[string]any\n\t\t_ = json.NewDecoder(res.Body).Decode(&answer)\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(res.Status)\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels/5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/labels/5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nif not response.ok:\n    error = response.json()[\"error\"]\n    raise RuntimeError(f\"{error['code']}: {error['message']}\")"
          }
        ]
      }
    },
    "/missed-orders": {
      "get": {
        "tags": [
          "Missed orders"
        ],
        "operationId": "listMissedOrders",
        "summary": "List missed orders",
        "description": "**Scope:** [`read_missed_orders`](/scopes)\n\nLists the store's missed orders, oldest first unless\n`sort=created_at,DESC`. A missed order is deleted 30 days after it\nwas created.\n\nThere is no `filter`. Narrow the list with `created_since` and\n`updated_since`: to keep your system in step, read with\n`updated_since` set to the time of your last read.\n",
        "x-scope": "read_missed_orders",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Sort"
          },
          {
            "$ref": "#/components/parameters/CreatedSince"
          },
          {
            "$ref": "#/components/parameters/MissedOrderUpdatedSince"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of missed orders.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MissedOrder"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as `cursor` for the next page; `null` on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d",
                      "full_name": "Mona Hassan",
                      "email": "",
                      "phone": "+201001234567",
                      "phone_alt": "",
                      "country": "Egypt",
                      "city": "Cairo",
                      "address": "12 Tahrir St, Downtown",
                      "sa_national_address": "",
                      "payment_method": "cod",
                      "note": "",
                      "utm_source": "facebook",
                      "utm_campaign": "winter-sale",
                      "metadata": {},
                      "funnel_id": null,
                      "custom_currency": "",
                      "is_digital": false,
                      "products": [
                        "Cotton Hoodie"
                      ],
                      "reason": "",
                      "can_convert_to_order": true,
                      "is_completed": false,
                      "masked": false,
                      "masked_reason": null,
                      "items": [
                        {
                          "id": "5c8d0e1f-2a3b-4c4d-8e5f-6a7b8c9d0e10",
                          "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                          "variant_id": null,
                          "product_name": "Cotton Hoodie",
                          "quantity": 1,
                          "price": 450,
                          "is_upsell": false,
                          "metadata": {}
                        }
                      ],
                      "created_at": "2026-12-04T10:15:00Z",
                      "updated_at": "2026-12-04T10:15:00Z"
                    }
                  ],
                  "next_cursor": "00064a1b2c3d4e5f3e7a9c2d5b8f4e1a9c6d2b7f0e3a5c8d00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/MissedOrdersUnavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/missed-orders\" \\\n  --data-urlencode \"limit=20\" \\\n  --data-urlencode \"updated_since=2026-12-04T00:00:00Z\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['limit', '20'],\n  ['updated_since', '2026-12-04T00:00:00Z'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/missed-orders?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"limit\", \"20\")\n\tquery.Add(\"updated_since\", \"2026-12-04T00:00:00Z\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/missed-orders?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'limit' => '20',\n    'updated_since' => '2026-12-04T00:00:00Z',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/missed-orders?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/missed-orders\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"limit\", \"20\"),\n        (\"updated_since\", \"2026-12-04T00:00:00Z\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      }
    },
    "/missed-orders/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/MissedOrderID"
        }
      ],
      "get": {
        "tags": [
          "Missed orders"
        ],
        "operationId": "getMissedOrder",
        "summary": "Get a missed order",
        "description": "**Scope:** [`read_missed_orders`](/scopes)\n\nReads one missed order, with its cart items. It takes no parameters.",
        "x-scope": "read_missed_orders",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MissedOrderOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/MissedOrdersUnavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/missed-orders/3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/missed-orders/3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { missed_order } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/missed-orders/3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"missed_order\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/missed-orders/3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$missedOrder = $answer['missed_order'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/missed-orders/3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nmissed_order = answer[\"missed_order\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Missed orders"
        ],
        "operationId": "updateMissedOrder",
        "summary": "Update a missed order",
        "description": "**Scope:** [`write_missed_orders`](/scopes)\n\nChanges the customer's details and the note, or marks the missed\norder completed. Only the fields you send change; `null` is refused,\nand `\"\"` empties a field. Text is trimmed.\n\n- `is_completed` takes only `true`: a completed missed order cannot\n  be reopened.\n- The cart items, payment method and metadata are read only.\n\nThe answer is the missed order after the change. A request that\nchanges nothing leaves `updated_at` as it was.\n",
        "x-scope": "write_missed_orders",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MissedOrderUpdate"
              },
              "example": {
                "phone": "+201001234567",
                "note": "Called the customer, will order tomorrow."
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/MissedOrderOK"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/MissedOrdersUnavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/missed-orders/3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"phone\": \"+201001234567\",\n  \"note\": \"Called the customer, will order tomorrow.\"\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/missed-orders/3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    phone: '+201001234567',\n    note: 'Called the customer, will order tomorrow.',\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { missed_order } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"phone\": \"+201001234567\",\n\t  \"note\": \"Called the customer, will order tomorrow.\"\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/missed-orders/3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"missed_order\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/missed-orders/3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'phone' => '+201001234567',\n        'note' => 'Called the customer, will order tomorrow.',\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$missedOrder = $answer['missed_order'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/missed-orders/3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"phone\": \"+201001234567\",\n        \"note\": \"Called the customer, will order tomorrow.\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nmissed_order = answer[\"missed_order\"]"
          }
        ]
      }
    },
    "/orders": {
      "get": {
        "tags": [
          "Orders"
        ],
        "operationId": "listOrders",
        "summary": "List orders",
        "description": "**Scope:** [`read_orders`](/scopes)\n\nLists the orders created in the last 14 days, at most the newest 500 of\nthem, oldest first unless `sort=created_at,DESC`. Read an older order\nby its ID with [Get an order](/api-reference/orders/get-an-order).\n\nFilter with `filter=field||$op||value` (repeatable, all must match):\n\n| Field | Operators |\n|---|---|\n| `status` | `$eq`, `$ne`, `$in` |\n| `payment_status` | `$eq`, `$in` |\n| `payment_method` | `$eq`, `$in` |\n| `phone` | `$eq` |\n| `ref` | `$eq` |\n| `product_id` | `$eq` |\n\n`$in` takes comma-separated values, up to 50. Up to 10 filters per\nrequest. `join=items` adds each order's cart items.\n",
        "x-scope": "read_orders",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Sort"
          },
          {
            "$ref": "#/components/parameters/CreatedSince"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "A filter, `field||$op||value`. Repeat it to combine filters.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "example": [
              "status||$eq||pending"
            ]
          },
          {
            "name": "join",
            "in": "query",
            "description": "`items` adds each order's cart items.",
            "schema": {
              "type": "string",
              "enum": [
                "items"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of orders.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Order"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as `cursor` for the next page; `null` on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c",
                      "number": 1042,
                      "status": "confirmed",
                      "payment_status": "pending_payment",
                      "payment_method": "cod",
                      "full_name": "Mona Hassan",
                      "email": "",
                      "phone": "+201001234567",
                      "phone_alt": "",
                      "country": "Egypt",
                      "city": "Cairo",
                      "address": "12 Tahrir St, Downtown",
                      "sa_national_address": "",
                      "note": "",
                      "ref": "",
                      "utm_source": "",
                      "utm_campaign": "",
                      "metadata": {
                        "is_app_order": true,
                        "app_name": "ERP Sync",
                        "erp_ref": "INV-778"
                      },
                      "product_cost": 900,
                      "shipping_cost": 60,
                      "coupon_code": "",
                      "coupon_discount": 0,
                      "total_cost": 960,
                      "custom_currency": "",
                      "is_digital": false,
                      "shipping_status": "",
                      "masked": false,
                      "masked_reason": null,
                      "items": [
                        {
                          "id": "2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f60",
                          "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                          "variant_id": null,
                          "quantity": 2,
                          "price": 450,
                          "metadata": {}
                        }
                      ],
                      "created_at": "2026-12-04T10:15:00Z",
                      "updated_at": "2026-12-04T10:20:00Z"
                    }
                  ],
                  "next_cursor": "Ab3kZ2l..."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/orders\" \\\n  --data-urlencode \"limit=20\" \\\n  --data-urlencode \"filter=status||\\$eq||pending\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['limit', '20'],\n  ['filter', 'status||$eq||pending'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/orders?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"limit\", \"20\")\n\tquery.Add(\"filter\", \"status||$eq||pending\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/orders?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'limit' => '20',\n    'filter' => 'status||$eq||pending',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/orders\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"limit\", \"20\"),\n        (\"filter\", \"status||$eq||pending\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "createOrder",
        "summary": "Create an order",
        "description": "**Scope:** [`write_orders`](/scopes)\n\nCreates an order. It starts `pending`, with the payment status\n`pending_payment`.\n\n- Set each item's `price`, `shipping_cost` and `total_cost` yourself,\n  or leave them out to use the store's prices and shipping.\n- `coupon_codes` apply to the prices; they cannot be sent with\n  `total_cost`.\n- Stock moves with the order: an item over the available stock of a\n  product that tracks it answers `409 insufficient_stock`.\n- A blocked phone number is refused.\n\nSend an `Idempotency-Key` to retry safely.\n",
        "x-scope": "write_orders",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderCreate"
              },
              "example": {
                "full_name": "Mona Hassan",
                "phone": "+201001234567",
                "country": "Egypt",
                "city": "Cairo",
                "address": "12 Tahrir St, Downtown",
                "payment_method": "cod",
                "items": [
                  {
                    "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                    "quantity": 2
                  }
                ],
                "metadata": {
                  "erp_ref": "INV-778"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/OrderCreated"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "description": "`insufficient_stock`, `product_gone` or `idempotency_in_progress`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_stock",
                    "message": "A product or variant of the order has less in stock than its items ask"
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/orders\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: INV-778\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"full_name\": \"Mona Hassan\",\n  \"phone\": \"+201001234567\",\n  \"country\": \"Egypt\",\n  \"city\": \"Cairo\",\n  \"address\": \"12 Tahrir St, Downtown\",\n  \"payment_method\": \"cod\",\n  \"items\": [\n    {\n      \"product_id\": \"0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\",\n      \"quantity\": 2\n    }\n  ],\n  \"metadata\": {\n    \"erp_ref\": \"INV-778\"\n  }\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'INV-778',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    full_name: 'Mona Hassan',\n    phone: '+201001234567',\n    country: 'Egypt',\n    city: 'Cairo',\n    address: '12 Tahrir St, Downtown',\n    payment_method: 'cod',\n    items: [\n      {\n        product_id: '0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10',\n        quantity: 2,\n      },\n    ],\n    metadata: {\n      erp_ref: 'INV-778',\n    },\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { order } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"full_name\": \"Mona Hassan\",\n\t  \"phone\": \"+201001234567\",\n\t  \"country\": \"Egypt\",\n\t  \"city\": \"Cairo\",\n\t  \"address\": \"12 Tahrir St, Downtown\",\n\t  \"payment_method\": \"cod\",\n\t  \"items\": [\n\t    {\n\t      \"product_id\": \"0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\",\n\t      \"quantity\": 2\n\t    }\n\t  ],\n\t  \"metadata\": {\n\t    \"erp_ref\": \"INV-778\"\n\t  }\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/orders\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"INV-778\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"order\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: INV-778',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'full_name' => 'Mona Hassan',\n        'phone' => '+201001234567',\n        'country' => 'Egypt',\n        'city' => 'Cairo',\n        'address' => '12 Tahrir St, Downtown',\n        'payment_method' => 'cod',\n        'items' => [\n            [\n                'product_id' => '0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10',\n                'quantity' => 2,\n            ],\n        ],\n        'metadata' => [\n            'erp_ref' => 'INV-778',\n        ],\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$order = $answer['order'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/orders\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"INV-778\",\n    },\n    json={\n        \"full_name\": \"Mona Hassan\",\n        \"phone\": \"+201001234567\",\n        \"country\": \"Egypt\",\n        \"city\": \"Cairo\",\n        \"address\": \"12 Tahrir St, Downtown\",\n        \"payment_method\": \"cod\",\n        \"items\": [\n            {\n                \"product_id\": \"0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\",\n                \"quantity\": 2,\n            },\n        ],\n        \"metadata\": {\n            \"erp_ref\": \"INV-778\",\n        },\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\norder = answer[\"order\"]"
          }
        ]
      }
    },
    "/orders/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrderID"
        }
      ],
      "get": {
        "tags": [
          "Orders"
        ],
        "operationId": "getOrder",
        "summary": "Get an order",
        "description": "**Scope:** [`read_orders`](/scopes)\n\nReads one order of any age, with its cart items.",
        "x-scope": "read_orders",
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { order } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"order\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$order = $answer['order'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\norder = answer[\"order\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Orders"
        ],
        "operationId": "updateOrder",
        "summary": "Update an order",
        "description": "**Scope:** [`write_orders`](/scopes)\n\nChanges only the fields you send; `null` is refused.\n\n- `items` replaces every cart item of the order, and stock moves with\n  it. An order that does not hold its stock (canceled, refunded, or\n  its payment failed) answers `409 order_closed`.\n- `metadata` is merged: the keys you send are added or changed, the\n  order's other keys stay. Reserved keys are refused.\n- Changing `items` or `shipping_cost` moves `total_cost` with them.\n- The email and phones of a digital order cannot change\n  (`409 digital_order`).\n",
        "x-scope": "write_orders",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderUpdate"
              },
              "example": {
                "city": "Giza",
                "metadata": {
                  "erp_ref": "INV-778"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderOK"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`order_closed`, `insufficient_stock`, `product_gone` or `digital_order`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "order_closed",
                    "message": "The order is canceled, refunded or failed payment: its items cannot change"
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"city\": \"Giza\",\n  \"metadata\": {\n    \"erp_ref\": \"INV-778\"\n  }\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    city: 'Giza',\n    metadata: {\n      erp_ref: 'INV-778',\n    },\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { order } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"city\": \"Giza\",\n\t  \"metadata\": {\n\t    \"erp_ref\": \"INV-778\"\n\t  }\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"order\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'city' => 'Giza',\n        'metadata' => [\n            'erp_ref' => 'INV-778',\n        ],\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$order = $answer['order'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"city\": \"Giza\",\n        \"metadata\": {\n            \"erp_ref\": \"INV-778\",\n        },\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\norder = answer[\"order\"]"
          }
        ]
      }
    },
    "/orders/{id}/status": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrderID"
        }
      ],
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "setOrderStatus",
        "summary": "Change the status",
        "description": "**Scope:** [`write_orders`](/scopes)\n\nSets the order's status. Stock moves in the same step: an order that\nstops holding its stock (canceled or refunded) gives it back, and one\nthat holds it again takes it again. Setting the status the order\nalready has changes nothing.\n\nPayment values (`pending_payment`, `paid`, `paid_failed`) are refused\nhere: use [Change the payment status](/api-reference/orders/change-the-payment-status).\n",
        "x-scope": "write_orders",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "status"
                ],
                "additionalProperties": false,
                "properties": {
                  "status": {
                    "$ref": "#/components/schemas/OrderStatus"
                  }
                }
              },
              "example": {
                "status": "confirmed"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`insufficient_stock` or `digital_order`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/status\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"status\": \"confirmed\"\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/status', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    status: 'confirmed',\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { order } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"status\": \"confirmed\"\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/status\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"order\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/status');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'status' => 'confirmed',\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$order = $answer['order'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/status\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"status\": \"confirmed\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\norder = answer[\"order\"]"
          }
        ]
      }
    },
    "/orders/{id}/payment-status": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrderID"
        }
      ],
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "setOrderPaymentStatus",
        "summary": "Change the payment status",
        "description": "**Scope:** [`write_orders`](/scopes)\n\nSets the payment status, apart from the order's status.\n`paid_failed` gives the stock back when the order held it, and\nleaving it takes the stock again, in the same step.\n\nA digital order cannot be set `paid` by an app, nor can a paid\ndigital order's payment status change (`409 digital_order`).\n",
        "x-scope": "write_orders",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "payment_status"
                ],
                "additionalProperties": false,
                "properties": {
                  "payment_status": {
                    "$ref": "#/components/schemas/PaymentStatus"
                  }
                }
              },
              "example": {
                "payment_status": "paid"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`insufficient_stock` or `digital_order`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/payment-status\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"payment_status\": \"paid\"\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/payment-status', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    payment_status: 'paid',\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { order } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"payment_status\": \"paid\"\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/payment-status\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"order\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/payment-status');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'payment_status' => 'paid',\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$order = $answer['order'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/payment-status\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"payment_status\": \"paid\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\norder = answer[\"order\"]"
          }
        ]
      }
    },
    "/orders/{id}/notes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrderID"
        }
      ],
      "get": {
        "tags": [
          "Orders"
        ],
        "operationId": "listOrderNotes",
        "summary": "List notes",
        "description": "**Scope:** [`read_orders`](/scopes)\n\nThe order's notes, newest first.",
        "x-scope": "read_orders",
        "responses": {
          "200": {
            "description": "The notes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/OrderNote"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c70",
                      "note": "Customer asked for delivery after 5 PM.",
                      "type": "private",
                      "created_at": "2026-12-04T11:00:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/notes\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/notes', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/notes\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/notes');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/notes\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "createOrderNote",
        "summary": "Add a note",
        "description": "**Scope:** [`write_orders`](/scopes)\n\nAdds a note to the order. A `public` note is shown to the shopper on\nthe order's page; `private` (the default) is the merchant's only. An\norder takes up to 500 notes from apps (`409 too_many_notes`).\n\nSend an `Idempotency-Key` to retry safely.\n",
        "x-scope": "write_orders",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "note"
                ],
                "additionalProperties": false,
                "properties": {
                  "note": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "The text, trimmed. No `<`."
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "private",
                      "public"
                    ],
                    "default": "private"
                  }
                }
              },
              "example": {
                "note": "Customer asked for delivery after 5 PM.",
                "type": "private"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The note added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "note"
                  ],
                  "properties": {
                    "note": {
                      "$ref": "#/components/schemas/OrderNote"
                    }
                  }
                },
                "example": {
                  "note": {
                    "id": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c70",
                    "note": "Customer asked for delivery after 5 PM.",
                    "type": "private",
                    "created_at": "2026-12-04T11:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`too_many_notes` or `idempotency_in_progress`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/notes\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: INV-778-note-1\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"note\": \"Customer asked for delivery after 5 PM.\",\n  \"type\": \"private\"\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/notes', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'INV-778-note-1',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    note: 'Customer asked for delivery after 5 PM.',\n    type: 'private',\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { note } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"note\": \"Customer asked for delivery after 5 PM.\",\n\t  \"type\": \"private\"\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/notes\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"INV-778-note-1\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"note\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/notes');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: INV-778-note-1',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'note' => 'Customer asked for delivery after 5 PM.',\n        'type' => 'private',\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$note = $answer['note'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/orders/6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c/notes\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"INV-778-note-1\",\n    },\n    json={\n        \"note\": \"Customer asked for delivery after 5 PM.\",\n        \"type\": \"private\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nnote = answer[\"note\"]"
          }
        ]
      }
    },
    "/pages": {
      "get": {
        "tags": [
          "Pages"
        ],
        "operationId": "listPages",
        "summary": "List pages",
        "description": "**Scope:** [`read_content`](/scopes)\n\nLists the store's pages, oldest first unless `sort=created_at,DESC`.\nA list leaves out each page's `content`: read it with\n[Get a page](/api-reference/pages/get-a-page).\n\nFilter with `filter=field||$op||value` (repeatable, all must match):\n\n| Field | Operators |\n|---|---|\n| `slug` | `$eq`, `$in` |\n| `title` | `$eq`, `$cont` |\n| `is_active` | `$eq` |\n| `show_in_header` | `$eq` |\n| `show_in_footer` | `$eq` |\n| `show_under_gallery` | `$eq` |\n| `is_need_review` | `$eq` |\n| `created_at` | `$gt`, `$gte`, `$lt`, `$lte` |\n\n`$in` takes comma-separated values, up to 50. Up to 10 filters per\nrequest.\n",
        "x-scope": "read_content",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Sort"
          },
          {
            "$ref": "#/components/parameters/CreatedSince"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "A filter, `field||$op||value`. Repeat it to combine filters.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "example": [
              "is_active||$eq||true"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the store's pages, without their content.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Page"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as `cursor` for the next page; `null` on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70",
                      "title": "Return policy",
                      "slug": "return-policy",
                      "show_in_header": false,
                      "show_in_footer": true,
                      "show_under_gallery": false,
                      "position": 2,
                      "is_active": true,
                      "is_need_review": false,
                      "created_at": "2026-11-20T09:00:00Z",
                      "updated_at": "2026-12-04T11:30:00Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/pages\" \\\n  --data-urlencode \"limit=20\" \\\n  --data-urlencode \"filter=is_active||\\$eq||true\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['limit', '20'],\n  ['filter', 'is_active||$eq||true'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/pages?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"limit\", \"20\")\n\tquery.Add(\"filter\", \"is_active||$eq||true\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/pages?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'limit' => '20',\n    'filter' => 'is_active||$eq||true',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/pages?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/pages\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"limit\", \"20\"),\n        (\"filter\", \"is_active||$eq||true\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Pages"
        ],
        "operationId": "createPage",
        "summary": "Create a page",
        "description": "**Scope:** [`write_content`](/scopes)\n\nCreates a page. `title` and `content` are required.\n\n- `content` is HTML, up to 51,200 bytes as sent. Unsafe HTML is\n  removed before it is saved, and the answer holds the cleaned\n  content. See [HTML content](/api-reference/pages/overview#html-content).\n- Without `slug`, one is made from the title. A `slug` another page\n  of the store has answers `409 slug_taken`.\n- The title and content go through an AI content check, which can\n  take up to 15 seconds. When it flags them, the page is saved anyway\n  with `is_need_review: true`.\n\nSend an `Idempotency-Key` to retry safely.\n",
        "x-scope": "write_content",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PageCreate"
              },
              "example": {
                "title": "Return policy",
                "content": "<h2>Returns</h2><p>You can return any item within <strong>14 days</strong> of delivery.</p>",
                "show_in_footer": true,
                "position": 2
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The page created. `Location` is its path.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the saved answer of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "page"
                  ],
                  "properties": {
                    "page": {
                      "$ref": "#/components/schemas/Page"
                    }
                  }
                },
                "example": {
                  "page": {
                    "id": "3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70",
                    "title": "Return policy",
                    "slug": "return-policy",
                    "content": "<h2>Returns</h2><p>You can return any item within <strong>14 days</strong> of delivery.</p>",
                    "show_in_header": false,
                    "show_in_footer": true,
                    "show_under_gallery": false,
                    "position": 2,
                    "is_active": true,
                    "is_need_review": false,
                    "created_at": "2026-11-20T09:00:00Z",
                    "updated_at": "2026-11-20T09:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "description": "`slug_taken`, or `idempotency_in_progress` while a request with the same `Idempotency-Key` is still running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "slug_taken",
                    "message": "Another page of the store has this slug"
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PageBodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/pages\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: page-return-policy\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"title\": \"Return policy\",\n  \"content\": \"<h2>Returns</h2><p>You can return any item within <strong>14 days</strong> of delivery.</p>\",\n  \"show_in_footer\": true,\n  \"position\": 2\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/pages', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'page-return-policy',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    title: 'Return policy',\n    content: '<h2>Returns</h2><p>You can return any item within <strong>14 days</strong> of delivery.</p>',\n    show_in_footer: true,\n    position: 2,\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { page } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"title\": \"Return policy\",\n\t  \"content\": \"<h2>Returns</h2><p>You can return any item within <strong>14 days</strong> of delivery.</p>\",\n\t  \"show_in_footer\": true,\n\t  \"position\": 2\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/pages\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"page-return-policy\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"page\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/pages');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: page-return-policy',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'title' => 'Return policy',\n        'content' => '<h2>Returns</h2><p>You can return any item within <strong>14 days</strong> of delivery.</p>',\n        'show_in_footer' => true,\n        'position' => 2,\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$page = $answer['page'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/pages\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"page-return-policy\",\n    },\n    json={\n        \"title\": \"Return policy\",\n        \"content\": \"<h2>Returns</h2><p>You can return any item within <strong>14 days</strong> of delivery.</p>\",\n        \"show_in_footer\": True,\n        \"position\": 2,\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\npage = answer[\"page\"]"
          }
        ]
      }
    },
    "/pages/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/PageID"
        }
      ],
      "get": {
        "tags": [
          "Pages"
        ],
        "operationId": "getPage",
        "summary": "Get a page",
        "description": "**Scope:** [`read_content`](/scopes)\n\nReads one page, with its `content`.",
        "x-scope": "read_content",
        "responses": {
          "200": {
            "$ref": "#/components/responses/PageOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "The request has a query parameter; this endpoint takes none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "validation_failed",
                    "message": "Validation failed",
                    "details": {
                      "fields": [
                        {
                          "field": "join",
                          "rule": "unknown"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { page } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"page\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$page = $answer['page'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\npage = answer[\"page\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Pages"
        ],
        "operationId": "updatePage",
        "summary": "Update a page",
        "description": "**Scope:** [`write_content`](/scopes)\n\nChanges only the fields you send; `null` is refused.\n\n- `content` is cleaned of unsafe HTML, as on create, and the answer\n  holds the cleaned content.\n- Changing the title does not change the slug: send `slug` to change\n  it. A `slug` another page of the store has answers\n  `409 slug_taken`.\n- Changing the title or the content runs the AI content check again.\n  A flag sets `is_need_review: true`; a passing check never sets it\n  back to `false`.\n",
        "x-scope": "write_content",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PageUpdate"
              },
              "example": {
                "is_active": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/PageOK"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`slug_taken`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "slug_taken",
                    "message": "Another page of the store has this slug"
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/PageBodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"is_active\": false\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    is_active: false,\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { page } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"is_active\": false\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"page\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'is_active' => false,\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$page = $answer['page'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"is_active\": False,\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\npage = answer[\"page\"]"
          }
        ]
      },
      "delete": {
        "tags": [
          "Pages"
        ],
        "operationId": "deletePage",
        "summary": "Delete a page",
        "description": "**Scope:** [`write_content`](/scopes)\n\nDeletes the page for good, as the merchant's dashboard does. There is\nno undo; to take a page off the storefront and keep it, set\n`is_active: false` instead.\n",
        "x-scope": "write_content",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nif (!response.ok) {\n  const { error } = await response.json()\n  throw new Error(`${error.code}: ${error.message}`)\n}"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode >= 300 {\n\t\tvar answer map[string]any\n\t\t_ = json.NewDecoder(res.Body).Decode(&answer)\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(res.Status)\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.easy-orders.net/api/partners-apps/v1/pages/3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nif not response.ok:\n    error = response.json()[\"error\"]\n    raise RuntimeError(f\"{error['code']}: {error['message']}\")"
          }
        ]
      }
    },
    "/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "operationId": "listProducts",
        "summary": "List products",
        "description": "**Scope:** [`read_products`](/scopes)\n\nLists the store's products, oldest first unless\n`sort=created_at,DESC`. Lists leave out each product's `description`:\nread it with [Get a product](/api-reference/products/get-a-product).\n\nFilter with `filter=field||$op||value` (repeatable, all must match):\n\n| Field | Operators |\n|---|---|\n| `slug` | `$eq`, `$in` |\n| `sku` | `$eq`, `$in` |\n| `external_sku` | `$eq`, `$in` |\n| `name` | `$eq`, `$cont` (any letter case) |\n| `hidden` | `$eq` (`true` or `false`) |\n| `is_digital` | `$eq` (`true` or `false`) |\n| `created_at` | `$gt`, `$gte`, `$lt`, `$lte` (RFC 3339) |\n\n`$in` takes comma-separated values, up to 50. Up to 10 filters per\nrequest.\n\n`join` adds relations to each product, comma-separated: `options`,\n`variants`, and `categories` (which adds `category_ids`).\n",
        "x-scope": "read_products",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Sort"
          },
          {
            "$ref": "#/components/parameters/CreatedSince"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "A filter, `field||$op||value`. Repeat it to combine filters.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "example": [
              "hidden||$eq||false"
            ]
          },
          {
            "$ref": "#/components/parameters/ProductJoin"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of products.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as `cursor` for the next page; `null` on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                      "name": "Classic Cotton T-Shirt",
                      "slug": "classic-cotton-t-shirt",
                      "sku": "TS-CLASSIC",
                      "external_sku": "",
                      "source_app": "ERP Sync",
                      "meta_description": "",
                      "price": 450,
                      "sale_price": 399,
                      "sale_end_date": null,
                      "thumb": "https://cdn.example.com/products/tshirt.jpg",
                      "images": [
                        "https://cdn.example.com/products/tshirt-back.jpg"
                      ],
                      "position": 0,
                      "hidden": false,
                      "quantity": 0,
                      "track_stock": true,
                      "disable_orders_for_no_stock": false,
                      "is_digital": false,
                      "digital_type": null,
                      "is_skip_cart": false,
                      "buy_now_text": "",
                      "is_fixed_bottom_buy": false,
                      "is_one_page_checkout": false,
                      "is_fast_checkout": false,
                      "is_free_shipping": false,
                      "is_quantity_hidden": false,
                      "is_header_hidden": false,
                      "hide_related_products": false,
                      "is_reviews_enabled": false,
                      "is_visitor_counter": false,
                      "visitor_counter_min": 0,
                      "visitor_counter_max": 0,
                      "is_countdown_timer": false,
                      "countdown_timer_hours": 0,
                      "created_at": "2026-12-04T09:00:00Z",
                      "updated_at": "2026-12-04T09:30:00Z"
                    }
                  ],
                  "next_cursor": "Ab3kZ2l..."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/products\" \\\n  --data-urlencode \"limit=20\" \\\n  --data-urlencode \"filter=hidden||\\$eq||false\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['limit', '20'],\n  ['filter', 'hidden||$eq||false'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/products?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"limit\", \"20\")\n\tquery.Add(\"filter\", \"hidden||$eq||false\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/products?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'limit' => '20',\n    'filter' => 'hidden||$eq||false',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/products?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/products\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"limit\", \"20\"),\n        (\"filter\", \"hidden||$eq||false\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Products"
        ],
        "operationId": "createProduct",
        "summary": "Create a product",
        "description": "**Scope:** [`write_products`](/scopes)\n\nCreates a product. `name`, `price` and `thumb` are required; every\nother field starts empty, zero or `false`, as in the dashboard.\n\n- Without a `slug`, one is made from the name (`product` when the\n  name has no Latin letters or digits), with a random suffix when\n  taken. A `slug` you send must be free (`409 slug_taken`).\n- `description` is HTML, cleaned before it is saved: see\n  [HTML descriptions](/api-reference/products/overview#html-descriptions).\n- `options` and `variants` go together: see\n  [Options and variants](/api-reference/products/overview#options-and-variants).\n  Variants you create have no `id` yet.\n- The body is at most 50 KB (`413 body_too_large`), and so is the\n  product it makes (`422 product_too_large`).\n- The store must have no unpaid dues (`402 store_overdue`). Each\n  product created charges the store the import fee, as importing\n  from the dashboard does.\n- The name, description and meta description go through an\n  automatic content review: see\n  [Content review](/api-reference/products/overview#content-review).\n- Apps cannot create digital products.\n\n`source_app` is set to your app's name. Send an `Idempotency-Key` to\nretry safely.\n",
        "x-scope": "write_products",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCreate"
              },
              "example": {
                "name": "Classic Cotton T-Shirt",
                "sku": "TS-CLASSIC",
                "description": "<p>Soft cotton, cut for everyday wear.</p>",
                "price": 450,
                "sale_price": 399,
                "thumb": "https://cdn.example.com/products/tshirt.jpg",
                "images": [
                  "https://cdn.example.com/products/tshirt-back.jpg"
                ],
                "track_stock": true,
                "category_ids": [
                  "5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
                ],
                "options": [
                  {
                    "name": "Size",
                    "type": "button",
                    "values": [
                      {
                        "name": "M"
                      },
                      {
                        "name": "L"
                      }
                    ]
                  }
                ],
                "variants": [
                  {
                    "price": 450,
                    "quantity": 40,
                    "sku": "TS-CLASSIC-M",
                    "options": {
                      "Size": "M"
                    }
                  },
                  {
                    "price": 450,
                    "quantity": 25,
                    "sku": "TS-CLASSIC-L",
                    "options": {
                      "Size": "L"
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/ProductCreated"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "`store_overdue` when the store has unpaid dues, or `payment_required` when your app's subscription on this store is suspended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "store_overdue",
                    "message": "The store has an overdue balance: products cannot be created until it is paid"
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "description": "`slug_taken` or `idempotency_in_progress`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "slug_taken",
                    "message": "Another product of the store has this slug"
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ProductBodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ProductRefused"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/products\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: ERP-SKU-TS-CLASSIC\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"Classic Cotton T-Shirt\",\n  \"sku\": \"TS-CLASSIC\",\n  \"description\": \"<p>Soft cotton, cut for everyday wear.</p>\",\n  \"price\": 450,\n  \"sale_price\": 399,\n  \"thumb\": \"https://cdn.example.com/products/tshirt.jpg\",\n  \"images\": [\n    \"https://cdn.example.com/products/tshirt-back.jpg\"\n  ],\n  \"track_stock\": true,\n  \"category_ids\": [\n    \"5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\"\n  ],\n  \"options\": [\n    {\n      \"name\": \"Size\",\n      \"type\": \"button\",\n      \"values\": [\n        {\n          \"name\": \"M\"\n        },\n        {\n          \"name\": \"L\"\n        }\n      ]\n    }\n  ],\n  \"variants\": [\n    {\n      \"price\": 450,\n      \"quantity\": 40,\n      \"sku\": \"TS-CLASSIC-M\",\n      \"options\": {\n        \"Size\": \"M\"\n      }\n    },\n    {\n      \"price\": 450,\n      \"quantity\": 25,\n      \"sku\": \"TS-CLASSIC-L\",\n      \"options\": {\n        \"Size\": \"L\"\n      }\n    }\n  ]\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/products', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'ERP-SKU-TS-CLASSIC',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    name: 'Classic Cotton T-Shirt',\n    sku: 'TS-CLASSIC',\n    description: '<p>Soft cotton, cut for everyday wear.</p>',\n    price: 450,\n    sale_price: 399,\n    thumb: 'https://cdn.example.com/products/tshirt.jpg',\n    images: [\n      'https://cdn.example.com/products/tshirt-back.jpg',\n    ],\n    track_stock: true,\n    category_ids: [\n      '5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f',\n    ],\n    options: [\n      {\n        name: 'Size',\n        type: 'button',\n        values: [\n          {\n            name: 'M',\n          },\n          {\n            name: 'L',\n          },\n        ],\n      },\n    ],\n    variants: [\n      {\n        price: 450,\n        quantity: 40,\n        sku: 'TS-CLASSIC-M',\n        options: {\n          Size: 'M',\n        },\n      },\n      {\n        price: 450,\n        quantity: 25,\n        sku: 'TS-CLASSIC-L',\n        options: {\n          Size: 'L',\n        },\n      },\n    ],\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { product } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"name\": \"Classic Cotton T-Shirt\",\n\t  \"sku\": \"TS-CLASSIC\",\n\t  \"description\": \"<p>Soft cotton, cut for everyday wear.</p>\",\n\t  \"price\": 450,\n\t  \"sale_price\": 399,\n\t  \"thumb\": \"https://cdn.example.com/products/tshirt.jpg\",\n\t  \"images\": [\n\t    \"https://cdn.example.com/products/tshirt-back.jpg\"\n\t  ],\n\t  \"track_stock\": true,\n\t  \"category_ids\": [\n\t    \"5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\"\n\t  ],\n\t  \"options\": [\n\t    {\n\t      \"name\": \"Size\",\n\t      \"type\": \"button\",\n\t      \"values\": [\n\t        {\n\t          \"name\": \"M\"\n\t        },\n\t        {\n\t          \"name\": \"L\"\n\t        }\n\t      ]\n\t    }\n\t  ],\n\t  \"variants\": [\n\t    {\n\t      \"price\": 450,\n\t      \"quantity\": 40,\n\t      \"sku\": \"TS-CLASSIC-M\",\n\t      \"options\": {\n\t        \"Size\": \"M\"\n\t      }\n\t    },\n\t    {\n\t      \"price\": 450,\n\t      \"quantity\": 25,\n\t      \"sku\": \"TS-CLASSIC-L\",\n\t      \"options\": {\n\t        \"Size\": \"L\"\n\t      }\n\t    }\n\t  ]\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/products\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"ERP-SKU-TS-CLASSIC\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"product\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/products');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: ERP-SKU-TS-CLASSIC',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'Classic Cotton T-Shirt',\n        'sku' => 'TS-CLASSIC',\n        'description' => '<p>Soft cotton, cut for everyday wear.</p>',\n        'price' => 450,\n        'sale_price' => 399,\n        'thumb' => 'https://cdn.example.com/products/tshirt.jpg',\n        'images' => [\n            'https://cdn.example.com/products/tshirt-back.jpg',\n        ],\n        'track_stock' => true,\n        'category_ids' => [\n            '5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f',\n        ],\n        'options' => [\n            [\n                'name' => 'Size',\n                'type' => 'button',\n                'values' => [\n                    [\n                        'name' => 'M',\n                    ],\n                    [\n                        'name' => 'L',\n                    ],\n                ],\n            ],\n        ],\n        'variants' => [\n            [\n                'price' => 450,\n                'quantity' => 40,\n                'sku' => 'TS-CLASSIC-M',\n                'options' => [\n                    'Size' => 'M',\n                ],\n            ],\n            [\n                'price' => 450,\n                'quantity' => 25,\n                'sku' => 'TS-CLASSIC-L',\n                'options' => [\n                    'Size' => 'L',\n                ],\n            ],\n        ],\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$product = $answer['product'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/products\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"ERP-SKU-TS-CLASSIC\",\n    },\n    json={\n        \"name\": \"Classic Cotton T-Shirt\",\n        \"sku\": \"TS-CLASSIC\",\n        \"description\": \"<p>Soft cotton, cut for everyday wear.</p>\",\n        \"price\": 450,\n        \"sale_price\": 399,\n        \"thumb\": \"https://cdn.example.com/products/tshirt.jpg\",\n        \"images\": [\n            \"https://cdn.example.com/products/tshirt-back.jpg\",\n        ],\n        \"track_stock\": True,\n        \"category_ids\": [\n            \"5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f\",\n        ],\n        \"options\": [\n            {\n                \"name\": \"Size\",\n                \"type\": \"button\",\n                \"values\": [\n                    {\n                        \"name\": \"M\",\n                    },\n                    {\n                        \"name\": \"L\",\n                    },\n                ],\n            },\n        ],\n        \"variants\": [\n            {\n                \"price\": 450,\n                \"quantity\": 40,\n                \"sku\": \"TS-CLASSIC-M\",\n                \"options\": {\n                    \"Size\": \"M\",\n                },\n            },\n            {\n                \"price\": 450,\n                \"quantity\": 25,\n                \"sku\": \"TS-CLASSIC-L\",\n                \"options\": {\n                    \"Size\": \"L\",\n                },\n            },\n        ],\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nproduct = answer[\"product\"]"
          }
        ]
      }
    },
    "/products/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProductID"
        }
      ],
      "get": {
        "tags": [
          "Products"
        ],
        "operationId": "getProduct",
        "summary": "Get a product",
        "description": "**Scope:** [`read_products`](/scopes)\n\nReads one product, with its `description`.\n\n`join` adds relations, comma-separated: `options`, `variants`, and\n`categories` (which adds `category_ids`). Without it, those fields\nare left out.\n",
        "x-scope": "read_products",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProductJoin"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProductOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\" \\\n  --data-urlencode \"join=options,variants,categories\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['join', 'options,variants,categories'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { product } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"join\", \"options,variants,categories\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"product\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'join' => 'options,variants,categories',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$product = $answer['product'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"join\", \"options,variants,categories\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nproduct = answer[\"product\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Products"
        ],
        "operationId": "updateProduct",
        "summary": "Update a product",
        "description": "**Scope:** [`write_products`](/scopes)\n\nChanges only the fields you send. `null` is refused, except for\n`sale_end_date`, where it removes the end date.\n\n- `images` and `category_ids` replace the product's whole list.\n- `options` replaces every option. Sending `options` needs `variants`\n  in the same request.\n- `variants` is matched by `id`: a variant with an `id` is updated\n  and keeps its ID, one without an `id` is created, and a variant you\n  leave out is deleted. See\n  [Options and variants](/api-reference/products/overview#options-and-variants).\n- `quantity` sets the stock. To add or take away an amount, use\n  [Adjust stock](/api-reference/products/adjust-stock).\n- A product larger than 50 KB is refused (`422 product_too_large`),\n  unless it was larger before and your change does not make it\n  larger.\n- A change to the name, description or meta description goes through\n  the [content review](/api-reference/products/overview#content-review).\n- A digital product has no options or variants; one sold as codes\n  also keeps its stock fields (`422`, rule `digital`).\n\nThe answer has every relation: `options`, `variants` and\n`category_ids`.\n",
        "x-scope": "write_products",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUpdate"
              },
              "example": {
                "price": 420,
                "sale_price": 0,
                "variants": [
                  {
                    "id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01",
                    "price": 420,
                    "quantity": 35,
                    "sku": "TS-CLASSIC-M",
                    "options": {
                      "Size": "M"
                    }
                  },
                  {
                    "id": "8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12",
                    "price": 420,
                    "quantity": 25,
                    "sku": "TS-CLASSIC-L",
                    "options": {
                      "Size": "L"
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProductOK"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`slug_taken`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "slug_taken",
                    "message": "Another product of the store has this slug"
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ProductBodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ProductRefused"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"price\": 420,\n  \"sale_price\": 0,\n  \"variants\": [\n    {\n      \"id\": \"7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01\",\n      \"price\": 420,\n      \"quantity\": 35,\n      \"sku\": \"TS-CLASSIC-M\",\n      \"options\": {\n        \"Size\": \"M\"\n      }\n    },\n    {\n      \"id\": \"8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\",\n      \"price\": 420,\n      \"quantity\": 25,\n      \"sku\": \"TS-CLASSIC-L\",\n      \"options\": {\n        \"Size\": \"L\"\n      }\n    }\n  ]\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    price: 420,\n    sale_price: 0,\n    variants: [\n      {\n        id: '7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01',\n        price: 420,\n        quantity: 35,\n        sku: 'TS-CLASSIC-M',\n        options: {\n          Size: 'M',\n        },\n      },\n      {\n        id: '8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12',\n        price: 420,\n        quantity: 25,\n        sku: 'TS-CLASSIC-L',\n        options: {\n          Size: 'L',\n        },\n      },\n    ],\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { product } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"price\": 420,\n\t  \"sale_price\": 0,\n\t  \"variants\": [\n\t    {\n\t      \"id\": \"7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01\",\n\t      \"price\": 420,\n\t      \"quantity\": 35,\n\t      \"sku\": \"TS-CLASSIC-M\",\n\t      \"options\": {\n\t        \"Size\": \"M\"\n\t      }\n\t    },\n\t    {\n\t      \"id\": \"8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\",\n\t      \"price\": 420,\n\t      \"quantity\": 25,\n\t      \"sku\": \"TS-CLASSIC-L\",\n\t      \"options\": {\n\t        \"Size\": \"L\"\n\t      }\n\t    }\n\t  ]\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"product\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'price' => 420,\n        'sale_price' => 0,\n        'variants' => [\n            [\n                'id' => '7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01',\n                'price' => 420,\n                'quantity' => 35,\n                'sku' => 'TS-CLASSIC-M',\n                'options' => [\n                    'Size' => 'M',\n                ],\n            ],\n            [\n                'id' => '8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12',\n                'price' => 420,\n                'quantity' => 25,\n                'sku' => 'TS-CLASSIC-L',\n                'options' => [\n                    'Size' => 'L',\n                ],\n            ],\n        ],\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$product = $answer['product'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"price\": 420,\n        \"sale_price\": 0,\n        \"variants\": [\n            {\n                \"id\": \"7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01\",\n                \"price\": 420,\n                \"quantity\": 35,\n                \"sku\": \"TS-CLASSIC-M\",\n                \"options\": {\n                    \"Size\": \"M\",\n                },\n            },\n            {\n                \"id\": \"8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12\",\n                \"price\": 420,\n                \"quantity\": 25,\n                \"sku\": \"TS-CLASSIC-L\",\n                \"options\": {\n                    \"Size\": \"L\",\n                },\n            },\n        ],\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nproduct = answer[\"product\"]"
          }
        ]
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "operationId": "deleteProduct",
        "summary": "Delete a product",
        "description": "**Scope:** [`write_products`](/scopes)\n\nDeletes a product: it no longer shows in lists, and reading it\nanswers `404`. A deleted product cannot be restored through the API.\n",
        "x-scope": "write_products",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nif (!response.ok) {\n  const { error } = await response.json()\n  throw new Error(`${error.code}: ${error.message}`)\n}"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode >= 300 {\n\t\tvar answer map[string]any\n\t\t_ = json.NewDecoder(res.Body).Decode(&answer)\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(res.Status)\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nif not response.ok:\n    error = response.json()[\"error\"]\n    raise RuntimeError(f\"{error['code']}: {error['message']}\")"
          }
        ]
      }
    },
    "/products/{id}/inventory/adjust": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ProductID"
        }
      ],
      "post": {
        "tags": [
          "Products"
        ],
        "operationId": "adjustProductInventory",
        "summary": "Adjust stock",
        "description": "**Scope:** [`write_products`](/scopes)\n\nAdds `delta` to the stock in one step: a negative `delta` takes\naway. With `variant_id`, the variant's stock changes; without it, the\nproduct's. Adjustments that meet (yours, another app's, an order's)\nall count.\n\nThe stock stays from 0 to 1,000,000,000: past that, nothing changes\nand the answer is `409 quantity_below_zero` or\n`409 quantity_above_max`. The stock of a digital product sold as\ncodes is the number of codes left, and cannot be adjusted\n(`409 stock_follows_codes`).\n\nSend an `Idempotency-Key` so a retry does not adjust twice.\n",
        "x-scope": "write_products",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductInventoryAdjust"
              },
              "example": {
                "variant_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01",
                "delta": -3
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stock after the adjustment.",
            "headers": {
              "Idempotent-Replayed": {
                "description": "`true` when this is the saved answer of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "inventory"
                  ],
                  "properties": {
                    "inventory": {
                      "$ref": "#/components/schemas/ProductInventory"
                    }
                  }
                },
                "example": {
                  "inventory": {
                    "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                    "variant_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01",
                    "quantity": 37
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "description": "No such product in this store, or `variant_id` is not one of its variants.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Resource not found"
                  }
                }
              }
            }
          },
          "409": {
            "description": "`quantity_below_zero`, `quantity_above_max`, `stock_follows_codes` or `idempotency_in_progress`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "quantity_below_zero",
                    "message": "The quantity would go below zero"
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/inventory/adjust\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: ERP-STOCK-MOVE-5512\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"variant_id\": \"7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01\",\n  \"delta\": -3\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/inventory/adjust', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'ERP-STOCK-MOVE-5512',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    variant_id: '7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01',\n    delta: -3,\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { inventory } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"variant_id\": \"7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01\",\n\t  \"delta\": -3\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/inventory/adjust\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"ERP-STOCK-MOVE-5512\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"inventory\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/inventory/adjust');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: ERP-STOCK-MOVE-5512',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'variant_id' => '7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01',\n        'delta' => -3,\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$inventory = $answer['inventory'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/products/0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10/inventory/adjust\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"ERP-STOCK-MOVE-5512\",\n    },\n    json={\n        \"variant_id\": \"7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01\",\n        \"delta\": -3,\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ninventory = answer[\"inventory\"]"
          }
        ]
      }
    },
    "/reviews": {
      "get": {
        "tags": [
          "Reviews"
        ],
        "operationId": "listReviews",
        "summary": "List reviews",
        "description": "**Scope:** [`read_reviews`](/scopes)\n\nLists the store's reviews, oldest first unless `sort=created_at,DESC`.\n\nFilter with `filter=field||$op||value` (repeatable, all must match):\n\n| Field | Operators |\n|---|---|\n| `product_id` | `$eq`, `$in` |\n| `is_accepted` | `$eq` |\n| `rating` | `$eq`, `$in`, `$gte`, `$lte` |\n| `created_at` | `$gt`, `$gte`, `$lt`, `$lte` |\n\n`$in` takes comma-separated values, up to 50. Up to 10 filters per\nrequest.\n",
        "x-scope": "read_reviews",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Sort"
          },
          {
            "$ref": "#/components/parameters/CreatedSince"
          },
          {
            "name": "filter",
            "in": "query",
            "description": "A filter, `field||$op||value`. Repeat it to combine filters.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "example": [
              "is_accepted||$eq||false"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "A page of reviews.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Review"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as `cursor` for the next page; `null` on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a",
                      "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                      "rating": 5,
                      "user_name": "Sara Adel",
                      "comment": "Great quality, arrived in two days.\nWould buy again.",
                      "image": "https://cdn.example.com/reviews/sara-shoes.jpg",
                      "is_accepted": true,
                      "created_at": "2026-12-04T12:30:00Z",
                      "updated_at": "2026-12-04T12:30:00Z"
                    }
                  ],
                  "next_cursor": "Ab3kZ2l..."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -G \"https://api.easy-orders.net/api/partners-apps/v1/reviews\" \\\n  --data-urlencode \"limit=20\" \\\n  --data-urlencode \"filter=is_accepted||\\$eq||false\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const params = new URLSearchParams([\n  ['limit', '20'],\n  ['filter', 'is_accepted||$eq||false'],\n])\nconst url = 'https://api.easy-orders.net/api/partners-apps/v1/reviews?' + params\n\nconst response = await fetch(url, {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { data } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tquery := url.Values{}\n\tquery.Add(\"limit\", \"20\")\n\tquery.Add(\"filter\", \"is_accepted||$eq||false\")\n\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/reviews?\"+query.Encode(), nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"data\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$query = http_build_query([\n    'limit' => '20',\n    'filter' => 'is_accepted||$eq||false',\n]);\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/reviews?' . $query);\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$data = $answer['data'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/reviews\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    params=[\n        (\"limit\", \"20\"),\n        (\"filter\", \"is_accepted||$eq||false\"),\n    ],\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ndata = answer[\"data\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Reviews"
        ],
        "operationId": "createReview",
        "summary": "Create a review",
        "description": "**Scope:** [`write_reviews`](/scopes)\n\nAdds a review to a product of the store. `is_accepted` is `false`\nunless you send `true`: only accepted reviews show on the product\npage.\n\n- `product_id` must be a live product of this store, or the answer\n  is `422` with the rule `product`. It cannot change later.\n- `user_name` and `comment` are plain text: `<` is refused.\n- `image` must be an `https` URL.\n\nSends the `reviews/created` event. Send an `Idempotency-Key` to\nretry safely.\n",
        "x-scope": "write_reviews",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewCreate"
              },
              "example": {
                "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                "rating": 5,
                "user_name": "Sara Adel",
                "comment": "Great quality, arrived in two days.\nWould buy again.",
                "image": "https://cdn.example.com/reviews/sara-shoes.jpg",
                "is_accepted": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The review created. `Location` is its path.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the saved answer of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "review"
                  ],
                  "properties": {
                    "review": {
                      "$ref": "#/components/schemas/Review"
                    }
                  }
                },
                "example": {
                  "review": {
                    "id": "7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a",
                    "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                    "rating": 5,
                    "user_name": "Sara Adel",
                    "comment": "Great quality, arrived in two days.\nWould buy again.",
                    "image": "https://cdn.example.com/reviews/sara-shoes.jpg",
                    "is_accepted": true,
                    "created_at": "2026-12-04T12:30:00Z",
                    "updated_at": "2026-12-04T12:30:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "description": "`idempotency_in_progress`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "idempotency_in_progress",
                    "message": "A request with this Idempotency-Key is still running; retry shortly"
                  }
                }
              }
            }
          },
          "422": {
            "description": "`validation_failed`, for instance when `product_id` is not a live product of this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "validation_failed",
                    "message": "Validation failed",
                    "details": {
                      "fields": [
                        {
                          "field": "product_id",
                          "rule": "product"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/reviews\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: review-import-7781\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"product_id\": \"0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\",\n  \"rating\": 5,\n  \"user_name\": \"Sara Adel\",\n  \"comment\": \"Great quality, arrived in two days.\\nWould buy again.\",\n  \"image\": \"https://cdn.example.com/reviews/sara-shoes.jpg\",\n  \"is_accepted\": true\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/reviews', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'review-import-7781',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    product_id: '0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10',\n    rating: 5,\n    user_name: 'Sara Adel',\n    comment: 'Great quality, arrived in two days.\\nWould buy again.',\n    image: 'https://cdn.example.com/reviews/sara-shoes.jpg',\n    is_accepted: true,\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { review } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"product_id\": \"0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\",\n\t  \"rating\": 5,\n\t  \"user_name\": \"Sara Adel\",\n\t  \"comment\": \"Great quality, arrived in two days.\\nWould buy again.\",\n\t  \"image\": \"https://cdn.example.com/reviews/sara-shoes.jpg\",\n\t  \"is_accepted\": true\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/reviews\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"review-import-7781\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"review\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/reviews');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: review-import-7781',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'product_id' => '0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10',\n        'rating' => 5,\n        'user_name' => 'Sara Adel',\n        'comment' => \"Great quality, arrived in two days.\\nWould buy again.\",\n        'image' => 'https://cdn.example.com/reviews/sara-shoes.jpg',\n        'is_accepted' => true,\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$review = $answer['review'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/reviews\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"review-import-7781\",\n    },\n    json={\n        \"product_id\": \"0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10\",\n        \"rating\": 5,\n        \"user_name\": \"Sara Adel\",\n        \"comment\": \"Great quality, arrived in two days.\\nWould buy again.\",\n        \"image\": \"https://cdn.example.com/reviews/sara-shoes.jpg\",\n        \"is_accepted\": True,\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nreview = answer[\"review\"]"
          }
        ]
      }
    },
    "/reviews/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ReviewID"
        }
      ],
      "get": {
        "tags": [
          "Reviews"
        ],
        "operationId": "getReview",
        "summary": "Get a review",
        "description": "**Scope:** [`read_reviews`](/scopes)\n\nReads one review. It takes no query parameters.",
        "x-scope": "read_reviews",
        "responses": {
          "200": {
            "$ref": "#/components/responses/ReviewOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { review } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"review\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$review = $answer['review'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nreview = answer[\"review\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Reviews"
        ],
        "operationId": "updateReview",
        "summary": "Update a review",
        "description": "**Scope:** [`write_reviews`](/scopes)\n\nChanges only the fields you send; `null` is refused. Set\n`is_accepted` to show the review on the product page or hide it.\n\nA review stays on its product: sending `product_id` answers `422`\nwith the rule `read_only`.\n",
        "x-scope": "write_reviews",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewUpdate"
              },
              "example": {
                "is_accepted": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ReviewOK"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"is_accepted\": true\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    is_accepted: true,\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { review } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"is_accepted\": true\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"review\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'is_accepted' => true,\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$review = $answer['review'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"is_accepted\": True,\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nreview = answer[\"review\"]"
          }
        ]
      },
      "delete": {
        "tags": [
          "Reviews"
        ],
        "operationId": "deleteReview",
        "summary": "Delete a review",
        "description": "**Scope:** [`write_reviews`](/scopes)\n\nDeletes a review for good, as the dashboard does. It cannot be brought back.",
        "x-scope": "write_reviews",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nif (!response.ok) {\n  const { error } = await response.json()\n  throw new Error(`${error.code}: ${error.message}`)\n}"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode >= 300 {\n\t\tvar answer map[string]any\n\t\t_ = json.NewDecoder(res.Body).Decode(&answer)\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(res.Status)\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.easy-orders.net/api/partners-apps/v1/reviews/7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nif not response.ok:\n    error = response.json()[\"error\"]\n    raise RuntimeError(f\"{error['code']}: {error['message']}\")"
          }
        ]
      }
    },
    "/shipping/settings": {
      "get": {
        "tags": [
          "Shipping"
        ],
        "operationId": "getShippingSettings",
        "summary": "Get shipping settings",
        "description": "**Scope:** [`read_shipping`](/scopes)\n\nWhether shipping is on, the country the store ships in, and how the\nmerchant prices shipping. A store that never set shipping up answers\n`enabled: false` and `country: null`.\n",
        "x-scope": "read_shipping",
        "responses": {
          "200": {
            "$ref": "#/components/responses/ShippingSettingsOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ShippingUnavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/shipping/settings\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/shipping/settings', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { shipping_settings } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/shipping/settings\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"shipping_settings\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/shipping/settings');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$shippingSettings = $answer['shipping_settings'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/shipping/settings\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nshipping_settings = answer[\"shipping_settings\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Shipping"
        ],
        "operationId": "updateShippingSettings",
        "summary": "Update shipping settings",
        "description": "**Scope:** [`write_shipping_areas`](/scopes)\n\nTurns shipping on or off, and changes the country. Only the fields you\nsend change; `null` is refused. The cost type is the merchant's\nchoice, read only.\n\nChanging the country replaces every shipping area with the new\ncountry's governorates: shown, and costing zero (or the fixed cost\nwhen the cost type is `fixed`). In Egypt, Cairo, Giza and Alexandria\ncome first. Sending the same country changes nothing. A store with no\nsettings yet must send `country`.\n\nCounts toward the [daily shipping limit](/api-reference/shipping/overview#daily-limit).\n",
        "x-scope": "write_shipping_areas",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Za-z]{2}$",
                    "description": "The ISO 3166-1 alpha-2 code of a country from [List countries](/api-reference/shipping/list-countries)."
                  }
                }
              },
              "example": {
                "enabled": true,
                "country": "EG"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ShippingSettingsOK"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/DailyLimit"
          },
          "503": {
            "$ref": "#/components/responses/ShippingUnavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/shipping/settings\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"enabled\": true,\n  \"country\": \"EG\"\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/shipping/settings', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    enabled: true,\n    country: 'EG',\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { shipping_settings } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"enabled\": true,\n\t  \"country\": \"EG\"\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/shipping/settings\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"shipping_settings\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/shipping/settings');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'enabled' => true,\n        'country' => 'EG',\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$shippingSettings = $answer['shipping_settings'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/shipping/settings\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"enabled\": True,\n        \"country\": \"EG\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nshipping_settings = answer[\"shipping_settings\"]"
          }
        ]
      }
    },
    "/shipping/countries": {
      "get": {
        "tags": [
          "Shipping"
        ],
        "operationId": "listShippingCountries",
        "summary": "List countries",
        "description": "**Scope:** [`read_shipping`](/scopes)\n\nThe countries a store can ship in, with their codes.",
        "x-scope": "read_shipping",
        "responses": {
          "200": {
            "description": "The countries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "countries"
                  ],
                  "properties": {
                    "countries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Country"
                      }
                    }
                  }
                },
                "example": {
                  "countries": [
                    {
                      "code": "EG",
                      "name_ar": "مصر",
                      "name_en": "Egypt"
                    },
                    {
                      "code": "SA",
                      "name_ar": "السعودية",
                      "name_en": "Saudi Arabia"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ShippingUnavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/shipping/countries\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/shipping/countries', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { countries } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/shipping/countries\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"countries\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/shipping/countries');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$countries = $answer['countries'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/shipping/countries\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\ncountries = answer[\"countries\"]"
          }
        ]
      }
    },
    "/shipping/areas": {
      "get": {
        "tags": [
          "Shipping"
        ],
        "operationId": "listShippingAreas",
        "summary": "List areas",
        "description": "**Scope:** [`read_shipping`](/scopes)\n\nEvery shipping area of the store, in the order the shopper sees them\nat checkout. Not paginated: a store has at most 250 areas.\n",
        "x-scope": "read_shipping",
        "responses": {
          "200": {
            "$ref": "#/components/responses/AreasOK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ShippingUnavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/shipping/areas', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { areas } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"areas\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/shipping/areas');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$areas = $answer['areas'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nareas = answer[\"areas\"]"
          }
        ]
      },
      "patch": {
        "tags": [
          "Shipping"
        ],
        "operationId": "updateShippingAreas",
        "summary": "Update areas",
        "description": "**Scope:** [`write_shipping_areas`](/scopes)\n\nChanges the areas you send, and of each only the fields you send;\nthe others stay as they are. Answers the whole list.\n\nIf any `id` is not one of the store's areas, nothing changes and the\nanswer is `404 not_found`: read the list again, as an area's ID can\nchange when the merchant saves the list from the dashboard.\n\nCounts toward the [daily shipping limit](/api-reference/shipping/overview#daily-limit).\n",
        "x-scope": "write_shipping_areas",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "areas"
                ],
                "additionalProperties": false,
                "properties": {
                  "areas": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "$ref": "#/components/schemas/AreaChange"
                    }
                  }
                }
              },
              "example": {
                "areas": [
                  {
                    "id": "5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50",
                    "cost": 65
                  },
                  {
                    "id": "7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60",
                    "hidden": true
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/AreasOK"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/AreaExists"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/DailyLimit"
          },
          "503": {
            "$ref": "#/components/responses/ShippingUnavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"areas\": [\n    {\n      \"id\": \"5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50\",\n      \"cost\": 65\n    },\n    {\n      \"id\": \"7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60\",\n      \"hidden\": true\n    }\n  ]\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/shipping/areas', {\n  method: 'PATCH',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    areas: [\n      {\n        id: '5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50',\n        cost: 65,\n      },\n      {\n        id: '7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60',\n        hidden: true,\n      },\n    ],\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { areas } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"areas\": [\n\t    {\n\t      \"id\": \"5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50\",\n\t      \"cost\": 65\n\t    },\n\t    {\n\t      \"id\": \"7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60\",\n\t      \"hidden\": true\n\t    }\n\t  ]\n\t}`)\n\n\treq, err := http.NewRequest(\"PATCH\", \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"areas\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/shipping/areas');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PATCH',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'areas' => [\n            [\n                'id' => '5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50',\n                'cost' => 65,\n            ],\n            [\n                'id' => '7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60',\n                'hidden' => true,\n            ],\n        ],\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$areas = $answer['areas'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.patch(\n    \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"areas\": [\n            {\n                \"id\": \"5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50\",\n                \"cost\": 65,\n            },\n            {\n                \"id\": \"7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60\",\n                \"hidden\": True,\n            },\n        ],\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nareas = answer[\"areas\"]"
          }
        ]
      },
      "post": {
        "tags": [
          "Shipping"
        ],
        "operationId": "createShippingArea",
        "summary": "Add an area",
        "description": "**Scope:** [`write_shipping_areas`](/scopes)\n\nAdds an area by hand, at the end of the list. It is `custom`, so it\ncan be deleted later.\n\nSend an `Idempotency-Key` to retry safely. Counts toward the\n[daily shipping limit](/api-reference/shipping/overview#daily-limit).\n",
        "x-scope": "write_shipping_areas",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "cost"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "$ref": "#/components/schemas/AreaName"
                  },
                  "cost": {
                    "$ref": "#/components/schemas/AreaCost"
                  },
                  "hidden": {
                    "type": "boolean",
                    "default": false
                  }
                }
              },
              "example": {
                "name": "New Cairo",
                "cost": 70
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The area added. `Location` is its path.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "area"
                  ],
                  "properties": {
                    "area": {
                      "$ref": "#/components/schemas/Area"
                    }
                  }
                },
                "example": {
                  "area": {
                    "id": "1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a50",
                    "name": "New Cairo",
                    "cost": 70,
                    "hidden": false,
                    "custom": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "409": {
            "$ref": "#/components/responses/AreaExists"
          },
          "422": {
            "description": "`validation_failed`, or `limit_exceeded` when the store has 250 areas.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "limit_exceeded",
                    "message": "A store may have at most 250 areas: delete one first",
                    "details": {
                      "max": 250
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/DailyLimit"
          },
          "503": {
            "$ref": "#/components/responses/ShippingUnavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X POST \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Idempotency-Key: area-new-cairo\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"New Cairo\",\n  \"cost\": 70\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/shipping/areas', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Idempotency-Key': 'area-new-cairo',\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    name: 'New Cairo',\n    cost: 70,\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { area } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"name\": \"New Cairo\",\n\t  \"cost\": 70\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Idempotency-Key\", \"area-new-cairo\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"area\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/shipping/areas');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'POST',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Idempotency-Key: area-new-cairo',\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'name' => 'New Cairo',\n        'cost' => 70,\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$area = $answer['area'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.post(\n    \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n        \"Idempotency-Key\": \"area-new-cairo\",\n    },\n    json={\n        \"name\": \"New Cairo\",\n        \"cost\": 70,\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\narea = answer[\"area\"]"
          }
        ]
      }
    },
    "/shipping/areas/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "The area's ID.",
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "example": "1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a50"
        }
      ],
      "delete": {
        "tags": [
          "Shipping"
        ],
        "operationId": "deleteShippingArea",
        "summary": "Delete an area",
        "description": "**Scope:** [`write_shipping_areas`](/scopes)\n\nDeletes an area added by hand (`custom: true`). A country's area\nanswers `409 area_not_custom`: hide it instead.\n\nCounts toward the [daily shipping limit](/api-reference/shipping/overview#daily-limit).\n",
        "x-scope": "write_shipping_areas",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`area_not_custom`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "area_not_custom",
                    "message": "Only an area added by hand can be deleted: hide a country's area instead"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/DailyLimit"
          },
          "503": {
            "$ref": "#/components/responses/ShippingUnavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas/1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a50\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/shipping/areas/1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a50', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nif (!response.ok) {\n  const { error } = await response.json()\n  throw new Error(`${error.code}: ${error.message}`)\n}"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"DELETE\", \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas/1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a50\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tif res.StatusCode >= 300 {\n\t\tvar answer map[string]any\n\t\t_ = json.NewDecoder(res.Body).Decode(&answer)\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(res.Status)\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/shipping/areas/1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a50');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'DELETE',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.delete(\n    \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas/1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a50\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nif not response.ok:\n    error = response.json()[\"error\"]\n    raise RuntimeError(f\"{error['code']}: {error['message']}\")"
          }
        ]
      }
    },
    "/shipping/areas/order": {
      "put": {
        "tags": [
          "Shipping"
        ],
        "operationId": "orderShippingAreas",
        "summary": "Reorder areas",
        "description": "**Scope:** [`write_shipping_areas`](/scopes)\n\nSets the order the shopper sees the areas in. `ids` must hold every\narea of the store exactly once, or the answer is `422` with the rule\n`all_areas`.\n\nCounts toward the [daily shipping limit](/api-reference/shipping/overview#daily-limit).\n",
        "x-scope": "write_shipping_areas",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ids"
                ],
                "additionalProperties": false,
                "properties": {
                  "ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              },
              "example": {
                "ids": [
                  "7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60",
                  "5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/AreasOK"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/DailyLimit"
          },
          "503": {
            "$ref": "#/components/responses/ShippingUnavailable"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl -X PUT \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas/order\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"ids\": [\n    \"7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60\",\n    \"5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50\"\n  ]\n}'"
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/shipping/areas/order', {\n  method: 'PUT',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    ids: [\n      '7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60',\n      '5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50',\n    ],\n  }),\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { areas } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\n\t  \"ids\": [\n\t    \"7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60\",\n\t    \"5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50\"\n\t  ]\n\t}`)\n\n\treq, err := http.NewRequest(\"PUT\", \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas/order\", bytes.NewReader(body))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"areas\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/shipping/areas/order');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'PUT',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n        'Content-Type: application/json',\n    ],\n    CURLOPT_POSTFIELDS => json_encode([\n        'ids' => [\n            '7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60',\n            '5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50',\n        ],\n    ]),\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$areas = $answer['areas'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.put(\n    \"https://api.easy-orders.net/api/partners-apps/v1/shipping/areas/order\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    json={\n        \"ids\": [\n            \"7c4a1b2d-3e5f-4a6b-9c8d-1e2f3a4b5c60\",\n            \"5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50\",\n        ],\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nareas = answer[\"areas\"]"
          }
        ]
      }
    },
    "/store": {
      "get": {
        "tags": [
          "Store"
        ],
        "operationId": "getStore",
        "summary": "Get the store",
        "description": "**Scope:** [`read_store`](/scopes)\n\nThe store your access token works on: its name, addresses, currency,\ncountry, timezone, storefront language and plan. It takes no\nparameters.\n",
        "x-scope": "read_store",
        "responses": {
          "200": {
            "description": "The store.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "store"
                  ],
                  "properties": {
                    "store": {
                      "$ref": "#/components/schemas/Store"
                    }
                  }
                },
                "example": {
                  "store": {
                    "id": "8d2f6a1b-4c3e-4f5a-9b7c-0e1d2c3b4a50",
                    "name": "Nile Fashion",
                    "subdomain": "nilefashion",
                    "domain": "nilefashion.com",
                    "url": "https://www.nilefashion.com",
                    "currency": {
                      "name": "EGP",
                      "symbol": "ج.م"
                    },
                    "country": {
                      "code": "EG",
                      "name_en": "Egypt",
                      "name_ar": "مصر"
                    },
                    "timezone": "Africa/Cairo",
                    "language": "ar",
                    "plan": {
                      "key": "pro",
                      "name": "Pro"
                    },
                    "created_at": "2025-03-14T09:30:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/InsufficientScope"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl \"https://api.easy-orders.net/api/partners-apps/v1/store\" \\\n  -H \"Authorization: Bearer $EASYORDERS_ACCESS_TOKEN\""
          },
          {
            "lang": "typescript",
            "label": "TypeScript",
            "source": "const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/store', {\n  method: 'GET',\n  headers: {\n    Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,\n  },\n})\n\nconst json = await response.json()\nif (!response.ok) {\n  throw new Error(`${json.error.code}: ${json.error.message}`)\n}\nconst { store } = json"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.easy-orders.net/api/partners-apps/v1/store\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"EASYORDERS_ACCESS_TOKEN\"))\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar answer map[string]any\n\tif err := json.NewDecoder(res.Body).Decode(&answer); err != nil {\n\t\tpanic(err)\n\t}\n\tif res.StatusCode >= 300 {\n\t\tpanic(fmt.Sprint(res.Status, answer[\"error\"]))\n\t}\n\tfmt.Println(answer[\"store\"])\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\n$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/store');\ncurl_setopt_array($ch, [\n    CURLOPT_CUSTOMREQUEST => 'GET',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_HTTPHEADER => [\n        'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),\n    ],\n]);\n\n$answer = json_decode(curl_exec($ch), true);\n$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);\ncurl_close($ch);\n\nif ($status >= 300) {\n    throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);\n}\n$store = $answer['store'];"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nimport requests\n\nresponse = requests.get(\n    \"https://api.easy-orders.net/api/partners-apps/v1/store\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}\",\n    },\n    timeout=30,\n)\nanswer = response.json()\nif not response.ok:\n    raise RuntimeError(f\"{answer['error']['code']}: {answer['error']['message']}\")\nstore = answer[\"store\"]"
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "accessToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "An access token from the OAuth flow (`eo_at_...`). It lasts one hour;\nrefresh it with the refresh token. See [Authentication](/authentication).\n"
      }
    },
    "parameters": {
      "Limit": {
        "name": "limit",
        "in": "query",
        "description": "How many items a page holds.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 20
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "description": "The `next_cursor` of the previous page. Keep the same `sort` while paging.",
        "schema": {
          "type": "string"
        }
      },
      "Sort": {
        "name": "sort",
        "in": "query",
        "description": "`created_at,ASC` (the default) or `created_at,DESC`.",
        "schema": {
          "type": "string",
          "enum": [
            "created_at,ASC",
            "created_at,DESC"
          ]
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "description": "A unique key (up to 255 printable ASCII characters). The same key\nfrom your app within 24 hours answers the first result again, with\n`Idempotent-Replayed: true`, instead of creating twice.\n",
        "schema": {
          "type": "string",
          "maxLength": 255
        }
      },
      "CreatedSince": {
        "name": "created_since",
        "in": "query",
        "description": "Only items created at or after this time (RFC 3339), e.g. `2026-12-01T00:00:00Z`. Use it with `sort` to sync.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "ArticleCategoryID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The article category's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20"
      },
      "ArticleID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The article's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50"
      },
      "ArticleJoin": {
        "name": "join",
        "in": "query",
        "description": "`categories` adds each article's `categories` (`id`, `name`, `slug`).",
        "schema": {
          "type": "string",
          "enum": [
            "categories"
          ]
        }
      },
      "BillingDebitIdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "A unique key for this debit (up to 255 printable ASCII characters),\nfrom your own record. It is kept with the debit, so sending it again\nlater answers the first debit instead of taking twice.\n",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "CategoryID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The category's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
      },
      "CheckoutFieldID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The checkout field's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70"
      },
      "CouponID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The coupon's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a"
      },
      "LabelOrderID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The order's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c"
      },
      "LabelProductID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The product's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10"
      },
      "LabelID": {
        "name": "label_id",
        "in": "path",
        "required": true,
        "description": "The label's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a"
      },
      "MissedOrderID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The missed order's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d"
      },
      "MissedOrderUpdatedSince": {
        "name": "updated_since",
        "in": "query",
        "description": "Only missed orders changed at or after this time (RFC 3339).",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "OrderID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The order's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c"
      },
      "PageID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The page's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70"
      },
      "ProductID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The product's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10"
      },
      "ProductJoin": {
        "name": "join",
        "in": "query",
        "description": "Relations to add, comma-separated: `options`, `variants`, `categories` (adds `category_ids`).",
        "schema": {
          "type": "string"
        },
        "example": "options,variants,categories"
      },
      "ReviewID": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The review's ID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a"
      }
    },
    "headers": {
      "X-RateLimit-Limit": {
        "description": "Requests allowed per minute (600).",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Remaining": {
        "description": "Requests left in the current minute.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Reset": {
        "description": "When the current minute ends, in Unix seconds.",
        "schema": {
          "type": "integer"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "A stable, snake_case code. Branch on it, not on the message."
              },
              "message": {
                "type": "string",
                "description": "A human-readable explanation. It may change."
              },
              "details": {
                "description": "More about the error, shaped per code."
              }
            }
          }
        }
      },
      "FieldError": {
        "type": "object",
        "required": [
          "field",
          "rule"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "The JSON path of the input, e.g. `items[0].quantity`."
          },
          "rule": {
            "type": "string",
            "description": "The rule that failed, e.g. `required`, `between` or `in`."
          },
          "param": {
            "type": "string",
            "description": "The rule's parameter, e.g. `1,10000` for `between`."
          }
        }
      },
      "ArticleCategory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "The category's name in its storefront URL. Unique among the store's article categories."
          },
          "description": {
            "type": "string",
            "description": "Plain text. Empty when not set."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ArticleCategoryName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 255,
        "description": "One line, trimmed, no invisible characters and no `<`."
      },
      "ArticleCategorySlug": {
        "type": "string",
        "maxLength": 255,
        "pattern": "^[a-zA-Z0-9-]+$",
        "description": "Letters `a-z` and `A-Z`, digits and dashes. Unique among the store's article categories (`409 slug_taken`)."
      },
      "ArticleCategoryDescription": {
        "type": "string",
        "maxLength": 1000,
        "description": "Plain text, trimmed. Line breaks and tabs are kept; `<` and invisible characters are refused. May be empty."
      },
      "Article": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "The article's name in its storefront URL. Unique among the store's articles."
          },
          "description": {
            "type": "string",
            "description": "Plain text, the excerpt the blog shows on the article's card."
          },
          "content": {
            "type": "string",
            "description": "The article's HTML, as saved after cleaning. Only in a single article's answer; lists leave it out."
          },
          "meta_description": {
            "type": "string",
            "description": "Plain text for search engines. Empty when not set."
          },
          "thumbnail": {
            "type": "string",
            "description": "An https image URL. Empty when there is none."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty (`[]`) when there are none."
          },
          "published": {
            "type": "boolean",
            "description": "Whether the article is on the blog."
          },
          "is_need_review": {
            "type": "boolean",
            "description": "Read only. `true` when the AI content check flagged the article's text for a human review."
          },
          "category_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The IDs of the article's categories, in ID order (not the order sent). Always there; `[]` when it has none."
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArticleCategoryRef"
            },
            "description": "Only with `join=categories`. The categories of `category_ids`, in the same order."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ArticleCategoryRef": {
        "type": "object",
        "description": "An article category, in short. [Get an article category](/api-reference/article-categories/get-an-article-category) has the rest of it.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        }
      },
      "ArticleTitle": {
        "type": "string",
        "minLength": 1,
        "maxLength": 255,
        "description": "One line, trimmed, no invisible characters and no `<`."
      },
      "ArticleSlug": {
        "type": "string",
        "maxLength": 255,
        "pattern": "^[a-zA-Z0-9-]+$",
        "description": "Letters `a-z` and `A-Z`, digits and dashes. Unique among the store's articles (`409 slug_taken`)."
      },
      "ArticleDescription": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000,
        "description": "Plain text, trimmed. Line breaks and tabs are kept; `<` and invisible characters are refused."
      },
      "ArticleContent": {
        "type": "string",
        "description": "HTML, up to 51,200 bytes as sent (rule `max`). Valid UTF-8 without NUL characters (rule `text`). Unsafe HTML is removed before it is saved; content that cleaning leaves empty is refused (rule `required`)."
      },
      "ArticleMetaDescription": {
        "type": "string",
        "maxLength": 1000,
        "description": "One line of plain text, trimmed, no invisible characters and no `<`. May be empty."
      },
      "ArticleThumbnail": {
        "type": "string",
        "maxLength": 2048,
        "description": "An https URL with an ASCII host, without credentials or a fragment, and without spaces, quotes, `<`, `>`, backslashes or backticks. `\"\"` removes the thumbnail."
      },
      "ArticleTags": {
        "type": "array",
        "maxItems": 20,
        "uniqueItems": true,
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50,
          "description": "One line, trimmed, no invisible characters and no `<`."
        },
        "description": "Replaces the article's tags."
      },
      "ArticleCategoryIDs": {
        "type": "array",
        "maxItems": 20,
        "uniqueItems": true,
        "items": {
          "type": "string",
          "format": "uuid"
        },
        "description": "Article categories of the store (rule `article_category` otherwise). Replaces the article's categories."
      },
      "ArticleCreate": {
        "type": "object",
        "required": [
          "title",
          "description",
          "content"
        ],
        "additionalProperties": false,
        "properties": {
          "title": {
            "$ref": "#/components/schemas/ArticleTitle"
          },
          "slug": {
            "$ref": "#/components/schemas/ArticleSlug"
          },
          "description": {
            "$ref": "#/components/schemas/ArticleDescription"
          },
          "content": {
            "$ref": "#/components/schemas/ArticleContent"
          },
          "meta_description": {
            "$ref": "#/components/schemas/ArticleMetaDescription"
          },
          "thumbnail": {
            "$ref": "#/components/schemas/ArticleThumbnail"
          },
          "tags": {
            "$ref": "#/components/schemas/ArticleTags"
          },
          "published": {
            "type": "boolean",
            "default": false
          },
          "category_ids": {
            "$ref": "#/components/schemas/ArticleCategoryIDs"
          }
        }
      },
      "ArticleUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "$ref": "#/components/schemas/ArticleTitle"
          },
          "slug": {
            "$ref": "#/components/schemas/ArticleSlug"
          },
          "description": {
            "$ref": "#/components/schemas/ArticleDescription"
          },
          "content": {
            "$ref": "#/components/schemas/ArticleContent"
          },
          "meta_description": {
            "$ref": "#/components/schemas/ArticleMetaDescription"
          },
          "thumbnail": {
            "$ref": "#/components/schemas/ArticleThumbnail"
          },
          "tags": {
            "$ref": "#/components/schemas/ArticleTags"
          },
          "published": {
            "type": "boolean"
          },
          "category_ids": {
            "$ref": "#/components/schemas/ArticleCategoryIDs"
          }
        }
      },
      "BillingAmount": {
        "type": "string",
        "pattern": "^[0-9]+(\\.[0-9]{1,6})?$",
        "description": "US dollars as a string, more than zero, with up to 6 decimals."
      },
      "Billing": {
        "type": "object",
        "required": [
          "subscription",
          "wallet"
        ],
        "properties": {
          "subscription": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BillingSubscription"
              },
              {
                "type": "null"
              }
            ],
            "description": "`null` when your app has no plans (a free app)."
          },
          "wallet": {
            "$ref": "#/components/schemas/BillingWallet"
          }
        }
      },
      "BillingSubscription": {
        "type": "object",
        "description": "Your app's plan on the store. Amounts are US dollar strings; times are UTC.",
        "properties": {
          "plan_id": {
            "type": "string",
            "description": "The plan's ID, as your app's billing settings name it."
          },
          "plan_name": {
            "type": "string"
          },
          "price": {
            "type": "string",
            "description": "What the merchant agreed to pay a month, e.g. `\"19.00\"`. Renewals charge it until a price change applies."
          },
          "status": {
            "type": "string",
            "enum": [
              "trialing",
              "active",
              "suspended"
            ],
            "description": "`trialing`: the free trial, the first charge comes at its end.\n`active`: the current month is paid, or the plan is free.\n`suspended`: a renewal found too few credits; the rest of the API\nanswers `402` until the merchant's credits cover it.\n"
          },
          "trial_ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set while `trialing`."
          },
          "current_period_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The start of the paid month; `null` while `trialing`."
          },
          "current_period_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The next renewal; `null` while `trialing`."
          },
          "pending_plan_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A cheaper plan the merchant picked, which the next renewal moves to."
          },
          "pending_plan_price": {
            "type": [
              "string",
              "null"
            ],
            "description": "The pending plan's price when the merchant picked it; the renewal charges no more."
          },
          "price_change": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BillingPriceChange"
              },
              {
                "type": "null"
              }
            ],
            "description": "A higher price of the plan that your app set; `null` when there is none, and while a cheaper plan is pending."
          }
        }
      },
      "BillingPriceChange": {
        "type": "object",
        "description": "Until the merchant accepts it, renewals charge the old price. If they neither accept it nor remove the app by `deadline`, the app is removed then.",
        "properties": {
          "new_price": {
            "type": "string"
          },
          "deadline": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the app is removed without an answer; `null` before the merchant is told, and once they accepted."
          },
          "accepted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set once the merchant accepted; `new_price` applies from the next renewal."
          }
        }
      },
      "BillingWallet": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Your app has a usage wallet that the merchant can top up."
          },
          "balance": {
            "type": "string",
            "description": "US dollars, e.g. `\"19.95\"`; `\"0.00\"` when never topped up."
          }
        }
      },
      "BillingDebit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "amount": {
            "type": "string",
            "description": "US dollars."
          },
          "balance_after": {
            "type": "string",
            "description": "The wallet's balance right after this debit."
          },
          "description": {
            "type": "string",
            "description": "What the merchant reads, in Arabic, naming your app first, then your `description`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BillingWalletTransaction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "wallet_topup",
              "wallet_debit",
              "wallet_return"
            ],
            "description": "`wallet_topup`: the merchant added to the wallet.\n`wallet_debit`: your app took from it.\n`wallet_return`: the balance went back to the merchant when your app was removed.\n"
          },
          "amount": {
            "type": "string",
            "description": "US dollars, always positive; `type` gives the direction."
          },
          "balance_after": {
            "type": [
              "string",
              "null"
            ],
            "description": "The wallet's balance right after this move."
          },
          "description": {
            "type": "string",
            "description": "What the merchant reads, in Arabic, naming your app (and, for a debit, your `description` after it)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Category": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "The category's address on the storefront. Unique in the store."
          },
          "thumb": {
            "type": "string",
            "description": "The category's image URL."
          },
          "parent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The category this one is under; `null` for a top-level category."
          },
          "position": {
            "type": "integer",
            "description": "The merchant's order. Subcategories come highest first."
          },
          "hidden": {
            "type": "boolean",
            "description": "A hidden category is not shown on the storefront."
          },
          "show_in_header": {
            "type": "boolean",
            "description": "Whether the category is shown in the storefront's header."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Old categories without a creation time read `1970-01-01T00:00:00Z`."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "children": {
            "type": "array",
            "description": "The subcategories, each with its own `children` at deeper levels. Present on a single category with `join`; `[]` when it has none.",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          }
        }
      },
      "CategoryCreate": {
        "type": "object",
        "required": [
          "name",
          "slug",
          "thumb"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "description": "One line, trimmed, with at least one visible character."
          },
          "slug": {
            "type": "string",
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9-]+$",
            "description": "Unique among the store's categories."
          },
          "thumb": {
            "type": "string",
            "maxLength": 2048,
            "description": "An https URL."
          },
          "parent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "A category of the store to put this one under; `null` for a top-level category. Not the category itself, nor one of its subcategories."
          },
          "position": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000,
            "default": 0
          },
          "hidden": {
            "type": "boolean",
            "default": false
          },
          "show_in_header": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CategoryUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Every field is optional; only the fields sent change.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "description": "One line, trimmed, with at least one visible character."
          },
          "slug": {
            "type": "string",
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9-]+$",
            "description": "Unique among the store's categories."
          },
          "thumb": {
            "type": "string",
            "maxLength": 2048,
            "description": "An https URL."
          },
          "parent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "A category of the store to put this one under; `null` for a top-level category. Not the category itself, nor one of its subcategories."
          },
          "position": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000,
            "default": 0
          },
          "hidden": {
            "type": "boolean",
            "default": false
          },
          "show_in_header": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CheckoutField": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string",
            "description": "Which order field it fills, e.g. `full_name`, `phone`, `email`,\n`country`, `government`, `address`, or the optional `phone_alt`,\n`note` and `sa_national_address`. Read only.\n"
          },
          "name": {
            "type": "string",
            "description": "The label the shopper sees."
          },
          "type": {
            "type": "string",
            "enum": [
              "input",
              "textarea"
            ],
            "description": "`input` is one line, `textarea` several. Read only."
          },
          "placeholder": {
            "type": "string",
            "description": "The hint shown in the empty field; `\"\"` for none."
          },
          "position": {
            "type": "integer",
            "description": "The field's place in the form, lowest first. Fields with the same position are ordered by `key`."
          },
          "is_active": {
            "type": "boolean",
            "description": "Whether the form shows the field. Always `true` for `full_name` and `phone`."
          },
          "is_required": {
            "type": "boolean",
            "description": "Whether the shopper must fill it. Always `true` for `full_name` and `phone`."
          }
        }
      },
      "CheckoutFieldName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 255,
        "description": "The label. One line, trimmed, with a visible character, no invisible characters and no `<`."
      },
      "CheckoutFieldPlaceholder": {
        "type": "string",
        "maxLength": 255,
        "description": "One line, trimmed, no invisible characters and no `<`. `\"\"` removes it."
      },
      "CheckoutFieldPosition": {
        "type": "integer",
        "minimum": 0,
        "maximum": 1000,
        "description": "The place in the form, lowest first."
      },
      "CheckoutFieldCreate": {
        "type": "object",
        "required": [
          "key"
        ],
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "note",
              "phone_alt",
              "sa_national_address"
            ],
            "description": "The optional field to add."
          },
          "name": {
            "$ref": "#/components/schemas/CheckoutFieldName"
          },
          "placeholder": {
            "$ref": "#/components/schemas/CheckoutFieldPlaceholder"
          },
          "position": {
            "$ref": "#/components/schemas/CheckoutFieldPosition"
          },
          "is_active": {
            "type": "boolean",
            "default": false
          },
          "is_required": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CheckoutFieldUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Every field is optional; only the fields sent change.",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/CheckoutFieldName"
          },
          "placeholder": {
            "$ref": "#/components/schemas/CheckoutFieldPlaceholder"
          },
          "position": {
            "$ref": "#/components/schemas/CheckoutFieldPosition"
          },
          "is_active": {
            "type": "boolean",
            "description": "`false` is refused for `full_name` and `phone` (`always_required`)."
          },
          "is_required": {
            "type": "boolean",
            "description": "`false` is refused for `full_name` and `phone` (`always_required`)."
          }
        }
      },
      "CouponMethod": {
        "type": "string",
        "description": "`code`: the shopper types the code at checkout. `automatic`: applied without a code.",
        "enum": [
          "code",
          "automatic"
        ]
      },
      "CouponDiscountType": {
        "type": "string",
        "description": "`amount_off_products`: off the products' prices. `amount_off_order`:\noff the order. `free_shipping`: off the shipping cost. `buy_x_get_y`:\nbuy some items, get others free or discounted.\n",
        "enum": [
          "amount_off_products",
          "amount_off_order",
          "free_shipping",
          "buy_x_get_y"
        ]
      },
      "CouponAppliesTo": {
        "type": "string",
        "description": "`specific_products` and `specific_categories` need `applicable_items`.",
        "enum": [
          "all",
          "specific_products",
          "specific_categories"
        ]
      },
      "CouponMoney": {
        "type": "number",
        "minimum": 0,
        "maximum": 100000000,
        "description": "An amount in the store's currency, with at most 4 decimals."
      },
      "CouponCount": {
        "type": "integer",
        "minimum": 0,
        "maximum": 1000000
      },
      "CouponScheduleTime": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "description": "RFC 3339, from `2000-01-01T00:00:00Z` to `2100-01-01T00:00:00Z`. Kept in UTC, to the microsecond."
      },
      "Coupon": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "method": {
            "$ref": "#/components/schemas/CouponMethod"
          },
          "code": {
            "type": "string",
            "description": "Lowercase. `\"\"` for an automatic coupon."
          },
          "title": {
            "type": "string",
            "description": "The coupon's name, shown on the storefront (an automatic coupon's banner). Required on an automatic coupon; `\"\"` for none."
          },
          "discount_type": {
            "$ref": "#/components/schemas/CouponDiscountType"
          },
          "value_type": {
            "type": "string",
            "description": "How `value` reads, `fixed` or `percentage`."
          },
          "value": {
            "type": "number",
            "description": "The discount of `amount_off_products` and `amount_off_order`, an amount or a percentage per `value_type`."
          },
          "min_order_amount": {
            "type": "number"
          },
          "min_quantity": {
            "type": "integer"
          },
          "max_discount_amount": {
            "type": "number"
          },
          "usage_limit": {
            "type": "integer",
            "description": "How many times the coupon can be used; `0` is no limit."
          },
          "usage_count": {
            "type": "integer",
            "description": "How many orders used the coupon. Read only."
          },
          "is_active": {
            "type": "boolean"
          },
          "starts_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "`null`: no start."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "`null`: no expiry."
          },
          "applies_to": {
            "$ref": "#/components/schemas/CouponAppliesTo"
          },
          "buy_quantity": {
            "type": "integer",
            "description": "`buy_x_get_y`: how many buy items the cart needs, when `buy_requirement_type` is `quantity`."
          },
          "buy_requirement_type": {
            "type": "string",
            "description": "`buy_x_get_y`: whether the shopper must buy a quantity (`buy_quantity`) or an amount (`buy_amount`).",
            "enum": [
              "quantity",
              "amount"
            ]
          },
          "buy_amount": {
            "type": "number",
            "description": "`buy_x_get_y`: how much the buy items must cost, when `buy_requirement_type` is `amount`."
          },
          "get_quantity": {
            "type": "integer",
            "description": "`buy_x_get_y`: how many get items the shopper gets."
          },
          "get_value_type": {
            "type": "string",
            "description": "`buy_x_get_y`: how the get items are discounted: `free`, or by `get_value` as a `percentage` or a `fixed` amount.",
            "enum": [
              "free",
              "percentage",
              "fixed"
            ]
          },
          "get_value": {
            "type": "number"
          },
          "max_uses_per_order": {
            "type": "integer"
          },
          "max_shipping_discount": {
            "type": "number"
          },
          "exclude_shipping_over": {
            "type": "number"
          },
          "combines_with_product": {
            "type": "boolean",
            "description": "Whether it combines with product coupons (`amount_off_products`, `buy_x_get_y`). Two coupons combine only when each allows the other's kind."
          },
          "combines_with_order": {
            "type": "boolean",
            "description": "Whether it combines with order coupons (`amount_off_order`)."
          },
          "combines_with_shipping": {
            "type": "boolean",
            "description": "Whether it combines with shipping coupons (`free_shipping`)."
          },
          "applicable_items": {
            "type": "array",
            "description": "What the coupon applies to; `[]` for none. Buy items first, then by type and ID.",
            "items": {
              "$ref": "#/components/schemas/CouponItem"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "`1970-01-01T00:00:00Z` for an old coupon saved without one."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CouponItem": {
        "type": "object",
        "properties": {
          "item_type": {
            "type": "string",
            "description": "`product` (every variant of it), `variant` (one variant of a product) or `category`.",
            "enum": [
              "product",
              "variant",
              "category"
            ]
          },
          "item_id": {
            "type": "string",
            "format": "uuid",
            "description": "The product's, variant's or category's ID."
          },
          "is_buy_item": {
            "type": "boolean",
            "description": "`buy_x_get_y`: `true` for a buy item; the others are get items."
          }
        }
      },
      "CouponItemInput": {
        "type": "object",
        "required": [
          "item_type",
          "item_id"
        ],
        "additionalProperties": false,
        "properties": {
          "item_type": {
            "type": "string",
            "enum": [
              "product",
              "variant",
              "category"
            ]
          },
          "item_id": {
            "type": "string",
            "format": "uuid",
            "description": "A live product, variant or category of this store."
          },
          "is_buy_item": {
            "type": "boolean",
            "default": false,
            "description": "`buy_x_get_y`: `true` for a buy item; the others are get items."
          }
        }
      },
      "CouponCreate": {
        "type": "object",
        "required": [
          "method",
          "discount_type"
        ],
        "additionalProperties": false,
        "description": "Only `starts_at` and `expires_at` take `null`.",
        "properties": {
          "method": {
            "$ref": "#/components/schemas/CouponMethod"
          },
          "code": {
            "type": "string",
            "maxLength": 64,
            "description": "Letters of any language, digits, `-` and `_`. Trimmed and saved lowercased. Required on a `code` coupon; `\"\"` (or left out) on an `automatic` one."
          },
          "title": {
            "type": "string",
            "maxLength": 255,
            "description": "One line, trimmed, no `<`. Required on an `automatic` coupon."
          },
          "discount_type": {
            "$ref": "#/components/schemas/CouponDiscountType"
          },
          "value_type": {
            "type": "string",
            "default": "fixed",
            "enum": [
              "fixed",
              "percentage"
            ]
          },
          "value": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CouponMoney"
              }
            ],
            "description": "Above 0 for `amount_off_products` and `amount_off_order`; at most 100 as a percentage."
          },
          "min_order_amount": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "min_quantity": {
            "$ref": "#/components/schemas/CouponCount"
          },
          "max_discount_amount": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "usage_limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000,
            "default": 0,
            "description": "`0` is no limit."
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "starts_at": {
            "$ref": "#/components/schemas/CouponScheduleTime"
          },
          "expires_at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CouponScheduleTime"
              }
            ],
            "description": "Not before `starts_at`."
          },
          "applies_to": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CouponAppliesTo"
              }
            ],
            "default": "all"
          },
          "buy_quantity": {
            "$ref": "#/components/schemas/CouponCount"
          },
          "buy_requirement_type": {
            "type": "string",
            "default": "quantity",
            "enum": [
              "quantity",
              "amount"
            ]
          },
          "buy_amount": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "get_quantity": {
            "$ref": "#/components/schemas/CouponCount"
          },
          "get_value_type": {
            "type": "string",
            "default": "free",
            "enum": [
              "free",
              "percentage",
              "fixed"
            ]
          },
          "get_value": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CouponMoney"
              }
            ],
            "description": "Above 0 unless `get_value_type` is `free`; at most 100 as a percentage."
          },
          "max_uses_per_order": {
            "$ref": "#/components/schemas/CouponCount"
          },
          "max_shipping_discount": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "exclude_shipping_over": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "combines_with_product": {
            "type": "boolean",
            "default": false
          },
          "combines_with_order": {
            "type": "boolean",
            "default": false
          },
          "combines_with_shipping": {
            "type": "boolean",
            "default": false
          },
          "applicable_items": {
            "type": "array",
            "maxItems": 100,
            "description": "No item twice.",
            "items": {
              "$ref": "#/components/schemas/CouponItemInput"
            }
          }
        }
      },
      "CouponUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Every field is optional; only the fields sent change. `null` clears\n`starts_at` or `expires_at` and is refused anywhere else.\n`applicable_items` replaces the coupon's items.\n",
        "properties": {
          "method": {
            "$ref": "#/components/schemas/CouponMethod"
          },
          "code": {
            "type": "string",
            "maxLength": 64,
            "description": "Letters of any language, digits, `-` and `_`. Trimmed and saved lowercased. `\"\"` removes the code."
          },
          "title": {
            "type": "string",
            "maxLength": 255,
            "description": "One line, trimmed, no `<`."
          },
          "discount_type": {
            "$ref": "#/components/schemas/CouponDiscountType"
          },
          "value_type": {
            "type": "string",
            "enum": [
              "fixed",
              "percentage"
            ]
          },
          "value": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "min_order_amount": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "min_quantity": {
            "$ref": "#/components/schemas/CouponCount"
          },
          "max_discount_amount": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "usage_limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000,
            "description": "`0` is no limit."
          },
          "is_active": {
            "type": "boolean"
          },
          "starts_at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CouponScheduleTime"
              }
            ],
            "description": "`null` removes the start."
          },
          "expires_at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CouponScheduleTime"
              }
            ],
            "description": "`null` removes the expiry."
          },
          "applies_to": {
            "$ref": "#/components/schemas/CouponAppliesTo"
          },
          "buy_quantity": {
            "$ref": "#/components/schemas/CouponCount"
          },
          "buy_requirement_type": {
            "type": "string",
            "enum": [
              "quantity",
              "amount"
            ]
          },
          "buy_amount": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "get_quantity": {
            "$ref": "#/components/schemas/CouponCount"
          },
          "get_value_type": {
            "type": "string",
            "enum": [
              "free",
              "percentage",
              "fixed"
            ]
          },
          "get_value": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "max_uses_per_order": {
            "$ref": "#/components/schemas/CouponCount"
          },
          "max_shipping_discount": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "exclude_shipping_over": {
            "$ref": "#/components/schemas/CouponMoney"
          },
          "combines_with_product": {
            "type": "boolean"
          },
          "combines_with_order": {
            "type": "boolean"
          },
          "combines_with_shipping": {
            "type": "boolean"
          },
          "applicable_items": {
            "type": "array",
            "maxItems": 100,
            "description": "Replaces every item of the coupon. No item twice.",
            "items": {
              "$ref": "#/components/schemas/CouponItemInput"
            }
          }
        }
      },
      "Label": {
        "type": "object",
        "required": [
          "id",
          "text",
          "color",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "text": {
            "type": "string",
            "description": "The word the merchant sees, 1 to 30 characters."
          },
          "color": {
            "$ref": "#/components/schemas/LabelColor"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LabelColor": {
        "type": "string",
        "description": "The color's name; the dashboard picks its shades.",
        "enum": [
          "gray",
          "red",
          "orange",
          "yellow",
          "green",
          "blue",
          "purple"
        ]
      },
      "LabelCreate": {
        "type": "object",
        "required": [
          "text"
        ],
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 30,
            "description": "Trimmed, then 1 to 30 characters with at least one that shows.\nOne line: no control or invisible characters. Unique among your\napp's labels on the order or product, letter case aside.\n"
          },
          "color": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LabelColor"
              }
            ],
            "default": "gray",
            "description": "`gray` when left out. `null` is refused."
          }
        }
      },
      "MissedOrder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "full_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "phone_alt": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "city": {
            "type": "string",
            "description": "The governorate (shipping area) the shopper chose."
          },
          "address": {
            "type": "string"
          },
          "sa_national_address": {
            "type": "string",
            "description": "The Saudi national address, when the checkout asked for it."
          },
          "payment_method": {
            "type": "string",
            "description": "The payment method's key, e.g. `cod`."
          },
          "note": {
            "type": "string",
            "description": "The note on the missed order; at first, what the shopper typed at checkout."
          },
          "utm_source": {
            "type": "string"
          },
          "utm_campaign": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Free key-value data of the checkout. Read only."
          },
          "funnel_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The funnel the checkout came from; `null` when none."
          },
          "custom_currency": {
            "type": "string"
          },
          "is_digital": {
            "type": "boolean"
          },
          "products": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The names of the products in the cart, as the merchant's list shows them."
          },
          "reason": {
            "type": "string",
            "description": "Why the storefront saved the missed order, as it sent it."
          },
          "can_convert_to_order": {
            "type": "boolean",
            "description": "`true` when it has a name, a phone or an email, an address and a cart item: enough for the merchant to turn it into an order."
          },
          "is_completed": {
            "type": "boolean",
            "description": "The missed order's status, `true` once it is recovered or no longer to follow."
          },
          "masked": {
            "type": "boolean",
            "description": "`true` when the customer's details are hidden; see `masked_reason`."
          },
          "masked_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "`store_overdue` while the store has unpaid dues: the name keeps its first 2 letters then `****`; the email, phones, country, city, addresses and the metadata (of the missed order and its items) are empty."
          },
          "items": {
            "type": "array",
            "description": "The cart items.",
            "items": {
              "$ref": "#/components/schemas/MissedOrderItem"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MissedOrderItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "variant_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "product_name": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "price": {
            "type": "number",
            "description": "The unit price."
          },
          "is_upsell": {
            "type": "boolean",
            "description": "Added to the cart as an upsell."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "What the shopper chose on the product's form."
          }
        }
      },
      "MissedOrderLine": {
        "type": "string",
        "maxLength": 255,
        "description": "One line, trimmed, no invisible characters and no `<`. `\"\"` empties it."
      },
      "MissedOrderAddress": {
        "type": "string",
        "maxLength": 1000,
        "description": "One line, trimmed, no invisible characters and no `<`. `\"\"` empties it."
      },
      "MissedOrderPhone": {
        "type": "string",
        "maxLength": 255,
        "description": "7 to 15 digits, optionally after `+`, separated by spaces, dashes, dots or parentheses. `\"\"` empties it."
      },
      "MissedOrderUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Every field is optional; only the fields sent change. None may be `null`.",
        "properties": {
          "full_name": {
            "$ref": "#/components/schemas/MissedOrderLine"
          },
          "email": {
            "type": "string",
            "maxLength": 255,
            "description": "A plain address, e.g. `mona@example.com`. `\"\"` empties it."
          },
          "phone": {
            "$ref": "#/components/schemas/MissedOrderPhone"
          },
          "phone_alt": {
            "$ref": "#/components/schemas/MissedOrderPhone"
          },
          "country": {
            "$ref": "#/components/schemas/MissedOrderLine"
          },
          "city": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MissedOrderLine"
              }
            ],
            "description": "The governorate. One line, up to 255 characters, no `<`. `\"\"` empties it."
          },
          "address": {
            "$ref": "#/components/schemas/MissedOrderAddress"
          },
          "sa_national_address": {
            "$ref": "#/components/schemas/MissedOrderAddress"
          },
          "note": {
            "type": "string",
            "maxLength": 2000,
            "description": "Trimmed. Line breaks and tabs are kept; no other control characters and no `<`. `\"\"` empties it."
          },
          "is_completed": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Marks the missed order completed. Only `true` is taken."
          }
        }
      },
      "OrderStatus": {
        "type": "string",
        "description": "The statuses an app can set, in the order of an order's life.",
        "enum": [
          "pending",
          "confirmed",
          "processing",
          "waiting_for_pickup",
          "in_delivery",
          "delivered",
          "canceled",
          "returning_from_delivery",
          "request_refund",
          "refund_in_progress",
          "refunded"
        ]
      },
      "PaymentStatus": {
        "type": "string",
        "enum": [
          "pending_payment",
          "paid",
          "paid_failed",
          "pending_refund",
          "payment_refunded"
        ]
      },
      "Order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "description": "The store's order number, as the merchant sees it."
          },
          "status": {
            "type": "string",
            "description": "The order's status. Besides the values an app sets, orders the store's anti-spam checks hold can read `high_risk`, `moderate_risk`, `proxy_blacklisted` or `created`."
          },
          "payment_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "One of the payment statuses; `null` for an older order that never had one."
          },
          "payment_method": {
            "type": "string",
            "description": "The payment method's key, e.g. `cod`."
          },
          "full_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "phone_alt": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "city": {
            "type": "string",
            "description": "The governorate (shipping area) the order ships to."
          },
          "address": {
            "type": "string"
          },
          "sa_national_address": {
            "type": "string",
            "description": "The Saudi national address, when the checkout asked for it."
          },
          "note": {
            "type": "string",
            "description": "The shopper's note at checkout."
          },
          "ref": {
            "type": "string"
          },
          "utm_source": {
            "type": "string"
          },
          "utm_campaign": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Free key-value data, up to 4096 bytes. Orders created by an app carry `is_app_order` and `app_name`."
          },
          "product_cost": {
            "type": "number"
          },
          "shipping_cost": {
            "type": "number"
          },
          "coupon_code": {
            "type": "string"
          },
          "coupon_discount": {
            "type": "number"
          },
          "total_cost": {
            "type": "number"
          },
          "custom_currency": {
            "type": "string"
          },
          "is_digital": {
            "type": "boolean"
          },
          "shipping_status": {
            "type": "string",
            "description": "The shipping company's status, as it sent it."
          },
          "masked": {
            "type": "boolean",
            "description": "`true` when the customer's details are hidden; see `masked_reason`."
          },
          "masked_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "`store_overdue` while the store has unpaid dues: the name keeps its first letters, the other customer fields and the metadata are empty."
          },
          "items": {
            "type": "array",
            "description": "The cart items. Present on a single order, and on lists with `join=items`.",
            "items": {
              "$ref": "#/components/schemas/OrderItem"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrderItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "variant_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "quantity": {
            "type": "integer"
          },
          "price": {
            "type": "number",
            "description": "The unit price."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "OrderNote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "note": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "private",
              "public"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ItemInput": {
        "type": "object",
        "required": [
          "product_id",
          "quantity"
        ],
        "additionalProperties": false,
        "properties": {
          "product_id": {
            "type": "string",
            "format": "uuid",
            "description": "A product of the store."
          },
          "variant_id": {
            "type": "string",
            "format": "uuid",
            "description": "Required when the product has variants."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "price": {
            "type": "number",
            "minimum": 0,
            "description": "The unit price; the store's price when left out."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Up to 1024 bytes."
          }
        }
      },
      "OrderCreate": {
        "type": "object",
        "required": [
          "full_name",
          "phone",
          "address",
          "payment_method",
          "items"
        ],
        "additionalProperties": false,
        "properties": {
          "full_name": {
            "type": "string",
            "maxLength": 255
          },
          "phone": {
            "type": "string",
            "description": "7 to 15 digits."
          },
          "phone_alt": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "country": {
            "type": "string",
            "maxLength": 255
          },
          "city": {
            "type": "string",
            "maxLength": 255,
            "description": "The governorate."
          },
          "address": {
            "type": "string",
            "maxLength": 1000
          },
          "sa_national_address": {
            "type": "string",
            "maxLength": 255
          },
          "payment_method": {
            "type": "string",
            "pattern": "^[a-z0-9_-]{2,50}$",
            "description": "The payment method's key, e.g. `cod`."
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ItemInput"
            }
          },
          "shipping_cost": {
            "type": "number",
            "minimum": 0,
            "maximum": 100000000,
            "description": "The store's shipping cost when left out."
          },
          "total_cost": {
            "type": "number",
            "minimum": 0,
            "maximum": 100000000,
            "description": "The order's total. Cannot be sent with `coupon_codes`."
          },
          "coupon_codes": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          },
          "ref": {
            "type": "string",
            "maxLength": 255
          },
          "utm_source": {
            "type": "string",
            "maxLength": 255
          },
          "utm_campaign": {
            "type": "string",
            "maxLength": 255
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Up to 4096 bytes. Reserved keys are refused."
          }
        }
      },
      "OrderUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Every field is optional; only the fields sent change.",
        "properties": {
          "full_name": {
            "type": "string",
            "maxLength": 255
          },
          "phone": {
            "type": "string"
          },
          "phone_alt": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "country": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "address": {
            "type": "string",
            "maxLength": 1000
          },
          "sa_national_address": {
            "type": "string"
          },
          "payment_method": {
            "type": "string",
            "pattern": "^[a-z0-9_-]{2,50}$"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "description": "Replaces every cart item of the order.",
            "items": {
              "$ref": "#/components/schemas/ItemInput"
            }
          },
          "shipping_cost": {
            "type": "number",
            "minimum": 0
          },
          "total_cost": {
            "type": "number",
            "minimum": 0
          },
          "note": {
            "type": "string",
            "maxLength": 2000
          },
          "ref": {
            "type": "string"
          },
          "utm_source": {
            "type": "string"
          },
          "utm_campaign": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Merged into the order's metadata."
          }
        }
      },
      "Page": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "The page's name in its storefront URL. Unique among the store's pages."
          },
          "content": {
            "type": "string",
            "description": "The page's HTML, as saved after cleaning. Only in a single page's answer; lists leave it out."
          },
          "show_in_header": {
            "type": "boolean",
            "description": "Whether the storefront's header links to the page."
          },
          "show_in_footer": {
            "type": "boolean",
            "description": "Whether the storefront's footer links to the page."
          },
          "show_under_gallery": {
            "type": "boolean"
          },
          "position": {
            "type": "integer",
            "description": "A number the merchant orders the pages by, 0 to 1,000,000,000. Lists here are ordered by `created_at`, not by it."
          },
          "is_active": {
            "type": "boolean",
            "description": "Whether the page is on the storefront."
          },
          "is_need_review": {
            "type": "boolean",
            "description": "Read only. `true` when the AI content check flagged the title or content for a human review."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PageTitle": {
        "type": "string",
        "minLength": 1,
        "maxLength": 255,
        "description": "One line, trimmed, no invisible characters and no `<`."
      },
      "PageSlug": {
        "type": "string",
        "maxLength": 255,
        "pattern": "^[a-zA-Z0-9-]+$",
        "description": "Letters `a-z` and `A-Z`, digits and dashes. Unique among the store's pages (`409 slug_taken`)."
      },
      "PageContent": {
        "type": "string",
        "description": "HTML, up to 51,200 bytes as sent (rule `max`). Valid UTF-8 without NUL characters (rule `text`). Unsafe HTML is removed before it is saved."
      },
      "PagePosition": {
        "type": "integer",
        "minimum": 0,
        "maximum": 1000000000
      },
      "PageCreate": {
        "type": "object",
        "required": [
          "title",
          "content"
        ],
        "additionalProperties": false,
        "properties": {
          "title": {
            "$ref": "#/components/schemas/PageTitle"
          },
          "slug": {
            "$ref": "#/components/schemas/PageSlug"
          },
          "content": {
            "$ref": "#/components/schemas/PageContent"
          },
          "show_in_header": {
            "type": "boolean",
            "default": false
          },
          "show_in_footer": {
            "type": "boolean",
            "default": false
          },
          "show_under_gallery": {
            "type": "boolean",
            "default": false
          },
          "position": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PagePosition"
              }
            ],
            "default": 0
          },
          "is_active": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "PageUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "$ref": "#/components/schemas/PageTitle"
          },
          "slug": {
            "$ref": "#/components/schemas/PageSlug"
          },
          "content": {
            "$ref": "#/components/schemas/PageContent"
          },
          "show_in_header": {
            "type": "boolean"
          },
          "show_in_footer": {
            "type": "boolean"
          },
          "show_under_gallery": {
            "type": "boolean"
          },
          "position": {
            "$ref": "#/components/schemas/PagePosition"
          },
          "is_active": {
            "type": "boolean"
          }
        }
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "The product's address on the storefront. Unique in the store."
          },
          "sku": {
            "type": "string"
          },
          "external_sku": {
            "type": "string",
            "description": "The product's code in an outside system, such as a supplier's."
          },
          "source_app": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the app that created the product (or of an older integration that did); `null` when none did. Read only."
          },
          "description": {
            "type": "string",
            "description": "The product's HTML description, as cleaned when saved. Only on a single product and on write answers; lists leave it out."
          },
          "meta_description": {
            "type": "string",
            "description": "The search engines' description of the product page."
          },
          "price": {
            "type": "number",
            "description": "In the store's currency."
          },
          "sale_price": {
            "type": "number",
            "description": "The price on sale, under `price`; `0` when the product is not on sale."
          },
          "sale_end_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the sale ends; `null` for no end date."
          },
          "thumb": {
            "type": "string",
            "description": "The main image's URL."
          },
          "images": {
            "type": "array",
            "description": "More images' URLs.",
            "items": {
              "type": "string"
            }
          },
          "position": {
            "type": "integer",
            "description": "The merchant's order of the product."
          },
          "hidden": {
            "type": "boolean",
            "description": "A hidden product is not shown on the storefront."
          },
          "quantity": {
            "type": "integer",
            "description": "The product's stock."
          },
          "track_stock": {
            "type": "boolean",
            "description": "Whether the product's stock is tracked."
          },
          "disable_orders_for_no_stock": {
            "type": "boolean",
            "description": "Whether the storefront refuses orders when the stock runs out."
          },
          "is_digital": {
            "type": "boolean",
            "description": "A digital product, sold as codes or links. Apps cannot create one."
          },
          "digital_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "code",
              "link",
              null
            ],
            "description": "How a digital product is sold; `null` for other products."
          },
          "category_ids": {
            "type": "array",
            "description": "The IDs of the product's categories. Present with `join=categories`, and on write answers.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "options": {
            "type": "array",
            "description": "The product's options, such as size or color. Present with `join=options`, and on write answers. They have no set order.",
            "items": {
              "$ref": "#/components/schemas/ProductOption"
            }
          },
          "variants": {
            "type": "array",
            "description": "The product's variants. Present with `join=variants`, and on write answers. They have no set order.",
            "items": {
              "$ref": "#/components/schemas/ProductVariant"
            }
          },
          "is_skip_cart": {
            "type": "boolean",
            "description": "The product page's purchase settings, from here to `is_reviews_enabled`, as the merchant sets them in the dashboard."
          },
          "buy_now_text": {
            "type": "string",
            "description": "The buy button's text; empty for the theme's own."
          },
          "is_fixed_bottom_buy": {
            "type": "boolean"
          },
          "is_one_page_checkout": {
            "type": "boolean"
          },
          "is_fast_checkout": {
            "type": "boolean"
          },
          "is_free_shipping": {
            "type": "boolean"
          },
          "is_quantity_hidden": {
            "type": "boolean"
          },
          "is_header_hidden": {
            "type": "boolean"
          },
          "hide_related_products": {
            "type": "boolean"
          },
          "is_reviews_enabled": {
            "type": "boolean"
          },
          "is_visitor_counter": {
            "type": "boolean",
            "description": "The product page shows a visitor counter."
          },
          "visitor_counter_min": {
            "type": "integer",
            "description": "The lowest count the visitor counter shows."
          },
          "visitor_counter_max": {
            "type": "integer",
            "description": "The highest count the visitor counter shows."
          },
          "is_countdown_timer": {
            "type": "boolean",
            "description": "The product page shows a countdown timer."
          },
          "countdown_timer_hours": {
            "type": "integer",
            "description": "The countdown timer's length, in hours."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Old products without a creation time read `1970-01-01T00:00:00Z`."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProductOption": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The option's name, such as `Size`."
          },
          "type": {
            "type": "string",
            "enum": [
              "button",
              "color",
              "image"
            ],
            "description": "How the storefront draws its values."
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductOptionValue"
            }
          }
        }
      },
      "ProductOptionValue": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The value's name, such as `M`. Variants name values by it."
          },
          "value": {
            "type": "string",
            "description": "What the storefront draws, by the option's type. A `#rgb` or `#rrggbb` color for `color`, an image URL for `image`, a label for `button`."
          },
          "thumb": {
            "type": "string",
            "description": "An image URL for the value; may be empty."
          },
          "is_out_of_stock": {
            "type": "boolean"
          }
        }
      },
      "ProductVariant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "price": {
            "type": "number"
          },
          "sale_price": {
            "type": "number",
            "description": "`0` when the variant is not on sale."
          },
          "quantity": {
            "type": "integer",
            "description": "The variant's stock."
          },
          "sku": {
            "type": "string"
          },
          "thumb": {
            "type": "string",
            "description": "The variant's image URL; may be empty."
          },
          "options": {
            "type": "object",
            "description": "Each option's name, and this variant's value of it.",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "ProductOptionInput": {
        "type": "object",
        "required": [
          "name",
          "type",
          "values"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "description": "One line, trimmed. Unique among the product's options."
          },
          "type": {
            "type": "string",
            "enum": [
              "button",
              "color",
              "image"
            ]
          },
          "values": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ProductOptionValueInput"
            }
          }
        }
      },
      "ProductOptionValueInput": {
        "type": "object",
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "description": "One line, trimmed. Unique within the option."
          },
          "value": {
            "type": "string",
            "description": "By the option's type: `color` needs `#rgb` or `#rrggbb`; `image` needs an https URL (up to 2048 bytes); `button` takes a label of up to 100 characters, the `name` when empty."
          },
          "thumb": {
            "type": "string",
            "maxLength": 2048,
            "description": "An https URL, or empty."
          },
          "is_out_of_stock": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "ProductVariantInput": {
        "type": "object",
        "required": [
          "price",
          "options"
        ],
        "additionalProperties": false,
        "description": "A variant, sent whole. A field you leave out takes its empty value (0, `\"\"`), not the variant's current one.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "One of the product's variants, to update it in place. Leave it out to create a variant."
          },
          "price": {
            "type": "number",
            "minimum": 0,
            "maximum": 100000000,
            "description": "Up to 4 decimals."
          },
          "sale_price": {
            "type": "number",
            "minimum": 0,
            "maximum": 100000000,
            "default": 0,
            "description": "Under `price`, or `0` for no sale."
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000,
            "default": 0
          },
          "sku": {
            "type": "string",
            "maxLength": 255
          },
          "thumb": {
            "type": "string",
            "maxLength": 2048,
            "description": "An https URL, or empty."
          },
          "options": {
            "type": "object",
            "description": "Each option's name, and the `name` of one of its values. Name every option of the product, and no other key. No two variants may name the same values.",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "ProductCreate": {
        "type": "object",
        "required": [
          "name",
          "price",
          "thumb"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "description": "One line, trimmed, with at least one visible character."
          },
          "slug": {
            "type": "string",
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9-]+$",
            "description": "Unique among the store's products. Made from the name on create when left out."
          },
          "sku": {
            "type": "string",
            "maxLength": 255
          },
          "external_sku": {
            "type": "string",
            "maxLength": 255,
            "description": "The product's code in an outside system."
          },
          "description": {
            "type": "string",
            "description": "HTML, cleaned before it is saved; see [HTML descriptions](/api-reference/products/overview#html-descriptions). No limit of its own beyond the 50 KB of the product."
          },
          "meta_description": {
            "type": "string",
            "maxLength": 1000,
            "description": "One line."
          },
          "price": {
            "type": "number",
            "minimum": 0,
            "maximum": 100000000,
            "description": "Up to 4 decimals. An amount that cannot be stored exactly is refused (rule `precision`)."
          },
          "sale_price": {
            "type": "number",
            "minimum": 0,
            "maximum": 100000000,
            "description": "Under `price`, or `0` for no sale."
          },
          "sale_end_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339. `null` removes the end date."
          },
          "thumb": {
            "type": "string",
            "maxLength": 2048,
            "description": "An https URL."
          },
          "images": {
            "type": "array",
            "maxItems": 20,
            "description": "https URLs, up to 2048 bytes each. Replaces the whole list.",
            "items": {
              "type": "string"
            }
          },
          "position": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000
          },
          "hidden": {
            "type": "boolean"
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000,
            "description": "Sets the product's stock."
          },
          "track_stock": {
            "type": "boolean"
          },
          "disable_orders_for_no_stock": {
            "type": "boolean"
          },
          "category_ids": {
            "type": "array",
            "maxItems": 50,
            "uniqueItems": true,
            "description": "Categories of the store. Replaces the product's categories; `[]` removes them all.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "options": {
            "type": "array",
            "maxItems": 3,
            "description": "Replaces every option of the product. Needs `variants` in the same request.",
            "items": {
              "$ref": "#/components/schemas/ProductOptionInput"
            }
          },
          "variants": {
            "type": "array",
            "maxItems": 100,
            "description": "The product's variants after the write. A variant with an `id` is updated, one without is created, and one left out is deleted. `[]` deletes them all.",
            "items": {
              "$ref": "#/components/schemas/ProductVariantInput"
            }
          },
          "is_skip_cart": {
            "type": "boolean"
          },
          "buy_now_text": {
            "type": "string",
            "maxLength": 100,
            "description": "One line."
          },
          "is_fixed_bottom_buy": {
            "type": "boolean"
          },
          "is_one_page_checkout": {
            "type": "boolean"
          },
          "is_fast_checkout": {
            "type": "boolean"
          },
          "is_free_shipping": {
            "type": "boolean"
          },
          "is_quantity_hidden": {
            "type": "boolean"
          },
          "is_header_hidden": {
            "type": "boolean"
          },
          "hide_related_products": {
            "type": "boolean"
          },
          "is_reviews_enabled": {
            "type": "boolean"
          },
          "is_visitor_counter": {
            "type": "boolean"
          },
          "visitor_counter_min": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "description": "At most `visitor_counter_max`."
          },
          "visitor_counter_max": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "is_countdown_timer": {
            "type": "boolean"
          },
          "countdown_timer_hours": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8760
          }
        }
      },
      "ProductUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Every field is optional; only the fields sent change.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "description": "One line, trimmed, with at least one visible character."
          },
          "slug": {
            "type": "string",
            "maxLength": 255,
            "pattern": "^[a-zA-Z0-9-]+$",
            "description": "Unique among the store's products. Made from the name on create when left out."
          },
          "sku": {
            "type": "string",
            "maxLength": 255
          },
          "external_sku": {
            "type": "string",
            "maxLength": 255,
            "description": "The product's code in an outside system."
          },
          "description": {
            "type": "string",
            "description": "HTML, cleaned before it is saved; see [HTML descriptions](/api-reference/products/overview#html-descriptions). No limit of its own beyond the 50 KB of the product."
          },
          "meta_description": {
            "type": "string",
            "maxLength": 1000,
            "description": "One line."
          },
          "price": {
            "type": "number",
            "minimum": 0,
            "maximum": 100000000,
            "description": "Up to 4 decimals. An amount that cannot be stored exactly is refused (rule `precision`)."
          },
          "sale_price": {
            "type": "number",
            "minimum": 0,
            "maximum": 100000000,
            "description": "Under `price`, or `0` for no sale."
          },
          "sale_end_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "RFC 3339. `null` removes the end date."
          },
          "thumb": {
            "type": "string",
            "maxLength": 2048,
            "description": "An https URL."
          },
          "images": {
            "type": "array",
            "maxItems": 20,
            "description": "https URLs, up to 2048 bytes each. Replaces the whole list.",
            "items": {
              "type": "string"
            }
          },
          "position": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000
          },
          "hidden": {
            "type": "boolean"
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000,
            "description": "Sets the product's stock."
          },
          "track_stock": {
            "type": "boolean"
          },
          "disable_orders_for_no_stock": {
            "type": "boolean"
          },
          "category_ids": {
            "type": "array",
            "maxItems": 50,
            "uniqueItems": true,
            "description": "Categories of the store. Replaces the product's categories; `[]` removes them all.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "options": {
            "type": "array",
            "maxItems": 3,
            "description": "Replaces every option of the product. Needs `variants` in the same request.",
            "items": {
              "$ref": "#/components/schemas/ProductOptionInput"
            }
          },
          "variants": {
            "type": "array",
            "maxItems": 100,
            "description": "The product's variants after the write. A variant with an `id` is updated, one without is created, and one left out is deleted. `[]` deletes them all.",
            "items": {
              "$ref": "#/components/schemas/ProductVariantInput"
            }
          },
          "is_skip_cart": {
            "type": "boolean"
          },
          "buy_now_text": {
            "type": "string",
            "maxLength": 100,
            "description": "One line."
          },
          "is_fixed_bottom_buy": {
            "type": "boolean"
          },
          "is_one_page_checkout": {
            "type": "boolean"
          },
          "is_fast_checkout": {
            "type": "boolean"
          },
          "is_free_shipping": {
            "type": "boolean"
          },
          "is_quantity_hidden": {
            "type": "boolean"
          },
          "is_header_hidden": {
            "type": "boolean"
          },
          "hide_related_products": {
            "type": "boolean"
          },
          "is_reviews_enabled": {
            "type": "boolean"
          },
          "is_visitor_counter": {
            "type": "boolean"
          },
          "visitor_counter_min": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "description": "At most `visitor_counter_max`."
          },
          "visitor_counter_max": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          },
          "is_countdown_timer": {
            "type": "boolean"
          },
          "countdown_timer_hours": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8760
          }
        }
      },
      "ProductInventoryAdjust": {
        "type": "object",
        "required": [
          "delta"
        ],
        "additionalProperties": false,
        "properties": {
          "variant_id": {
            "type": "string",
            "format": "uuid",
            "description": "One of the product's variants. Leave it out to adjust the product's own stock."
          },
          "delta": {
            "type": "integer",
            "minimum": -1000000000,
            "maximum": 1000000000,
            "description": "The amount to add; negative to take away. Not `0`."
          }
        }
      },
      "ProductInventory": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "string",
            "format": "uuid"
          },
          "variant_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The variant adjusted; `null` when the product's own stock was."
          },
          "quantity": {
            "type": "integer",
            "description": "The stock after the adjustment."
          }
        }
      },
      "Review": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": "string",
            "format": "uuid",
            "description": "The product reviewed. Set on create, never changes."
          },
          "rating": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          },
          "user_name": {
            "type": "string",
            "description": "The reviewer's name, as the product page shows it."
          },
          "comment": {
            "type": "string",
            "description": "Plain text, may hold line breaks. `\"\"` for none."
          },
          "image": {
            "type": "string",
            "description": "An `https` image URL, or `\"\"` for none."
          },
          "is_accepted": {
            "type": "boolean",
            "description": "Only accepted reviews show on the product page."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "`1970-01-01T00:00:00Z` for an old review saved without one."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ReviewRating": {
        "type": "integer",
        "minimum": 1,
        "maximum": 5,
        "description": "A whole number of stars."
      },
      "ReviewUserName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 255,
        "description": "One line, trimmed, no invisible characters and no `<`."
      },
      "ReviewComment": {
        "type": "string",
        "maxLength": 5000,
        "description": "Trimmed. Line breaks and tabs are kept; `<` and invisible characters are refused."
      },
      "ReviewImage": {
        "type": "string",
        "maxLength": 2048,
        "description": "An `https` URL with a host, no user name or password, no `#` fragment, and none of `\"`, `'`, `<`, `>`, `` ` ``, `\\` or spaces. `\"\"` for none."
      },
      "ReviewCreate": {
        "type": "object",
        "required": [
          "product_id",
          "rating",
          "user_name"
        ],
        "additionalProperties": false,
        "description": "No field takes `null`.",
        "properties": {
          "product_id": {
            "type": "string",
            "format": "uuid",
            "description": "A live product of this store. It cannot change later."
          },
          "rating": {
            "$ref": "#/components/schemas/ReviewRating"
          },
          "user_name": {
            "$ref": "#/components/schemas/ReviewUserName"
          },
          "comment": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ReviewComment"
              }
            ],
            "default": ""
          },
          "image": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ReviewImage"
              }
            ],
            "default": ""
          },
          "is_accepted": {
            "type": "boolean",
            "default": false,
            "description": "`true` shows the review on the product page."
          }
        }
      },
      "ReviewUpdate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Every field is optional; only the fields sent change. No field takes `null`, and `product_id` cannot be sent.",
        "properties": {
          "rating": {
            "$ref": "#/components/schemas/ReviewRating"
          },
          "user_name": {
            "$ref": "#/components/schemas/ReviewUserName"
          },
          "comment": {
            "$ref": "#/components/schemas/ReviewComment"
          },
          "image": {
            "$ref": "#/components/schemas/ReviewImage"
          },
          "is_accepted": {
            "type": "boolean"
          }
        }
      },
      "ShippingSettings": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "country": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Country"
              },
              {
                "type": "null"
              }
            ],
            "description": "`null` until the store chose a country."
          },
          "cost_type": {
            "type": "string",
            "enum": [
              "fixed",
              "per_area"
            ],
            "description": "The merchant's choice, read only. With `fixed`, the areas' costs are not used."
          },
          "fixed_cost": {
            "type": "number"
          }
        }
      },
      "Country": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2."
          },
          "name_ar": {
            "type": "string"
          },
          "name_en": {
            "type": "string"
          }
        }
      },
      "Area": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Can change when the merchant saves the list from the dashboard."
          },
          "name": {
            "type": "string"
          },
          "cost": {
            "type": "number",
            "description": "The shipping cost to this area, in the store's currency."
          },
          "hidden": {
            "type": "boolean",
            "description": "A hidden area is not offered at checkout."
          },
          "custom": {
            "type": "boolean",
            "description": "Added by hand (by the merchant or an app), not one of the country's. Only a custom area can be deleted."
          }
        }
      },
      "AreaName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100,
        "description": "One line, trimmed, no invisible characters and no `<`. Unique in the store, letter case aside."
      },
      "AreaCost": {
        "type": "number",
        "minimum": 0,
        "maximum": 1000000,
        "description": "At most 2 decimals."
      },
      "AreaChange": {
        "type": "object",
        "required": [
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "$ref": "#/components/schemas/AreaName"
          },
          "cost": {
            "$ref": "#/components/schemas/AreaCost"
          },
          "hidden": {
            "type": "boolean"
          }
        }
      },
      "Store": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The store's title, as merchants and shoppers see it. The subdomain when the store has no title."
          },
          "subdomain": {
            "type": "string",
            "description": "The store's address on EasyOrders, `<subdomain>.myeasyorders.com`."
          },
          "domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "The custom domain, without scheme or trailing slash; `null` when the store has none."
          },
          "url": {
            "type": "string",
            "description": "The storefront's public URL: `https://` and the custom domain when\nset (a bare domain such as `example.com` gets `www.`), otherwise\n`https://<subdomain>.myeasyorders.com`.\n"
          },
          "currency": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/StoreCurrency"
              },
              {
                "type": "null"
              }
            ],
            "description": "The store's currency; `null` when it has none."
          },
          "country": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/StoreCountry"
              },
              {
                "type": "null"
              }
            ],
            "description": "The store's country; `null` when it has none."
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "description": "The store's timezone name, e.g. `Africa/Cairo`; `null` when it has none."
          },
          "language": {
            "type": "string",
            "description": "The storefront's language code; `ar` when the store never chose one."
          },
          "plan": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/StorePlan"
              },
              {
                "type": "null"
              }
            ],
            "description": "The merchant's EasyOrders plan; `null` when it has none."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the store was created. A few old stores without a date read `1970-01-01T00:00:00Z`."
          }
        }
      },
      "StoreCurrency": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          }
        }
      },
      "StoreCountry": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2."
          },
          "name_en": {
            "type": "string"
          },
          "name_ar": {
            "type": "string"
          }
        }
      },
      "StorePlan": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The plan's stable key. Branch on it, not on the name."
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "InvalidRequest": {
        "description": "The body is not a JSON object, or has a field of the wrong type or an unknown field.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "invalid_request",
                "message": "Invalid JSON body: unknown field"
              }
            }
          }
        }
      },
      "Unauthenticated": {
        "description": "The access token is missing, invalid or expired.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "unauthenticated",
                "message": "Missing or invalid access token"
              }
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "Your app's subscription on this store is suspended.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "payment_required",
                "message": "The app's subscription on this store is suspended"
              }
            }
          }
        }
      },
      "InsufficientScope": {
        "description": "The token lacks the scope this endpoint needs.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "insufficient_scope",
                "message": "This request requires the scope: read_orders",
                "details": {
                  "required_scope": "read_orders"
                }
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "No such resource in this store.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "not_found",
                "message": "Resource not found"
              }
            }
          }
        }
      },
      "ValidationFailed": {
        "description": "The request broke one or more rules; `details.fields` lists every one.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Error"
                },
                {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "details": {
                          "type": "object",
                          "properties": {
                            "fields": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/FieldError"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              ]
            },
            "example": {
              "error": {
                "code": "validation_failed",
                "message": "Validation failed",
                "details": {
                  "fields": [
                    {
                      "field": "items[0].quantity",
                      "rule": "between",
                      "param": "1,10000"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "RateLimited": {
        "description": "More than 600 requests in a minute from your app on this store.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "too_many_requests",
                "message": "Rate limit exceeded"
              }
            }
          }
        }
      },
      "ArticleCategoryOK": {
        "description": "The article category.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "article_category"
              ],
              "properties": {
                "article_category": {
                  "$ref": "#/components/schemas/ArticleCategory"
                }
              }
            },
            "example": {
              "article_category": {
                "id": "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20",
                "name": "Buying guides",
                "slug": "buying-guides",
                "description": "How to pick the right product for you.",
                "created_at": "2026-11-15T10:00:00Z",
                "updated_at": "2026-11-15T10:00:00Z"
              }
            }
          }
        }
      },
      "ArticleBodyTooLarge": {
        "description": "The body is over 64 KiB.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "body_too_large",
                "message": "Request body too large"
              }
            }
          }
        }
      },
      "ArticleValidationFailed": {
        "description": "The request broke one or more rules; `details.fields` lists every one.\nA category ID that is not an article category of the store answers\nthe rule `article_category` on `category_ids`, alone.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "validation_failed",
                "message": "Validation failed",
                "details": {
                  "fields": [
                    {
                      "field": "category_ids",
                      "rule": "article_category"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "CheckoutFieldOK": {
        "description": "The checkout field.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "checkout_field"
              ],
              "properties": {
                "checkout_field": {
                  "$ref": "#/components/schemas/CheckoutField"
                }
              }
            },
            "example": {
              "checkout_field": {
                "id": "6c2f8d3b-0e4a-4b7f-9c6d-2a3b4c5d6e70",
                "key": "phone",
                "name": "Mobile number",
                "type": "input",
                "placeholder": "01xxxxxxxxx",
                "position": 1,
                "is_active": true,
                "is_required": true
              }
            }
          }
        }
      },
      "CouponOK": {
        "description": "The coupon.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "coupon"
              ],
              "properties": {
                "coupon": {
                  "$ref": "#/components/schemas/Coupon"
                }
              }
            },
            "example": {
              "coupon": {
                "id": "4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a",
                "method": "code",
                "code": "summer15",
                "title": "",
                "discount_type": "amount_off_products",
                "value_type": "percentage",
                "value": 15,
                "min_order_amount": 0,
                "min_quantity": 0,
                "max_discount_amount": 200,
                "usage_limit": 500,
                "usage_count": 37,
                "is_active": true,
                "starts_at": null,
                "expires_at": "2027-09-01T00:00:00Z",
                "applies_to": "specific_categories",
                "buy_quantity": 0,
                "buy_requirement_type": "quantity",
                "buy_amount": 0,
                "get_quantity": 0,
                "get_value_type": "free",
                "get_value": 0,
                "max_uses_per_order": 0,
                "max_shipping_discount": 0,
                "exclude_shipping_over": 0,
                "combines_with_product": false,
                "combines_with_order": false,
                "combines_with_shipping": true,
                "applicable_items": [
                  {
                    "item_type": "category",
                    "item_id": "8d2f4b6a-1c3e-4a5b-9d7f-0e1a2b3c4d5e",
                    "is_buy_item": false
                  }
                ],
                "created_at": "2026-12-01T09:00:00Z",
                "updated_at": "2026-12-03T14:30:00Z"
              }
            }
          }
        }
      },
      "LabelListOK": {
        "description": "Your app's labels on it, oldest first.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "labels"
              ],
              "properties": {
                "labels": {
                  "type": "array",
                  "maxItems": 5,
                  "items": {
                    "$ref": "#/components/schemas/Label"
                  }
                }
              }
            },
            "example": {
              "labels": [
                {
                  "id": "5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a",
                  "text": "VIP",
                  "color": "purple",
                  "created_at": "2026-12-03T10:00:00Z"
                },
                {
                  "id": "8a3d4c2b-1e0f-4a9b-8c7d-6e5f4a3b2c10",
                  "text": "Call before shipping",
                  "color": "orange",
                  "created_at": "2026-12-03T10:05:00Z"
                }
              ]
            }
          }
        }
      },
      "LabelCreated": {
        "description": "The label added. `Location` is its path, for deleting it; there is no endpoint to read one label.",
        "headers": {
          "Location": {
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "label"
              ],
              "properties": {
                "label": {
                  "$ref": "#/components/schemas/Label"
                }
              }
            },
            "example": {
              "label": {
                "id": "5d2e8f1a-3b4c-4d5e-8f6a-7b8c9d0e1f2a",
                "text": "VIP",
                "color": "purple",
                "created_at": "2026-12-03T10:00:00Z"
              }
            }
          }
        }
      },
      "LabelConflict": {
        "description": "`label_exists`: your app already has this text on it, letter case aside; or `idempotency_in_progress`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "label_exists",
                "message": "The app already has a label with this text on it (letter case aside)"
              }
            }
          }
        }
      },
      "LabelUnprocessable": {
        "description": "`validation_failed`, `idempotency_key_reused`, or `limit_exceeded` when your app already has 5 labels on it.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "limit_exceeded",
                "message": "An app may put at most 5 labels on an order or a product: delete one first",
                "details": {
                  "max": 5
                }
              }
            }
          }
        }
      },
      "MissedOrderOK": {
        "description": "The missed order.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "missed_order"
              ],
              "properties": {
                "missed_order": {
                  "$ref": "#/components/schemas/MissedOrder"
                }
              }
            },
            "example": {
              "missed_order": {
                "id": "3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d",
                "full_name": "Mona Hassan",
                "email": "",
                "phone": "+201001234567",
                "phone_alt": "",
                "country": "Egypt",
                "city": "Cairo",
                "address": "12 Tahrir St, Downtown",
                "sa_national_address": "",
                "payment_method": "cod",
                "note": "",
                "utm_source": "facebook",
                "utm_campaign": "winter-sale",
                "metadata": {},
                "funnel_id": null,
                "custom_currency": "",
                "is_digital": false,
                "products": [
                  "Cotton Hoodie"
                ],
                "reason": "",
                "can_convert_to_order": true,
                "is_completed": false,
                "masked": false,
                "masked_reason": null,
                "items": [
                  {
                    "id": "5c8d0e1f-2a3b-4c4d-8e5f-6a7b8c9d0e10",
                    "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                    "variant_id": null,
                    "product_name": "Cotton Hoodie",
                    "quantity": 1,
                    "price": 450,
                    "is_upsell": false,
                    "metadata": {}
                  }
                ],
                "created_at": "2026-12-04T10:15:00Z",
                "updated_at": "2026-12-04T10:15:00Z"
              }
            }
          }
        }
      },
      "MissedOrdersUnavailable": {
        "description": "The service that keeps missed orders did not answer. A write may or may not have happened; read before retrying.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "service_unavailable",
                "message": "Missed orders are unavailable right now, try again later"
              }
            }
          }
        }
      },
      "OrderOK": {
        "description": "The order.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "order"
              ],
              "properties": {
                "order": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "example": {
              "order": {
                "id": "6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c",
                "number": 1042,
                "status": "confirmed",
                "payment_status": "pending_payment",
                "payment_method": "cod",
                "full_name": "Mona Hassan",
                "email": "",
                "phone": "+201001234567",
                "phone_alt": "",
                "country": "Egypt",
                "city": "Cairo",
                "address": "12 Tahrir St, Downtown",
                "sa_national_address": "",
                "note": "",
                "ref": "",
                "utm_source": "",
                "utm_campaign": "",
                "metadata": {
                  "is_app_order": true,
                  "app_name": "ERP Sync",
                  "erp_ref": "INV-778"
                },
                "product_cost": 900,
                "shipping_cost": 60,
                "coupon_code": "",
                "coupon_discount": 0,
                "total_cost": 960,
                "custom_currency": "",
                "is_digital": false,
                "shipping_status": "",
                "masked": false,
                "masked_reason": null,
                "items": [
                  {
                    "id": "2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f60",
                    "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                    "variant_id": null,
                    "quantity": 2,
                    "price": 450,
                    "metadata": {}
                  }
                ],
                "created_at": "2026-12-04T10:15:00Z",
                "updated_at": "2026-12-04T10:20:00Z"
              }
            }
          }
        }
      },
      "OrderCreated": {
        "description": "The order created.",
        "headers": {
          "Idempotent-Replayed": {
            "description": "`true` when this is the saved answer of an earlier request with the same `Idempotency-Key`.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "order"
              ],
              "properties": {
                "order": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "example": {
              "order": {
                "id": "6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c",
                "number": 1042,
                "status": "confirmed",
                "payment_status": "pending_payment",
                "payment_method": "cod",
                "full_name": "Mona Hassan",
                "email": "",
                "phone": "+201001234567",
                "phone_alt": "",
                "country": "Egypt",
                "city": "Cairo",
                "address": "12 Tahrir St, Downtown",
                "sa_national_address": "",
                "note": "",
                "ref": "",
                "utm_source": "",
                "utm_campaign": "",
                "metadata": {
                  "is_app_order": true,
                  "app_name": "ERP Sync",
                  "erp_ref": "INV-778"
                },
                "product_cost": 900,
                "shipping_cost": 60,
                "coupon_code": "",
                "coupon_discount": 0,
                "total_cost": 960,
                "custom_currency": "",
                "is_digital": false,
                "shipping_status": "",
                "masked": false,
                "masked_reason": null,
                "items": [
                  {
                    "id": "2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f60",
                    "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                    "variant_id": null,
                    "quantity": 2,
                    "price": 450,
                    "metadata": {}
                  }
                ],
                "created_at": "2026-12-04T10:15:00Z",
                "updated_at": "2026-12-04T10:20:00Z"
              }
            }
          }
        }
      },
      "PageOK": {
        "description": "The page, with its content.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "page"
              ],
              "properties": {
                "page": {
                  "$ref": "#/components/schemas/Page"
                }
              }
            },
            "example": {
              "page": {
                "id": "3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70",
                "title": "Return policy",
                "slug": "return-policy",
                "content": "<h2>Returns</h2><p>You can return any item within <strong>14 days</strong> of delivery.</p>",
                "show_in_header": false,
                "show_in_footer": true,
                "show_under_gallery": false,
                "position": 2,
                "is_active": true,
                "is_need_review": false,
                "created_at": "2026-11-20T09:00:00Z",
                "updated_at": "2026-11-20T09:00:00Z"
              }
            }
          }
        }
      },
      "PageBodyTooLarge": {
        "description": "The body is over 64 KiB.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "body_too_large",
                "message": "Request body too large"
              }
            }
          }
        }
      },
      "ProductOK": {
        "description": "The product.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "product"
              ],
              "properties": {
                "product": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            },
            "example": {
              "product": {
                "id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                "name": "Classic Cotton T-Shirt",
                "slug": "classic-cotton-t-shirt",
                "sku": "TS-CLASSIC",
                "external_sku": "",
                "source_app": "ERP Sync",
                "description": "<p>Soft cotton, cut for everyday wear.</p>",
                "meta_description": "",
                "price": 450,
                "sale_price": 399,
                "sale_end_date": null,
                "thumb": "https://cdn.example.com/products/tshirt.jpg",
                "images": [
                  "https://cdn.example.com/products/tshirt-back.jpg"
                ],
                "position": 0,
                "hidden": false,
                "quantity": 0,
                "track_stock": true,
                "disable_orders_for_no_stock": false,
                "is_digital": false,
                "digital_type": null,
                "category_ids": [
                  "5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
                ],
                "options": [
                  {
                    "name": "Size",
                    "type": "button",
                    "values": [
                      {
                        "name": "M",
                        "value": "M",
                        "thumb": "",
                        "is_out_of_stock": false
                      },
                      {
                        "name": "L",
                        "value": "L",
                        "thumb": "",
                        "is_out_of_stock": false
                      }
                    ]
                  }
                ],
                "variants": [
                  {
                    "id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01",
                    "price": 450,
                    "sale_price": 0,
                    "quantity": 40,
                    "sku": "TS-CLASSIC-M",
                    "thumb": "",
                    "options": {
                      "Size": "M"
                    }
                  },
                  {
                    "id": "8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12",
                    "price": 450,
                    "sale_price": 0,
                    "quantity": 25,
                    "sku": "TS-CLASSIC-L",
                    "thumb": "",
                    "options": {
                      "Size": "L"
                    }
                  }
                ],
                "is_skip_cart": false,
                "buy_now_text": "",
                "is_fixed_bottom_buy": false,
                "is_one_page_checkout": false,
                "is_fast_checkout": false,
                "is_free_shipping": false,
                "is_quantity_hidden": false,
                "is_header_hidden": false,
                "hide_related_products": false,
                "is_reviews_enabled": false,
                "is_visitor_counter": false,
                "visitor_counter_min": 0,
                "visitor_counter_max": 0,
                "is_countdown_timer": false,
                "countdown_timer_hours": 0,
                "created_at": "2026-12-04T09:00:00Z",
                "updated_at": "2026-12-04T09:30:00Z"
              }
            }
          }
        }
      },
      "ProductCreated": {
        "description": "The product created. `Location` is its path.",
        "headers": {
          "Location": {
            "schema": {
              "type": "string"
            }
          },
          "Idempotent-Replayed": {
            "description": "`true` when this is the saved answer of an earlier request with the same `Idempotency-Key`.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "product"
              ],
              "properties": {
                "product": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            },
            "example": {
              "product": {
                "id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                "name": "Classic Cotton T-Shirt",
                "slug": "classic-cotton-t-shirt",
                "sku": "TS-CLASSIC",
                "external_sku": "",
                "source_app": "ERP Sync",
                "description": "<p>Soft cotton, cut for everyday wear.</p>",
                "meta_description": "",
                "price": 450,
                "sale_price": 399,
                "sale_end_date": null,
                "thumb": "https://cdn.example.com/products/tshirt.jpg",
                "images": [
                  "https://cdn.example.com/products/tshirt-back.jpg"
                ],
                "position": 0,
                "hidden": false,
                "quantity": 0,
                "track_stock": true,
                "disable_orders_for_no_stock": false,
                "is_digital": false,
                "digital_type": null,
                "category_ids": [
                  "5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
                ],
                "options": [
                  {
                    "name": "Size",
                    "type": "button",
                    "values": [
                      {
                        "name": "M",
                        "value": "M",
                        "thumb": "",
                        "is_out_of_stock": false
                      },
                      {
                        "name": "L",
                        "value": "L",
                        "thumb": "",
                        "is_out_of_stock": false
                      }
                    ]
                  }
                ],
                "variants": [
                  {
                    "id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01",
                    "price": 450,
                    "sale_price": 0,
                    "quantity": 40,
                    "sku": "TS-CLASSIC-M",
                    "thumb": "",
                    "options": {
                      "Size": "M"
                    }
                  },
                  {
                    "id": "8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12",
                    "price": 450,
                    "sale_price": 0,
                    "quantity": 25,
                    "sku": "TS-CLASSIC-L",
                    "thumb": "",
                    "options": {
                      "Size": "L"
                    }
                  }
                ],
                "is_skip_cart": false,
                "buy_now_text": "",
                "is_fixed_bottom_buy": false,
                "is_one_page_checkout": false,
                "is_fast_checkout": false,
                "is_free_shipping": false,
                "is_quantity_hidden": false,
                "is_header_hidden": false,
                "hide_related_products": false,
                "is_reviews_enabled": false,
                "is_visitor_counter": false,
                "visitor_counter_min": 0,
                "visitor_counter_max": 0,
                "is_countdown_timer": false,
                "countdown_timer_hours": 0,
                "created_at": "2026-12-04T09:00:00Z",
                "updated_at": "2026-12-04T09:30:00Z"
              }
            }
          }
        }
      },
      "ProductBodyTooLarge": {
        "description": "The body is larger than 50 KB.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "body_too_large",
                "message": "Request body too large"
              }
            }
          }
        }
      },
      "ProductRefused": {
        "description": "`validation_failed` (`details.fields` lists every rule broken),\n`product_too_large` when the saved product would be larger than\n50 KB, or `idempotency_key_reused` (on create, a key sent before\nwith a different body).\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "product_too_large",
                "message": "The product would be larger than 50 KB: shorten the description or send fewer variants or images"
              }
            }
          }
        }
      },
      "ReviewOK": {
        "description": "The review.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "review"
              ],
              "properties": {
                "review": {
                  "$ref": "#/components/schemas/Review"
                }
              }
            },
            "example": {
              "review": {
                "id": "7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a",
                "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
                "rating": 5,
                "user_name": "Sara Adel",
                "comment": "Great quality, arrived in two days.\nWould buy again.",
                "image": "https://cdn.example.com/reviews/sara-shoes.jpg",
                "is_accepted": true,
                "created_at": "2026-12-04T12:30:00Z",
                "updated_at": "2026-12-04T12:30:00Z"
              }
            }
          }
        }
      },
      "ShippingSettingsOK": {
        "description": "The shipping settings.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "shipping_settings"
              ],
              "properties": {
                "shipping_settings": {
                  "$ref": "#/components/schemas/ShippingSettings"
                }
              }
            },
            "example": {
              "shipping_settings": {
                "enabled": true,
                "country": {
                  "code": "EG",
                  "name_ar": "مصر",
                  "name_en": "Egypt"
                },
                "cost_type": "per_area",
                "fixed_cost": 0
              }
            }
          }
        }
      },
      "AreasOK": {
        "description": "Every area of the store, in order.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "areas"
              ],
              "properties": {
                "areas": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Area"
                  }
                }
              }
            },
            "example": {
              "areas": [
                {
                  "id": "5a2e8f04-1c3b-4d7a-8e9f-0b1c2d3e4f50",
                  "name": "Cairo",
                  "cost": 65,
                  "hidden": false,
                  "custom": false
                },
                {
                  "id": "9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c60",
                  "name": "Giza",
                  "cost": 65,
                  "hidden": false,
                  "custom": false
                },
                {
                  "id": "1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a50",
                  "name": "New Cairo",
                  "cost": 70,
                  "hidden": false,
                  "custom": true
                }
              ]
            }
          }
        }
      },
      "AreaExists": {
        "description": "Another area of the store has this name, letter case aside.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "area_exists",
                "message": "Another area of the store has this name (letter case aside)"
              }
            }
          }
        }
      },
      "ShippingUnavailable": {
        "description": "The shipping service did not answer. A write may or may not have happened; read before retrying.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "service_unavailable",
                "message": "Shipping is unavailable right now, try again later"
              }
            }
          }
        }
      },
      "DailyLimit": {
        "description": "`too_many_requests` (600 a minute), or `daily_limit_exceeded`: your app\nalready changed this store's shipping 3 times today (Cairo time).\n",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "daily_limit_exceeded",
                "message": "An app may change a store's shipping 3 times a day (Cairo time): try again after resets_at",
                "details": {
                  "limit": 3,
                  "resets_at": "2026-12-04T22:00:00Z"
                }
              }
            }
          }
        }
      }
    },
    "examples": {
      "ArticleCategoryValue": {
        "value": {
          "id": "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20",
          "name": "Buying guides",
          "slug": "buying-guides",
          "description": "How to pick the right product for you.",
          "created_at": "2026-11-15T10:00:00Z",
          "updated_at": "2026-11-15T10:00:00Z"
        }
      },
      "ArticleValue": {
        "value": {
          "id": "8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50",
          "title": "How to choose a winter jacket",
          "slug": "how-to-choose-a-winter-jacket",
          "description": "Five things to check before you buy a jacket for the cold months.",
          "content": "<h2>1. Insulation</h2><p>Down keeps you warmest for its weight.</p><img src=\"https://cdn.example.com/blog/down.jpg\" alt=\"Down jacket\">",
          "meta_description": "A short guide to choosing a warm, waterproof winter jacket.",
          "thumbnail": "https://cdn.example.com/blog/winter-jacket.jpg",
          "tags": [
            "winter",
            "guides"
          ],
          "published": true,
          "is_need_review": false,
          "category_ids": [
            "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20"
          ],
          "created_at": "2026-11-28T08:00:00Z",
          "updated_at": "2026-11-28T08:00:00Z"
        }
      },
      "ArticleJoinedValue": {
        "value": {
          "id": "8d2f4a6c-1b3e-4c5d-9e7f-0a1b2c3d4e50",
          "title": "How to choose a winter jacket",
          "slug": "how-to-choose-a-winter-jacket",
          "description": "Five things to check before you buy a jacket for the cold months.",
          "content": "<h2>1. Insulation</h2><p>Down keeps you warmest for its weight.</p><img src=\"https://cdn.example.com/blog/down.jpg\" alt=\"Down jacket\">",
          "meta_description": "A short guide to choosing a warm, waterproof winter jacket.",
          "thumbnail": "https://cdn.example.com/blog/winter-jacket.jpg",
          "tags": [
            "winter",
            "guides"
          ],
          "published": true,
          "is_need_review": false,
          "category_ids": [
            "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20"
          ],
          "categories": [
            {
              "id": "4a7c9e1b-2d3f-4b5a-8c6d-7e8f9a0b1c20",
              "name": "Buying guides",
              "slug": "buying-guides"
            }
          ],
          "created_at": "2026-11-28T08:00:00Z",
          "updated_at": "2026-11-28T08:00:00Z"
        }
      },
      "CategoryValue": {
        "value": {
          "id": "5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
          "name": "T-Shirts",
          "slug": "t-shirts",
          "thumb": "https://cdn.example.com/categories/t-shirts.jpg",
          "parent_id": "3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d",
          "position": 0,
          "hidden": false,
          "show_in_header": true,
          "created_at": "2026-12-04T09:00:00Z",
          "updated_at": "2026-12-04T09:00:00Z"
        }
      },
      "CategoryChildValue": {
        "value": {
          "id": "5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
          "name": "T-Shirts",
          "slug": "t-shirts",
          "thumb": "https://cdn.example.com/categories/t-shirts.jpg",
          "parent_id": "3b4c5d6e-7f80-4a1b-9c2d-3e4f5a6b7c8d",
          "position": 0,
          "hidden": false,
          "show_in_header": true,
          "created_at": "2026-12-04T09:00:00Z",
          "updated_at": "2026-12-04T09:00:00Z",
          "children": []
        }
      },
      "CouponValue": {
        "value": {
          "id": "4b7e2c1a-9d3f-4e6b-8a5c-2f1d0e9c8b7a",
          "method": "code",
          "code": "summer15",
          "title": "",
          "discount_type": "amount_off_products",
          "value_type": "percentage",
          "value": 15,
          "min_order_amount": 0,
          "min_quantity": 0,
          "max_discount_amount": 200,
          "usage_limit": 500,
          "usage_count": 37,
          "is_active": true,
          "starts_at": null,
          "expires_at": "2027-09-01T00:00:00Z",
          "applies_to": "specific_categories",
          "buy_quantity": 0,
          "buy_requirement_type": "quantity",
          "buy_amount": 0,
          "get_quantity": 0,
          "get_value_type": "free",
          "get_value": 0,
          "max_uses_per_order": 0,
          "max_shipping_discount": 0,
          "exclude_shipping_over": 0,
          "combines_with_product": false,
          "combines_with_order": false,
          "combines_with_shipping": true,
          "applicable_items": [
            {
              "item_type": "category",
              "item_id": "8d2f4b6a-1c3e-4a5b-9d7f-0e1a2b3c4d5e",
              "is_buy_item": false
            }
          ],
          "created_at": "2026-12-01T09:00:00Z",
          "updated_at": "2026-12-03T14:30:00Z"
        }
      },
      "AutomaticCouponValue": {
        "value": {
          "id": "9a1b2c3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
          "method": "automatic",
          "code": "",
          "title": "Free shipping over 1000",
          "discount_type": "free_shipping",
          "value_type": "fixed",
          "value": 0,
          "min_order_amount": 1000,
          "min_quantity": 0,
          "max_discount_amount": 0,
          "usage_limit": 0,
          "usage_count": 112,
          "is_active": true,
          "starts_at": null,
          "expires_at": null,
          "applies_to": "all",
          "buy_quantity": 0,
          "buy_requirement_type": "quantity",
          "buy_amount": 0,
          "get_quantity": 0,
          "get_value_type": "free",
          "get_value": 0,
          "max_uses_per_order": 0,
          "max_shipping_discount": 0,
          "exclude_shipping_over": 0,
          "combines_with_product": true,
          "combines_with_order": false,
          "combines_with_shipping": false,
          "applicable_items": [],
          "created_at": "2026-12-02T08:00:00Z",
          "updated_at": "2026-12-02T08:00:00Z"
        }
      },
      "MissedOrderValue": {
        "value": {
          "id": "3e7a9c2d-5b8f-4e1a-9c6d-2b7f0e3a5c8d",
          "full_name": "Mona Hassan",
          "email": "",
          "phone": "+201001234567",
          "phone_alt": "",
          "country": "Egypt",
          "city": "Cairo",
          "address": "12 Tahrir St, Downtown",
          "sa_national_address": "",
          "payment_method": "cod",
          "note": "",
          "utm_source": "facebook",
          "utm_campaign": "winter-sale",
          "metadata": {},
          "funnel_id": null,
          "custom_currency": "",
          "is_digital": false,
          "products": [
            "Cotton Hoodie"
          ],
          "reason": "",
          "can_convert_to_order": true,
          "is_completed": false,
          "masked": false,
          "masked_reason": null,
          "items": [
            {
              "id": "5c8d0e1f-2a3b-4c4d-8e5f-6a7b8c9d0e10",
              "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
              "variant_id": null,
              "product_name": "Cotton Hoodie",
              "quantity": 1,
              "price": 450,
              "is_upsell": false,
              "metadata": {}
            }
          ],
          "created_at": "2026-12-04T10:15:00Z",
          "updated_at": "2026-12-04T10:15:00Z"
        }
      },
      "OrderValue": {
        "value": {
          "id": "6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c",
          "number": 1042,
          "status": "confirmed",
          "payment_status": "pending_payment",
          "payment_method": "cod",
          "full_name": "Mona Hassan",
          "email": "",
          "phone": "+201001234567",
          "phone_alt": "",
          "country": "Egypt",
          "city": "Cairo",
          "address": "12 Tahrir St, Downtown",
          "sa_national_address": "",
          "note": "",
          "ref": "",
          "utm_source": "",
          "utm_campaign": "",
          "metadata": {
            "is_app_order": true,
            "app_name": "ERP Sync",
            "erp_ref": "INV-778"
          },
          "product_cost": 900,
          "shipping_cost": 60,
          "coupon_code": "",
          "coupon_discount": 0,
          "total_cost": 960,
          "custom_currency": "",
          "is_digital": false,
          "shipping_status": "",
          "masked": false,
          "masked_reason": null,
          "items": [
            {
              "id": "2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f60",
              "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
              "variant_id": null,
              "quantity": 2,
              "price": 450,
              "metadata": {}
            }
          ],
          "created_at": "2026-12-04T10:15:00Z",
          "updated_at": "2026-12-04T10:20:00Z"
        }
      },
      "NoteValue": {
        "value": {
          "id": "3a4b5c6d-7e8f-4a0b-9c1d-2e3f4a5b6c70",
          "note": "Customer asked for delivery after 5 PM.",
          "type": "private",
          "created_at": "2026-12-04T11:00:00Z"
        }
      },
      "PageValue": {
        "value": {
          "id": "3b8e1f2a-6c4d-4e9f-8a1b-2c3d4e5f6a70",
          "title": "Return policy",
          "slug": "return-policy",
          "content": "<h2>Returns</h2><p>You can return any item within <strong>14 days</strong> of delivery.</p>",
          "show_in_header": false,
          "show_in_footer": true,
          "show_under_gallery": false,
          "position": 2,
          "is_active": true,
          "is_need_review": false,
          "created_at": "2026-11-20T09:00:00Z",
          "updated_at": "2026-11-20T09:00:00Z"
        }
      },
      "ProductValue": {
        "value": {
          "id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
          "name": "Classic Cotton T-Shirt",
          "slug": "classic-cotton-t-shirt",
          "sku": "TS-CLASSIC",
          "external_sku": "",
          "source_app": "ERP Sync",
          "description": "<p>Soft cotton, cut for everyday wear.</p>",
          "meta_description": "",
          "price": 450,
          "sale_price": 399,
          "sale_end_date": null,
          "thumb": "https://cdn.example.com/products/tshirt.jpg",
          "images": [
            "https://cdn.example.com/products/tshirt-back.jpg"
          ],
          "position": 0,
          "hidden": false,
          "quantity": 0,
          "track_stock": true,
          "disable_orders_for_no_stock": false,
          "is_digital": false,
          "digital_type": null,
          "category_ids": [
            "5c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
          ],
          "options": [
            {
              "name": "Size",
              "type": "button",
              "values": [
                {
                  "name": "M",
                  "value": "M",
                  "thumb": "",
                  "is_out_of_stock": false
                },
                {
                  "name": "L",
                  "value": "L",
                  "thumb": "",
                  "is_out_of_stock": false
                }
              ]
            }
          ],
          "variants": [
            {
              "id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a01",
              "price": 450,
              "sale_price": 0,
              "quantity": 40,
              "sku": "TS-CLASSIC-M",
              "thumb": "",
              "options": {
                "Size": "M"
              }
            },
            {
              "id": "8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b12",
              "price": 450,
              "sale_price": 0,
              "quantity": 25,
              "sku": "TS-CLASSIC-L",
              "thumb": "",
              "options": {
                "Size": "L"
              }
            }
          ],
          "is_skip_cart": false,
          "buy_now_text": "",
          "is_fixed_bottom_buy": false,
          "is_one_page_checkout": false,
          "is_fast_checkout": false,
          "is_free_shipping": false,
          "is_quantity_hidden": false,
          "is_header_hidden": false,
          "hide_related_products": false,
          "is_reviews_enabled": false,
          "is_visitor_counter": false,
          "visitor_counter_min": 0,
          "visitor_counter_max": 0,
          "is_countdown_timer": false,
          "countdown_timer_hours": 0,
          "created_at": "2026-12-04T09:00:00Z",
          "updated_at": "2026-12-04T09:30:00Z"
        }
      },
      "ProductListValue": {
        "value": {
          "id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
          "name": "Classic Cotton T-Shirt",
          "slug": "classic-cotton-t-shirt",
          "sku": "TS-CLASSIC",
          "external_sku": "",
          "source_app": "ERP Sync",
          "meta_description": "",
          "price": 450,
          "sale_price": 399,
          "sale_end_date": null,
          "thumb": "https://cdn.example.com/products/tshirt.jpg",
          "images": [
            "https://cdn.example.com/products/tshirt-back.jpg"
          ],
          "position": 0,
          "hidden": false,
          "quantity": 0,
          "track_stock": true,
          "disable_orders_for_no_stock": false,
          "is_digital": false,
          "digital_type": null,
          "is_skip_cart": false,
          "buy_now_text": "",
          "is_fixed_bottom_buy": false,
          "is_one_page_checkout": false,
          "is_fast_checkout": false,
          "is_free_shipping": false,
          "is_quantity_hidden": false,
          "is_header_hidden": false,
          "hide_related_products": false,
          "is_reviews_enabled": false,
          "is_visitor_counter": false,
          "visitor_counter_min": 0,
          "visitor_counter_max": 0,
          "is_countdown_timer": false,
          "countdown_timer_hours": 0,
          "created_at": "2026-12-04T09:00:00Z",
          "updated_at": "2026-12-04T09:30:00Z"
        }
      },
      "ReviewValue": {
        "value": {
          "id": "7e3d9a2b-5c1f-4b8e-a6d4-3f2e1d0c9b8a",
          "product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
          "rating": 5,
          "user_name": "Sara Adel",
          "comment": "Great quality, arrived in two days.\nWould buy again.",
          "image": "https://cdn.example.com/reviews/sara-shoes.jpg",
          "is_accepted": true,
          "created_at": "2026-12-04T12:30:00Z",
          "updated_at": "2026-12-04T12:30:00Z"
        }
      }
    }
  }
}
