{
    "openapi": "3.1.0",
    "info": {
        "title": "M2E Cloud - Sales Channels API",
        "version": "4.3",
        "description": "The M2E Cloud Sales Channels API enables integration with various sales channels such as eBay, Amazon, Walmart, Kaufland, TikTok, Temu, Shein, OnBuy and more. It provides functionalities for product management, order processing, and channel-specific operations.",
        "termsOfService": "https://m2ecloud.com/terms-and-conditions.html",
        "contact": {
            "email": "support@m2ecloud.com",
            "name": "M2E Cloud Support"
        }
    },
    "paths": {
        "/user/accounts/": {
            "get": {
                "tags": ["User"],
                "summary": "Retrieve accounts associated with a user",
                "description": "Fetches a list of accounts linked to the specified user, identified by a unique token.",
                "operationId": "UserAccountsList",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "A list of accounts retrieved for the user.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Retry-After": {
                                "$ref": "#/components/headers/X-RateLimit-Retry-After"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserAccountsResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalError"
                    }
                }
            }
        },
        "/catalog/product/": {
            "delete": {
                "tags": ["Catalog"],
                "summary": "Deletes products in catalog",
                "description": "Allows batch delete of products in the catalog.",
                "operationId": "CatalogProductDelete",
                "requestBody": {
                    "description": "A list of products to delete.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CatalogProductsDeleteRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfully deleted products in catalog.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Retry-After": {
                                "$ref": "#/components/headers/X-RateLimit-Retry-After"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CatalogProductsDeleteResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalError"
                    }
                }
            },
            "patch": {
                "tags": ["Catalog"],
                "summary": "Update products in catalog",
                "description": "Allows batch updates of products in the catalog, including currency, images and attributes information.",
                "operationId": "catalogProductsUpdate",
                "requestBody": {
                    "description": "A list of products to update.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CatalogProductsUpdateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfully updated products in catalog.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Retry-After": {
                                "$ref": "#/components/headers/X-RateLimit-Retry-After"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CatalogProductsUpdateResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalError"
                    }
                }
            },
            "get": {
                "tags": ["Catalog"],
                "summary": "Retrieve a catalog product by SKU",
                "description": "Fetches details of a product in the catalog.",
                "operationId": "CatalogProductGet",
                "parameters": [
                    {
                        "name": "sku",
                        "description": "The Stock Keeping Unit (SKU) of the product.",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "WBH-12345"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully deleted products in catalog.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Retry-After": {
                                "$ref": "#/components/headers/X-RateLimit-Retry-After"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CatalogProduct"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalError"
                    }
                }
            },
            "post": {
                "tags": ["Catalog"],
                "summary": "Creates products in catalog",
                "description": "Allows batch create of products in the catalog.",
                "operationId": "CatalogProductCreate",
                "requestBody": {
                    "description": "A list of products to create.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CatalogProductsCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfully created products in catalog.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Retry-After": {
                                "$ref": "#/components/headers/X-RateLimit-Retry-After"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CatalogProductsCreateResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalError"
                    }
                }
            }
        },
        "/catalog/product/find/": {
            "post": {
                "tags": ["Catalog"],
                "summary": "Retrieve products by criteria",
                "description": "Finds products based on specified criteria.",
                "operationId": "CatalogProductsFind",
                "requestBody": {
                    "description": "Criteria for filtering and sorting products.",
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CatalogProductsFindRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Products retrieved successfully.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Retry-After": {
                                "$ref": "#/components/headers/X-RateLimit-Retry-After"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CatalogProductsFindResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalError"
                    }
                }
            }
        },
        "/catalog/product/variant/": {
            "patch": {
                "tags": ["Catalog"],
                "summary": "Update variants in catalog",
                "description": "Allows batch updates of variants in the catalog.",
                "operationId": "catalogProductsVariantsUpdate",
                "requestBody": {
                    "description": "A list of variants to update.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CatalogProductsVariantsUpdateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfully updated variants in catalog.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Retry-After": {
                                "$ref": "#/components/headers/X-RateLimit-Retry-After"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CatalogProductsVariantsUpdateResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalError"
                    }
                }
            }
        },
        "/order/find/": {
            "post": {
                "tags": ["Orders"],
                "summary": "Retrieve orders by criteria",
                "description": "Finds orders based on specified criteria, such as channel, account token, and various filters like sale date, status, and buyer details.",
                "operationId": "OrdersFind",
                "parameters": [
                    {
                        "name": "channel",
                        "description": "The name of the sales channel (e.g., eBay, Amazon).",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": ["ebay", "amazon", "walmart", "kaufland", "tiktok", "temu", "shein", "onbuy", "otto", "mirakl"]
                        }
                    },
                    {
                        "name": "account_token",
                        "description": "A unique token identifying the account on the specified sales channel.",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Criteria for filtering and sorting orders.",
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/OrdersFindRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Orders retrieved successfully.",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Retry-After": {
                                "$ref": "#/components/headers/X-RateLimit-Retry-After"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OrdersFindResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalError"
                    }
                }
            }
        },
        "/order/invoice/": {
            "post": {
                "tags": ["Orders"],
                "summary": "Upload invoice for an order",
                "description": "Processes and uploads invoice data for a specific order using a base64-encoded PDF.",
                "operationId": "UploadOrderInvoice",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UploadInvoiceRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Invoice successfully processed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Retry-After": {
                                "$ref": "#/components/headers/X-RateLimit-Retry-After"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UploadInvoiceResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalError"
                    }
                }
            }
        },
        "/order/shipment/": {
            "put": {
                "tags": ["Orders"],
                "summary": "Update shipment for an order",
                "description": "Updates shipment tracking information for a specific order.",
                "operationId": "UpdateOrderShipment",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateShipmentRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Shipment successfully processed",
                        "headers": {
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "X-RateLimit-Retry-After": {
                                "$ref": "#/components/headers/X-RateLimit-Retry-After"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpdateShipmentResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "500": {
                        "$ref": "#/components/responses/InternalError"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "JWT": {
                "type": "apiKey",
                "description": "JWT token for authentication, passed as `access-token` in header.",
                "name": "access-token",
                "in": "header"
            }
        },
        "schemas": {
            "UserAccountsResponse": {
                "type": "array",
                "description": "An array of user accounts.",
                "items": {
                    "$ref": "#/components/schemas/Account"
                }
            },
            "Account": {
                "type": "object",
                "description": "Represents an account object linked to a user, containing channel information, credentials validity, and other identifying details.",
                "properties": {
                    "token": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Unique token identifying the account.",
                        "example": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
                    },
                    "channel": {
                        "type": "string",
                        "enum": [
                            "ebay",
                            "amazon",
                            "walmart",
                            "kaufland",
                            "tiktok",
                            "temu",
                            "shein",
                            "onbuy",
                            "otto",
                            "mirakl",
                            "shopify",
                            "bigcommerce",
                            "woocommerce",
                            "ecwid",
                            "salesforce",
                            "square",
                            "lightspeed",
                            "shopware",
                            "prestashop",
                            "magento1",
                            "magento2"
                        ],
                        "description": "Sales channel associated with this account (e.g., 'ebay', 'amazon').",
                        "example": "ebay"
                    },
                    "title": {
                        "type": "string",
                        "description": "User-defined title for the account, often used for easy identification.",
                        "example": "My eBay Account"
                    },
                    "identifier": {
                        "type": "string",
                        "description": "Unique identifier associated with the account on the specified sales channel.",
                        "example": "ebay-usr-12345"
                    },
                    "is_valid": {
                        "type": "boolean",
                        "description": "Indicates whether the account's credentials are valid and active.",
                        "example": true
                    },
                    "create_date": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The date and time when the account was created.",
                        "example": "2020-12-30T15:30:50Z"
                    }
                },
                "required": ["token", "channel", "title", "identifier", "is_valid", "create_date"]
            },

            "CatalogProductsDeleteRequest": {
                "type": "array",
                "description": "An array of products to be deleted in the catalog.",
                "minItems": 1,
                "maxItems": 500,
                "items": {
                    "$ref": "#/components/schemas/CatalogProductDelete"
                }
            },
            "CatalogProductsDeleteResponse": {
                "type": "object",
                "required": ["deleted"],
                "properties": {
                    "deleted": {
                        "type": "integer",
                        "description": "The count of products successfully deleted.",
                        "example": 10
                    }
                }
            },
            "CatalogProductDelete": {
                "type": "object",
                "required": ["sku"],
                "properties": {
                    "sku": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Stock Keeping Unit (SKU).",
                        "example": "test-product-SKU"
                    }
                }
            },

            "CatalogProductsCreateRequest": {
                "type": "array",
                "description": "An array of products to be created in the catalog.",
                "minItems": 1,
                "maxItems": 500,
                "items": {
                    "$ref": "#/components/schemas/CatalogProductCreate"
                }
            },
            "CatalogProductsCreateResponse": {
                "type": "object",
                "required": ["created"],
                "properties": {
                    "deleted": {
                        "type": "integer",
                        "description": "The count of products successfully created.",
                        "example": 10
                    }
                }
            },
            "CatalogProductCreate": {
                "type": "object",
                "required": [
                    "sku",
                    "status",
                    "is_simple",
                    "currency",
                    "title",
                    "variants"
                ],
                "properties": {
                    "sku": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Stock Keeping Unit (SKU).",
                        "example": "test-product-SKU"
                    },
                    "status": {
                        "type": "integer",
                        "enum": [1, 2, 3, 4, 5, 7, 8, 9, 10, 11],
                        "description": "Product statuses (e.g., 1 = Active, 2 = Inactive, 3 = Disabled, 4 = Preorder, 5 = Available, 7 = Draft, 8 = Pending, 9 = Private, 10 = Publish, 11 = Archived).",
                        "example": 1
                    },
                    "is_simple": {
                        "type": "boolean",
                        "description": "Indicates whether the product is a simple product (true) or has variants (false).",
                        "example": false
                    },
                    "currency": {
                        "type": "string",
                        "description": "The currency code for the product's pricing, in ISO 4217 format (e.g., USD, EUR).",
                        "minLength": 3,
                        "maxLength": 3,
                        "pattern": "^[A-Z]{3}$",
                        "example": "USD"
                    },
                    "title": {
                        "type": "string",
                        "description": "The title or name of the product.",
                        "example": "Wireless Bluetooth Headphones"
                    },
                    "description": {
                        "type": "string",
                        "description": "A detailed description of the product.",
                        "example": "High-quality wireless Bluetooth headphones with noise-cancelling feature."
                    },
                    "short_description": {
                        "type": "string",
                        "description": "A short description of the product.",
                        "example": "High-quality wireless Bluetooth headphones with noise-cancelling feature."
                    },
                    "images": {
                        "type": "array",
                        "description": "A list of image URLs representing the product.",
                        "items": {
                            "type": "string",
                            "format": "url",
                            "description": "URL of the product image.",
                            "example": "https://example.com/product-image.jpg"
                        },
                        "uniqueItems": true
                    },
                    "attributes": {
                        "$ref": "#/components/schemas/CatalogProductAttributes"
                    },
                    "variants": {
                        "type": "array",
                        "description": "A list of product variants.",
                        "minItems": 1,
                        "items": {
                            "type": "object",
                            "required": ["sku", "barcode", "price", "quantity"],
                            "properties": {
                                "sku": {
                                    "type": "string",
                                    "minLength": 1,
                                    "description": "Stock Keeping Unit (SKU).",
                                    "example": "WBH-12345"
                                },
                                "barcode": {
                                    "type": ["null", "string"],
                                    "description": "The unique barcode for the variant, such as UPC or EAN.",
                                    "example": "012345678905"
                                },
                                "price": {
                                    "type": "number",
                                    "minimum": 0,
                                    "maximum": 1000000.0,
                                    "description": "The price of the variant in the specified currency.",
                                    "example": 79.99
                                },
                                "quantity": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 1000000,
                                    "description": "The available stock quantity for the variant.",
                                    "example": 100
                                },
                                "images": {
                                    "type": "array",
                                    "description": "A list of image URLs representing the product variant.",
                                    "items": {
                                        "type": "string",
                                        "format": "url",
                                        "example": "https://example.com/variant-image1.jpg"
                                    }
                                },
                                "options": {
                                    "$ref": "#/components/schemas/CatalogProductOptions"
                                },
                                "attributes": {
                                    "$ref": "#/components/schemas/CatalogProductAttributes"
                                },
                                "weight": {
                                    "type": ["null", "number"],
                                    "minimum": 0,
                                    "description": "The weight of the product variant.",
                                    "example": 0.5
                                },
                                "weight_unit": {
                                    "type": ["null", "string"],
                                    "enum": ["GRAMS", "KILOGRAMS", "OUNCES", "POUNDS", "TONNES"],
                                    "description": "The unit of measurement for the weight.",
                                    "example": "GRAMS"
                                },
                                "height": {
                                    "type": ["null", "number"],
                                    "minimum": 0,
                                    "description": "The height of the product variant.",
                                    "example": 10.0
                                },
                                "depth": {
                                    "type": ["null", "number"],
                                    "minimum": 0,
                                    "description": "The depth of the product variant.",
                                    "example": 5.0
                                },
                                "width": {
                                    "type": ["null", "number"],
                                    "minimum": 0,
                                    "description": "The width of the product variant.",
                                    "example": 8.0
                                },
                                "dimension_unit": {
                                    "type": ["null", "string"],
                                    "enum": ["MILLILITERS", "CENTILITERS", "DECIMETERS", "METERS", "INCHES", "YARD", "FEET"],
                                    "description": "The unit of measurement for dimensions (height, width, depth).",
                                    "example": "CENTILITERS"
                                }
                            }
                        }
                    }
                }
            },

            "CatalogProductsUpdateRequest": {
                "type": "object",
                "required": ["products"],
                "properties": {
                    "products": {
                        "type": "array",
                        "description": "An array of products to be updated in the catalog.",
                        "minItems": 1,
                        "maxItems": 500,
                        "items": {
                            "$ref": "#/components/schemas/CatalogProductsUpdate"
                        }
                    }
                }
            },
            "CatalogProductsUpdateResponse": {
                "type": "object",
                "required": ["updated"],
                "properties": {
                    "updated": {
                        "type": "integer",
                        "description": "The count of products successfully updated.",
                        "example": 10
                    }
                }
            },
            "CatalogProductsUpdate": {
                "type": "object",
                "required": ["sku"],
                "properties": {
                    "sku": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Stock Keeping Unit (SKU).",
                        "example": "test-product-SKU"
                    },
                    "currency": {
                        "type": "string",
                        "description": "The currency code for the product's pricing, in ISO 4217 format (e.g., USD, EUR).",
                        "minLength": 3,
                        "maxLength": 3,
                        "pattern": "^[A-Z]{3}$",
                        "example": "USD"
                    },
                    "title": {
                        "type": "string",
                        "description": "The title or name of the product.",
                        "example": "Wireless Bluetooth Headphones"
                    },
                    "description": {
                        "type": "string",
                        "description": "A detailed description of the product.",
                        "example": "High-quality wireless Bluetooth headphones with noise-cancelling feature."
                    },
                    "short_description": {
                        "type": "string",
                        "description": "A short description of the product.",
                        "example": "High-quality wireless Bluetooth headphones with noise-cancelling feature."
                    },
                    "images": {
                        "type": "array",
                        "description": "A list of image URLs representing the product.",
                        "items": {
                            "type": "string",
                            "format": "url",
                            "description": "URL of the product image.",
                            "example": "https://example.com/product-image.jpg"
                        },
                        "uniqueItems": true
                    },
                    "attributes": {
                        "$ref": "#/components/schemas/CatalogProductAttributes"
                    }
                }
            },

            "CatalogProductsVariantsUpdateRequest": {
                "type": "object",
                "required": ["variants"],
                "properties": {
                    "variants": {
                        "type": "array",
                        "description": "An array of variants to be updated in the catalog.",
                        "minItems": 1,
                        "maxItems": 500,
                        "items": {
                            "$ref": "#/components/schemas/CatalogProductsVariantsUpdate"
                        }
                    }
                }
            },
            "CatalogProductsVariantsUpdateResponse": {
                "type": "object",
                "required": ["updated"],
                "properties": {
                    "updated": {
                        "type": "integer",
                        "description": "The count of variants successfully updated.",
                        "example": 10
                    }
                }
            },
            "CatalogProductsVariantsUpdate": {
                "type": "object",
                "required": ["sku"],
                "properties": {
                    "sku": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Stock Keeping Unit (SKU).",
                        "example": "test-product-SKU"
                    },
                    "barcode": {
                        "type": "string",
                        "description": "The unique barcode for the variant, such as UPC or EAN.",
                        "example": "012345678905"
                    },
                    "price": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1000000.00,
                        "description": "The price of the product in the specified currency.",
                        "example": 99.99
                    },
                    "quantity": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000,
                        "description": "The available stock quantity of the product.",
                        "example": 17
                    },
                    "images": {
                        "type": "array",
                        "description": "List of image URLs associated with the product variant.",
                        "items": {
                            "type": "string",
                            "format": "url",
                            "example": "https://example.com/image.jpg"
                        }
                    },
                    "options": {
                        "$ref": "#/components/schemas/CatalogProductOptions"
                    },
                    "attributes": {
                        "$ref": "#/components/schemas/CatalogProductAttributes"
                    }
                }
            },

            "CatalogProductsFindRequest": {
                "type": "object",
                "properties": {
                    "sort": {
                        "type": "object",
                        "description": "Sorting options for the search results.",
                        "properties": {
                            "price": {
                                "type": "string",
                                "enum": ["asc", "desc"],
                                "description": "Order by price."
                            },
                            "quantity":  {
                                "type": "string",
                                "enum": ["asc", "desc"],
                                "description": "Order by quantity."
                            },
                            "update_date": {
                                "type": "string",
                                "enum": ["asc", "desc"],
                                "description": "Order by update date."
                            }
                        }
                    },
                    "filters": {
                        "type": "object",
                        "description": "Filtering options.",
                        "properties": {
                            "is_simple": {
                                "type": "array",
                                "description": "Filter by is_simple: yes|no",
                                "maxItems": 1,
                                "minItems": 1,
                                "items": {"type": "boolean", "example": true}
                            },
                            "price": {
                                "type": "object",
                                "description": "Filter by price range.",
                                "properties": {
                                    "from": {"type": "number", "example":  10.00},
                                    "to": {"type": "number", "example":  15.00}
                                }
                            },
                            "quantity": {
                                "type": "object",
                                "description": "Filter by quantity range.",
                                "properties": {
                                    "from": {"type": "number", "example":  10},
                                    "to": {"type": "number", "example":  11}
                                }
                            },
                            "status": {
                                "type": "array",
                                "description": "Filter by product status.",
                                "items": {
                                    "type": "integer",
                                    "enum": [1, 2, 3, 4, 5, 7, 8, 9, 10, 11],
                                    "description": "Product statuses (e.g., 1 = Active, 2 = Inactive, 3 = Disabled, 4 = Preorder, 5 = Available, 7 = Draft, 8 = Pending, 9 = Private, 10 = Publish, 11 = Archived)."
                                }
                            },
                            "sku": {
                                "type": "array",
                                "description": "Filter by product SKUs.",
                                "items": {
                                    "type": "string",
                                    "description": "Stock Keeping Unit (SKU) of the item."
                                }
                            }
                        }
                    },
                    "_result": {
                        "type": "object",
                        "required": ["limit"],
                        "properties": {
                            "limit": {
                                "type": "object",
                                "required": ["offset", "count"],
                                "properties": {
                                    "offset": {"type": "integer", "minimum": 0, "example": 25},
                                    "count": {"type": "integer", "minimum": 1, "maximum": 100, "example": 10}
                                }
                            }
                        }
                    }
                },
                "example": {
                    "sort": {"quantity": "desc"},
                    "filters": {
                        "status": [1],
                        "quantity": {"from": 10, "to": 12}
                    },
                    "_result": {
                        "limit": {"count": 10, "offset": 0}
                    }
                }
            },
            "CatalogProductsFindResponse": {
                "type": "object",
                "required": ["list", "total"],
                "properties": {
                    "list": {
                        "type": "array",
                        "description": "A list of orders matching the query.",
                        "items": { "$ref": "#/components/schemas/CatalogProduct" }
                    },
                    "total": {
                        "type": "integer",
                        "description": "The total number of products matching the query.",
                        "example": 1
                    }
                }
            },
            "CatalogProduct": {
                "type": "object",
                "required": [
                    "token",
                    "external_id",
                    "sku",
                    "quantity",
                    "is_simple",
                    "status",
                    "title",
                    "images",
                    "attributes",
                    "update_date",
                    "variants"
                ],
                "properties": {
                    "token": {
                        "type": "string",
                        "format": "uuid",
                        "description": "A unique token that identifies the product.",
                        "example": "1529970e-7508-489f-8a79-281225ee330e"
                    },
                    "external_id": {
                        "type": ["null", "string"],
                        "description": "An external identifier for the product, typically used for mapping with external systems.",
                        "example": "0011-0022-11"
                    },
                    "sku": {
                        "type": ["null", "string"],
                        "description": "Stock Keeping Unit (SKU).",
                        "example": "WBH-12345"
                    },
                    "quantity": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000,
                        "description": "The available stock quantity for the variant.",
                        "example": 100
                    },
                    "is_simple": {
                        "type": "boolean",
                        "description": "Indicates whether the product is a simple product (true) or has variants (false).",
                        "example": false
                    },
                    "status": {
                        "type": "string",
                        "description": "The current status of the product.",
                        "enum": ["Active", "Inactive", "Disabled", "Preorder", "Available", "Draft", "Pending", "Private", "Publish", "Archive"],
                        "example": "Active"
                    },
                    "title": {
                        "type": "string",
                        "description": "The name or title of the product.",
                        "example": "Wireless Bluetooth Headphones"
                    },
                    "description": {
                        "type": "string",
                        "description": "A detailed description of the product.",
                        "example": "High-quality wireless Bluetooth headphones with noise-cancelling feature."
                    },
                    "short_description": {
                        "type": "string",
                        "description": "A short description of the product.",
                        "example": "High-quality wireless Bluetooth headphones with noise-cancelling feature."
                    },
                    "images": {
                        "type": "array",
                        "description": "A list of image URLs representing the product.",
                        "items": {
                            "type": "string",
                            "format": "url",
                            "example": "https://example.com/image1.jpg"
                        }
                    },
                    "attributes": {
                        "$ref": "#/components/schemas/CatalogProductAttributes"
                    },
                    "update_date": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The date and time when the product was last updated, in ISO 8601 format.",
                        "example": "2020-12-30T15:30:50Z"
                    },
                    "variants": {
                        "type": "array",
                        "description": "A list of product variants.",
                        "items": {
                            "$ref": "#/components/schemas/CatalogProductVariant"
                        }
                    }
                }
            },
            "CatalogProductVariant": {
                "type": "object",
                "required": [
                    "token",
                    "sku",
                    "barcode",
                    "price",
                    "quantity",
                    "images",
                    "options",
                    "attributes",
                    "weight",
                    "weight_unit",
                    "height",
                    "depth",
                    "width",
                    "dimension_unit",
                    "update_date"
                ],
                "properties": {
                    "token": {
                        "type": "string",
                        "format": "uuid",
                        "description": "A unique token identifying the product variant.",
                        "example": "1529970e-7508-489f-8a79-281225ee330e"
                    },
                    "sku": {
                        "type": ["null", "string"],
                        "description": "Stock Keeping Unit (SKU).",
                        "example": "WBH-12345"
                    },
                    "barcode": {
                        "type": ["null", "string"],
                        "description": "The unique barcode for the variant, such as UPC or EAN.",
                        "example": "012345678905"
                    },
                    "price": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1000000.00,
                        "description": "The price of the variant in the specified currency.",
                        "example": 79.99
                    },
                    "quantity": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000,
                        "description": "The available stock quantity for the variant.",
                        "example": 100
                    },
                    "images": {
                        "type": "array",
                        "description": "A list of image URLs representing the product variant.",
                        "items": {
                            "type": "string",
                            "format": "url",
                            "example": "https://example.com/variant-image1.jpg"
                        }
                    },
                    "options": {
                        "$ref": "#/components/schemas/CatalogProductOptions"
                    },
                    "attributes": {
                        "$ref": "#/components/schemas/CatalogProductAttributes"
                    },
                    "weight": {
                        "type": ["null", "number"],
                        "minimum": 0,
                        "description": "The weight of the product variant.",
                        "example": 0.5
                    },
                    "weight_unit": {
                        "type": ["null", "string"],
                        "enum": ["GRAMS", "KILOGRAMS", "OUNCES", "POUNDS", "TONNES"],
                        "description": "The unit of measurement for the weight.",
                        "example": "GRAMS"
                    },
                    "height": {
                        "type": ["null", "number"],
                        "minimum": 0,
                        "description": "The height of the product variant.",
                        "example": 10.0
                    },
                    "depth": {
                        "type": ["null", "number"],
                        "minimum": 0,
                        "description": "The depth of the product variant.",
                        "example": 5.0
                    },
                    "width": {
                        "type": ["null", "number"],
                        "minimum": 0,
                        "description": "The width of the product variant.",
                        "example": 8.0
                    },
                    "dimension_unit": {
                        "type": ["null", "string"],
                        "enum": ["MILLILITERS", "CENTILITERS", "DECIMETERS", "METERS", "INCHES", "YARD", "FEET"],
                        "description": "The unit of measurement for dimensions (height, width, depth).",
                        "example": "CENTILITERS"
                    },
                    "update_date": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The date and time when the variant was last updated, in ISO 8601 format.",
                        "example": "2020-12-30T15:30:50Z"
                    }
                }
            },
            "CatalogProductOptions": {
                "type": "array",
                "description": "A list of options specifying attributes of the variant (e.g., size, color).",
                "items": {
                    "type": "object",
                    "required": ["name", "value"],
                    "properties": {
                        "name": {
                            "type": "string",
                            "description": "The name of the option.",
                            "example": "Size"
                        },
                        "value": {
                            "type": "string",
                            "description": "The value of the option.",
                            "example": "Medium"
                        }
                    }
                }
            },
            "CatalogProductAttributes": {
                "type": "array",
                "description": "A list of key-value pairs representing attributes.",
                "items": {
                    "type": "object",
                    "required": ["name", "value"],
                    "properties": {
                        "name": {
                            "type": "string",
                            "description": "The name of the attribute (e.g., material, size, color).",
                            "example": "material"
                        },
                        "value": {
                            "type": "string",
                            "description": "The value of the attribute corresponding to its name (e.g., cotton, red, large).",
                            "example": "cotton"
                        }
                    }
                }
            },

            "OrdersFindRequest": {
                "type": "object",
                "properties": {
                    "sort": {
                        "type": "object",
                        "description": "Sorting options for the search results.",
                        "additionalProperties": false,
                        "properties": {
                            "sale_date": {
                                "type": "string",
                                "enum": ["asc", "desc"],
                                "description": "Order by sale date."
                            },
                            "ship_by_date":  {
                                "type": "string",
                                "enum": ["asc", "desc"],
                                "description": "Order by ship by date."
                            },
                            "status": {
                                "type": "string",
                                "enum": ["asc", "desc"],
                                "description": "Order by order status."
                            },
                            "order_total": {
                                "type": "string",
                                "enum": ["asc", "desc"],
                                "description": "Order by order total."
                            }
                        }
                    },
                    "filters": {
                        "type": "object",
                        "description": "Filtering options.",
                        "additionalProperties": false,
                        "properties": {
                            "order_id" : {
                                "type": "array",
                                "description": "Filter by channel Order ID",
                                "maxItems": 1,
                                "minItems": 1,
                                "items": {"type": "string", "example": "113-00010001-0002002"}
                            },
                            "data_source_order": {
                                "type": "array",
                                "description": "Filter by created in store: yes|no",
                                "maxItems": 1,
                                "minItems": 1,
                                "items": {"type": "string", "example":  "true"}
                            },
                            "archived": {
                                "type": "array",
                                "description": "Filter by archived: yes|no",
                                "maxItems": 1,
                                "minItems": 1,
                                "items": {"type": "boolean", "example": true}
                            },
                            "buyer": {
                                "description": "Filter by Buyer firstName or lastName",
                                "type": "array",
                                "maxItems": 1,
                                "minItems": 1,
                                "items": {"type": "string", "example": "Nadine Beebis"}
                            },
                            "price": {
                                "type": "object",
                                "description": "Filter by total price range.",
                                "properties": {
                                    "from": {"type": "number", "example":  10.00},
                                    "to": {"type": "number", "example":  15.00}
                                }
                            },
                            "shipping_price": {
                                "type": "object",
                                "description": "Filter by shipping price range.",
                                "properties": {
                                    "from": {"type": "number", "example":  10.00},
                                    "to": {"type": "number", "example":  15.00}
                                }
                            },
                            "status": {
                                "type": "array",
                                "description": "Filter by order status.",
                                "items": {
                                    "type": "integer",
                                    "enum": [1, 2, 3, 4, 5, 9],
                                    "description": "Order statuses (e.g., 1 = Pending, 2 = Unshipped, 3 = Partially Shipped, 4: Completed, 5: Cancelled, 9: Refunded)."
                                }
                            },
                            "sale_date": {
                                "type": "object",
                                "description": "Filter orders by sale date range.",
                                "properties": {
                                    "from": { "type": "string", "format": "date-time", "example": "2020-12-01T15:30:50Z" },
                                    "to": { "type": "string", "format": "date-time", "example": "2020-12-30T15:30:50Z" }
                                }
                            },
                            "ship_by_date": {
                                "type": "object",
                                "description": "Filter orders by ship by date range.",
                                "properties": {
                                    "from": {"type": "string", "format": "date-time", "example": "2020-12-01T15:30:50Z"},
                                    "to": {"type": "string", "format": "date-time", "example": "2020-12-30T15:30:50Z"}
                                }
                            }
                        }
                    },
                    "search": {
                        "type": ["string", "null"],
                        "description": "Search by Title, SKU, Identifier, GTIN"
                    },
                    "_result": {
                        "type": "object",
                        "required": ["limit"],
                        "properties": {
                            "limit": {
                                "type": "object",
                                "required": ["offset", "count"],
                                "properties": {
                                    "offset": {"type": "integer", "minimum": 0, "example": 25},
                                    "count": {"type": "integer", "minimum": 1, "maximum": 100, "example": 10}
                                }
                            }
                        }
                    }
                },
                "example": {
                    "sort": {"sale_date": "desc"},
                    "filters": {
                        "status": [1],
                        "sale_date": {"from": "2020-12-01T15:30:50Z"}
                    },
                    "_result": {
                        "limit": {"count": 10, "offset": 0}
                    }
                }
            },
            "OrdersFindResponse": {
                "type": "object",
                "required": ["list", "total"],
                "properties": {
                    "list": {
                        "type": "array",
                        "description": "A list of orders matching the query.",
                        "items": { "$ref": "#/components/schemas/Order" }
                    },
                    "total": {
                        "type": "integer",
                        "description": "The total number of orders matching the query.",
                        "example": 1
                    }
                }
            },
            "Order": {
                "type": "object",
                "description": "Represents an order with details about the buyer, status, dates, shipping, total cost, and items purchased.",
                "required": [
                    "token",
                    "order_id",
                    "source_order_id",
                    "buyer_name",
                    "buyer_email",
                    "status",
                    "is_archived",
                    "sale_date",
                    "ship_date",
                    "ship_by_date",
                    "shipping_address",
                    "country_code",
                    "total",
                    "items"
                ],
                "properties": {
                    "token": {
                        "type": "string",
                        "format": "uuid",
                        "description": "A unique token associated with the order.",
                        "example": "1529970e-7508-489f-8a79-281225ee330e"
                    },
                    "order_id": {
                        "type": "string",
                        "description": "The order ID assigned by the sales channel.",
                        "example": "113-00010001-0002002"
                    },
                    "source_order_id": {
                        "type": "string",
                        "description": "The store-specific order ID, often used internally.",
                        "example": "0002002"
                    },
                    "buyer_name": {
                        "type": ["string", "null"],
                        "description": "Name of the buyer who placed the order.",
                        "example": "Nadine Beebis"
                    },
                    "buyer_email": {
                        "type": ["string", "null"],
                        "format": "email",
                        "description": "Email address of the buyer.",
                        "example": "nbeebis0@eventbrite.com"
                    },
                    "status": {
                        "type": "string",
                        "description": "Current status of the order.",
                        "enum": [
                            "pending",
                            "unshipped",
                            "partially_shipped",
                            "completed",
                            "cancelled",
                            "unshipped_partially_refunded",
                            "partially_shipped_partially_refunded",
                            "completed_partially_refunded",
                            "refunded"
                        ],
                        "example": "completed"
                    },
                    "is_archived": {
                        "type": "boolean",
                        "description": "Indicates whether the order is archived.",
                        "example": false
                    },
                    "sale_date": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The date and time when the order was placed.",
                        "example": "2020-12-30T15:30:50Z"
                    },
                    "ship_date": {
                        "type": ["string", "null"],
                        "format": "date-time",
                        "description": "The actual shipping date of the order, if available.",
                        "example": "2020-12-31T10:20:00Z"
                    },
                    "ship_by_date": {
                        "type": ["string", "null"],
                        "format": "date-time",
                        "description": "The date by which the order should be shipped.",
                        "example": "2020-12-30T15:30:50Z"
                    },
                    "shipping_address": {
                        "type": "object",
                        "description": "Shipping address details for the order.",
                        "required": [
                            "name",
                            "phone",
                            "street_first",
                            "street_second",
                            "city",
                            "state",
                            "postal_code",
                            "country_code"
                        ],
                        "properties": {
                            "name": {
                                "type": ["string", "null"],
                                "description": "Recipient's name for the shipping address.",
                                "example": "Nadine Beebis"
                            },
                            "phone": {
                                "type": ["string", "null"],
                                "description": "Contact phone number for the recipient.",
                                "example": "318-395-7232"
                            },
                            "street_first": {
                                "type": ["string", "null"],
                                "description": "Primary address line.",
                                "example": "7 Summerview Center"
                            },
                            "street_second": {
                                "type": ["string", "null"],
                                "description": "Secondary address line (e.g., apartment, suite, PO box).",
                                "example": "PO Box 29079"
                            },
                            "city": {
                                "type": ["string", "null"],
                                "description": "City for the shipping address.",
                                "example": "Sixi"
                            },
                            "state": {
                                "type": ["string", "null"],
                                "description": "State or province for the shipping address.",
                                "example": "NY"
                            },
                            "postal_code": {
                                "type": ["string", "null"],
                                "description": "Postal or ZIP code.",
                                "example": "976800"
                            },
                            "country_code": {
                                "type": ["string", "null"],
                                "description": "ISO 3166-1 alpha-2 country code.",
                                "example": "US"
                            }
                        }
                    },
                    "country_code": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2,
                        "description": "ISO 3166-1 alpha-2 country code representing the shipping country.",
                        "example": "US"
                    },
                    "total": {
                        "type": "object",
                        "description": "Total cost breakdown for the order.",
                        "required": [
                            "total",
                            "shipping",
                            "subtotal",
                            "tax",
                            "discount",
                            "currency"
                        ],
                        "properties": {
                            "total": {
                                "type": "number",
                                "description": "Total order cost, including all fees and discounts.",
                                "example": 44.55
                            },
                            "shipping": {
                                "type": "number",
                                "description": "Shipping cost for the order.",
                                "example": 5.55
                            },
                            "subtotal": {
                                "type": "number",
                                "description": "Subtotal cost of items before tax and discounts.",
                                "example": 40.00
                            },
                            "tax": {
                                "type": "number",
                                "description": "Total tax applied to the order.",
                                "example": 0.55
                            },
                            "discount": {
                                "type": "number",
                                "description": "Total discount applied to the order.",
                                "example": 1.00
                            },
                            "currency": {
                                "type": "string",
                                "description": "Currency code (ISO 4217 format) used in the order.",
                                "example": "USD"
                            }
                        }
                    },
                    "items": {
                        "type": "array",
                        "description": "List of items included in the order.",
                        "items": { "$ref": "#/components/schemas/OrderItem" }
                    }
                }
            },
            "OrderItem": {
                "type": "object",
                "description": "Represents an individual item within an order, including details such as SKU, quantity, and tracking information.",
                "required": [
                    "title",
                    "sku",
                    "barcode",
                    "item_id",
                    "item_img",
                    "quantity",
                    "price",
                    "tracking_service",
                    "tracking_numbers"
                ],
                "properties": {
                    "title": {
                        "type": "string",
                        "description": "The title or name of the item as it appears in the order.",
                        "example": "Wireless Bluetooth Headphones"
                    },
                    "sku": {
                        "type": "string",
                        "description": "Stock Keeping Unit (SKU) of the item.",
                        "example": "WBH-12345"
                    },
                    "barcode": {
                        "type": "string",
                        "description": "The barcode or UPC of the item.",
                        "example": "012345678905"
                    },
                    "item_id": {
                        "type": "string",
                        "description": "Unique identifier for the item.",
                        "example": "item-5678"
                    },
                    "item_img": {
                        "type": ["string", "null"],
                        "format": "url",
                        "description": "URL of the item image.",
                        "example": "https://example.com/product-image.jpg"
                    },
                    "quantity": {
                        "type": "integer",
                        "description": "The quantity of this item ordered.",
                        "minimum": 1,
                        "example": 2
                    },
                    "price": {
                        "type": "number",
                        "format": "float",
                        "description": "The unit price of the item.",
                        "example": 59.99
                    },
                    "tracking_service": {
                        "type": ["string", "null"],
                        "description": "The name of the tracking service.",
                        "example": "UPS Ground"
                    },
                    "tracking_numbers": {
                        "type": "array",
                        "description": "List of tracking numbers associated with this item.",
                        "items": {
                            "type": "string",
                            "example": "1Z9999999999999999"
                        }
                    }
                }
            },

            "UploadInvoiceRequest": {
                "type": "object",
                "required": [
                    "order_id",
                    "invoice_number",
                    "invoice_data"
                ],
                "properties": {
                    "order_id": {
                        "type": "string",
                        "maxLength": 50,
                        "description": "Unique identifier of the order within the store system.",
                        "example": "0002002"
                    },
                    "invoice_number": {
                        "type": "string",
                        "maxLength": 100,
                        "description": "Invoice number.",
                        "example": "113-00010001-0002002"
                    },
                    "total_amount": {
                        "type": ["number", "null"],
                        "format": "float",
                        "nullable": true,
                        "description": "Total order amount including VAT, in the store's currency.",
                        "example": 59.99
                    },
                    "total_vat_amount": {
                        "type": ["number", "null"],
                        "format": "float",
                        "nullable": true,
                        "description": "VAT portion of the total amount.",
                        "example": 9.99
                    },
                    "shipping_id": {
                        "type": ["string", "null"],
                        "maxLength": 100,
                        "nullable": true,
                        "description": "Identifier of the related shipping record, if available.",
                        "example": "113-00010001-0002002"
                    },
                    "transaction_id": {
                        "type": ["string", "null"],
                        "maxLength": 100,
                        "nullable": true,
                        "description": "Identifier of the payment transaction, if available.",
                        "example": "113-00010001-0002002"
                    },
                    "invoice_data": {
                        "type": "string",
                        "description": "Base64-encoded string of the PDF invoice file."
                    }
                }
            },
            "UploadInvoiceResponse": {
                "token": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Unique token identifying the invoice.",
                    "example": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
                }
            },

            "UpdateShipmentRequest": {
                "type": "object",
                "additionalProperties": false,
                "required": ["tracking_company", "tracking_number"],
                "properties": {
                    "token": {
                        "type": "string",
                        "format": "uuid",
                        "description": "A unique token associated with the order.",
                        "example": "1529970e-7508-489f-8a79-281225ee330e"
                    },
                    "source_order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 50,
                        "description": "Unique identifier of the order within the store system.",
                        "example": "0002002"
                    },
                    "channel_order_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 50,
                        "description": "The order ID assigned by the sales channel.",
                        "example": "113-00010001-0002002"
                    },
                    "tracking_company": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100,
                        "description": "Shipping carrier name (e.g., DHL, UPS, FedEx).",
                        "example": "DHL"
                    },
                    "tracking_number": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100,
                        "description": "Tracking number provided by the shipping carrier.",
                        "example": "JD014600006281234567"
                    },
                    "return_tracking_company": {
                        "type": ["string", "null"],
                        "nullable": true,
                        "maxLength": 100,
                        "description": "Return shipment carrier name, if applicable.",
                        "example": "UPS"
                    },
                    "return_tracking_number": {
                        "type": ["string", "null"],
                        "nullable": true,
                        "maxLength": 100,
                        "description": "Return shipment tracking number, if applicable.",
                        "example": "1Z999AA10123456784"
                    }
                }
            },
            "UpdateShipmentResponse": {
            },

            "Error": {
                "type": "object",
                "required": ["message", "code", "data"],
                "properties": {
                    "code": {
                        "type": "string",
                        "description": "An error code that identifies the type of error that occurred.",
                        "example": 404
                    },
                    "message": {
                        "type": "string",
                        "description": "A message that describes the error condition in a human-readable form.",
                        "example": "Not found."
                    },
                    "data": {
                        "type": ["object", "array"],
                        "description": "Additional information that can help the caller understand or fix the issue."
                    }
                },
                "description": "An error response returned when the request is unsuccessful."
            },
            "ErrorList": {
                "type": "array",
                "minItems": 1,
                "description": "A list of errors returned when a request is unsuccessful.",
                "items": {
                    "$ref": "#/components/schemas/Error"
                }
            }
        },
        "headers": {
            "X-RateLimit-Limit": {
                "description": "The number of allowed requests in the current period.",
                "schema": {
                    "type": "number",
                    "example": 100
                }
            },
            "X-RateLimit-Remaining": {
                "description": "The number of remaining requests in the current period.",
                "schema": {
                    "type": "number",
                    "example": 90
                }
            },
            "X-RateLimit-Retry-After": {
                "description": "The date of number of remaining requests will reset.",
                "schema": {
                    "type": "string",
                    "format": "datetime",
                    "example": "2022-11-04T13:43:28Z"
                }
            }
        },
        "responses": {
            "ApiError": {
                "description": "Api error",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorList"
                        }
                    }
                },
                "headers": {
                    "X-RateLimit-Limit": {
                        "$ref": "#/components/headers/X-RateLimit-Limit"
                    },
                    "X-RateLimit-Remaining": {
                        "$ref": "#/components/headers/X-RateLimit-Remaining"
                    },
                    "X-RateLimit-Retry-After": {
                        "$ref": "#/components/headers/X-RateLimit-Retry-After"
                    }
                }
            },
            "BadRequest": {
                "description": "Bad request",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorList"
                        },
                        "example": [
                            {
                                "code": null,
                                "message": "All array items must match schema"
                            },
                            {
                                "code": null,
                                "message": "The required properties (currency) are missing"
                            }
                        ]
                    }
                },
                "headers": {
                    "X-RateLimit-Limit": {
                        "$ref": "#/components/headers/X-RateLimit-Limit"
                    },
                    "X-RateLimit-Remaining": {
                        "$ref": "#/components/headers/X-RateLimit-Remaining"
                    },
                    "X-RateLimit-Retry-After": {
                        "$ref": "#/components/headers/X-RateLimit-Retry-After"
                    }
                }
            },
            "NotFound": {
                "description": "Not found",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorList"
                        },
                        "example": [
                            {
                                "code": 404,
                                "message": "Entity is not found."
                            }
                        ]
                    }
                }
            },
            "Unauthorized": {
                "description": "Unauthorized",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorList"
                        },
                        "example": [
                            {
                                "code": 401,
                                "message": "Unauthorized"
                            }
                        ]
                    }
                }
            },
            "TooManyRequests": {
                "description": "Too many requests",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorList"
                        },
                        "example": [
                            {
                                "code": 429,
                                "message": "Too many requests."
                            }
                        ]
                    }
                },
                "headers": {
                    "X-RateLimit-Limit": {
                        "$ref": "#/components/headers/X-RateLimit-Limit"
                    },
                    "X-RateLimit-Remaining": {
                        "$ref": "#/components/headers/X-RateLimit-Remaining"
                    },
                    "X-RateLimit-Retry-After": {
                        "$ref": "#/components/headers/X-RateLimit-Retry-After"
                    }
                }
            },
            "InternalError": {
                "description": "Internal server error",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorList"
                        },
                        "example": [
                            {
                                "code": 500,
                                "message": "Internal server error."
                            }
                        ]
                    }
                }
            }
        },
        "parameters": {},
        "examples": {}
    },
    "servers": [
        { "url": "https://m2e.cloud/api/v1/api", "description": "production" },
        {"url": "https://sales-channels.m2ecloud.dev/api/v1/api", "description": "dev"},
        {"url": "https://10.0.30.15:56000/api/v1/api", "description": "local"}
    ],
    "security": [{ "JWT": [] }]
}
