> ## Documentation Index
> Fetch the complete documentation index at: https://developers-docs.easyorders.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a product

> **Scope:** [`write_products`](/scopes)

Creates a product. `name`, `price` and `thumb` are required; every
other field starts empty, zero or `false`, as in the dashboard.

- Without a `slug`, one is made from the name (`product` when the
  name has no Latin letters or digits), with a random suffix when
  taken. A `slug` you send must be free (`409 slug_taken`).
- `description` is HTML, cleaned before it is saved: see
  [HTML descriptions](/api-reference/products/overview#html-descriptions).
- `options` and `variants` go together: see
  [Options and variants](/api-reference/products/overview#options-and-variants).
  Variants you create have no `id` yet.
- The body is at most 50 KB (`413 body_too_large`), and so is the
  product it makes (`422 product_too_large`).
- The store must have no unpaid dues (`402 store_overdue`). Each
  product created charges the store the import fee, as importing
  from the dashboard does.
- The name, description and meta description go through an
  automatic content review: see
  [Content review](/api-reference/products/overview#content-review).
- Apps cannot create digital products.

`source_app` is set to your app's name. Send an `Idempotency-Key` to
retry safely.




## OpenAPI

````yaml /openapi.json post /products
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
    store: its orders, shipping settings and shipping areas, within the
    scopes the merchant approved.

    - Every request needs an access token (`Authorization: Bearer eo_at_...`)
      from the OAuth flow. A token works on one store only.
    - Request and response bodies are JSON. Unknown fields and query
      parameters are refused.
    - Errors share one shape: `{"error": {"code", "message", "details"}}`.
    - `v1` is stable: new fields and endpoints are added to it; a breaking
      change ships as a new version.
  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:
  /products:
    post:
      tags:
        - Products
      summary: Create a product
      description: |
        **Scope:** [`write_products`](/scopes)

        Creates a product. `name`, `price` and `thumb` are required; every
        other field starts empty, zero or `false`, as in the dashboard.

        - Without a `slug`, one is made from the name (`product` when the
          name has no Latin letters or digits), with a random suffix when
          taken. A `slug` you send must be free (`409 slug_taken`).
        - `description` is HTML, cleaned before it is saved: see
          [HTML descriptions](/api-reference/products/overview#html-descriptions).
        - `options` and `variants` go together: see
          [Options and variants](/api-reference/products/overview#options-and-variants).
          Variants you create have no `id` yet.
        - The body is at most 50 KB (`413 body_too_large`), and so is the
          product it makes (`422 product_too_large`).
        - The store must have no unpaid dues (`402 store_overdue`). Each
          product created charges the store the import fee, as importing
          from the dashboard does.
        - The name, description and meta description go through an
          automatic content review: see
          [Content review](/api-reference/products/overview#content-review).
        - Apps cannot create digital products.

        `source_app` is set to your app's name. Send an `Idempotency-Key` to
        retry safely.
      operationId: createProduct
      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" \
              -H "Authorization: Bearer $EASYORDERS_ACCESS_TOKEN" \
              -H "Idempotency-Key: ERP-SKU-TS-CLASSIC" \
              -H "Content-Type: application/json" \
              -d '{
              "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"
                  }
                }
              ]
            }'
        - lang: typescript
          label: TypeScript
          source: >-
            const response = await
            fetch('https://api.easy-orders.net/api/partners-apps/v1/products', {
              method: 'POST',
              headers: {
                Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,
                'Idempotency-Key': 'ERP-SKU-TS-CLASSIC',
                'Content-Type': 'application/json',
              },
              body: JSON.stringify({
                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',
                    },
                  },
                ],
              }),
            })


            const json = await response.json()

            if (!response.ok) {
              throw new Error(`${json.error.code}: ${json.error.message}`)
            }

            const { 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


            $ch =
            curl_init('https://api.easy-orders.net/api/partners-apps/v1/products');

            curl_setopt_array($ch, [
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_HTTPHEADER => [
                    'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),
                    'Idempotency-Key: ERP-SKU-TS-CLASSIC',
                    'Content-Type: application/json',
                ],
                CURLOPT_POSTFIELDS => json_encode([
                    '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',
                            ],
                        ],
                    ],
                ]),
            ]);


            $answer = json_decode(curl_exec($ch), true);

            $status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

            curl_close($ch);


            if ($status >= 300) {
                throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);
            }

            $product = $answer['product'];
        - lang: python
          label: Python
          source: |-
            import os

            import requests

            response = requests.post(
                "https://api.easy-orders.net/api/partners-apps/v1/products",
                headers={
                    "Authorization": f"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}",
                    "Idempotency-Key": "ERP-SKU-TS-CLASSIC",
                },
                json={
                    "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",
                            },
                        },
                    ],
                },
                timeout=30,
            )
            answer = response.json()
            if not response.ok:
                raise RuntimeError(f"{answer['error']['code']}: {answer['error']['message']}")
            product = answer["product"]
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      description: |
        A unique key (up to 255 printable ASCII characters). The same key
        from your app within 24 hours answers the first result again, with
        `Idempotent-Replayed: true`, instead of creating twice.
      schema:
        type: string
        maxLength: 255
  schemas:
    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
    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.
    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'
    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
    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
    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
    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'
    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
    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
  responses:
    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'
    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
    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
    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),
        `product_too_large` when the saved product would be larger than
        50 KB, or `idempotency_key_reused` (on create, a key sent before
        with a different body).
      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
    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
  headers:
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  securitySchemes:
    accessToken:
      type: http
      scheme: bearer
      description: >
        An access token from the OAuth flow (`eo_at_...`). It lasts one hour;

        refresh it with the refresh token. See
        [Authentication](/authentication).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.