{
    "variable": [
        {
            "id": "baseUrl",
            "key": "baseUrl",
            "type": "string",
            "name": "string",
            "value": "https:\/\/nwms.cloud"
        }
    ],
    "info": {
        "name": "Laravel NWMS API",
        "_postman_id": "82565306-98c9-4d8d-be92-ae48b4905cb0",
        "description": "NWMS API documentation.",
        "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json"
    },
    "item": [
        {
            "name": "Acceptances",
            "description": "\nGoods receiving documents (warehouse inbound).\nUse these endpoints to list, create, view, update and delete acceptances.\n\n**Authentication:** Bearer Token (Laravel Sanctum)\n\n**Access scope**\n- Results are automatically scoped to the caller\u2019s `acc_domain_id` (their tenant\/domain).",
            "item": [
                {
                    "name": "List acceptances",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/acceptances",
                            "query": [
                                {
                                    "key": "page",
                                    "value": "1",
                                    "description": "The page number for pagination.",
                                    "disabled": false
                                },
                                {
                                    "key": "per_page",
                                    "value": "20",
                                    "description": "Items per page (max 250).",
                                    "disabled": false
                                },
                                {
                                    "key": "acc_wh_id",
                                    "value": "3",
                                    "description": "Filter by warehouse ID.",
                                    "disabled": false
                                },
                                {
                                    "key": "acc_shop_id",
                                    "value": "12",
                                    "description": "Filter by shop ID.",
                                    "disabled": false
                                },
                                {
                                    "key": "acc_type",
                                    "value": "1",
                                    "description": "Filter by acceptance type ID.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/acceptances?page=1&per_page=20&acc_wh_id=3&acc_shop_id=12&acc_type=1"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns a paginated list of acceptances for the authenticated user\u2019s domain.\nIncludes linked relations for convenience: status, type, warehouse, creator and offers."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": [\n    {\n      \"acc_id\": 101,\n      \"acc_wh_id\": 3,\n      \"acc_shop_id\": 12,\n      \"acc_type\": 1,\n      \"acc_status\": 1,\n      \"acc_comment\": \"Inbound from supplier ACME\",\n      \"acc_date\": \"2025-11-12T08:30:00Z\",\n      \"getAccStatus\": {\"las_id\":1,\"las_name\":\"Created\"},\n      \"getAccType\": {\"lat_id\":1,\"lat_name\":\"Supplier receipt\"},\n      \"getWarehouse\": {\"wh_id\":3,\"wh_name\":\"Main DC\"},\n      \"getUser\": {\"id\":5,\"name\":\"Operator John\"},\n      \"offers\": [\n        {\n          \"aof_id\": 555,\n          \"aof_offer_id\": 77,\n          \"aof_qty\": 10,\n          \"aof_price\": 4.99\n        }\n      ]\n    }\n  ],\n  \"links\": {\n    \"first\": \"https:\/\/api.example.com\/api\/acceptances?page=1\",\n    \"last\": \"https:\/\/api.example.com\/api\/acceptances?page=5\",\n    \"prev\": null,\n    \"next\": \"https:\/\/api.example.com\/api\/acceptances?page=2\"\n  },\n  \"meta\": {\n    \"current_page\": 1,\n    \"from\": 1,\n    \"last_page\": 5,\n    \"path\": \"https:\/\/api.example.com\/api\/acceptances\",\n    \"per_page\": 20,\n    \"to\": 20,\n    \"total\": 100\n  }\n}",
                            "name": "Success (paginated)"
                        }
                    ]
                },
                {
                    "name": "Create acceptance",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/acceptances",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/acceptances"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"acc_wh_id\":3,\"acc_shop_id\":12,\"acc_type\":1,\"acc_comment\":\"\\\"Inbound from ACME\\\"\"}"
                        },
                        "description": "Creates a new acceptance (warehouse inbound) in the caller\u2019s domain.\nServer sets initial status to **1** (created) and the `acc_date` to now."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\n  \"acc_id\": 101,\n  \"acc_wh_id\": 3,\n  \"acc_shop_id\": 12,\n  \"acc_type\": 1,\n  \"acc_status\": 1,\n  \"acc_comment\": \"Inbound from ACME\",\n  \"acc_date\": \"2025-11-12T08:30:00Z\"\n}",
                            "name": "Created"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"message\": \"The given data was invalid.\",\n  \"errors\": {\"acc_wh_id\": [\"The acc_wh_id field is required.\"]}\n}",
                            "name": "Validation error"
                        }
                    ]
                },
                {
                    "name": "Get acceptance by ID",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/acceptances\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/acceptances\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "101",
                                    "description": "Acceptance ID."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns a single acceptance with related entities and line items."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"acc_id\": 101,\n  \"acc_wh_id\": 3,\n  \"acc_shop_id\": 12,\n  \"acc_type\": 1,\n  \"acc_status\": 1,\n  \"acc_comment\": \"Inbound from ACME\",\n  \"acc_date\": \"2025-11-12T08:30:00Z\",\n  \"offers\": [\n    {\"aof_id\":555,\"aof_offer_id\":77,\"aof_qty\":10,\"aof_price\":4.99}\n  ]\n}",
                            "name": "Found"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\": \"Not found\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Update acceptance",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/acceptances\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/acceptances\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "101",
                                    "description": "Acceptance ID."
                                }
                            ]
                        },
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"acc_wh_id\":4,\"acc_shop_id\":12,\"acc_type\":2,\"acc_comment\":\"\\\"Adjusted note\\\"\"}"
                        },
                        "description": "Updates editable fields of an existing acceptance in the caller\u2019s domain.\nTypically, status transitions are handled elsewhere; here we focus on basic fields."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"acc_id\": 101,\n  \"acc_comment\": \"Adjusted note\"\n}",
                            "name": "Updated"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\": \"Not found\"}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"message\": \"The given data was invalid.\",\n  \"errors\": {\"acc_comment\": [\"The acc_comment may not be greater than 255 characters.\"]}\n}",
                            "name": "Validation error"
                        }
                    ]
                },
                {
                    "name": "Delete acceptance",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/acceptances\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/acceptances\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "101",
                                    "description": "Acceptance ID."
                                }
                            ]
                        },
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Deletes an acceptance in the caller\u2019s domain.\nBe careful: associated offers\/stock postings may require additional handling by business logic."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"message\": \"Deleted\"}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\": \"Not found\"}",
                            "name": ""
                        }
                    ]
                }
            ]
        },
        {
            "name": "Acceptances \u00bb Lines",
            "description": "\nManage line items (offers) inside an acceptance (warehouse inbound document).\n\n**Authentication:** Bearer Token (Laravel Sanctum)\n\n**Access scope**\n- All operations are restricted to the caller\u2019s domain (`acc_domain_id = user.domain_id`).\n- The acceptance must exist and belong to the caller\u2019s domain.",
            "item": [
                {
                    "name": "Add offers (lines) to an acceptance",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/acceptances\/:id\/offers",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/acceptances\/:id\/offers",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "101",
                                    "description": "The acceptance ID you are adding lines to."
                                }
                            ]
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"*\":[{\"ao_offer_id\":77,\"ao_expected\":10,\"ao_price\":4.99}]}"
                        },
                        "description": "Appends one or more offer lines to an existing acceptance.\nEach line contains the product (offer) ID and the expected quantity to receive.\n\nNotes:\n- The server will link each line to the specified acceptance.\n- Do not supply server-calculated fields; only editable inputs are accepted."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "[\n  {\n    \"ao_id\": 555,\n    \"ao_acceptance_id\": 101,\n    \"ao_offer_id\": 77,\n    \"ao_expected\": 10,\n    \"ao_price\": 4.99,\n    \"ao_batch\": \"LOT-2025-11\",\n    \"ao_expiration_date\": \"2026-03-31\",\n    \"ao_barcode\": \"EAN-1234567890123\"\n  }\n]",
                            "name": "Created"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\":\"No query results for model\"}",
                            "name": "Acceptance not found \/ out of scope"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"message\":\"The given data was invalid.\",\n  \"errors\": {\"0.ao_offer_id\":[\"The 0.ao_offer_id field is required.\"]}\n}",
                            "name": "Validation error"
                        }
                    ]
                },
                {
                    "name": "Update a line in an acceptance",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/acceptances\/:acceptance_id\/offers\/:offer_id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/acceptances\/:acceptance_id\/offers\/:offer_id",
                            "variable": [
                                {
                                    "id": "acceptance_id",
                                    "key": "acceptance_id",
                                    "value": "architecto",
                                    "description": "The ID of the acceptance."
                                },
                                {
                                    "id": "offer_id",
                                    "key": "offer_id",
                                    "value": "architecto",
                                    "description": "The ID of the offer."
                                },
                                {
                                    "id": "acc_id",
                                    "key": "acc_id",
                                    "value": "101",
                                    "description": "Acceptance ID."
                                },
                                {
                                    "id": "ao_id",
                                    "key": "ao_id",
                                    "value": "555",
                                    "description": "Line (acceptance offer) ID."
                                }
                            ]
                        },
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"ao_expected\":12.5,\"ao_price\":5.25,\"ao_batch\":\"\\\"LOT-2025-12\\\"\",\"ao_expiration_date\":\"2026-05-15\",\"ao_barcode\":\"\\\"EAN-9876543210987\\\"\"}"
                        },
                        "description": "Updates a single acceptance line (quantity, price, batch details, etc.)."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"ao_id\": 555,\n  \"ao_acceptance_id\": 101,\n  \"ao_offer_id\": 77,\n  \"ao_expected\": 12.5,\n  \"ao_price\": 5.25,\n  \"ao_batch\": \"LOT-2025-12\",\n  \"ao_expiration_date\": \"2026-05-15\",\n  \"ao_barcode\": \"EAN-9876543210987\"\n}",
                            "name": "Updated"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\":\"No query results for model\"}",
                            "name": "Acceptance or line not found \/ out of scope"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"message\":\"The given data was invalid.\",\n  \"errors\": {\"ao_expected\":[\"The ao_expected must be at least 0.01.\"]}\n}",
                            "name": "Validation error"
                        }
                    ]
                },
                {
                    "name": "Delete a line from an acceptance",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/acceptances\/:acceptance_id\/offers\/:offer_id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/acceptances\/:acceptance_id\/offers\/:offer_id",
                            "variable": [
                                {
                                    "id": "acceptance_id",
                                    "key": "acceptance_id",
                                    "value": "architecto",
                                    "description": "The ID of the acceptance."
                                },
                                {
                                    "id": "offer_id",
                                    "key": "offer_id",
                                    "value": "architecto",
                                    "description": "The ID of the offer."
                                },
                                {
                                    "id": "acc_id",
                                    "key": "acc_id",
                                    "value": "101",
                                    "description": "Acceptance ID."
                                },
                                {
                                    "id": "ao_id",
                                    "key": "ao_id",
                                    "value": "555",
                                    "description": "Line (acceptance offer) ID."
                                }
                            ]
                        },
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Removes a single line from an acceptance document.\nMake sure there are no dependent stock movements you still need."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"message\":\"Deleted\"}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\":\"No query results for model\"}",
                            "name": "Acceptance or line not found \/ out of scope"
                        }
                    ]
                }
            ]
        },
        {
            "name": "Orders",
            "description": "\nManage warehouse orders and their associated offers.\n\nEach order represents a customer shipment or acceptance document,\ndepending on the order type. Orders can include delivery information,\ncontact details, and multiple product offers.\n\n**Authentication:** Bearer Token via Sanctum",
            "item": [
                {
                    "name": "Get list of orders",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/orders",
                            "query": [
                                {
                                    "key": "per_page",
                                    "value": "50",
                                    "description": "optional Number of records per page.",
                                    "disabled": false
                                },
                                {
                                    "key": "page",
                                    "value": "1",
                                    "description": "optional Page number for pagination.",
                                    "disabled": false
                                },
                                {
                                    "key": "o_ext_id",
                                    "value": "ORD-12345",
                                    "description": "optional External order ID for filtering.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/orders?per_page=50&page=1&o_ext_id=ORD-12345"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns a paginated list of all orders available to the authenticated user.\nAccess depends on user roles: admins see all, warehouse managers see their domain,\nshop users see only their shop\u2019s orders."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": [\n    {\n      \"o_id\": 105,\n      \"o_ext_id\": \"ORD-105\",\n      \"o_shop_id\": 1,\n      \"o_wh_id\": 2,\n      \"o_status_id\": 10,\n      \"o_sum\": 199.80,\n      \"created_at\": \"2025-11-12T08:30:00Z\"\n    }\n  ],\n  \"meta\": {\n    \"current_page\": 1,\n    \"per_page\": 50,\n    \"total\": 312\n  }\n}",
                            "name": "Successful"
                        }
                    ]
                },
                {
                    "name": "Create a new order",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/orders",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/orders"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"o_type_id\":1,\"o_ext_id\":\"ORD-105\",\"o_shop_id\":1,\"o_wh_id\":2,\"o_date_send\":\"2025-11-15\",\"o_source_id\":3,\"o_status_id\":16,\"o_customer_type\":16,\"o_is_cod\":true,\"o_shipping_price\":12.5,\"o_shipping_cost\":9.8,\"o_company_id\":44,\"contact\":{\"oc_first_name\":\"John\",\"oc_middle_name\":\"g\",\"oc_last_name\":\"Doe\",\"oc_phone\":\"+15551234567\",\"oc_email\":\"john@example.com\",\"oc_country_id\":16,\"oc_city_id\":16,\"oc_postcode\":\"ngzmiyvdljnikhwa\",\"oc_coord_latitude\":4326.41688,\"oc_coord_longitude\":4326.41688,\"oc_full_address\":\"\\\"221B Baker Street, London\\\"\"},\"ds\":{\"ods_ds_id\":12,\"ods_status\":1,\"ods_track_number\":\"\\\"TRACK-12345\\\"\",\"ods_ds_pp_id\":\"g\",\"ods_source_id\":16}}"
                        },
                        "description": "Creates a new order with optional contact and delivery details.\nSome fields (like total sums) are calculated automatically and\nshould not be included in the request."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\n  \"o_id\": 105,\n  \"o_ext_id\": \"ORD-105\",\n  \"o_sum\": 0,\n  \"contact\": {\"oc_first_name\": \"John\"},\n  \"ds\": {\"ods_track_number\": \"TRACK-12345\"}\n}",
                            "name": "Created"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"message\": \"The given data was invalid.\",\n  \"errors\": {\"o_type_id\": [\"The o_type_id field is required.\"]}\n}",
                            "name": "Validation error"
                        }
                    ]
                },
                {
                    "name": "Get a single order by ID",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/orders\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/orders\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "105",
                                    "description": "The order ID."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns detailed information about a specific order including offers,\ncontact, and delivery info."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"o_id\": 105,\n  \"o_ext_id\": \"ORD-105\",\n  \"o_type_id\": 2,\n  \"o_shop_id\": 1,\n  \"o_wh_id\": 2,\n  \"contact\": {\"oc_first_name\": \"John\", \"oc_phone\": \"+15551234567\"},\n  \"ds\": {\"ods_track_number\": \"TRACK-12345\"},\n  \"offers\": [\n    {\"oo_offer_id\": 77, \"oo_qty\": 2, \"oo_price\": 39.95}\n  ]\n}",
                            "name": "Found"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\": \"Order not found\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Update an existing order",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/orders\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/orders\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "105",
                                    "description": "The order ID."
                                }
                            ]
                        },
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"o_status_id\":15,\"o_date_send\":\"2025-11-15\",\"o_shipping_price\":15.5}"
                        },
                        "description": "Updates editable fields of an existing order.\nAutomatically recalculates totals and prevents modification of computed fields."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"o_id\": 105,\n  \"o_status_id\": 15,\n  \"o_date_send\": \"2025-11-15\"\n}",
                            "name": "Updated"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\": \"Order not found\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Delete an order",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/orders\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/orders\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "105",
                                    "description": "Order ID."
                                }
                            ]
                        },
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Deletes a specific order and all associated offers.\nOnly accessible to authorized users within their domain."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"message\": \"Deleted\"}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\": \"Order not found\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Add offers (products) to an order",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/orders\/:id\/offers",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/orders\/:id\/offers",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "105",
                                    "description": "The order ID."
                                }
                            ]
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"offers\":[\"architecto\"]}"
                        },
                        "description": "Adds one or more product offers to an existing order.\nThe offer list must include product IDs and quantities."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\n  \"offers\": [\n    {\"oo_offer_id\": 77, \"oo_qty\": 2, \"oo_price\": 39.95}\n  ]\n}",
                            "name": "Added"
                        }
                    ]
                },
                {
                    "name": "Update an offer within an order",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/orders\/:order_id\/offers\/:offer_id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/orders\/:order_id\/offers\/:offer_id",
                            "variable": [
                                {
                                    "id": "order_id",
                                    "key": "order_id",
                                    "value": "105",
                                    "description": "The order ID."
                                },
                                {
                                    "id": "offer_id",
                                    "key": "offer_id",
                                    "value": "44",
                                    "description": "Offer ID inside this order."
                                }
                            ]
                        },
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"oo_qty\":5,\"oo_oc_price\":4326.41688,\"oo_price\":45,\"oo_expiration_date\":\"2025-11-12T11:51:33\",\"oo_batch\":\"i\",\"oo_operation_user_id\":16}"
                        },
                        "description": "Updates quantity or price for a specific offer line."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"message\": \"Offer updated\"}",
                            "name": "Updated"
                        }
                    ]
                },
                {
                    "name": "Delete an offer from an order",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/orders\/:order_id\/offers\/:offer_id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/orders\/:order_id\/offers\/:offer_id",
                            "variable": [
                                {
                                    "id": "order_id",
                                    "key": "order_id",
                                    "value": "105",
                                    "description": "The order ID."
                                },
                                {
                                    "id": "offer_id",
                                    "key": "offer_id",
                                    "value": "44",
                                    "description": "Offer ID."
                                }
                            ]
                        },
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Removes a specific offer from an existing order."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"message\": \"Offer removed from order\"}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"error\": \"Offer not found in this order\"}",
                            "name": ""
                        }
                    ]
                }
            ]
        },
        {
            "name": "Products",
            "description": "\nEndpoints for managing the product catalog (\"offers\").\n\n### Authorization\nAll endpoints require **Bearer Token** (Laravel Sanctum) unless explicitly marked `@unauthenticated`.\n\n### Domain & Access Scoping\n- Non-admin users are **automatically scoped** to their `of_domain_id` (the same as the user's `domain_id`).\n- Additionally, if a user is **not** a `warehouse_manager`, they can only access products belonging to shops where\n  `sh_user_id` \u2208 { current_user.id, current_user.parent_id } (within the same domain).\n\n### Server-calculated Fields\nFields like **`rests`** (current stock balances) are computed by the server and **must not** be included in request payloads.\nThey are returned in responses (see `OfferResource`).",
            "item": [
                {
                    "name": "Get product list",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/products",
                            "query": [
                                {
                                    "key": "page",
                                    "value": "1",
                                    "description": "The page number for pagination.",
                                    "disabled": false
                                },
                                {
                                    "key": "per_page",
                                    "value": "50",
                                    "description": "Number of items per page (max 250).",
                                    "disabled": false
                                },
                                {
                                    "key": "of_id",
                                    "value": "1024",
                                    "description": "Filter by internal numeric ID.",
                                    "disabled": false
                                },
                                {
                                    "key": "of_ext_id",
                                    "value": "EXT-ACME-777",
                                    "description": "Filter by external ID (third-party mapping). Max 25 chars.",
                                    "disabled": false
                                },
                                {
                                    "key": "of_sku",
                                    "value": "SKU-001",
                                    "description": "Filter by SKU (exact match). Max 25 chars.",
                                    "disabled": false
                                },
                                {
                                    "key": "of_name",
                                    "value": "shirt",
                                    "description": "Filter by product name (substring, case-insensitive). Max 150 chars.",
                                    "disabled": false
                                },
                                {
                                    "key": "of_status",
                                    "value": "1",
                                    "description": "Filter by status (1 = active, 0 = inactive).",
                                    "disabled": false
                                },
                                {
                                    "key": "sort_by",
                                    "value": "of_price",
                                    "description": "Field to sort by. Common values: `of_name`, `of_price`, `of_status`, `created_at`.",
                                    "disabled": false
                                },
                                {
                                    "key": "sort_dir",
                                    "value": "desc",
                                    "description": "Sort direction. Allowed: `asc`, `desc`. Defaults to `asc`.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/products?page=1&per_page=50&of_id=1024&of_ext_id=EXT-ACME-777&of_sku=SKU-001&of_name=shirt&of_status=1&sort_by=of_price&sort_dir=desc"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns a paginated list of products (offers) with filtering and sorting.\nNon-admin access is restricted to the caller's domain and (unless the user has the `warehouse_manager` role)\nto shops associated with the caller or their parent account (see \"Domain & Access Scoping\" above).\n\n#### Pagination\n- `per_page` is capped at **250** to protect performance.\n\n#### Sorting\n- Use `sort_by` with any sortable column (e.g. `of_name`, `of_price`, `of_status`).\n- Use `sort_dir` as `asc` or `desc`. Defaults to `asc`."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": [\n    {\n      \"of_id\": 10, \/\/ Example product ID\n      \"of_ext_id\": \"EXT-123\",\n      \"of_name\": \"Cotton T-shirt\",\n      \"of_sku\": \"SKU-001\",\n      \"of_article\": \"ART-444\",\n      \"of_price\": 19.99,\n      \"of_status\": 1,\n      \"of_shop_id\": 15,\n      \"of_domain_id\": 3,\n      \"of_dimensions\": { \"x\": 20, \"y\": 10, \"z\": 5 },\n      \"of_weight\": 350,\n      \"of_image\": \"https:\/\/cdn.example.com\/images\/sku001.jpg\",\n      \"of_datamatrix\": 1234567890123,\n      \"of_comment\": \"New seasonal item\",\n      \"rests\":\n         {\n             \"10\": 120 \/\/ when 10 - ID warehouse, 120 - quantity in warehouse\n         },\n      \"created_at\": \"2025-01-10T09:30:00Z\",\n      \"updated_at\": \"2025-02-01T16:20:00Z\"\n    }\n  ],\n  \"links\": {\n    \"first\": \"https:\/\/api.example.com\/api\/offers?page=1\",\n    \"last\": \"https:\/\/api.example.com\/api\/offers?page=3\",\n    \"prev\": null,\n    \"next\": \"https:\/\/api.example.com\/api\/offers?page=2\"\n  },\n  \"meta\": {\n    \"current_page\": 1,\n    \"from\": 1,\n    \"last_page\": 3,\n    \"path\": \"https:\/\/api.example.com\/api\/offers\",\n    \"per_page\": 50,\n    \"to\": 50,\n    \"total\": 123\n  }\n}",
                            "name": "Success (paginated list)"
                        }
                    ]
                },
                {
                    "name": "Create products (bulk)",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/products",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/products"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"products\":[\"architecto\"]}"
                        },
                        "description": "Creates multiple products in a single request.\n\n#### Access rules\n- Admins can create products in any shop within any domain.\n- `warehouse_manager` can create products **only** in shops within their `domain_id`.\n- Regular users can create products only in shops where `sh_user_id` \u2208 { current_user.id, current_user.parent_id } and within the same domain.\n\n#### Notes\n- Server will set `of_domain_id` automatically to the caller's domain (for non-admins).\n- Server will set `of_status` to **1** (active) for newly created offers unless overridden by privileged logic.\n- Omit computed fields (e.g., `rests`)."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "[\n  {\n    \"of_id\": 1,\n    \"of_ext_id\": \"EXT-123\",\n    \"of_name\": \"Cotton T-shirt\",\n    \"of_sku\": \"SKU-001\",\n    \"of_article\": \"ART-444\",\n    \"of_price\": 19.99,\n    \"of_status\": 1,\n    \"of_shop_id\": 15,\n    \"of_domain_id\": 3,\n    \"of_dimensions\": { \"x\": 20, \"y\": 10, \"z\": 5 },\n    \"of_weight\": 350,\n    \"of_image\": \"https:\/\/cdn.example.com\/images\/sku001.jpg\",\n    \"of_datamatrix\": 1234567890123,\n    \"of_comment\": \"New seasonal item\",\n    \"rests\": { \"total\": 0, \"by_places\": {} },\n    \"created_at\": \"2025-02-12T10:00:00Z\",\n    \"updated_at\": \"2025-02-12T10:00:00Z\"\n  }\n]",
                            "name": "Created (array of created products as resources)"
                        },
                        {
                            "header": [],
                            "code": 401,
                            "body": "{\n  \"status\": \"error\",\n  \"message\": \"You do not have sufficient rights to create a product in shop ID 15\"\n}",
                            "name": "Insufficient rights"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"message\": \"The given data was invalid.\",\n  \"errors\": {\n    \"0.of_shop_id\": [\"The of_shop_id field is required.\"],\n    \"0.of_name\": [\"The of_name field is required.\"],\n    \"0.of_name.1\": [\"The of_name may not be greater than 150 characters.\"]\n  }\n}",
                            "name": "Validation error example"
                        }
                    ]
                },
                {
                    "name": "Get a single product",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/products\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/products\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "10",
                                    "description": "Product ID."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns a detailed product (offer) by its ID, scoped to the caller\u2019s domain and shop access (see class-level notes)."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"of_id\": 10,\n  \"of_ext_id\": \"EXT-123\",\n  \"of_name\": \"Cotton T-shirt\",\n  \"of_sku\": \"SKU-001\",\n  \"of_article\": \"ART-444\",\n  \"of_price\": 19.99,\n  \"of_status\": 1,\n  \"of_shop_id\": 15,\n  \"of_domain_id\": 3,\n  \"of_dimensions\": { \"x\": 20, \"y\": 10, \"z\": 5 },\n  \"of_weight\": 350,\n  \"of_image\": \"https:\/\/cdn.example.com\/images\/sku001.jpg\",\n  \"of_datamatrix\": 1234567890123,\n  \"of_comment\": \"Seasonal\",\n  \"rests\": { \"total\": 120, \"by_places\": { \"A-01-01\": 50, \"A-01-02\": 70 } },\n  \"created_at\": \"2025-01-10T09:30:00Z\",\n  \"updated_at\": \"2025-02-01T16:20:00Z\"\n}",
                            "name": "Found"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{ \"message\": \"Not found\" }",
                            "name": "Not found or out of scope"
                        }
                    ]
                },
                {
                    "name": "Update a product",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/products\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/products\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "10",
                                    "description": "Product ID."
                                }
                            ]
                        },
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"of_name\":\"\\\"Updated T-shirt\\\"\",\"of_article\":\"\\\"ART-444\\\"\",\"of_sku\":\"\\\"SKU-001\\\"\",\"of_price\":24.5,\"of_estimated_price\":22,\"of_img\":\"\\\"https:\\\/\\\/cdn.example.com\\\/images\\\/sku001-v2.jpg\\\"\",\"of_dimension_x\":21,\"of_dimension_y\":11,\"of_dimension_z\":6,\"of_weight\":360,\"of_datamatrix\":1234567890123,\"of_comment\":\"\\\"Price adjusted\\\"\",\"of_status\":1}"
                        },
                        "description": "Partially updates product fields (PATCH semantics; all provided fields will be updated).\nThe record must belong to the caller\u2019s domain; otherwise, `404 Not found` is returned."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"of_id\": 10,\n  \"of_name\": \"Updated T-shirt\",\n  \"of_price\": 24.50,\n  \"of_status\": 1,\n  \"updated_at\": \"2025-02-12T12:00:00Z\"\n}",
                            "name": "Updated"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\":\"Not found\"}",
                            "name": "Not found in caller's domain"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"message\": \"The given data was invalid.\",\n  \"errors\": { \"of_name\": [\"The of_name may not be greater than 150 characters.\"] }\n}",
                            "name": "Validation error (example)"
                        }
                    ]
                },
                {
                    "name": "Delete a product",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/products\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/products\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "10",
                                    "description": "Product ID."
                                }
                            ]
                        },
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Deletes a product by ID. To prevent accidental cross-shop deletions, the controller also checks that the product\u2019s\n`of_shop_id` matches the caller\u2019s `shop_id` (in addition to domain scoping). If the record is outside of the caller\u2019s scope,\na `404 Not found` is returned."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{ \"message\": \"Deleted\" }",
                            "name": "Deleted"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{ \"message\": \"Not found\" }",
                            "name": "Not found or out of scope"
                        }
                    ]
                }
            ]
        },
        {
            "name": "Users",
            "description": "",
            "item": [
                {
                    "name": "GET api\/user",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/user",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/user"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "response": [
                        {
                            "header": [
                                {
                                    "key": "cache-control",
                                    "value": "no-cache, private"
                                },
                                {
                                    "key": "content-type",
                                    "value": "application\/json"
                                },
                                {
                                    "key": "access-control-allow-origin",
                                    "value": "*"
                                }
                            ],
                            "code": 401,
                            "body": "{\"message\":\"Unauthenticated.\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "POST api\/login",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/login",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/login"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "response": []
                },
                {
                    "name": "POST api\/logout",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/logout",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/logout"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "response": []
                },
                {
                    "name": "POST api\/accounts\/create",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/accounts\/create",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/accounts\/create"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"language\":\"bngz\",\"company\":\"m\",\"FName\":\"i\",\"LName\":\"y\",\"email\":\"justina.gaylord@example.org\",\"password\":\"gxwmi\\\/#iw\\\/\",\"massage\":\"architecto\",\"fst\":4326.41688,\"mName\":\"architecto\"}"
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "response": []
                }
            ]
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "Authorization",
                "type": "string"
            }
        ]
    }
}