{
    "openapi": "3.0.3",
    "info": {
        "title": "Evyoo POS API",
        "version": "1.0.0",
        "description": "Read the data of your Evyoo POS: products, customers, vendors, quotes, orders, invoices, payments, purchases, transfers, adjustments and reference data.\n\nThe API is REST and answers in JSON. You authenticate once with your access key and security code to get a token valid 15 minutes, then send that token with every request.",
        "contact": {
            "name": "Evyoo support",
            "email": "info@evyooht.com"
        }
    },
    "servers": [
        {
            "url": "https://{host}/api/v1",
            "description": "The API of your company. Every company has its own address.",
            "variables": {
                "host": {
                    "default": "your-company.evyooht.com",
                    "description": "The address of your Evyoo POS, without https://"
                }
            }
        }
    ],
    "tags": [
        {
            "name": "Getting started",
            "description": "Check the connection, get an access token and discover what you can read."
        },
        {
            "name": "Catalog and parties",
            "description": "Products, customers and vendors."
        },
        {
            "name": "Sales",
            "description": "Quotes, sales orders, invoices, credit memos and payments received."
        },
        {
            "name": "Purchasing and stock",
            "description": "Purchase orders, receivings, transfers and adjustments."
        },
        {
            "name": "Reference data",
            "description": "Stores, departments, sub-departments, price lists and customer types."
        }
    ],
    "paths": {
        "/status": {
            "get": {
                "tags": [
                    "Getting started"
                ],
                "operationId": "getStatus",
                "security": [],
                "summary": "Check that the API answers",
                "description": "Public: no token needed. This is the first call to make, to know whether you talk to the right server.\n\n`authorization_header_received` tells whether an `Authorization` header reached the server (some hosting setups remove it). Send `Authorization: Bearer x` to test it. `enabled` is false when your company has not subscribed to the API.",
                "responses": {
                    "200": {
                        "description": "The API answers.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Status"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/auth/token": {
            "post": {
                "tags": [
                    "Getting started"
                ],
                "operationId": "createToken",
                "security": [],
                "summary": "Get an access token",
                "description": "Exchange your access key and security code for a token valid for 15 minutes (OAuth 2.0 client credentials).\n\nEach successful call creates a new token and the previous ones stay valid until they expire: keep your token and reuse it, and ask for a new one only after a 401. Limit: 10 token requests per minute per IP address. After repeated failures the client is blocked for 15 minutes.\n\nAll errors on this route use the OAuth format: `{\"error\": \"...\", \"error_description\": \"...\"}`.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/TokenRequest"
                            }
                        },
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TokenRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The token. It is never cached.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Token"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid_request, unsupported_grant_type or invalid_scope.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OAuthError"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "invalid_client: missing or wrong credentials. The message is the same whatever the cause.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OAuthError"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "rate_limited or too_many_attempts. See the Retry-After header.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OAuthError"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "api_not_enabled for your company, or the service is temporarily unavailable.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OAuthError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ping": {
            "get": {
                "tags": [
                    "Getting started"
                ],
                "operationId": "ping",
                "security": [
                    {
                        "oauth2": []
                    }
                ],
                "summary": "Check that your token works",
                "description": "Tells whether a token is accepted, and for which client. Needs no permission: any valid token can call it.",
                "responses": {
                    "200": {
                        "description": "The token is accepted.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Ping"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/resources": {
            "get": {
                "tags": [
                    "Getting started"
                ],
                "operationId": "listResources",
                "security": [
                    {
                        "oauth2": []
                    }
                ],
                "summary": "Discover what you can read",
                "description": "Describes, for YOUR client, the resources it can read, with their fields, filters and sort fields. A resource you have no permission for is not listed, and neither is a field that needs an add-on permission you do not hold.",
                "responses": {
                    "200": {
                        "description": "The resources you can read.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ResourceCatalog"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/products": {
            "get": {
                "tags": [
                    "Catalog and parties"
                ],
                "operationId": "listProducts",
                "summary": "List products, services and special or assembled items, with prices and stock",
                "description": "The product catalog. Only active products are listed unless you ask for `status=all` or `status=inactive`.\n\nPrices and stock are computed for you. A client with no price list restriction gets the base `price` and a `price_lists` array with the price of each of the seven price lists. A client restricted to one price list gets a single `price`: the one of its list, or the base price when the list price is zero. Stock is listed per store; for a client restricted to some stores, the totals add up those stores only.",
                "security": [
                    {
                        "oauth2": [
                            "products:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `name`, `code`, `updated_at`. Default: `name`.",
                        "schema": {
                            "type": "string",
                            "default": "name"
                        },
                        "example": "-name"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "active (default), inactive, or all. When omitted, only active records are listed. Allowed values: `active`, `inactive`, `all`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "active",
                            "inactive",
                            "all"
                        ],
                        "example": "active"
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "Filter by type. Several values can be given, separated by commas. Allowed values: `inventory`, `service`, `assembly`, `special`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "inventory",
                            "service",
                            "assembly",
                            "special"
                        ],
                        "example": "inventory"
                    },
                    {
                        "name": "department_id",
                        "in": "query",
                        "required": false,
                        "description": "Only products of this department.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "sub_department_id",
                        "in": "query",
                        "required": false,
                        "description": "Only products of this sub-department.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "vendor_id",
                        "in": "query",
                        "required": false,
                        "description": "Only records of this vendor.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the name, the code or the barcode.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ProductList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 463,
                                            "code": "PRD-0463",
                                            "barcode": "6291041500213",
                                            "name": "Thermal paper roll 57x18m",
                                            "description": "Thermal paper roll for receipt printers",
                                            "type": "inventory",
                                            "status": "active",
                                            "size": "",
                                            "attribute": "",
                                            "department_id": 3,
                                            "department": "Office supplies",
                                            "sub_department_id": 21,
                                            "sub_department": "Paper",
                                            "unit": "Box of 100",
                                            "second_unit": "Box of 200",
                                            "vendor_id": 12,
                                            "reorder_point": 20,
                                            "currency": "USD",
                                            "cost": 90,
                                            "average_cost": 92.5,
                                            "order_cost": 90,
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00",
                                            "quantity_total": 12,
                                            "on_sales_order": 4,
                                            "on_purchase_order": 0,
                                            "price": 125,
                                            "second_unit_price": 250,
                                            "price_lists": [
                                                {
                                                    "price_list_id": 1,
                                                    "price": 125,
                                                    "second_unit_price": 250
                                                },
                                                {
                                                    "price_list_id": 2,
                                                    "price": 118,
                                                    "second_unit_price": 236
                                                }
                                            ],
                                            "stock": [
                                                {
                                                    "store_id": 1,
                                                    "quantity": 8,
                                                    "on_sales_order": 3,
                                                    "on_purchase_order": 0
                                                },
                                                {
                                                    "store_id": 2,
                                                    "quantity": 4,
                                                    "on_sales_order": 1,
                                                    "on_purchase_order": 0
                                                }
                                            ]
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/products/{id}": {
            "get": {
                "tags": [
                    "Catalog and parties"
                ],
                "operationId": "getProduct",
                "summary": "Get one product",
                "description": "Returns one record by its identifier. A record that does not exist, or that your client may not see, answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "products:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 463
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Product"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 463,
                                        "code": "PRD-0463",
                                        "barcode": "6291041500213",
                                        "name": "Thermal paper roll 57x18m",
                                        "description": "Thermal paper roll for receipt printers",
                                        "type": "inventory",
                                        "status": "active",
                                        "size": "",
                                        "attribute": "",
                                        "department_id": 3,
                                        "department": "Office supplies",
                                        "sub_department_id": 21,
                                        "sub_department": "Paper",
                                        "unit": "Box of 100",
                                        "second_unit": "Box of 200",
                                        "vendor_id": 12,
                                        "reorder_point": 20,
                                        "currency": "USD",
                                        "cost": 90,
                                        "average_cost": 92.5,
                                        "order_cost": 90,
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00",
                                        "quantity_total": 12,
                                        "on_sales_order": 4,
                                        "on_purchase_order": 0,
                                        "price": 125,
                                        "second_unit_price": 250,
                                        "price_lists": [
                                            {
                                                "price_list_id": 1,
                                                "price": 125,
                                                "second_unit_price": 250
                                            },
                                            {
                                                "price_list_id": 2,
                                                "price": 118,
                                                "second_unit_price": 236
                                            }
                                        ],
                                        "stock": [
                                            {
                                                "store_id": 1,
                                                "quantity": 8,
                                                "on_sales_order": 3,
                                                "on_purchase_order": 0
                                            },
                                            {
                                                "store_id": 2,
                                                "quantity": 4,
                                                "on_sales_order": 1,
                                                "on_purchase_order": 0
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/customers": {
            "get": {
                "tags": [
                    "Catalog and parties"
                ],
                "operationId": "listCustomers",
                "summary": "List customers",
                "description": "The customers of the company, with their type and price list. The credit limit and the balance are only returned to clients that hold the `customers:financial` permission.",
                "security": [
                    {
                        "oauth2": [
                            "customers:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `name`, `code`, `updated_at`. Default: `name`.",
                        "schema": {
                            "type": "string",
                            "default": "name"
                        },
                        "example": "-name"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "active or inactive. Allowed values: `active`, `inactive`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "active",
                            "inactive"
                        ],
                        "example": "active"
                    },
                    {
                        "name": "customer_type_id",
                        "in": "query",
                        "required": false,
                        "description": "Only customers of this type.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "price_list_id",
                        "in": "query",
                        "required": false,
                        "description": "Only customers on this price list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the name, the code, the company name, the phone or the e-mail.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CustomerList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 58,
                                            "code": "CUS-0058",
                                            "name": "Marie Dupont",
                                            "first_name": "Marie",
                                            "last_name": "Dupont",
                                            "company_name": "",
                                            "alt_name": "",
                                            "phone": "+509 3700 0000",
                                            "phone2": "",
                                            "email": "contact@example.com",
                                            "address": "12 Rue Capois",
                                            "city": "Port-au-Prince",
                                            "zip": "HT6110",
                                            "currency": "USD",
                                            "payment_term": "Net 30",
                                            "status": "active",
                                            "customer_type_id": 2,
                                            "customer_type": "Wholesale",
                                            "price_list_id": 1,
                                            "discount_level": 0,
                                            "discount_type": "",
                                            "credit_limit": 5000,
                                            "balance": 320,
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/customers/{id}": {
            "get": {
                "tags": [
                    "Catalog and parties"
                ],
                "operationId": "getCustomer",
                "summary": "Get one customer",
                "description": "Returns one record by its identifier. A record that does not exist, or that your client may not see, answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "customers:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 58
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Customer"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 58,
                                        "code": "CUS-0058",
                                        "name": "Marie Dupont",
                                        "first_name": "Marie",
                                        "last_name": "Dupont",
                                        "company_name": "",
                                        "alt_name": "",
                                        "phone": "+509 3700 0000",
                                        "phone2": "",
                                        "email": "contact@example.com",
                                        "address": "12 Rue Capois",
                                        "city": "Port-au-Prince",
                                        "zip": "HT6110",
                                        "currency": "USD",
                                        "payment_term": "Net 30",
                                        "status": "active",
                                        "customer_type_id": 2,
                                        "customer_type": "Wholesale",
                                        "price_list_id": 1,
                                        "discount_level": 0,
                                        "discount_type": "",
                                        "credit_limit": 5000,
                                        "balance": 320,
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/vendors": {
            "get": {
                "tags": [
                    "Catalog and parties"
                ],
                "operationId": "listVendors",
                "summary": "List vendors",
                "description": "The vendors of the company.",
                "security": [
                    {
                        "oauth2": [
                            "vendors:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `name`, `code`, `updated_at`. Default: `name`.",
                        "schema": {
                            "type": "string",
                            "default": "name"
                        },
                        "example": "-name"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "active or inactive. Allowed values: `active`, `inactive`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "active",
                            "inactive"
                        ],
                        "example": "active"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the company name, the code, the phone or the e-mail.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VendorList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 12,
                                            "code": "VND-0012",
                                            "name": "Papeterie Delmas",
                                            "contact_first_name": "Paul",
                                            "contact_last_name": "Delmas",
                                            "other_contact": "",
                                            "phone": "+509 3700 0000",
                                            "phone2": "",
                                            "email": "contact@example.com",
                                            "website": "https://www.example.com",
                                            "address": "12 Rue Capois",
                                            "city": "Port-au-Prince",
                                            "zip": "HT6110",
                                            "country": "Haiti",
                                            "currency": "USD",
                                            "status": "active",
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/vendors/{id}": {
            "get": {
                "tags": [
                    "Catalog and parties"
                ],
                "operationId": "getVendor",
                "summary": "Get one vendor",
                "description": "Returns one record by its identifier. A record that does not exist, or that your client may not see, answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "vendors:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 12
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Vendor"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 12,
                                        "code": "VND-0012",
                                        "name": "Papeterie Delmas",
                                        "contact_first_name": "Paul",
                                        "contact_last_name": "Delmas",
                                        "other_contact": "",
                                        "phone": "+509 3700 0000",
                                        "phone2": "",
                                        "email": "contact@example.com",
                                        "website": "https://www.example.com",
                                        "address": "12 Rue Capois",
                                        "city": "Port-au-Prince",
                                        "zip": "HT6110",
                                        "country": "Haiti",
                                        "currency": "USD",
                                        "status": "active",
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/quotes": {
            "get": {
                "tags": [
                    "Sales"
                ],
                "operationId": "listQuotes",
                "summary": "List quotes and their lines",
                "description": "Sales quotes. Recent and archived quotes are returned together as one collection: totals, sorting and pagination cover both.\n\nStatuses: hold (draft, hidden by default), open, converted (turned into an order or an invoice), void. A void quote keeps its identity but its amounts are zero.",
                "security": [
                    {
                        "oauth2": [
                            "quotes:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `date`, `total`, `updated_at`. Default: `-date`.",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        },
                        "example": "-date"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "hold, open, converted, void, or all. When omitted, drafts (status `hold`) are not listed. Allowed values: `hold`, `open`, `converted`, `void`, `all`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "hold",
                            "open",
                            "converted",
                            "void",
                            "all"
                        ],
                        "example": "hold"
                    },
                    {
                        "name": "customer_id",
                        "in": "query",
                        "required": false,
                        "description": "Only records of this customer.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "store_id",
                        "in": "query",
                        "required": false,
                        "description": "Only documents of this store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "required": false,
                        "description": "Only documents in this currency (USD or HTG).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "USD"
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or after this day (YYYY-MM-DD).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or before this day (YYYY-MM-DD), the whole day included.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-31"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the quote number or the customer name.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuoteList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 1087,
                                            "number": "Q1-1087",
                                            "store_id": 1,
                                            "date": "2026-03-15T14:30:00",
                                            "customer_id": 58,
                                            "customer_name": "Marie Dupont",
                                            "status": "hold",
                                            "payment_type": "Cash",
                                            "currency": "USD",
                                            "exchange_rate": 130.5,
                                            "quantity_total": 12,
                                            "items_total": 1250,
                                            "tax": 0,
                                            "discount_percent": 0,
                                            "discount_amount": 0,
                                            "shipping": 0,
                                            "total": 1250,
                                            "ship_to_name": "Marie Dupont",
                                            "ship_to_address": "12 Rue Capois, Port-au-Prince",
                                            "ship_to_phone": "+509 3700 0000",
                                            "notes": "Delivered on Friday.",
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/quotes/{id}": {
            "get": {
                "tags": [
                    "Sales"
                ],
                "operationId": "getQuote",
                "summary": "Get one quote",
                "description": "Returns one record by its identifier, with its lines. A record that does not exist, or that your client may not see (for example another store), answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "quotes:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 1087
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/QuoteDetail"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 1087,
                                        "number": "Q1-1087",
                                        "store_id": 1,
                                        "date": "2026-03-15T14:30:00",
                                        "customer_id": 58,
                                        "customer_name": "Marie Dupont",
                                        "status": "hold",
                                        "payment_type": "Cash",
                                        "currency": "USD",
                                        "exchange_rate": 130.5,
                                        "quantity_total": 12,
                                        "items_total": 1250,
                                        "tax": 0,
                                        "discount_percent": 0,
                                        "discount_amount": 0,
                                        "shipping": 0,
                                        "total": 1250,
                                        "ship_to_name": "Marie Dupont",
                                        "ship_to_address": "12 Rue Capois, Port-au-Prince",
                                        "ship_to_phone": "+509 3700 0000",
                                        "notes": "Delivered on Friday.",
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00",
                                        "lines": [
                                            {
                                                "id": 9001,
                                                "product_id": 463,
                                                "name": "Thermal paper roll 57x18m",
                                                "description": "Thermal paper roll for receipt printers",
                                                "type": "Inventory",
                                                "quantity": 10,
                                                "unit": "Box of 100",
                                                "unit_price": 125,
                                                "base_quantity": 1000,
                                                "base_unit_price": 1.25,
                                                "cost": 90
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/sales-orders": {
            "get": {
                "tags": [
                    "Sales"
                ],
                "operationId": "listSalesOrders",
                "summary": "List sales orders, their lines and payments",
                "description": "Customer sales orders.\n\nStatuses: new, open, hold (draft, hidden by default), converted (turned into an invoice), refunded, closed. For a sales order, closed is not a cancellation: amounts are kept.",
                "security": [
                    {
                        "oauth2": [
                            "sales-orders:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `date`, `total`, `updated_at`. Default: `-date`.",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        },
                        "example": "-date"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "new, open, hold, converted, refunded, closed, or all. When omitted, drafts (status `hold`) are not listed. Allowed values: `new`, `open`, `hold`, `converted`, `refunded`, `closed`, `all`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "new",
                            "open",
                            "hold",
                            "converted",
                            "refunded",
                            "closed",
                            "all"
                        ],
                        "example": "new"
                    },
                    {
                        "name": "customer_id",
                        "in": "query",
                        "required": false,
                        "description": "Only records of this customer.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "store_id",
                        "in": "query",
                        "required": false,
                        "description": "Only documents of this store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "required": false,
                        "description": "Only documents in this currency (USD or HTG).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "USD"
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or after this day (YYYY-MM-DD).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or before this day (YYYY-MM-DD), the whole day included.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-31"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the order number or the customer name.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SalesOrderList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 312,
                                            "number": "S1-312",
                                            "store_id": 1,
                                            "date": "2026-03-15T14:30:00",
                                            "customer_id": 58,
                                            "customer_name": "Marie Dupont",
                                            "status": "new",
                                            "payment_type": "Cash",
                                            "currency": "USD",
                                            "exchange_rate": 130.5,
                                            "quantity_total": 12,
                                            "items_total": 1250,
                                            "tax": 0,
                                            "discount_percent": 0,
                                            "discount_amount": 0,
                                            "shipping": 0,
                                            "total": 1250,
                                            "amount_paid": 1250,
                                            "cost_total": 900,
                                            "quote_number": "Q1-1087",
                                            "ship_to_name": "Marie Dupont",
                                            "ship_to_address": "12 Rue Capois, Port-au-Prince",
                                            "ship_to_phone": "+509 3700 0000",
                                            "notes": "Delivered on Friday.",
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/sales-orders/{id}": {
            "get": {
                "tags": [
                    "Sales"
                ],
                "operationId": "getSalesOrder",
                "summary": "Get one sales order",
                "description": "Returns one record by its identifier, with its lines and payments. A record that does not exist, or that your client may not see (for example another store), answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "sales-orders:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 312
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SalesOrderDetail"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 312,
                                        "number": "S1-312",
                                        "store_id": 1,
                                        "date": "2026-03-15T14:30:00",
                                        "customer_id": 58,
                                        "customer_name": "Marie Dupont",
                                        "status": "new",
                                        "payment_type": "Cash",
                                        "currency": "USD",
                                        "exchange_rate": 130.5,
                                        "quantity_total": 12,
                                        "items_total": 1250,
                                        "tax": 0,
                                        "discount_percent": 0,
                                        "discount_amount": 0,
                                        "shipping": 0,
                                        "total": 1250,
                                        "amount_paid": 1250,
                                        "cost_total": 900,
                                        "quote_number": "Q1-1087",
                                        "ship_to_name": "Marie Dupont",
                                        "ship_to_address": "12 Rue Capois, Port-au-Prince",
                                        "ship_to_phone": "+509 3700 0000",
                                        "notes": "Delivered on Friday.",
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00",
                                        "lines": [
                                            {
                                                "id": 9001,
                                                "product_id": 463,
                                                "name": "Thermal paper roll 57x18m",
                                                "description": "Thermal paper roll for receipt printers",
                                                "type": "Inventory",
                                                "quantity": 10,
                                                "delivered_quantity": 10,
                                                "unit": "Box of 100",
                                                "unit_price": 125,
                                                "base_quantity": 1000,
                                                "base_unit_price": 1.25,
                                                "cost": 90
                                            }
                                        ],
                                        "payments": [
                                            {
                                                "date": "2026-03-15T14:30:00",
                                                "cash": 1250,
                                                "card": 0,
                                                "cheque": 0,
                                                "cheque_number": "",
                                                "currency": "USD",
                                                "exchange_rate": 130.5,
                                                "notes": "Delivered on Friday."
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/invoices": {
            "get": {
                "tags": [
                    "Sales"
                ],
                "operationId": "listInvoices",
                "summary": "List invoices, their lines and payments",
                "description": "Sales invoices. Recent and archived invoices are returned together as one collection: totals, sorting and pagination cover both.\n\nStatuses: new, open, hold (draft, hidden by default), regular (final), void. A void invoice keeps its identity (number, date, customer) but all its amounts are zero, lines and payments included, so that adding up a list never counts a cancelled sale. Quantities are kept.\n\nPayments received on an invoice later, from the customer account, are in the payments resource.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `date`, `total`, `updated_at`. Default: `-date`.",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        },
                        "example": "-date"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "new, open, hold, regular, void, or all. When omitted, drafts (status `hold`) are not listed. Allowed values: `new`, `open`, `hold`, `regular`, `void`, `all`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "new",
                            "open",
                            "hold",
                            "regular",
                            "void",
                            "all"
                        ],
                        "example": "new"
                    },
                    {
                        "name": "payment_status",
                        "in": "query",
                        "required": false,
                        "description": "paid or unpaid. Allowed values: `paid`, `unpaid`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "paid",
                            "unpaid"
                        ],
                        "example": "paid"
                    },
                    {
                        "name": "customer_id",
                        "in": "query",
                        "required": false,
                        "description": "Only records of this customer.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "store_id",
                        "in": "query",
                        "required": false,
                        "description": "Only documents of this store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "required": false,
                        "description": "Only documents in this currency (USD or HTG).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "USD"
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or after this day (YYYY-MM-DD).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or before this day (YYYY-MM-DD), the whole day included.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-31"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the invoice number, the customer name or the purchase order number.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InvoiceList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 4149,
                                            "number": "I1-4149",
                                            "store_id": 1,
                                            "date": "2026-03-15T14:30:00",
                                            "customer_id": 58,
                                            "customer_name": "Marie Dupont",
                                            "status": "new",
                                            "payment_status": "paid",
                                            "payment_type": "Cash",
                                            "currency": "USD",
                                            "exchange_rate": 130.5,
                                            "quantity_total": 12,
                                            "items_total": 1250,
                                            "tax": 0,
                                            "discount_percent": 0,
                                            "discount_amount": 0,
                                            "shipping": 0,
                                            "total": 1250,
                                            "amount_paid": 1250,
                                            "deposit": 0,
                                            "cost_total": 900,
                                            "po_number": "PO-7781",
                                            "quote_number": "Q1-1087",
                                            "sales_order_number": "S1-312",
                                            "notes": "Delivered on Friday.",
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/invoices/{id}": {
            "get": {
                "tags": [
                    "Sales"
                ],
                "operationId": "getInvoice",
                "summary": "Get one invoice",
                "description": "Returns one record by its identifier, with its lines and payments. A record that does not exist, or that your client may not see (for example another store), answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "invoices:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 4149
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/InvoiceDetail"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 4149,
                                        "number": "I1-4149",
                                        "store_id": 1,
                                        "date": "2026-03-15T14:30:00",
                                        "customer_id": 58,
                                        "customer_name": "Marie Dupont",
                                        "status": "new",
                                        "payment_status": "paid",
                                        "payment_type": "Cash",
                                        "currency": "USD",
                                        "exchange_rate": 130.5,
                                        "quantity_total": 12,
                                        "items_total": 1250,
                                        "tax": 0,
                                        "discount_percent": 0,
                                        "discount_amount": 0,
                                        "shipping": 0,
                                        "total": 1250,
                                        "amount_paid": 1250,
                                        "deposit": 0,
                                        "cost_total": 900,
                                        "po_number": "PO-7781",
                                        "quote_number": "Q1-1087",
                                        "sales_order_number": "S1-312",
                                        "notes": "Delivered on Friday.",
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00",
                                        "lines": [
                                            {
                                                "id": 9001,
                                                "product_id": 463,
                                                "name": "Thermal paper roll 57x18m",
                                                "description": "Thermal paper roll for receipt printers",
                                                "type": "Inventory",
                                                "quantity": 10,
                                                "unit": "Box of 100",
                                                "unit_price": 125,
                                                "base_quantity": 1000,
                                                "base_unit_price": 1.25,
                                                "cost": 90
                                            }
                                        ],
                                        "payments": [
                                            {
                                                "date": "2026-03-15T14:30:00",
                                                "cash": 1250,
                                                "card": 0,
                                                "cheque": 0,
                                                "cheque_number": "",
                                                "account": 0,
                                                "deposit": 0,
                                                "currency": "USD",
                                                "exchange_rate": 130.5
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/credit-memos": {
            "get": {
                "tags": [
                    "Sales"
                ],
                "operationId": "listCreditMemos",
                "summary": "List credit memos and their lines",
                "description": "Credit memos issued to customers. They are stored with invoices in Evyoo POS but are a separate resource here: a credit memo is not readable as an invoice, and the other way round.\n\nSame structure, statuses and rules as invoices.",
                "security": [
                    {
                        "oauth2": [
                            "credit-memos:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `date`, `total`, `updated_at`. Default: `-date`.",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        },
                        "example": "-date"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "new, open, hold, regular, void, or all. When omitted, drafts (status `hold`) are not listed. Allowed values: `new`, `open`, `hold`, `regular`, `void`, `all`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "new",
                            "open",
                            "hold",
                            "regular",
                            "void",
                            "all"
                        ],
                        "example": "new"
                    },
                    {
                        "name": "payment_status",
                        "in": "query",
                        "required": false,
                        "description": "paid or unpaid. Allowed values: `paid`, `unpaid`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "paid",
                            "unpaid"
                        ],
                        "example": "paid"
                    },
                    {
                        "name": "customer_id",
                        "in": "query",
                        "required": false,
                        "description": "Only records of this customer.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "store_id",
                        "in": "query",
                        "required": false,
                        "description": "Only documents of this store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "required": false,
                        "description": "Only documents in this currency (USD or HTG).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "USD"
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or after this day (YYYY-MM-DD).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or before this day (YYYY-MM-DD), the whole day included.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-31"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the credit memo number, the customer name or the purchase order number.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreditMemoList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 212,
                                            "number": "C1-212",
                                            "store_id": 1,
                                            "date": "2026-03-15T14:30:00",
                                            "customer_id": 58,
                                            "customer_name": "Marie Dupont",
                                            "status": "new",
                                            "payment_status": "paid",
                                            "payment_type": "Cash",
                                            "currency": "USD",
                                            "exchange_rate": 130.5,
                                            "quantity_total": 12,
                                            "items_total": 1250,
                                            "tax": 0,
                                            "discount_percent": 0,
                                            "discount_amount": 0,
                                            "shipping": 0,
                                            "total": 1250,
                                            "amount_paid": 1250,
                                            "deposit": 0,
                                            "cost_total": 900,
                                            "po_number": "PO-7781",
                                            "quote_number": "Q1-1087",
                                            "sales_order_number": "S1-312",
                                            "notes": "Delivered on Friday.",
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/credit-memos/{id}": {
            "get": {
                "tags": [
                    "Sales"
                ],
                "operationId": "getCreditMemo",
                "summary": "Get one credit memo",
                "description": "Returns one record by its identifier, with its lines and payments. A record that does not exist, or that your client may not see (for example another store), answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "credit-memos:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 212
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CreditMemoDetail"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 212,
                                        "number": "C1-212",
                                        "store_id": 1,
                                        "date": "2026-03-15T14:30:00",
                                        "customer_id": 58,
                                        "customer_name": "Marie Dupont",
                                        "status": "new",
                                        "payment_status": "paid",
                                        "payment_type": "Cash",
                                        "currency": "USD",
                                        "exchange_rate": 130.5,
                                        "quantity_total": 12,
                                        "items_total": 1250,
                                        "tax": 0,
                                        "discount_percent": 0,
                                        "discount_amount": 0,
                                        "shipping": 0,
                                        "total": 1250,
                                        "amount_paid": 1250,
                                        "deposit": 0,
                                        "cost_total": 900,
                                        "po_number": "PO-7781",
                                        "quote_number": "Q1-1087",
                                        "sales_order_number": "S1-312",
                                        "notes": "Delivered on Friday.",
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00",
                                        "lines": [
                                            {
                                                "id": 9001,
                                                "product_id": 463,
                                                "name": "Thermal paper roll 57x18m",
                                                "description": "Thermal paper roll for receipt printers",
                                                "type": "Inventory",
                                                "quantity": 10,
                                                "unit": "Box of 100",
                                                "unit_price": 125,
                                                "base_quantity": 1000,
                                                "base_unit_price": 1.25,
                                                "cost": 90
                                            }
                                        ],
                                        "payments": [
                                            {
                                                "date": "2026-03-15T14:30:00",
                                                "cash": 1250,
                                                "card": 0,
                                                "cheque": 0,
                                                "cheque_number": "",
                                                "account": 0,
                                                "deposit": 0,
                                                "currency": "USD",
                                                "exchange_rate": 130.5
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/payments": {
            "get": {
                "tags": [
                    "Sales"
                ],
                "operationId": "listPayments",
                "summary": "List payments received from customers",
                "description": "Payments received from customers against their account (the Receive Payment module). Not to be confused with the payment of an invoice at the counter, which is part of the invoice (see the payments of an invoice).\n\nStatuses: regular, void. A void payment keeps its identity but its amounts are zero.",
                "security": [
                    {
                        "oauth2": [
                            "payments:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `date`, `amount_received`, `updated_at`. Default: `-date`.",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        },
                        "example": "-date"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "regular or void. Allowed values: `regular`, `void`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "regular",
                            "void"
                        ],
                        "example": "regular"
                    },
                    {
                        "name": "customer_id",
                        "in": "query",
                        "required": false,
                        "description": "Only records of this customer.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "store_id",
                        "in": "query",
                        "required": false,
                        "description": "Only documents of this store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "required": false,
                        "description": "Only documents in this currency (USD or HTG).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "USD"
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or after this day (YYYY-MM-DD).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or before this day (YYYY-MM-DD), the whole day included.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-31"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the payment number or the customer name.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PaymentList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 2201,
                                            "number": "P1-2201",
                                            "store_id": 1,
                                            "date": "2026-03-15T14:30:00",
                                            "customer_id": 58,
                                            "customer_name": "Marie Dupont",
                                            "status": "regular",
                                            "payment_type": "Cash",
                                            "currency": "USD",
                                            "exchange_rate": 130.5,
                                            "amount_received": 1250,
                                            "cash": 1250,
                                            "card": 0,
                                            "cheque": 0,
                                            "cheque_number": "",
                                            "notes": "Delivered on Friday.",
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/payments/{id}": {
            "get": {
                "tags": [
                    "Sales"
                ],
                "operationId": "getPayment",
                "summary": "Get one payment received",
                "description": "Returns one record by its identifier, with its applied_to. A record that does not exist, or that your client may not see (for example another store), answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "payments:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 2201
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PaymentDetail"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 2201,
                                        "number": "P1-2201",
                                        "store_id": 1,
                                        "date": "2026-03-15T14:30:00",
                                        "customer_id": 58,
                                        "customer_name": "Marie Dupont",
                                        "status": "regular",
                                        "payment_type": "Cash",
                                        "currency": "USD",
                                        "exchange_rate": 130.5,
                                        "amount_received": 1250,
                                        "cash": 1250,
                                        "card": 0,
                                        "cheque": 0,
                                        "cheque_number": "",
                                        "notes": "Delivered on Friday.",
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00",
                                        "applied_to": [
                                            {
                                                "invoice_id": 4149,
                                                "invoice_number": "I1-4149",
                                                "amount": 1250,
                                                "date": "2026-03-15T14:30:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/purchase-orders": {
            "get": {
                "tags": [
                    "Purchasing and stock"
                ],
                "operationId": "listPurchaseOrders",
                "summary": "List purchase orders and their lines",
                "description": "Purchase orders sent to vendors.\n\nStatuses: hold (draft, hidden by default), open, complete, closed. For a purchase order, closed is not a cancellation: amounts are kept. Prices are purchase prices belonging to the document and are visible with the purchase-orders:read permission.",
                "security": [
                    {
                        "oauth2": [
                            "purchase-orders:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `date`, `total`, `updated_at`. Default: `-date`.",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        },
                        "example": "-date"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "hold, open, complete, closed, or all. When omitted, drafts (status `hold`) are not listed. Allowed values: `hold`, `open`, `complete`, `closed`, `all`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "hold",
                            "open",
                            "complete",
                            "closed",
                            "all"
                        ],
                        "example": "hold"
                    },
                    {
                        "name": "vendor_id",
                        "in": "query",
                        "required": false,
                        "description": "Only records of this vendor.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "store_id",
                        "in": "query",
                        "required": false,
                        "description": "Only documents of this store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "required": false,
                        "description": "Only documents in this currency (USD or HTG).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "USD"
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or after this day (YYYY-MM-DD).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or before this day (YYYY-MM-DD), the whole day included.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-31"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the order number or the vendor name.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PurchaseOrderList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 95,
                                            "number": "PO1-95",
                                            "store_id": 1,
                                            "date": "2026-03-15T14:30:00",
                                            "vendor_id": 12,
                                            "vendor_name": "Papeterie Delmas",
                                            "status": "hold",
                                            "currency": "USD",
                                            "exchange_rate": 130.5,
                                            "quantity_total": 12,
                                            "items_total": 1250,
                                            "tax": 0,
                                            "total": 1250,
                                            "notes": "Delivered on Friday.",
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/purchase-orders/{id}": {
            "get": {
                "tags": [
                    "Purchasing and stock"
                ],
                "operationId": "getPurchaseOrder",
                "summary": "Get one purchase order",
                "description": "Returns one record by its identifier, with its lines. A record that does not exist, or that your client may not see (for example another store), answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "purchase-orders:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 95
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PurchaseOrderDetail"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 95,
                                        "number": "PO1-95",
                                        "store_id": 1,
                                        "date": "2026-03-15T14:30:00",
                                        "vendor_id": 12,
                                        "vendor_name": "Papeterie Delmas",
                                        "status": "hold",
                                        "currency": "USD",
                                        "exchange_rate": 130.5,
                                        "quantity_total": 12,
                                        "items_total": 1250,
                                        "tax": 0,
                                        "total": 1250,
                                        "notes": "Delivered on Friday.",
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00",
                                        "lines": [
                                            {
                                                "id": 9001,
                                                "product_id": 463,
                                                "name": "Thermal paper roll 57x18m",
                                                "description": "Thermal paper roll for receipt printers",
                                                "quantity": 10,
                                                "unit": "Box of 100",
                                                "unit_price": 125,
                                                "base_quantity": 1000
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/receivings": {
            "get": {
                "tags": [
                    "Purchasing and stock"
                ],
                "operationId": "listReceivings",
                "summary": "List goods receivings and vendor returns",
                "description": "Goods received from vendors, and goods returned to them. They are stored together in Evyoo POS; the `type` field tells them apart (receipt or return), and the `type` filter reads only one kind.\n\nStatuses: open, hold (draft, hidden by default), posted, void. A void document keeps its identity but its amounts are zero. The cost fields of the lines (previous costs, average cost) require costs:read.",
                "security": [
                    {
                        "oauth2": [
                            "receivings:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `date`, `total`, `updated_at`. Default: `-date`.",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        },
                        "example": "-date"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "open, hold, posted, void, or all. When omitted, drafts (status `hold`) are not listed. Allowed values: `open`, `hold`, `posted`, `void`, `all`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "open",
                            "hold",
                            "posted",
                            "void",
                            "all"
                        ],
                        "example": "open"
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "receipt or return. Allowed values: `receipt`, `return`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "receipt",
                            "return"
                        ],
                        "example": "receipt"
                    },
                    {
                        "name": "vendor_id",
                        "in": "query",
                        "required": false,
                        "description": "Only records of this vendor.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "purchase_order_id",
                        "in": "query",
                        "required": false,
                        "description": "Only receivings linked to this purchase order.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "store_id",
                        "in": "query",
                        "required": false,
                        "description": "Only documents of this store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "required": false,
                        "description": "Only documents in this currency (USD or HTG).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "USD"
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or after this day (YYYY-MM-DD).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or before this day (YYYY-MM-DD), the whole day included.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-31"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the receiving number, the vendor name or the vendor receipt number.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ReceivingList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 310,
                                            "number": "R1-310",
                                            "type": "receipt",
                                            "store_id": 1,
                                            "date": "2026-03-15T14:30:00",
                                            "receipt_number": "DN-20931",
                                            "receipt_date": "2026-03-15",
                                            "purchase_order_id": 95,
                                            "vendor_id": 12,
                                            "vendor_name": "Papeterie Delmas",
                                            "status": "open",
                                            "currency": "USD",
                                            "exchange_rate": 130.5,
                                            "quantity_total": 12,
                                            "items_total": 1250,
                                            "discount_percent": 0,
                                            "discount_amount": 0,
                                            "tax": 0,
                                            "freight": 0,
                                            "fee": 0,
                                            "total": 1250,
                                            "notes": "Delivered on Friday.",
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/receivings/{id}": {
            "get": {
                "tags": [
                    "Purchasing and stock"
                ],
                "operationId": "getReceiving",
                "summary": "Get one receiving",
                "description": "Returns one record by its identifier, with its lines. A record that does not exist, or that your client may not see (for example another store), answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "receivings:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 310
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ReceivingDetail"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 310,
                                        "number": "R1-310",
                                        "type": "receipt",
                                        "store_id": 1,
                                        "date": "2026-03-15T14:30:00",
                                        "receipt_number": "DN-20931",
                                        "receipt_date": "2026-03-15",
                                        "purchase_order_id": 95,
                                        "vendor_id": 12,
                                        "vendor_name": "Papeterie Delmas",
                                        "status": "open",
                                        "currency": "USD",
                                        "exchange_rate": 130.5,
                                        "quantity_total": 12,
                                        "items_total": 1250,
                                        "discount_percent": 0,
                                        "discount_amount": 0,
                                        "tax": 0,
                                        "freight": 0,
                                        "fee": 0,
                                        "total": 1250,
                                        "notes": "Delivered on Friday.",
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00",
                                        "lines": [
                                            {
                                                "id": 9001,
                                                "product_id": 463,
                                                "name": "Thermal paper roll 57x18m",
                                                "description": "Thermal paper roll for receipt printers",
                                                "barcode": "6291041500213",
                                                "quantity": 10,
                                                "unit": "Box of 100",
                                                "unit_price": 125,
                                                "new_price": 130,
                                                "base_quantity": 1000,
                                                "average_cost": 92.5,
                                                "previous_cost": 88,
                                                "previous_average_cost": 91
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/transfers": {
            "get": {
                "tags": [
                    "Purchasing and stock"
                ],
                "operationId": "listTransfers",
                "summary": "List stock transfers between stores",
                "description": "Transfers of stock from one store to another. A transfer involves two stores: a client restricted to some stores sees it if either the origin or the destination is allowed.\n\nStatuses: hold (draft, hidden by default), open, posted.",
                "security": [
                    {
                        "oauth2": [
                            "transfers:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `date`, `updated_at`. Default: `-date`.",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        },
                        "example": "-date"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "hold, open, posted, or all. When omitted, drafts (status `hold`) are not listed. Allowed values: `hold`, `open`, `posted`, `all`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "hold",
                            "open",
                            "posted",
                            "all"
                        ],
                        "example": "hold"
                    },
                    {
                        "name": "from_store_id",
                        "in": "query",
                        "required": false,
                        "description": "Only transfers leaving this store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "to_store_id",
                        "in": "query",
                        "required": false,
                        "description": "Only transfers arriving in this store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or after this day (YYYY-MM-DD).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or before this day (YYYY-MM-DD), the whole day included.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-31"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the transfer number.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TransferList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 48,
                                            "number": "T1-48",
                                            "date": "2026-03-15T14:30:00",
                                            "from_store_id": 1,
                                            "from_store": "Main store",
                                            "to_store_id": 2,
                                            "to_store": "Delmas store",
                                            "status": "hold",
                                            "quantity_total": 12,
                                            "notes": "Delivered on Friday.",
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/transfers/{id}": {
            "get": {
                "tags": [
                    "Purchasing and stock"
                ],
                "operationId": "getTransfer",
                "summary": "Get one transfer",
                "description": "Returns one record by its identifier, with its lines. A record that does not exist, or that your client may not see (for example another store), answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "transfers:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 48
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/TransferDetail"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 48,
                                        "number": "T1-48",
                                        "date": "2026-03-15T14:30:00",
                                        "from_store_id": 1,
                                        "from_store": "Main store",
                                        "to_store_id": 2,
                                        "to_store": "Delmas store",
                                        "status": "hold",
                                        "quantity_total": 12,
                                        "notes": "Delivered on Friday.",
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00",
                                        "lines": [
                                            {
                                                "id": 9001,
                                                "product_id": 463,
                                                "name": "Thermal paper roll 57x18m",
                                                "description": "Thermal paper roll for receipt printers",
                                                "quantity": 10,
                                                "unit": "Box of 100",
                                                "base_quantity": 1000,
                                                "average_cost": 92.5
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/adjustments": {
            "get": {
                "tags": [
                    "Purchasing and stock"
                ],
                "operationId": "listAdjustments",
                "summary": "List quantity and cost adjustments",
                "description": "Stock adjustments: quantity adjustments and cost adjustments are stored together in Evyoo POS. The `type` field tells them apart (quantity or cost), and the `type` filter reads only one kind.\n\nStatuses: hold (draft, hidden by default), posted. An adjustment talks about quantities or about costs: the cost fields (the total of the document, and the costs of the lines) require costs:read.",
                "security": [
                    {
                        "oauth2": [
                            "adjustments:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `date`, `updated_at`. Default: `-date`.",
                        "schema": {
                            "type": "string",
                            "default": "-date"
                        },
                        "example": "-date"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "hold, posted, or all. When omitted, drafts (status `hold`) are not listed. Allowed values: `hold`, `posted`, `all`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "hold",
                            "posted",
                            "all"
                        ],
                        "example": "hold"
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "quantity or cost. Allowed values: `quantity`, `cost`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "quantity",
                            "cost"
                        ],
                        "example": "quantity"
                    },
                    {
                        "name": "store_id",
                        "in": "query",
                        "required": false,
                        "description": "Only documents of this store.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "example": 1
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or after this day (YYYY-MM-DD).",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "required": false,
                        "description": "Only documents dated on or before this day (YYYY-MM-DD), the whole day included.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-01-31"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the adjustment number or the reason.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "Only records modified since this date (YYYY-MM-DD) or date and time (YYYY-MM-DDTHH:MM:SS).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-03-01T00:00:00"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AdjustmentList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 17,
                                            "number": "A1-17",
                                            "type": "quantity",
                                            "store_id": 1,
                                            "date": "2026-03-15T14:30:00",
                                            "status": "hold",
                                            "reason": "Stock count correction",
                                            "currency": "USD",
                                            "exchange_rate": 130.5,
                                            "total": 1250,
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/adjustments/{id}": {
            "get": {
                "tags": [
                    "Purchasing and stock"
                ],
                "operationId": "getAdjustment",
                "summary": "Get one adjustment",
                "description": "Returns one record by its identifier, with its lines. A record that does not exist, or that your client may not see (for example another store), answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "adjustments:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 17
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/AdjustmentDetail"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 17,
                                        "number": "A1-17",
                                        "type": "quantity",
                                        "store_id": 1,
                                        "date": "2026-03-15T14:30:00",
                                        "status": "hold",
                                        "reason": "Stock count correction",
                                        "currency": "USD",
                                        "exchange_rate": 130.5,
                                        "total": 1250,
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00",
                                        "lines": [
                                            {
                                                "id": 9001,
                                                "product_id": 463,
                                                "name": "Thermal paper roll 57x18m",
                                                "description": "Thermal paper roll for receipt printers",
                                                "unit": "Box of 100",
                                                "previous_quantity": 40,
                                                "new_quantity": 45,
                                                "quantity_difference": 5,
                                                "on_hand_quantity": 45,
                                                "average_cost": 92.5,
                                                "previous_cost": 88,
                                                "new_cost": 90,
                                                "cost_difference": 2
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/stores": {
            "get": {
                "tags": [
                    "Reference data"
                ],
                "operationId": "listStores",
                "summary": "List stores",
                "description": "The stores of the company. This is where you find the name and address behind a store_id seen in a document or in a stock. A client restricted to some stores only sees those.",
                "security": [
                    {
                        "oauth2": [
                            "reference:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `name`, `code`. Default: `name`.",
                        "schema": {
                            "type": "string",
                            "default": "name"
                        },
                        "example": "-name"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the store name or code.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/StoreList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 1,
                                            "code": "HQ",
                                            "name": "Main store",
                                            "address": "12 Rue Capois, Port-au-Prince",
                                            "manager": "Jean Baptiste",
                                            "phone": "+509 3700 0000",
                                            "phone2": "",
                                            "email": "main@example.com",
                                            "is_headquarters": true
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/stores/{id}": {
            "get": {
                "tags": [
                    "Reference data"
                ],
                "operationId": "getStore",
                "summary": "Get one store",
                "description": "Returns one record by its identifier. A record that does not exist, or that your client may not see, answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "reference:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 1
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Store"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 1,
                                        "code": "HQ",
                                        "name": "Main store",
                                        "address": "12 Rue Capois, Port-au-Prince",
                                        "manager": "Jean Baptiste",
                                        "phone": "+509 3700 0000",
                                        "phone2": "",
                                        "email": "main@example.com",
                                        "is_headquarters": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/departments": {
            "get": {
                "tags": [
                    "Reference data"
                ],
                "operationId": "listDepartments",
                "summary": "List product departments",
                "description": "The departments products are grouped in. A product refers to its department with department_id.",
                "security": [
                    {
                        "oauth2": [
                            "reference:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `name`, `code`. Default: `name`.",
                        "schema": {
                            "type": "string",
                            "default": "name"
                        },
                        "example": "-name"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the department name or code.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DepartmentList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 3,
                                            "code": "DEP-03",
                                            "name": "Office supplies",
                                            "manager": "Jean Baptiste"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/departments/{id}": {
            "get": {
                "tags": [
                    "Reference data"
                ],
                "operationId": "getDepartment",
                "summary": "Get one department",
                "description": "Returns one record by its identifier. A record that does not exist, or that your client may not see, answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "reference:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 3
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Department"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 3,
                                        "code": "DEP-03",
                                        "name": "Office supplies",
                                        "manager": "Jean Baptiste"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/sub-departments": {
            "get": {
                "tags": [
                    "Reference data"
                ],
                "operationId": "listSubDepartments",
                "summary": "List product sub-departments",
                "description": "The sub-departments products are grouped in. A product refers to its sub-department with sub_department_id.",
                "security": [
                    {
                        "oauth2": [
                            "reference:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `name`, `code`. Default: `name`.",
                        "schema": {
                            "type": "string",
                            "default": "name"
                        },
                        "example": "-name"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the sub-department name or code.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SubDepartmentList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 21,
                                            "code": "SUB-21",
                                            "name": "Paper",
                                            "manager": "Jean Baptiste"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/sub-departments/{id}": {
            "get": {
                "tags": [
                    "Reference data"
                ],
                "operationId": "getSubDepartment",
                "summary": "Get one sub-department",
                "description": "Returns one record by its identifier. A record that does not exist, or that your client may not see, answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "reference:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 21
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SubDepartment"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 21,
                                        "code": "SUB-21",
                                        "name": "Paper",
                                        "manager": "Jean Baptiste"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/price-lists": {
            "get": {
                "tags": [
                    "Reference data"
                ],
                "operationId": "listPriceLists",
                "summary": "List price lists",
                "description": "The price lists (for example Retail, Distributor). The identifier is the number of the price level of a product (price_lists[].price_list_id) and the price list of a customer (price_list_id). A client restricted to one price list only sees that one.",
                "security": [
                    {
                        "oauth2": [
                            "reference:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `name`. Default: `id`.",
                        "schema": {
                            "type": "string",
                            "default": "id"
                        },
                        "example": "-name"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "active or inactive. Allowed values: `active`, `inactive`.",
                        "schema": {
                            "type": "string"
                        },
                        "x-allowed-values": [
                            "active",
                            "inactive"
                        ],
                        "example": "active"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PriceListList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 1,
                                            "name": "Retail",
                                            "status": "active",
                                            "created_at": "2026-03-15T14:30:00",
                                            "updated_at": "2026-03-15T14:30:00"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/price-lists/{id}": {
            "get": {
                "tags": [
                    "Reference data"
                ],
                "operationId": "getPriceList",
                "summary": "Get one price list",
                "description": "Returns one record by its identifier. A record that does not exist, or that your client may not see, answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "reference:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 1
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PriceList"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 1,
                                        "name": "Retail",
                                        "status": "active",
                                        "created_at": "2026-03-15T14:30:00",
                                        "updated_at": "2026-03-15T14:30:00"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/customer-types": {
            "get": {
                "tags": [
                    "Reference data"
                ],
                "operationId": "listCustomerTypes",
                "summary": "List customer types",
                "description": "The customer types. A customer refers to its type with customer_type_id.",
                "security": [
                    {
                        "oauth2": [
                            "reference:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/page"
                    },
                    {
                        "$ref": "#/components/parameters/per_page"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "Sort fields, separated by commas, with `-` in front for descending order. Up to 3 fields. Sortable fields: `id`, `name`. Default: `name`.",
                        "schema": {
                            "type": "string",
                            "default": "name"
                        },
                        "example": "-name"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Text contained in the customer type name or code.",
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        },
                        "example": "paper"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of results.",
                        "headers": {
                            "X-Total-Count": {
                                "description": "Total number of results, all pages included.",
                                "schema": {
                                    "type": "integer"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CustomerTypeList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 2,
                                            "code": "WHS",
                                            "name": "Wholesale"
                                        }
                                    ],
                                    "meta": {
                                        "page": 1,
                                        "per_page": 25,
                                        "total": 1,
                                        "total_pages": 1
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/InvalidParameter"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/customer-types/{id}": {
            "get": {
                "tags": [
                    "Reference data"
                ],
                "operationId": "getCustomerType",
                "summary": "Get one customer type",
                "description": "Returns one record by its identifier. A record that does not exist, or that your client may not see, answers 404.",
                "security": [
                    {
                        "oauth2": [
                            "reference:read"
                        ]
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Identifier of the record, as returned in the `id` field of the list.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        },
                        "example": 2
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The record.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/CustomerType"
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "id": 2,
                                        "code": "WHS",
                                        "name": "Wholesale"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "oauth2": {
                "type": "oauth2",
                "description": "OAuth 2.0 client credentials. Exchange your access key (client_id) and security code (client_secret) for a token at POST /auth/token, then send it as `Authorization: Bearer <token>`.",
                "flows": {
                    "clientCredentials": {
                        "tokenUrl": "https://your-company.evyooht.com/api/v1/auth/token",
                        "scopes": {
                            "products:read": "Read the product catalog: prices and stock per store.",
                            "customers:read": "Read customers: contact details, type and price list.",
                            "vendors:read": "Read vendors.",
                            "quotes:read": "Read quotes and their lines.",
                            "sales-orders:read": "Read sales orders, their lines and payments.",
                            "invoices:read": "Read invoices, their lines and payments.",
                            "credit-memos:read": "Read credit memos and their lines.",
                            "payments:read": "Read payments received from customers.",
                            "purchase-orders:read": "Read purchase orders sent to vendors, and their lines.",
                            "receivings:read": "Read goods receivings and vendor returns, and their lines.",
                            "transfers:read": "Read stock transfers between stores.",
                            "adjustments:read": "Read quantity and cost adjustments.",
                            "reference:read": "Read reference data: stores, departments, sub-departments, price lists and customer types.",
                            "costs:read": "Add-on. Reveals cost fields (purchase cost, average cost, cost of sales documents) in responses you can already read.",
                            "customers:financial": "Add-on. Reveals the credit limit and the balance of customers."
                        }
                    }
                }
            }
        },
        "parameters": {
            "page": {
                "name": "page",
                "in": "query",
                "required": false,
                "description": "Page number, starting at 1. A page beyond the data is empty, not an error. At most 10000 pages: filter instead of paging deeper.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "default": 1
                }
            },
            "per_page": {
                "name": "per_page",
                "in": "query",
                "required": false,
                "description": "Results per page, from 1 to 100.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 25
                }
            }
        },
        "responses": {
            "InvalidParameter": {
                "description": "A query parameter is invalid or unknown. Every fault is reported at once in `error.details`. Nothing is ignored silently.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "invalid_parameter",
                                "message": "One or more query parameters are invalid.",
                                "request_id": "81c82f5c6e2eb5aa",
                                "details": [
                                    {
                                        "parameter": "per_page",
                                        "message": "An integer between 1 and 100 is expected."
                                    },
                                    {
                                        "parameter": "stauts",
                                        "message": "Unknown parameter."
                                    }
                                ]
                            }
                        }
                    }
                }
            },
            "Unauthorized": {
                "description": "The token is missing, malformed, expired or revoked (`missing_token` or `invalid_token`). Ask for a new token.",
                "headers": {
                    "WWW-Authenticate": {
                        "schema": {
                            "type": "string"
                        }
                    }
                },
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "invalid_token",
                                "message": "The access token is invalid or has expired. Request a new one from POST /api/v1/auth/token.",
                                "request_id": "81c82f5c6e2eb5aa"
                            }
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "Your token does not carry the permission this route needs (`insufficient_scope`), or the request was not made over HTTPS (`https_required`).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "insufficient_scope",
                                "message": "This token does not carry the required permission: invoices:read",
                                "request_id": "81c82f5c6e2eb5aa"
                            }
                        }
                    }
                }
            },
            "NotFound": {
                "description": "No record with this identifier, or a record your client may not see (for example another store).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "not_found",
                                "message": "Resource not found.",
                                "request_id": "81c82f5c6e2eb5aa"
                            }
                        }
                    }
                }
            },
            "RateLimited": {
                "description": "Too many requests this minute. Wait for the number of seconds in the `Retry-After` header.",
                "headers": {
                    "Retry-After": {
                        "schema": {
                            "type": "integer"
                        }
                    }
                },
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "rate_limited",
                                "message": "Too many requests. Retry in 42 seconds.",
                                "request_id": "81c82f5c6e2eb5aa"
                            }
                        }
                    }
                }
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message",
                            "request_id"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "description": "Stable code, meant for programs.",
                                "example": "invalid_parameter"
                            },
                            "message": {
                                "type": "string",
                                "description": "Human-readable explanation."
                            },
                            "request_id": {
                                "type": "string",
                                "description": "Quote it to the support: it finds the exact line in the server log.",
                                "example": "81c82f5c6e2eb5aa"
                            },
                            "details": {
                                "type": "array",
                                "description": "One entry per faulty query parameter (400 only).",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "parameter": {
                                            "type": "string",
                                            "example": "per_page"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "An integer between 1 and 100 is expected."
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "OAuthError": {
                "type": "object",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "string",
                        "example": "invalid_client"
                    },
                    "error_description": {
                        "type": "string",
                        "example": "Client authentication failed."
                    },
                    "request_id": {
                        "type": "string",
                        "example": "81c82f5c6e2eb5aa"
                    }
                }
            },
            "TokenRequest": {
                "type": "object",
                "required": [
                    "grant_type",
                    "client_id",
                    "client_secret"
                ],
                "properties": {
                    "grant_type": {
                        "type": "string",
                        "enum": [
                            "client_credentials"
                        ],
                        "description": "Always `client_credentials`."
                    },
                    "client_id": {
                        "type": "string",
                        "description": "Your access key (starts with `evy_ak_`).",
                        "example": "evy_ak_5719348562fb66e05a7e"
                    },
                    "client_secret": {
                        "type": "string",
                        "description": "Your security code (starts with `evy_sk_`).",
                        "example": "evy_sk_0000000000000000000000000000000000000000000000"
                    },
                    "scope": {
                        "type": "string",
                        "description": "Optional. Permissions wanted, separated by spaces: a subset of the ones of your client. Omitted: all of them.",
                        "example": "products:read invoices:read"
                    }
                }
            },
            "Token": {
                "type": "object",
                "required": [
                    "access_token",
                    "token_type",
                    "expires_in",
                    "scope"
                ],
                "properties": {
                    "access_token": {
                        "type": "string",
                        "description": "The token. Send it as `Authorization: Bearer <token>`.",
                        "example": "evy_at_0000000000000000000000000000000000000000000000000000000000000000"
                    },
                    "token_type": {
                        "type": "string",
                        "example": "Bearer"
                    },
                    "expires_in": {
                        "type": "integer",
                        "description": "Lifetime in seconds.",
                        "example": 900
                    },
                    "scope": {
                        "type": "string",
                        "description": "The permissions of this token.",
                        "example": "products:read invoices:read"
                    }
                }
            },
            "Status": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "example": "ok"
                    },
                    "api": {
                        "type": "string",
                        "example": "v1"
                    },
                    "enabled": {
                        "type": "boolean",
                        "description": "False when your company has not subscribed to the API.",
                        "example": true
                    },
                    "authorization_header_received": {
                        "type": "boolean",
                        "description": "True when an Authorization header reached the server.",
                        "example": true
                    },
                    "https": {
                        "type": "boolean",
                        "description": "What the server concluded about the connection.",
                        "example": true
                    },
                    "time": {
                        "type": "string",
                        "description": "Server time (UTC, ISO 8601).",
                        "example": "2026-03-15T14:30:00+00:00"
                    }
                }
            },
            "Ping": {
                "type": "object",
                "properties": {
                    "ok": {
                        "type": "boolean",
                        "example": true
                    },
                    "client": {
                        "type": "string",
                        "description": "Name of your client.",
                        "example": "Web shop"
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "The permissions of this token.",
                        "example": [
                            "products:read",
                            "invoices:read"
                        ]
                    }
                }
            },
            "ResourceCatalog": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string",
                                    "example": "invoices"
                                },
                                "path": {
                                    "type": "string",
                                    "example": "/api/v1/invoices"
                                },
                                "detail_path": {
                                    "type": "string",
                                    "example": "/api/v1/invoices/{id}"
                                },
                                "scope": {
                                    "type": "string",
                                    "example": "invoices:read"
                                },
                                "fields": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                },
                                "filters": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                },
                                "sort": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "default_sort": {
                                    "type": "string",
                                    "example": "-date"
                                },
                                "relations": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "ListMeta": {
                "type": "object",
                "required": [
                    "page",
                    "per_page",
                    "total",
                    "total_pages"
                ],
                "properties": {
                    "page": {
                        "type": "integer",
                        "example": 1
                    },
                    "per_page": {
                        "type": "integer",
                        "example": 25
                    },
                    "total": {
                        "type": "integer",
                        "description": "Total number of results, all pages included.",
                        "example": 69
                    },
                    "total_pages": {
                        "type": "integer",
                        "example": 3
                    }
                }
            },
            "Product": {
                "type": "object",
                "required": [
                    "id",
                    "code",
                    "barcode",
                    "name",
                    "description",
                    "type",
                    "status",
                    "size",
                    "attribute",
                    "department_id",
                    "department",
                    "sub_department_id",
                    "sub_department",
                    "unit",
                    "second_unit",
                    "vendor_id",
                    "reorder_point",
                    "currency",
                    "created_at",
                    "updated_at",
                    "quantity_total",
                    "on_sales_order",
                    "on_purchase_order",
                    "price",
                    "second_unit_price",
                    "price_lists",
                    "stock"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 463
                    },
                    "code": {
                        "type": "string",
                        "nullable": true,
                        "description": "Product code (item code).",
                        "example": "PRD-0463"
                    },
                    "barcode": {
                        "type": "string",
                        "nullable": true,
                        "description": "Barcode, when one is recorded.",
                        "example": "6291041500213"
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Product name.",
                        "example": "Thermal paper roll 57x18m"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true,
                        "description": "Product description.",
                        "example": "Thermal paper roll for receipt printers"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "inventory",
                            "service",
                            "assembly",
                            "special"
                        ],
                        "nullable": true,
                        "description": "Kind of item. inventory: stocked product. service: not stocked. assembly: built from other products. special: special item.",
                        "example": "inventory"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "inactive"
                        ],
                        "nullable": true,
                        "description": "active or inactive.",
                        "example": "active"
                    },
                    "size": {
                        "type": "string",
                        "nullable": true,
                        "description": "Size, when recorded.",
                        "example": ""
                    },
                    "attribute": {
                        "type": "string",
                        "nullable": true,
                        "description": "Free attribute (color, variant…), when recorded.",
                        "example": ""
                    },
                    "department_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the department (see the departments resource).",
                        "example": 3
                    },
                    "department": {
                        "type": "string",
                        "nullable": true,
                        "description": "Name of the department.",
                        "example": "Office supplies"
                    },
                    "sub_department_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the sub-department (see the sub-departments resource).",
                        "example": 21
                    },
                    "sub_department": {
                        "type": "string",
                        "nullable": true,
                        "description": "Name of the sub-department.",
                        "example": "Paper"
                    },
                    "unit": {
                        "type": "string",
                        "nullable": true,
                        "description": "Main unit of sale (for example Box of 100).",
                        "example": "Box of 100"
                    },
                    "second_unit": {
                        "type": "string",
                        "nullable": true,
                        "description": "Second unit of sale, when the product can be sold in two units.",
                        "example": "Box of 200"
                    },
                    "vendor_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the usual vendor. 0 when none.",
                        "example": 12
                    },
                    "reorder_point": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Stock level under which the product should be reordered.",
                        "example": 20
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency of the product prices, when recorded.",
                        "example": "USD"
                    },
                    "cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Last purchase cost. Requires costs:read.",
                        "example": 90
                    },
                    "average_cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Weighted average cost. Requires costs:read.",
                        "example": 92.5
                    },
                    "order_cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Cost used on purchase orders. Requires costs:read.",
                        "example": 90
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    },
                    "quantity_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity in stock. For a client restricted to some stores, the sum of those stores only.",
                        "example": 12
                    },
                    "on_sales_order": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity reserved on open sales orders (same restriction as quantity_total).",
                        "example": 4
                    },
                    "on_purchase_order": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity expected on open purchase orders (same restriction as quantity_total).",
                        "example": 0
                    },
                    "price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Selling price applicable to your client.",
                        "example": 125
                    },
                    "second_unit_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Selling price of the second unit applicable to your client.",
                        "example": 250
                    },
                    "price_lists": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "price_list_id": {
                                    "type": "integer",
                                    "description": "Identifier of the price list (see the price-lists resource)."
                                },
                                "price": {
                                    "type": "number",
                                    "description": "Selling price in this list."
                                },
                                "second_unit_price": {
                                    "type": "number",
                                    "description": "Selling price of the second unit in this list."
                                }
                            }
                        },
                        "description": "Price of each price list. Absent when your client is restricted to one price list.",
                        "example": [
                            {
                                "price_list_id": 1,
                                "price": 125,
                                "second_unit_price": 250
                            },
                            {
                                "price_list_id": 2,
                                "price": 118,
                                "second_unit_price": 236
                            }
                        ]
                    },
                    "stock": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "store_id": {
                                    "type": "integer",
                                    "description": "Identifier of the store."
                                },
                                "quantity": {
                                    "type": "number",
                                    "description": "Quantity in stock in this store."
                                },
                                "on_sales_order": {
                                    "type": "number",
                                    "description": "Quantity reserved on open sales orders in this store."
                                },
                                "on_purchase_order": {
                                    "type": "number",
                                    "description": "Quantity expected on open purchase orders in this store."
                                }
                            }
                        },
                        "description": "Stock per store, limited to the stores your client may see.",
                        "example": [
                            {
                                "store_id": 1,
                                "quantity": 8,
                                "on_sales_order": 3,
                                "on_purchase_order": 0
                            },
                            {
                                "store_id": 2,
                                "quantity": 4,
                                "on_sales_order": 1,
                                "on_purchase_order": 0
                            }
                        ]
                    }
                }
            },
            "ProductList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Product"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "Customer": {
                "type": "object",
                "required": [
                    "id",
                    "code",
                    "name",
                    "first_name",
                    "last_name",
                    "company_name",
                    "alt_name",
                    "phone",
                    "phone2",
                    "email",
                    "address",
                    "city",
                    "zip",
                    "currency",
                    "payment_term",
                    "status",
                    "customer_type_id",
                    "customer_type",
                    "price_list_id",
                    "discount_level",
                    "discount_type",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 58
                    },
                    "code": {
                        "type": "string",
                        "nullable": true,
                        "description": "Customer code.",
                        "example": "CUS-0058"
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Full name, as displayed in the screens.",
                        "example": "Marie Dupont"
                    },
                    "first_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "First name.",
                        "example": "Marie"
                    },
                    "last_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Last name.",
                        "example": "Dupont"
                    },
                    "company_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Company name.",
                        "example": ""
                    },
                    "alt_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Alternative name.",
                        "example": ""
                    },
                    "phone": {
                        "type": "string",
                        "nullable": true,
                        "description": "Main phone number.",
                        "example": "+509 3700 0000"
                    },
                    "phone2": {
                        "type": "string",
                        "nullable": true,
                        "description": "Second phone number.",
                        "example": ""
                    },
                    "email": {
                        "type": "string",
                        "nullable": true,
                        "description": "E-mail address. May contain several addresses.",
                        "example": "contact@example.com"
                    },
                    "address": {
                        "type": "string",
                        "nullable": true,
                        "description": "Street address.",
                        "example": "12 Rue Capois"
                    },
                    "city": {
                        "type": "string",
                        "nullable": true,
                        "description": "City.",
                        "example": "Port-au-Prince"
                    },
                    "zip": {
                        "type": "string",
                        "nullable": true,
                        "description": "Postal code.",
                        "example": "HT6110"
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Preferred currency.",
                        "example": "USD"
                    },
                    "payment_term": {
                        "type": "string",
                        "nullable": true,
                        "description": "Payment term.",
                        "example": "Net 30"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "inactive"
                        ],
                        "nullable": true,
                        "description": "active or inactive.",
                        "example": "active"
                    },
                    "customer_type_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the customer type (see the customer-types resource).",
                        "example": 2
                    },
                    "customer_type": {
                        "type": "string",
                        "nullable": true,
                        "description": "Name of the customer type.",
                        "example": "Wholesale"
                    },
                    "price_list_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the price list applied to this customer.",
                        "example": 1
                    },
                    "discount_level": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Discount level granted to this customer.",
                        "example": 0
                    },
                    "discount_type": {
                        "type": "string",
                        "nullable": true,
                        "description": "Kind of discount.",
                        "example": ""
                    },
                    "credit_limit": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "customers:financial",
                        "description": "Credit limit. Requires customers:financial.",
                        "example": 5000
                    },
                    "balance": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "customers:financial",
                        "description": "Current account balance. Requires customers:financial.",
                        "example": 320
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "CustomerList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Customer"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "Vendor": {
                "type": "object",
                "required": [
                    "id",
                    "code",
                    "name",
                    "contact_first_name",
                    "contact_last_name",
                    "other_contact",
                    "phone",
                    "phone2",
                    "email",
                    "website",
                    "address",
                    "city",
                    "zip",
                    "country",
                    "currency",
                    "status",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 12
                    },
                    "code": {
                        "type": "string",
                        "nullable": true,
                        "description": "Vendor code.",
                        "example": "VND-0012"
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Company name.",
                        "example": "Papeterie Delmas"
                    },
                    "contact_first_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "First name of the contact person.",
                        "example": "Paul"
                    },
                    "contact_last_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Last name of the contact person.",
                        "example": "Delmas"
                    },
                    "other_contact": {
                        "type": "string",
                        "nullable": true,
                        "description": "Other contact information.",
                        "example": ""
                    },
                    "phone": {
                        "type": "string",
                        "nullable": true,
                        "description": "Main phone number.",
                        "example": "+509 3700 0000"
                    },
                    "phone2": {
                        "type": "string",
                        "nullable": true,
                        "description": "Second phone number.",
                        "example": ""
                    },
                    "email": {
                        "type": "string",
                        "nullable": true,
                        "description": "E-mail address.",
                        "example": "contact@example.com"
                    },
                    "website": {
                        "type": "string",
                        "nullable": true,
                        "description": "Web site.",
                        "example": "https://www.example.com"
                    },
                    "address": {
                        "type": "string",
                        "nullable": true,
                        "description": "Street address.",
                        "example": "12 Rue Capois"
                    },
                    "city": {
                        "type": "string",
                        "nullable": true,
                        "description": "City.",
                        "example": "Port-au-Prince"
                    },
                    "zip": {
                        "type": "string",
                        "nullable": true,
                        "description": "Postal code.",
                        "example": "HT6110"
                    },
                    "country": {
                        "type": "string",
                        "nullable": true,
                        "description": "Country.",
                        "example": "Haiti"
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency used with this vendor.",
                        "example": "USD"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "inactive"
                        ],
                        "nullable": true,
                        "description": "active or inactive.",
                        "example": "active"
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "VendorList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Vendor"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "Quote": {
                "type": "object",
                "required": [
                    "id",
                    "number",
                    "store_id",
                    "date",
                    "customer_id",
                    "customer_name",
                    "status",
                    "payment_type",
                    "currency",
                    "exchange_rate",
                    "quantity_total",
                    "items_total",
                    "tax",
                    "discount_percent",
                    "discount_amount",
                    "shipping",
                    "total",
                    "ship_to_name",
                    "ship_to_address",
                    "ship_to_phone",
                    "notes",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 1087
                    },
                    "number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Human-readable document number, for example I1-4149.",
                        "example": "Q1-1087"
                    },
                    "store_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the store that owns the document (see the stores resource).",
                        "example": 1
                    },
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Document date and time (store local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "customer_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the customer (see the customers resource).",
                        "example": 58
                    },
                    "customer_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Full name of the customer.",
                        "example": "Marie Dupont"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "hold",
                            "open",
                            "converted",
                            "void"
                        ],
                        "nullable": true,
                        "description": "hold, open, converted or void.",
                        "example": "hold"
                    },
                    "payment_type": {
                        "type": "string",
                        "nullable": true,
                        "description": "Payment type chosen on the quote.",
                        "example": "Cash"
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency of the document: USD or HTG.",
                        "example": "USD"
                    },
                    "exchange_rate": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Exchange rate between USD and HTG recorded on the document.",
                        "example": 130.5
                    },
                    "quantity_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Total quantity of items on the document.",
                        "example": 12
                    },
                    "items_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Sum of the item amounts, before discount, tax and shipping. The document totals are the reference: lines carry facts, not computed line totals.",
                        "example": 1250
                    },
                    "tax": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Tax amount.",
                        "example": 0
                    },
                    "discount_percent": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Discount, as a percentage.",
                        "example": 0
                    },
                    "discount_amount": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Discount amount.",
                        "example": 0
                    },
                    "shipping": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Shipping and transport charges.",
                        "example": 0
                    },
                    "total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Grand total of the document. Zero when the document is void.",
                        "example": 1250
                    },
                    "ship_to_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Name to ship to.",
                        "example": "Marie Dupont"
                    },
                    "ship_to_address": {
                        "type": "string",
                        "nullable": true,
                        "description": "Delivery address.",
                        "example": "12 Rue Capois, Port-au-Prince"
                    },
                    "ship_to_phone": {
                        "type": "string",
                        "nullable": true,
                        "description": "Delivery phone number.",
                        "example": "+509 3700 0000"
                    },
                    "notes": {
                        "type": "string",
                        "nullable": true,
                        "description": "Free-text notes printed on the document.",
                        "example": "Delivered on Friday."
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "QuoteList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Quote"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "QuoteLine": {
                "type": "object",
                "required": [
                    "id",
                    "product_id",
                    "name",
                    "description",
                    "type",
                    "quantity",
                    "unit",
                    "unit_price",
                    "base_quantity",
                    "base_unit_price"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Identifier of the line.",
                        "example": 9001
                    },
                    "product_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the product. 0 for a free-text line.",
                        "example": 463
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item name as printed on the document.",
                        "example": "Thermal paper roll 57x18m"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item description as printed on the document.",
                        "example": "Thermal paper roll for receipt printers"
                    },
                    "type": {
                        "type": "string",
                        "nullable": true,
                        "description": "Kind of item: Inventory, Service or Special.",
                        "example": "Inventory"
                    },
                    "quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity, in the unit shown in unit.",
                        "example": 10
                    },
                    "unit": {
                        "type": "string",
                        "nullable": true,
                        "description": "Unit of the line (for example Box of 100).",
                        "example": "Box of 100"
                    },
                    "unit_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Price of one unit. Zero when the document is void.",
                        "example": 125
                    },
                    "base_quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity expressed in the base unit of the product.",
                        "example": 1000
                    },
                    "base_unit_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Price of one base unit. Zero when the document is void.",
                        "example": 1.25
                    },
                    "cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Cost of the line. Requires costs:read. Zero when the document is void.",
                        "example": 90
                    }
                }
            },
            "QuoteDetail": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Quote"
                    },
                    {
                        "type": "object",
                        "required": [
                            "lines"
                        ],
                        "properties": {
                            "lines": {
                                "type": "array",
                                "description": "The lines of the quote.",
                                "items": {
                                    "$ref": "#/components/schemas/QuoteLine"
                                }
                            }
                        }
                    }
                ]
            },
            "SalesOrder": {
                "type": "object",
                "required": [
                    "id",
                    "number",
                    "store_id",
                    "date",
                    "customer_id",
                    "customer_name",
                    "status",
                    "payment_type",
                    "currency",
                    "exchange_rate",
                    "quantity_total",
                    "items_total",
                    "tax",
                    "discount_percent",
                    "discount_amount",
                    "shipping",
                    "total",
                    "amount_paid",
                    "quote_number",
                    "ship_to_name",
                    "ship_to_address",
                    "ship_to_phone",
                    "notes",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 312
                    },
                    "number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Human-readable document number, for example I1-4149.",
                        "example": "S1-312"
                    },
                    "store_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the store that owns the document (see the stores resource).",
                        "example": 1
                    },
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Document date and time (store local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "customer_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the customer (see the customers resource).",
                        "example": 58
                    },
                    "customer_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Full name of the customer.",
                        "example": "Marie Dupont"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "open",
                            "hold",
                            "converted",
                            "refunded",
                            "closed"
                        ],
                        "nullable": true,
                        "description": "new, open, hold, converted, refunded or closed.",
                        "example": "new"
                    },
                    "payment_type": {
                        "type": "string",
                        "nullable": true,
                        "description": "How the document is paid, as recorded at sale time (for example Cash, Account).",
                        "example": "Cash"
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency of the document: USD or HTG.",
                        "example": "USD"
                    },
                    "exchange_rate": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Exchange rate between USD and HTG recorded on the document.",
                        "example": 130.5
                    },
                    "quantity_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Total quantity of items on the document.",
                        "example": 12
                    },
                    "items_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Sum of the item amounts, before discount, tax and shipping. The document totals are the reference: lines carry facts, not computed line totals.",
                        "example": 1250
                    },
                    "tax": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Tax amount.",
                        "example": 0
                    },
                    "discount_percent": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Discount, as a percentage.",
                        "example": 0
                    },
                    "discount_amount": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Discount amount.",
                        "example": 0
                    },
                    "shipping": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Shipping and transport charges.",
                        "example": 0
                    },
                    "total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Grand total of the document. Zero when the document is void.",
                        "example": 1250
                    },
                    "amount_paid": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount already paid on the document.",
                        "example": 1250
                    },
                    "cost_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Total cost of the order. Requires costs:read.",
                        "example": 900
                    },
                    "quote_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Number of the quote this order comes from, when there is one.",
                        "example": "Q1-1087"
                    },
                    "ship_to_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Name of the person or company to ship to.",
                        "example": "Marie Dupont"
                    },
                    "ship_to_address": {
                        "type": "string",
                        "nullable": true,
                        "description": "Delivery address.",
                        "example": "12 Rue Capois, Port-au-Prince"
                    },
                    "ship_to_phone": {
                        "type": "string",
                        "nullable": true,
                        "description": "Delivery phone number.",
                        "example": "+509 3700 0000"
                    },
                    "notes": {
                        "type": "string",
                        "nullable": true,
                        "description": "Free-text notes printed on the document.",
                        "example": "Delivered on Friday."
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "SalesOrderList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SalesOrder"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "SalesOrderLine": {
                "type": "object",
                "required": [
                    "id",
                    "product_id",
                    "name",
                    "description",
                    "type",
                    "quantity",
                    "delivered_quantity",
                    "unit",
                    "unit_price",
                    "base_quantity",
                    "base_unit_price"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Identifier of the line.",
                        "example": 9001
                    },
                    "product_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the product. 0 for a free-text line.",
                        "example": 463
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item name as printed on the document.",
                        "example": "Thermal paper roll 57x18m"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item description as printed on the document.",
                        "example": "Thermal paper roll for receipt printers"
                    },
                    "type": {
                        "type": "string",
                        "nullable": true,
                        "description": "Kind of item: Inventory, Service or Special.",
                        "example": "Inventory"
                    },
                    "quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity ordered, in the unit shown in unit.",
                        "example": 10
                    },
                    "delivered_quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity already delivered.",
                        "example": 10
                    },
                    "unit": {
                        "type": "string",
                        "nullable": true,
                        "description": "Unit of the line.",
                        "example": "Box of 100"
                    },
                    "unit_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Price of one unit.",
                        "example": 125
                    },
                    "base_quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity expressed in the base unit of the product.",
                        "example": 1000
                    },
                    "base_unit_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Price of one base unit.",
                        "example": 1.25
                    },
                    "cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Cost of the line. Requires costs:read.",
                        "example": 90
                    }
                }
            },
            "SalesOrderPayment": {
                "type": "object",
                "required": [
                    "date",
                    "cash",
                    "card",
                    "cheque",
                    "cheque_number",
                    "currency",
                    "exchange_rate",
                    "notes"
                ],
                "properties": {
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Date and time of the payment.",
                        "example": "2026-03-15T14:30:00"
                    },
                    "cash": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount paid in cash.",
                        "example": 1250
                    },
                    "card": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount paid by debit or credit card.",
                        "example": 0
                    },
                    "cheque": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount paid by cheque.",
                        "example": 0
                    },
                    "cheque_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Cheque number.",
                        "example": ""
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency of the payment.",
                        "example": "USD"
                    },
                    "exchange_rate": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Exchange rate recorded on the payment.",
                        "example": 130.5
                    },
                    "notes": {
                        "type": "string",
                        "nullable": true,
                        "description": "Notes.",
                        "example": "Delivered on Friday."
                    }
                }
            },
            "SalesOrderDetail": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/SalesOrder"
                    },
                    {
                        "type": "object",
                        "required": [
                            "lines",
                            "payments"
                        ],
                        "properties": {
                            "lines": {
                                "type": "array",
                                "description": "The lines of the order.",
                                "items": {
                                    "$ref": "#/components/schemas/SalesOrderLine"
                                }
                            },
                            "payments": {
                                "type": "array",
                                "description": "Payments recorded on the order (deposits).",
                                "items": {
                                    "$ref": "#/components/schemas/SalesOrderPayment"
                                }
                            }
                        }
                    }
                ]
            },
            "Invoice": {
                "type": "object",
                "required": [
                    "id",
                    "number",
                    "store_id",
                    "date",
                    "customer_id",
                    "customer_name",
                    "status",
                    "payment_status",
                    "payment_type",
                    "currency",
                    "exchange_rate",
                    "quantity_total",
                    "items_total",
                    "tax",
                    "discount_percent",
                    "discount_amount",
                    "shipping",
                    "total",
                    "amount_paid",
                    "deposit",
                    "po_number",
                    "quote_number",
                    "sales_order_number",
                    "notes",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 4149
                    },
                    "number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Human-readable document number, for example I1-4149.",
                        "example": "I1-4149"
                    },
                    "store_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the store that owns the document (see the stores resource).",
                        "example": 1
                    },
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Document date and time (store local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "customer_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the customer (see the customers resource).",
                        "example": 58
                    },
                    "customer_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Full name of the customer.",
                        "example": "Marie Dupont"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "open",
                            "hold",
                            "regular",
                            "void"
                        ],
                        "nullable": true,
                        "description": "new, open, hold, regular or void.",
                        "example": "new"
                    },
                    "payment_status": {
                        "type": "string",
                        "enum": [
                            "paid",
                            "unpaid"
                        ],
                        "nullable": true,
                        "description": "paid or unpaid.",
                        "example": "paid"
                    },
                    "payment_type": {
                        "type": "string",
                        "nullable": true,
                        "description": "How the document is paid, as recorded at sale time (for example Cash, Account).",
                        "example": "Cash"
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency of the document: USD or HTG.",
                        "example": "USD"
                    },
                    "exchange_rate": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Exchange rate between USD and HTG recorded on the document.",
                        "example": 130.5
                    },
                    "quantity_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Total quantity of items on the document.",
                        "example": 12
                    },
                    "items_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Sum of the item amounts, before discount, tax and shipping. The document totals are the reference: lines carry facts, not computed line totals.",
                        "example": 1250
                    },
                    "tax": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Tax amount.",
                        "example": 0
                    },
                    "discount_percent": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Discount, as a percentage.",
                        "example": 0
                    },
                    "discount_amount": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Discount amount.",
                        "example": 0
                    },
                    "shipping": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Shipping and transport charges.",
                        "example": 0
                    },
                    "total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Grand total of the document. Zero when the document is void.",
                        "example": 1250
                    },
                    "amount_paid": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount already paid on the document.",
                        "example": 1250
                    },
                    "deposit": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Deposit paid.",
                        "example": 0
                    },
                    "cost_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Cost of goods sold. Requires costs:read.",
                        "example": 900
                    },
                    "po_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Customer purchase order number, when recorded.",
                        "example": "PO-7781"
                    },
                    "quote_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Number of the quote this invoice comes from, when there is one.",
                        "example": "Q1-1087"
                    },
                    "sales_order_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Number of the sales order this invoice comes from, when there is one.",
                        "example": "S1-312"
                    },
                    "notes": {
                        "type": "string",
                        "nullable": true,
                        "description": "Free-text notes printed on the document.",
                        "example": "Delivered on Friday."
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "InvoiceList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Invoice"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "InvoiceLine": {
                "type": "object",
                "required": [
                    "id",
                    "product_id",
                    "name",
                    "description",
                    "type",
                    "quantity",
                    "unit",
                    "unit_price",
                    "base_quantity",
                    "base_unit_price"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Identifier of the line.",
                        "example": 9001
                    },
                    "product_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the product. 0 for a free-text line.",
                        "example": 463
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item name as printed on the document.",
                        "example": "Thermal paper roll 57x18m"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item description as printed on the document.",
                        "example": "Thermal paper roll for receipt printers"
                    },
                    "type": {
                        "type": "string",
                        "nullable": true,
                        "description": "Kind of item: Inventory, Service or Special.",
                        "example": "Inventory"
                    },
                    "quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity sold, in the unit shown in unit.",
                        "example": 10
                    },
                    "unit": {
                        "type": "string",
                        "nullable": true,
                        "description": "Unit of the line (for example Box of 100).",
                        "example": "Box of 100"
                    },
                    "unit_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Price of one unit. Zero when the invoice is void.",
                        "example": 125
                    },
                    "base_quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity expressed in the base unit of the product.",
                        "example": 1000
                    },
                    "base_unit_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Price of one base unit. Zero when the invoice is void.",
                        "example": 1.25
                    },
                    "cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Cost of the line. Requires costs:read. Zero when the invoice is void.",
                        "example": 90
                    }
                }
            },
            "InvoicePayment": {
                "type": "object",
                "required": [
                    "date",
                    "cash",
                    "card",
                    "cheque",
                    "cheque_number",
                    "account",
                    "deposit",
                    "currency",
                    "exchange_rate"
                ],
                "properties": {
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Date and time of the payment.",
                        "example": "2026-03-15T14:30:00"
                    },
                    "cash": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount paid in cash.",
                        "example": 1250
                    },
                    "card": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount paid by debit or credit card.",
                        "example": 0
                    },
                    "cheque": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount paid by cheque.",
                        "example": 0
                    },
                    "cheque_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Cheque number.",
                        "example": ""
                    },
                    "account": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount charged to the customer account.",
                        "example": 0
                    },
                    "deposit": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Deposit applied.",
                        "example": 0
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency of the payment.",
                        "example": "USD"
                    },
                    "exchange_rate": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Exchange rate recorded on the payment.",
                        "example": 130.5
                    }
                }
            },
            "InvoiceDetail": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Invoice"
                    },
                    {
                        "type": "object",
                        "required": [
                            "lines",
                            "payments"
                        ],
                        "properties": {
                            "lines": {
                                "type": "array",
                                "description": "The lines of the invoice.",
                                "items": {
                                    "$ref": "#/components/schemas/InvoiceLine"
                                }
                            },
                            "payments": {
                                "type": "array",
                                "description": "How the invoice was paid at the counter.",
                                "items": {
                                    "$ref": "#/components/schemas/InvoicePayment"
                                }
                            }
                        }
                    }
                ]
            },
            "CreditMemo": {
                "type": "object",
                "required": [
                    "id",
                    "number",
                    "store_id",
                    "date",
                    "customer_id",
                    "customer_name",
                    "status",
                    "payment_status",
                    "payment_type",
                    "currency",
                    "exchange_rate",
                    "quantity_total",
                    "items_total",
                    "tax",
                    "discount_percent",
                    "discount_amount",
                    "shipping",
                    "total",
                    "amount_paid",
                    "deposit",
                    "po_number",
                    "quote_number",
                    "sales_order_number",
                    "notes",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 212
                    },
                    "number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Human-readable document number, for example I1-4149.",
                        "example": "C1-212"
                    },
                    "store_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the store that owns the document (see the stores resource).",
                        "example": 1
                    },
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Document date and time (store local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "customer_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the customer (see the customers resource).",
                        "example": 58
                    },
                    "customer_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Full name of the customer.",
                        "example": "Marie Dupont"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "new",
                            "open",
                            "hold",
                            "regular",
                            "void"
                        ],
                        "nullable": true,
                        "description": "new, open, hold, regular or void.",
                        "example": "new"
                    },
                    "payment_status": {
                        "type": "string",
                        "enum": [
                            "paid",
                            "unpaid"
                        ],
                        "nullable": true,
                        "description": "paid or unpaid.",
                        "example": "paid"
                    },
                    "payment_type": {
                        "type": "string",
                        "nullable": true,
                        "description": "How the document is paid, as recorded at sale time (for example Cash, Account).",
                        "example": "Cash"
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency of the document: USD or HTG.",
                        "example": "USD"
                    },
                    "exchange_rate": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Exchange rate between USD and HTG recorded on the document.",
                        "example": 130.5
                    },
                    "quantity_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Total quantity of items on the document.",
                        "example": 12
                    },
                    "items_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Sum of the item amounts, before discount, tax and shipping. The document totals are the reference: lines carry facts, not computed line totals.",
                        "example": 1250
                    },
                    "tax": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Tax amount.",
                        "example": 0
                    },
                    "discount_percent": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Discount, as a percentage.",
                        "example": 0
                    },
                    "discount_amount": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Discount amount.",
                        "example": 0
                    },
                    "shipping": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Shipping and transport charges.",
                        "example": 0
                    },
                    "total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Grand total of the document. Zero when the document is void.",
                        "example": 1250
                    },
                    "amount_paid": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount already paid on the document.",
                        "example": 1250
                    },
                    "deposit": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Deposit paid.",
                        "example": 0
                    },
                    "cost_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Cost of the returned goods. Requires costs:read.",
                        "example": 900
                    },
                    "po_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Customer purchase order number, when recorded.",
                        "example": "PO-7781"
                    },
                    "quote_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Quote number, when there is one.",
                        "example": "Q1-1087"
                    },
                    "sales_order_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Sales order number, when there is one.",
                        "example": "S1-312"
                    },
                    "notes": {
                        "type": "string",
                        "nullable": true,
                        "description": "Free-text notes printed on the document.",
                        "example": "Delivered on Friday."
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "CreditMemoList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/CreditMemo"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "CreditMemoLine": {
                "type": "object",
                "required": [
                    "id",
                    "product_id",
                    "name",
                    "description",
                    "type",
                    "quantity",
                    "unit",
                    "unit_price",
                    "base_quantity",
                    "base_unit_price"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Identifier of the line.",
                        "example": 9001
                    },
                    "product_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the product. 0 for a free-text line.",
                        "example": 463
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item name as printed on the document.",
                        "example": "Thermal paper roll 57x18m"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item description as printed on the document.",
                        "example": "Thermal paper roll for receipt printers"
                    },
                    "type": {
                        "type": "string",
                        "nullable": true,
                        "description": "Kind of item: Inventory, Service or Special.",
                        "example": "Inventory"
                    },
                    "quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity returned, in the unit shown in unit.",
                        "example": 10
                    },
                    "unit": {
                        "type": "string",
                        "nullable": true,
                        "description": "Unit of the line.",
                        "example": "Box of 100"
                    },
                    "unit_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Price of one unit. Zero when the document is void.",
                        "example": 125
                    },
                    "base_quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity expressed in the base unit of the product.",
                        "example": 1000
                    },
                    "base_unit_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Price of one base unit. Zero when the document is void.",
                        "example": 1.25
                    },
                    "cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Cost of the line. Requires costs:read.",
                        "example": 90
                    }
                }
            },
            "CreditMemoPayment": {
                "type": "object",
                "required": [
                    "date",
                    "cash",
                    "card",
                    "cheque",
                    "cheque_number",
                    "account",
                    "deposit",
                    "currency",
                    "exchange_rate"
                ],
                "properties": {
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Date and time.",
                        "example": "2026-03-15T14:30:00"
                    },
                    "cash": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount refunded in cash.",
                        "example": 1250
                    },
                    "card": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount refunded by card.",
                        "example": 0
                    },
                    "cheque": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount refunded by cheque.",
                        "example": 0
                    },
                    "cheque_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Cheque number.",
                        "example": ""
                    },
                    "account": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount credited to the customer account.",
                        "example": 0
                    },
                    "deposit": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Deposit applied.",
                        "example": 0
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency.",
                        "example": "USD"
                    },
                    "exchange_rate": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Exchange rate.",
                        "example": 130.5
                    }
                }
            },
            "CreditMemoDetail": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/CreditMemo"
                    },
                    {
                        "type": "object",
                        "required": [
                            "lines",
                            "payments"
                        ],
                        "properties": {
                            "lines": {
                                "type": "array",
                                "description": "The lines of the credit memo.",
                                "items": {
                                    "$ref": "#/components/schemas/CreditMemoLine"
                                }
                            },
                            "payments": {
                                "type": "array",
                                "description": "Refund recorded on the credit memo.",
                                "items": {
                                    "$ref": "#/components/schemas/CreditMemoPayment"
                                }
                            }
                        }
                    }
                ]
            },
            "Payment": {
                "type": "object",
                "required": [
                    "id",
                    "number",
                    "store_id",
                    "date",
                    "customer_id",
                    "customer_name",
                    "status",
                    "payment_type",
                    "currency",
                    "exchange_rate",
                    "amount_received",
                    "cash",
                    "card",
                    "cheque",
                    "cheque_number",
                    "notes",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 2201
                    },
                    "number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Human-readable document number, for example I1-4149.",
                        "example": "P1-2201"
                    },
                    "store_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the store that owns the document (see the stores resource).",
                        "example": 1
                    },
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Document date and time (store local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "customer_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the customer (see the customers resource).",
                        "example": 58
                    },
                    "customer_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Full name of the customer.",
                        "example": "Marie Dupont"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "regular",
                            "void"
                        ],
                        "nullable": true,
                        "description": "regular or void.",
                        "example": "regular"
                    },
                    "payment_type": {
                        "type": "string",
                        "nullable": true,
                        "description": "Payment method as recorded (for example Cash, Cheque, Db/Cr).",
                        "example": "Cash"
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency of the document: USD or HTG.",
                        "example": "USD"
                    },
                    "exchange_rate": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Exchange rate between USD and HTG recorded on the document.",
                        "example": 130.5
                    },
                    "amount_received": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Total amount received. Zero when the payment is void.",
                        "example": 1250
                    },
                    "cash": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Part paid in cash.",
                        "example": 1250
                    },
                    "card": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Part paid by debit or credit card.",
                        "example": 0
                    },
                    "cheque": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Part paid by cheque.",
                        "example": 0
                    },
                    "cheque_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Cheque number.",
                        "example": ""
                    },
                    "notes": {
                        "type": "string",
                        "nullable": true,
                        "description": "Free-text notes printed on the document.",
                        "example": "Delivered on Friday."
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "PaymentList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Payment"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "PaymentAppliedTo": {
                "type": "object",
                "required": [
                    "invoice_id",
                    "invoice_number",
                    "amount",
                    "date"
                ],
                "properties": {
                    "invoice_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the invoice (see the invoices resource).",
                        "example": 4149
                    },
                    "invoice_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Number of the invoice.",
                        "example": "I1-4149"
                    },
                    "amount": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Amount applied to this invoice.",
                        "example": 1250
                    },
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Date and time of the application.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "PaymentDetail": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Payment"
                    },
                    {
                        "type": "object",
                        "required": [
                            "applied_to"
                        ],
                        "properties": {
                            "applied_to": {
                                "type": "array",
                                "description": "The invoices this payment was applied to.",
                                "items": {
                                    "$ref": "#/components/schemas/PaymentAppliedTo"
                                }
                            }
                        }
                    }
                ]
            },
            "PurchaseOrder": {
                "type": "object",
                "required": [
                    "id",
                    "number",
                    "store_id",
                    "date",
                    "vendor_id",
                    "vendor_name",
                    "status",
                    "currency",
                    "exchange_rate",
                    "quantity_total",
                    "items_total",
                    "tax",
                    "total",
                    "notes",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 95
                    },
                    "number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Human-readable document number, for example I1-4149.",
                        "example": "PO1-95"
                    },
                    "store_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the store that owns the document (see the stores resource).",
                        "example": 1
                    },
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Document date and time (store local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "vendor_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the vendor (see the vendors resource).",
                        "example": 12
                    },
                    "vendor_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Company name of the vendor.",
                        "example": "Papeterie Delmas"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "hold",
                            "open",
                            "complete",
                            "closed"
                        ],
                        "nullable": true,
                        "description": "hold, open, complete or closed.",
                        "example": "hold"
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency of the document: USD or HTG.",
                        "example": "USD"
                    },
                    "exchange_rate": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Exchange rate between USD and HTG recorded on the document.",
                        "example": 130.5
                    },
                    "quantity_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Total quantity ordered.",
                        "example": 12
                    },
                    "items_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Sum of the item amounts, before discount, tax and shipping. The document totals are the reference: lines carry facts, not computed line totals.",
                        "example": 1250
                    },
                    "tax": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Tax amount.",
                        "example": 0
                    },
                    "total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Grand total of the order.",
                        "example": 1250
                    },
                    "notes": {
                        "type": "string",
                        "nullable": true,
                        "description": "Free-text notes printed on the document.",
                        "example": "Delivered on Friday."
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "PurchaseOrderList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/PurchaseOrder"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "PurchaseOrderLine": {
                "type": "object",
                "required": [
                    "id",
                    "product_id",
                    "name",
                    "description",
                    "quantity",
                    "unit",
                    "unit_price",
                    "base_quantity"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Identifier of the line.",
                        "example": 9001
                    },
                    "product_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the product.",
                        "example": 463
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item name.",
                        "example": "Thermal paper roll 57x18m"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item description.",
                        "example": "Thermal paper roll for receipt printers"
                    },
                    "quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity ordered, in the unit shown in unit.",
                        "example": 10
                    },
                    "unit": {
                        "type": "string",
                        "nullable": true,
                        "description": "Unit of the line.",
                        "example": "Box of 100"
                    },
                    "unit_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Purchase price of one unit.",
                        "example": 125
                    },
                    "base_quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity expressed in the base unit of the product.",
                        "example": 1000
                    }
                }
            },
            "PurchaseOrderDetail": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/PurchaseOrder"
                    },
                    {
                        "type": "object",
                        "required": [
                            "lines"
                        ],
                        "properties": {
                            "lines": {
                                "type": "array",
                                "description": "The lines of the purchase order.",
                                "items": {
                                    "$ref": "#/components/schemas/PurchaseOrderLine"
                                }
                            }
                        }
                    }
                ]
            },
            "Receiving": {
                "type": "object",
                "required": [
                    "id",
                    "number",
                    "type",
                    "store_id",
                    "date",
                    "receipt_number",
                    "receipt_date",
                    "purchase_order_id",
                    "vendor_id",
                    "vendor_name",
                    "status",
                    "currency",
                    "exchange_rate",
                    "quantity_total",
                    "items_total",
                    "discount_percent",
                    "discount_amount",
                    "tax",
                    "freight",
                    "fee",
                    "total",
                    "notes",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 310
                    },
                    "number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Human-readable document number, for example I1-4149.",
                        "example": "R1-310"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "receipt",
                            "return"
                        ],
                        "nullable": true,
                        "description": "receipt (goods received) or return (goods returned to the vendor).",
                        "example": "receipt"
                    },
                    "store_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the store that owns the document (see the stores resource).",
                        "example": 1
                    },
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Document date and time (store local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "receipt_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Number of the vendor delivery note or invoice.",
                        "example": "DN-20931"
                    },
                    "receipt_date": {
                        "type": "string",
                        "format": "date",
                        "nullable": true,
                        "description": "Date of the vendor delivery note or invoice.",
                        "example": "2026-03-15"
                    },
                    "purchase_order_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the purchase order received, when there is one.",
                        "example": 95
                    },
                    "vendor_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the vendor (see the vendors resource).",
                        "example": 12
                    },
                    "vendor_name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Company name of the vendor.",
                        "example": "Papeterie Delmas"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "hold",
                            "posted",
                            "void"
                        ],
                        "nullable": true,
                        "description": "open, hold, posted or void.",
                        "example": "open"
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency of the document: USD or HTG.",
                        "example": "USD"
                    },
                    "exchange_rate": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Exchange rate between USD and HTG recorded on the document.",
                        "example": 130.5
                    },
                    "quantity_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Total quantity of items on the document.",
                        "example": 12
                    },
                    "items_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Sum of the item amounts, before discount, tax and shipping. The document totals are the reference: lines carry facts, not computed line totals.",
                        "example": 1250
                    },
                    "discount_percent": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Discount, as a percentage.",
                        "example": 0
                    },
                    "discount_amount": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Discount amount.",
                        "example": 0
                    },
                    "tax": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Tax amount.",
                        "example": 0
                    },
                    "freight": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Freight charges.",
                        "example": 0
                    },
                    "fee": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Other fees.",
                        "example": 0
                    },
                    "total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Grand total of the document.",
                        "example": 1250
                    },
                    "notes": {
                        "type": "string",
                        "nullable": true,
                        "description": "Free-text notes printed on the document.",
                        "example": "Delivered on Friday."
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "ReceivingList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Receiving"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "ReceivingLine": {
                "type": "object",
                "required": [
                    "id",
                    "product_id",
                    "name",
                    "description",
                    "barcode",
                    "quantity",
                    "unit",
                    "unit_price",
                    "new_price",
                    "base_quantity"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Identifier of the line.",
                        "example": 9001
                    },
                    "product_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the product.",
                        "example": 463
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item name.",
                        "example": "Thermal paper roll 57x18m"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item description.",
                        "example": "Thermal paper roll for receipt printers"
                    },
                    "barcode": {
                        "type": "string",
                        "nullable": true,
                        "description": "Barcode.",
                        "example": "6291041500213"
                    },
                    "quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity received, in the unit shown in unit.",
                        "example": 10
                    },
                    "unit": {
                        "type": "string",
                        "nullable": true,
                        "description": "Unit of the line.",
                        "example": "Box of 100"
                    },
                    "unit_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Purchase price of one unit.",
                        "example": 125
                    },
                    "new_price": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Selling price set at reception.",
                        "example": 130
                    },
                    "base_quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity expressed in the base unit of the product.",
                        "example": 1000
                    },
                    "average_cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Average cost after reception. Requires costs:read.",
                        "example": 92.5
                    },
                    "previous_cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Cost before reception. Requires costs:read.",
                        "example": 88
                    },
                    "previous_average_cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Average cost before reception. Requires costs:read.",
                        "example": 91
                    }
                }
            },
            "ReceivingDetail": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Receiving"
                    },
                    {
                        "type": "object",
                        "required": [
                            "lines"
                        ],
                        "properties": {
                            "lines": {
                                "type": "array",
                                "description": "The lines of the receiving.",
                                "items": {
                                    "$ref": "#/components/schemas/ReceivingLine"
                                }
                            }
                        }
                    }
                ]
            },
            "Transfer": {
                "type": "object",
                "required": [
                    "id",
                    "number",
                    "date",
                    "from_store_id",
                    "from_store",
                    "to_store_id",
                    "to_store",
                    "status",
                    "quantity_total",
                    "notes",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 48
                    },
                    "number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Human-readable document number, for example I1-4149.",
                        "example": "T1-48"
                    },
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Document date and time (store local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "from_store_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the store the goods leave.",
                        "example": 1
                    },
                    "from_store": {
                        "type": "string",
                        "nullable": true,
                        "description": "Name of the store the goods leave.",
                        "example": "Main store"
                    },
                    "to_store_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the store the goods arrive in.",
                        "example": 2
                    },
                    "to_store": {
                        "type": "string",
                        "nullable": true,
                        "description": "Name of the store the goods arrive in.",
                        "example": "Delmas store"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "hold",
                            "open",
                            "posted"
                        ],
                        "nullable": true,
                        "description": "hold, open or posted.",
                        "example": "hold"
                    },
                    "quantity_total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Total quantity transferred.",
                        "example": 12
                    },
                    "notes": {
                        "type": "string",
                        "nullable": true,
                        "description": "Free-text notes printed on the document.",
                        "example": "Delivered on Friday."
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "TransferList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Transfer"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "TransferLine": {
                "type": "object",
                "required": [
                    "id",
                    "product_id",
                    "name",
                    "description",
                    "quantity",
                    "unit",
                    "base_quantity"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Identifier of the line.",
                        "example": 9001
                    },
                    "product_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the product.",
                        "example": 463
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item name.",
                        "example": "Thermal paper roll 57x18m"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item description.",
                        "example": "Thermal paper roll for receipt printers"
                    },
                    "quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity transferred, in the unit shown in unit.",
                        "example": 10
                    },
                    "unit": {
                        "type": "string",
                        "nullable": true,
                        "description": "Unit of the line.",
                        "example": "Box of 100"
                    },
                    "base_quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity expressed in the base unit of the product.",
                        "example": 1000
                    },
                    "average_cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Average cost of the product. Requires costs:read.",
                        "example": 92.5
                    }
                }
            },
            "TransferDetail": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Transfer"
                    },
                    {
                        "type": "object",
                        "required": [
                            "lines"
                        ],
                        "properties": {
                            "lines": {
                                "type": "array",
                                "description": "The lines of the transfer.",
                                "items": {
                                    "$ref": "#/components/schemas/TransferLine"
                                }
                            }
                        }
                    }
                ]
            },
            "Adjustment": {
                "type": "object",
                "required": [
                    "id",
                    "number",
                    "type",
                    "store_id",
                    "date",
                    "status",
                    "reason",
                    "currency",
                    "exchange_rate",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 17
                    },
                    "number": {
                        "type": "string",
                        "nullable": true,
                        "description": "Human-readable document number, for example I1-4149.",
                        "example": "A1-17"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "quantity",
                            "cost"
                        ],
                        "nullable": true,
                        "description": "quantity (stock quantity adjustment) or cost (product cost adjustment).",
                        "example": "quantity"
                    },
                    "store_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the store that owns the document (see the stores resource).",
                        "example": 1
                    },
                    "date": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "Document date and time (store local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "hold",
                            "posted"
                        ],
                        "nullable": true,
                        "description": "hold or posted.",
                        "example": "hold"
                    },
                    "reason": {
                        "type": "string",
                        "nullable": true,
                        "description": "Reason given for the adjustment.",
                        "example": "Stock count correction"
                    },
                    "currency": {
                        "type": "string",
                        "nullable": true,
                        "description": "Currency of the document: USD or HTG.",
                        "example": "USD"
                    },
                    "exchange_rate": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Exchange rate between USD and HTG recorded on the document.",
                        "example": 130.5
                    },
                    "total": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Total value of the adjustment. Requires costs:read.",
                        "example": 1250
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "AdjustmentList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Adjustment"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "AdjustmentLine": {
                "type": "object",
                "required": [
                    "id",
                    "product_id",
                    "name",
                    "description",
                    "unit",
                    "previous_quantity",
                    "new_quantity",
                    "quantity_difference",
                    "on_hand_quantity"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Identifier of the line.",
                        "example": 9001
                    },
                    "product_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "Identifier of the product.",
                        "example": 463
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item name.",
                        "example": "Thermal paper roll 57x18m"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true,
                        "description": "Item description.",
                        "example": "Thermal paper roll for receipt printers"
                    },
                    "unit": {
                        "type": "string",
                        "nullable": true,
                        "description": "Unit of the line.",
                        "example": "Box of 100"
                    },
                    "previous_quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity before the adjustment.",
                        "example": 40
                    },
                    "new_quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity after the adjustment.",
                        "example": 45
                    },
                    "quantity_difference": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Difference between the new and the previous quantity.",
                        "example": 5
                    },
                    "on_hand_quantity": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "description": "Quantity on hand when the adjustment was made.",
                        "example": 45
                    },
                    "average_cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Average cost. Requires costs:read.",
                        "example": 92.5
                    },
                    "previous_cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Cost before the adjustment. Requires costs:read.",
                        "example": 88
                    },
                    "new_cost": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Cost after the adjustment. Requires costs:read.",
                        "example": 90
                    },
                    "cost_difference": {
                        "type": "number",
                        "format": "double",
                        "nullable": true,
                        "x-requires-permission": "costs:read",
                        "description": "Difference between the new and the previous cost. Requires costs:read.",
                        "example": 2
                    }
                }
            },
            "AdjustmentDetail": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Adjustment"
                    },
                    {
                        "type": "object",
                        "required": [
                            "lines"
                        ],
                        "properties": {
                            "lines": {
                                "type": "array",
                                "description": "The products adjusted.",
                                "items": {
                                    "$ref": "#/components/schemas/AdjustmentLine"
                                }
                            }
                        }
                    }
                ]
            },
            "Store": {
                "type": "object",
                "required": [
                    "id",
                    "code",
                    "name",
                    "address",
                    "manager",
                    "phone",
                    "phone2",
                    "email",
                    "is_headquarters"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 1
                    },
                    "code": {
                        "type": "string",
                        "nullable": true,
                        "description": "Store code.",
                        "example": "HQ"
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Store name.",
                        "example": "Main store"
                    },
                    "address": {
                        "type": "string",
                        "nullable": true,
                        "description": "Street address.",
                        "example": "12 Rue Capois, Port-au-Prince"
                    },
                    "manager": {
                        "type": "string",
                        "nullable": true,
                        "description": "Store manager.",
                        "example": "Jean Baptiste"
                    },
                    "phone": {
                        "type": "string",
                        "nullable": true,
                        "description": "Main phone number.",
                        "example": "+509 3700 0000"
                    },
                    "phone2": {
                        "type": "string",
                        "nullable": true,
                        "description": "Second phone number.",
                        "example": ""
                    },
                    "email": {
                        "type": "string",
                        "nullable": true,
                        "description": "Store e-mail address.",
                        "example": "main@example.com"
                    },
                    "is_headquarters": {
                        "type": "boolean",
                        "nullable": true,
                        "description": "true for the head office.",
                        "example": true
                    }
                }
            },
            "StoreList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Store"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "Department": {
                "type": "object",
                "required": [
                    "id",
                    "code",
                    "name",
                    "manager"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 3
                    },
                    "code": {
                        "type": "string",
                        "nullable": true,
                        "description": "Department code.",
                        "example": "DEP-03"
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Department name.",
                        "example": "Office supplies"
                    },
                    "manager": {
                        "type": "string",
                        "nullable": true,
                        "description": "Person in charge of the department.",
                        "example": "Jean Baptiste"
                    }
                }
            },
            "DepartmentList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Department"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "SubDepartment": {
                "type": "object",
                "required": [
                    "id",
                    "code",
                    "name",
                    "manager"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 21
                    },
                    "code": {
                        "type": "string",
                        "nullable": true,
                        "description": "Sub-department code.",
                        "example": "SUB-21"
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Sub-department name.",
                        "example": "Paper"
                    },
                    "manager": {
                        "type": "string",
                        "nullable": true,
                        "description": "Person in charge of the sub-department.",
                        "example": "Jean Baptiste"
                    }
                }
            },
            "SubDepartmentList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SubDepartment"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "PriceList": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "status",
                    "created_at",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 1
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Price list name.",
                        "example": "Retail"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "inactive"
                        ],
                        "nullable": true,
                        "description": "active or inactive.",
                        "example": "active"
                    },
                    "created_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was created (local time, no time zone).",
                        "example": "2026-03-15T14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
                        "nullable": true,
                        "description": "When the record was last modified (local time, no time zone). Use it with the updated_since filter to synchronize.",
                        "example": "2026-03-15T14:30:00"
                    }
                }
            },
            "PriceListList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/PriceList"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            },
            "CustomerType": {
                "type": "object",
                "required": [
                    "id",
                    "code",
                    "name"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Unique identifier. Use it in the detail route.",
                        "example": 2
                    },
                    "code": {
                        "type": "string",
                        "nullable": true,
                        "description": "Customer type code.",
                        "example": "WHS"
                    },
                    "name": {
                        "type": "string",
                        "nullable": true,
                        "description": "Customer type name.",
                        "example": "Wholesale"
                    }
                }
            },
            "CustomerTypeList": {
                "type": "object",
                "required": [
                    "data",
                    "meta"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/CustomerType"
                        }
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ListMeta"
                    }
                }
            }
        }
    }
}
