{
    "openapi": "3.0.3",
    "info": {
        "title": "Wholesale API reference",
        "version": "4.0.15.1",
        "description": "The base URL is the api/ directory under the storefront plugin URL. Select a resource and format, then pass the operation in op. Check the response for API errors.\n\n## Connect to the store\n\n1. In the Wholesale API section of Shop-Script, select the partner’s contact, enable access and save. The plugin creates a key on the first save. The partner can view their active key in their storefront account.\n2. If the store checks IP addresses, send `GET json/info/?shopscript=1&op=ip` from the integration server, relative to the API base URL. This request needs no key. Add the returned address to the contact’s allowed IP list.\n3. Test access with `GET json/product/?op=count&key=YOUR_API_KEY`, substituting the contact’s key. A successful response gives the product count in `product.productsCount`.\n\n## Prices, stock and catalog\n\n- To refresh SKU stock and the prices available to the partner, request `product` with `op=stock`. For descriptions, images and exportable features, use `op=content`. In XML and JSON, page through these lists using `offset` and `limit`. For one product, pass `op=item` and its `id`.\n- For a stock spreadsheet, use semicolon-delimited CSV. For a full content feed, select YML. Categories are available in JSON and XML. To list product types, use XML with `shopscript=1`.\n- The administrator selects the wholesale price source and export rules in the plugin settings. If a product is missing, check its visibility, category and exclusion flag on the product card. If its stock is zero, check how the store exports excluded products.\n\n## Troubleshoot a connection\n\nIf access fails, check that the contact has API access, the key is current and the integration server’s IP is allowed. Use the contact’s request history to verify the time, format and domain. After a key is reissued, update the integration. The resource sections below list parameters and sample responses.\n"
    },
    "servers": [
        {
            "url": "https://shopntoys.wa.mmh.4www.space/apiopt/api"
        }
    ],
    "tags": [
        {
            "name": "product",
            "x-displayName": "Products"
        },
        {
            "name": "category",
            "x-displayName": "Categories"
        },
        {
            "name": "type",
            "x-displayName": "Product types"
        },
        {
            "name": "image",
            "x-displayName": "Images"
        },
        {
            "name": "info",
            "x-displayName": "Connection information"
        }
    ],
    "paths": {
        "/json/product/": {
            "get": {
                "tags": [
                    "product"
                ],
                "operationId": "productJson",
                "summary": "Products · JSON",
                "description": "- `count` — Number of records.\n\n- `stock` — SKU stock levels and prices available to this customer.\n\n- `content` — Descriptions, images and exportable product features.\n\n- `item` — One record identified by id.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": true,
                        "description": "- `count` — Number of records.\n- `stock` — SKU stock levels and prices available to this customer.\n- `content` — Descriptions, images and exportable product features.\n- `item` — One record identified by id.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "count",
                                "stock",
                                "content",
                                "item"
                            ]
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "required": false,
                        "description": "Product ID for op=item.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "required": false,
                        "description": "Offset for stock and content lists.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Page size. Limits are configured by the store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "title": "count",
                                            "type": "object",
                                            "required": [
                                                "product"
                                            ],
                                            "properties": {
                                                "product": {
                                                    "type": "object"
                                                }
                                            }
                                        },
                                        {
                                            "title": "content",
                                            "type": "object",
                                            "required": [
                                                "version",
                                                "offset",
                                                "limit",
                                                "prices",
                                                "content"
                                            ],
                                            "properties": {
                                                "version": {
                                                    "type": "string"
                                                },
                                                "offset": {
                                                    "type": "integer"
                                                },
                                                "limit": {
                                                    "type": "integer"
                                                },
                                                "prices": {
                                                    "type": "object"
                                                },
                                                "content": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            }
                                        },
                                        {
                                            "title": "stock",
                                            "type": "object",
                                            "required": [
                                                "version",
                                                "offset",
                                                "limit",
                                                "prices",
                                                "stock"
                                            ],
                                            "properties": {
                                                "version": {
                                                    "type": "string"
                                                },
                                                "offset": {
                                                    "type": "integer"
                                                },
                                                "limit": {
                                                    "type": "integer"
                                                },
                                                "prices": {
                                                    "type": "object"
                                                },
                                                "stock": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            }
                                        },
                                        {
                                            "title": "item",
                                            "type": "object",
                                            "required": [
                                                "content",
                                                "stock"
                                            ],
                                            "properties": {
                                                "content": {
                                                    "type": "object"
                                                },
                                                "stock": {
                                                    "type": "object"
                                                }
                                            }
                                        }
                                    ]
                                },
                                "examples": {
                                    "count": {
                                        "value": {
                                            "product": {
                                                "version": "2.1",
                                                "productsCount": 128
                                            }
                                        }
                                    },
                                    "content": {
                                        "value": {
                                            "version": "2.1",
                                            "offset": 0,
                                            "limit": 20,
                                            "prices": {
                                                "version": "2.1",
                                                "0": {
                                                    "id": "0",
                                                    "name": "Retail"
                                                }
                                            },
                                            "content": []
                                        }
                                    },
                                    "stock": {
                                        "value": {
                                            "version": "2.1",
                                            "offset": 0,
                                            "limit": 20,
                                            "prices": {
                                                "version": "2.1",
                                                "0": {
                                                    "id": "0",
                                                    "name": "Retail"
                                                }
                                            },
                                            "stock": []
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/json/product/?op=count&key=YOUR_API_KEY"
                    }
                ]
            }
        },
        "/xml/product/": {
            "get": {
                "tags": [
                    "product"
                ],
                "operationId": "productXml",
                "summary": "Products · XML",
                "description": "- `count` — Number of records.\n\n- `stock` — SKU stock levels and prices available to this customer.\n\n- `content` — Descriptions, images and exportable product features.\n\n- `item` — One record identified by id.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": true,
                        "description": "- `count` — Number of records.\n- `stock` — SKU stock levels and prices available to this customer.\n- `content` — Descriptions, images and exportable product features.\n- `item` — One record identified by id.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "count",
                                "stock",
                                "content",
                                "item"
                            ]
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "required": false,
                        "description": "Product ID for op=item.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "required": false,
                        "description": "Offset for stock and content lists.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Page size. Limits are configured by the store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "text/xml": {
                                "schema": {
                                    "type": "string"
                                },
                                "example": "<response><version>2.0</version><productsCount>128</productsCount></response>"
                            }
                        }
                    }
                },
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/xml/product/?op=count&key=YOUR_API_KEY"
                    }
                ]
            }
        },
        "/csv/product/": {
            "get": {
                "tags": [
                    "product"
                ],
                "operationId": "productCsv",
                "summary": "Products · CSV",
                "description": "- `stock` — SKU stock levels and prices available to this customer.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": true,
                        "description": "- `stock` — SKU stock levels and prices available to this customer.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "stock"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "text/plain": {
                                "schema": {
                                    "type": "string"
                                },
                                "example": "id;sku_id;category_id;category_name;name;sku;brand;description;imageName;imageUrl;count;currency;Store price;Wholesale price\n1;2;1;Catalog;Example;A1;;;;;12;RUB;150;90"
                            }
                        }
                    }
                },
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/csv/product/?op=stock&key=YOUR_API_KEY"
                    }
                ]
            }
        },
        "/yml/product/": {
            "get": {
                "tags": [
                    "product"
                ],
                "operationId": "productYml",
                "summary": "Products · YML",
                "description": "- `content` — Descriptions, images and exportable product features.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": true,
                        "description": "- `content` — Descriptions, images and exportable product features.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "content"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "text/xml": {
                                "schema": {
                                    "type": "string"
                                },
                                "example": "<yml_catalog date=\"2026-01-01 12:00\"><shop><categories/><offers/></shop></yml_catalog>"
                            }
                        }
                    }
                },
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/yml/product/?op=content&key=YOUR_API_KEY"
                    }
                ]
            }
        },
        "/json/category/": {
            "get": {
                "tags": [
                    "category"
                ],
                "operationId": "categoryJson",
                "summary": "Categories · JSON",
                "description": "- `list` — List of records.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": false,
                        "description": "- `list` — List of records.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "list"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "title": "list",
                                    "type": "object",
                                    "required": [
                                        "version",
                                        "categories"
                                    ],
                                    "properties": {
                                        "version": {
                                            "type": "string"
                                        },
                                        "categories": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    }
                                },
                                "examples": {
                                    "list": {
                                        "value": {
                                            "version": "2.1",
                                            "categories": [
                                                {
                                                    "id": "1",
                                                    "name": "Catalog"
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/json/category/?op=list&key=YOUR_API_KEY"
                    }
                ]
            }
        },
        "/xml/category/": {
            "get": {
                "tags": [
                    "category"
                ],
                "operationId": "categoryXml",
                "summary": "Categories · XML",
                "description": "- `list` — List of records.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": false,
                        "description": "- `list` — List of records.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "list"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "text/xml": {
                                "schema": {
                                    "type": "string"
                                },
                                "example": "<response><version>2.0</version><categories><category id=\"1\">Catalog</category></categories></response>"
                            }
                        }
                    }
                },
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/xml/category/?op=list&key=YOUR_API_KEY"
                    }
                ]
            }
        },
        "/xml/type/": {
            "get": {
                "tags": [
                    "type"
                ],
                "operationId": "typeXml",
                "summary": "Product types · XML",
                "description": "- `list` — List of records.\n\n- `count` — Number of records.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": false,
                        "description": "- `list` — List of records.\n- `count` — Number of records.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "list",
                                "count"
                            ]
                        }
                    },
                    {
                        "name": "shopscript",
                        "in": "query",
                        "required": true,
                        "description": "Shop-Script mode.",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "text/xml": {
                                "schema": {
                                    "type": "string"
                                },
                                "example": "<response><typesCount>3</typesCount></response>"
                            }
                        }
                    }
                },
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/xml/type/?op=list&shopscript=1&key=YOUR_API_KEY"
                    }
                ]
            }
        },
        "/xml/image/": {
            "get": {
                "tags": [
                    "image"
                ],
                "operationId": "imageXml",
                "summary": "Images · XML",
                "description": "- `item` — One record identified by id.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": true,
                        "description": "- `item` — One record identified by id.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "item"
                            ]
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "required": true,
                        "description": "Image ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "image/*": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    }
                },
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/xml/image/?op=item&id=42&key=YOUR_API_KEY"
                    }
                ]
            }
        },
        "/json/image/": {
            "get": {
                "tags": [
                    "image"
                ],
                "operationId": "imageJson",
                "summary": "Images · JSON",
                "description": "- `item` — One record identified by id.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": true,
                        "description": "- `item` — One record identified by id.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "item"
                            ]
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "required": true,
                        "description": "Image ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "image/*": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    }
                },
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/json/image/?op=item&id=42&key=YOUR_API_KEY"
                    }
                ]
            }
        },
        "/csv/image/": {
            "get": {
                "tags": [
                    "image"
                ],
                "operationId": "imageCsv",
                "summary": "Images · CSV",
                "description": "- `item` — One record identified by id.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": true,
                        "description": "- `item` — One record identified by id.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "item"
                            ]
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "required": true,
                        "description": "Image ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "image/*": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    }
                },
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/csv/image/?op=item&id=42&key=YOUR_API_KEY"
                    }
                ]
            }
        },
        "/yml/image/": {
            "get": {
                "tags": [
                    "image"
                ],
                "operationId": "imageYml",
                "summary": "Images · YML",
                "description": "- `item` — One record identified by id.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": true,
                        "description": "- `item` — One record identified by id.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "item"
                            ]
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "required": true,
                        "description": "Image ID.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "image/*": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    }
                },
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/yml/image/?op=item&id=42&key=YOUR_API_KEY"
                    }
                ]
            }
        },
        "/json/info/": {
            "get": {
                "tags": [
                    "info"
                ],
                "operationId": "infoJson",
                "summary": "Connection information · JSON",
                "description": "- `ip` — Client IP as seen by the store. No key is required.\n\n- `legal` — Client IP and displayMessage field.\n\nOnly op=ip permits anonymous access.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": true,
                        "description": "- `ip` — Client IP as seen by the store. No key is required.\n- `legal` — Client IP and displayMessage field.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ip",
                                "legal"
                            ]
                        }
                    },
                    {
                        "name": "shopscript",
                        "in": "query",
                        "required": true,
                        "description": "Shop-Script mode.",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "title": "ip",
                                            "type": "object",
                                            "required": [
                                                "version",
                                                "ip"
                                            ],
                                            "properties": {
                                                "version": {
                                                    "type": "string"
                                                },
                                                "ip": {
                                                    "type": "string"
                                                }
                                            }
                                        },
                                        {
                                            "title": "legal",
                                            "type": "object",
                                            "required": [
                                                "version",
                                                "ip",
                                                "displayMessage"
                                            ],
                                            "properties": {
                                                "version": {
                                                    "type": "string"
                                                },
                                                "ip": {
                                                    "type": "string"
                                                },
                                                "displayMessage": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    ]
                                },
                                "examples": {
                                    "ip": {
                                        "value": {
                                            "version": "2.1",
                                            "ip": "192.0.2.10"
                                        }
                                    },
                                    "legal": {
                                        "value": {
                                            "version": "2.1",
                                            "ip": "192.0.2.10",
                                            "displayMessage": ""
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {},
                    {
                        "apiKey": []
                    }
                ],
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/json/info/?op=ip&shopscript=1"
                    }
                ]
            }
        },
        "/xml/info/": {
            "get": {
                "tags": [
                    "info"
                ],
                "operationId": "infoXml",
                "summary": "Connection information · XML",
                "description": "- `ip` — Client IP as seen by the store. No key is required.\n\n- `legal` — Client IP and displayMessage field.\n\n- `default` — Contact name. Omit the op parameter.\n\nOnly op=ip permits anonymous access.",
                "parameters": [
                    {
                        "name": "op",
                        "in": "query",
                        "required": false,
                        "description": "- `ip` — Client IP as seen by the store. No key is required.\n- `legal` — Client IP and displayMessage field.\n- `default` — Contact name. Omit the op parameter.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ip",
                                "legal",
                                "default"
                            ]
                        }
                    },
                    {
                        "name": "shopscript",
                        "in": "query",
                        "required": true,
                        "description": "Shop-Script mode.",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "API response",
                        "content": {
                            "text/xml": {
                                "schema": {
                                    "type": "string"
                                },
                                "example": "<response><version>2.0</version><ip>192.0.2.10</ip></response>"
                            }
                        }
                    }
                },
                "security": [
                    {},
                    {
                        "apiKey": []
                    }
                ],
                "x-codeSamples": [
                    {
                        "lang": "HTTP",
                        "source": "GET https://shopntoys.wa.mmh.4www.space/apiopt/api/xml/info/?op=ip&shopscript=1"
                    }
                ]
            }
        }
    },
    "components": {
        "securitySchemes": {
            "apiKey": {
                "type": "apiKey",
                "in": "query",
                "name": "key",
                "description": "Contact API key issued by the store administrator."
            }
        }
    },
    "security": [
        {
            "apiKey": []
        }
    ]
}