{
  "openapi": "3.0.3",
  "info": {
    "title": "Sumtracker Public API v2025-03",
    "version": "2025-03",
    "description": "Public API endpoints which can be accessed using an API key generated from Sumtracker account."
  },
  "paths": {
    "/products/": {
      "get": {
        "operationId": "ProductList",
        "description": "\nList Products.\nProducts can be of 2 types which is determined by the field `bundle_type`:\n- BUNDLE\n- NONE (NORMAL)\n\nInventory for bundle products is calculated based on the inventory of its components.\nComponents are always normal products. The results include only the non-archived products.\n",
        "summary": "List Products",
        "parameters": [
          {
            "in": "query",
            "name": "barcode",
            "schema": {
              "type": "string"
            },
            "description": "Product barcode"
          },
          {
            "in": "query",
            "name": "bundle_type",
            "schema": {
              "type": "string"
            },
            "description": "Can be either `BUNDLE` or `NONE`"
          },
          {
            "in": "query",
            "name": "categories",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Product category names separated by comma. A product type name also matches. Case insensitive.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "contact",
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "created_range_after",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Created at range filter."
          },
          {
            "in": "query",
            "name": "created_range_before",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Created at range filter."
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            },
            "description": "Product name"
          },
          {
            "in": "query",
            "name": "notes",
            "schema": {
              "type": "string"
            },
            "description": "Product notes"
          },
          {
            "in": "query",
            "name": "o",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "-id",
                  "-name",
                  "-sku",
                  "-variant_name",
                  "id",
                  "name",
                  "sku",
                  "variant_name"
                ]
              }
            },
            "description": "Ordering\n\n* `id` - Id\n* `-id` - Id (descending)\n* `name` - Name\n* `-name` - Name (descending)\n* `variant_name` - Variant name\n* `-variant_name` - Variant name (descending)\n* `sku` - Sku\n* `-sku` - Sku (descending)",
            "explode": false,
            "style": "form"
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sku",
            "schema": {
              "type": "string"
            },
            "description": "Product SKU"
          },
          {
            "in": "query",
            "name": "tags",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "updated_range_after",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Updated at range filter."
          },
          {
            "in": "query",
            "name": "updated_range_before",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Updated at range filter."
          },
          {
            "in": "query",
            "name": "variant_name",
            "schema": {
              "type": "string"
            },
            "description": "Product variant name"
          }
        ],
        "tags": [
          "Products"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedProductList"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/products/bundles/lines/": {
      "get": {
        "operationId": "BundleComponentList",
        "description": "\nList Bundle Components.\n\n- Filter components of a bundle using `product` filter.\n- Filter bundles of a product using `component` filter.\n",
        "summary": "List Bundle Components",
        "parameters": [
          {
            "in": "query",
            "name": "component",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "product",
            "schema": {
              "type": "number"
            }
          }
        ],
        "tags": [
          "Products"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedBundleLineList"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/purchases/{document_type}/": {
      "get": {
        "operationId": "PurchaseOrderList",
        "description": "\nList Purchase Orders.\n\n**The purchase orders API and stock transfer API are common.**\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\nA Stock Transfer (ST) is used for moving stock from one warehouse to another.\n\nA Purchase Order (PO) is used for purchasing products from suppliers.\n\nAgainst each PO/ST,\n- You can make changes in relevant data only when PO status is `DRAFT` or `INCOMING`.\n- You can make 1 or more Receive Notes (GRNs) to receive the goods.\n\n",
        "summary": "List Orders",
        "parameters": [
          {
            "in": "query",
            "name": "confirmation_date_range_after",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "confirmation_date_range_before",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "contact",
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "created_range_after",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "created_range_before",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "expected_arrival_date_range_after",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "expected_arrival_date_range_before",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "from_warehouse",
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "is_task_in_progress",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "notes",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "number",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "o",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "-id",
                  "-updated",
                  "id",
                  "updated"
                ]
              }
            },
            "description": "Ordering\n\n* `id` - Id\n* `-id` - Id (descending)\n* `updated` - Updated\n* `-updated` - Updated (descending)",
            "explode": false,
            "style": "form"
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "payment_terms",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "reference",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ship_by_time_range_after",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "ship_by_time_range_before",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "updated_range_after",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "updated_range_before",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "warehouse",
            "schema": {
              "type": "number"
            }
          }
        ],
        "tags": [
          "Purchase Orders"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedPurchaseOrderListList"
                }
              }
            },
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "PurchaseOrderCreate",
        "description": "\nCreate Purchase Order\n\n**The purchase orders API and stock transfer API are common.**\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\nA Stock Transfer (ST) is used for moving stock from one warehouse to another.\n\nA Purchase Order (PO) is used for purchasing products from suppliers.\n\nAgainst each PO/ST,\n- You can make changes in relevant data only when PO status is `DRAFT` or `INCOMING`.\n- You can make 1 or more Receive Notes (GRNs) to receive the goods.\n\n\n\n- In stock transfer creation, `from_warehouse_id` is required.\n- In purchase order creation, `contact_id` (Supplier) is required.\n- `number` is optional. When omitted, the next number in the sequence is assigned. When provided, it must be\nunique for the document type and the sequence still advances by one.\n\n",
        "summary": "Create Order",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          }
        ],
        "tags": [
          "Purchase Orders"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderBase"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderBase"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/purchases/{document_type}/{id}/": {
      "get": {
        "operationId": "PurchaseOrderGet",
        "description": "\nGet a Purchase Order\n\n**The purchase orders API and stock transfer API are common.**\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\nA Stock Transfer (ST) is used for moving stock from one warehouse to another.\n\nA Purchase Order (PO) is used for purchasing products from suppliers.\n\nAgainst each PO/ST,\n- You can make changes in relevant data only when PO status is `DRAFT` or `INCOMING`.\n- You can make 1 or more Receive Notes (GRNs) to receive the goods.\n\n",
        "summary": "Get Order",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Purchase Orders"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderRUD"
                }
              }
            },
            "description": ""
          }
        }
      },
      "put": {
        "operationId": "PurchaseOrderUpdate",
        "description": "\nUpdate Purchase Order\n\n**The purchase orders API and stock transfer API are common.**\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\nA Stock Transfer (ST) is used for moving stock from one warehouse to another.\n\nA Purchase Order (PO) is used for purchasing products from suppliers.\n\nAgainst each PO/ST,\n- You can make changes in relevant data only when PO status is `DRAFT` or `INCOMING`.\n- You can make 1 or more Receive Notes (GRNs) to receive the goods.\n\n",
        "summary": "Update Order",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Purchase Orders"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderRUD"
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderRUD"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/purchases/{document_type}/{po_id}/grns/": {
      "get": {
        "operationId": "GrnList",
        "description": "\nList of Received Notes (GRN)\n\nGRN is used to received products in a purchase order or a stock transfer.\n\nThe GRN API is common for both purchase orders and stock transfers.\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\n",
        "summary": "List GRN",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "is_task_in_progress",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "o",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "-id",
                  "-updated",
                  "id",
                  "updated"
                ]
              }
            },
            "description": "Ordering\n\n* `id` - Id\n* `-id` - Id (descending)\n* `updated` - Updated\n* `-updated` - Updated (descending)",
            "explode": false,
            "style": "form"
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Received Notes (GRN)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedGrnCRUDList"
                }
              }
            },
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "GrnCreate",
        "description": "\nGoods Receive Note (GRN) Create API.\n\n\nGRN is used to received products in a purchase order or a stock transfer.\n\nThe GRN API is common for both purchase orders and stock transfers.\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\n\nGRN creation raises:\n- ValidationError if the PO is not in INCOMING status.\n- ValidationError if the PO already has 200 receive notes.\n        ",
        "summary": "Create GRN",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Received Notes (GRN)"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GrnCRUD"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GrnCRUD"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/purchases/{document_type}/{po_id}/grns/{grn_id}/lines/": {
      "get": {
        "operationId": "GrnLineList",
        "description": "List of GRN lines for a given GRN.",
        "summary": "List GRN Lines",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "grn_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "o",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "-id",
                  "id"
                ]
              }
            },
            "description": "Ordering\n\n* `id` - Id\n* `-id` - Id (descending)",
            "explode": false,
            "style": "form"
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "poline",
            "schema": {
              "type": "number"
            }
          }
        ],
        "tags": [
          "Receive Notes/Lines"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedGrnLineCreateList"
                }
              }
            },
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "GrnLineCreate",
        "description": "\nCreate a GRN line item.\n\nRaises\n- ValidationError if the GRN is not in DRAFT status.\n        ",
        "summary": "Create GRN Line",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "grn_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Receive Notes/Lines"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GrnLineCreate"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GrnLineCreate"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/purchases/{document_type}/{po_id}/grns/{grn_id}/lines/{id}/": {
      "put": {
        "operationId": "GrnLineUpdate",
        "description": "\nUpdate a GRN line item.\n\nRaises\n- ValidationError if the GRN is not in DRAFT status.\n        ",
        "summary": "Update GRN Line",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "grn_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Receive Notes/Lines"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GrnLineRUD"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GrnLineRUD"
                }
              }
            },
            "description": ""
          }
        }
      },
      "delete": {
        "operationId": "GrnLineDelete",
        "description": "\nDelete a GRN line item.\n\nRaises\n- ValidationError if the GRN is not in DRAFT status.\n        ",
        "summary": "Delete GRN Line",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "grn_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Receive Notes/Lines"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "No response body"
          }
        }
      }
    },
    "/purchases/{document_type}/{po_id}/grns/{id}/": {
      "get": {
        "operationId": "GrnGet",
        "description": "\nGets the data of a GRN object.\n\n\nGRN is used to received products in a purchase order or a stock transfer.\n\nThe GRN API is common for both purchase orders and stock transfers.\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\n",
        "summary": "Get GRN",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Received Notes (GRN)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GrnCRUD"
                }
              }
            },
            "description": ""
          }
        }
      },
      "put": {
        "operationId": "GrnUpdate",
        "description": "\nGRN Update API.\n- GRN can only be updated if it is in draft status.\n- In case of stock transfer, `warehouse` in GRN can not be updated.\n        ",
        "summary": "Update GRN",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Received Notes (GRN)"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GrnCRUD"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GrnCRUD"
                }
              }
            },
            "description": ""
          }
        }
      },
      "delete": {
        "operationId": "GrnDelete",
        "description": "\nGRN Delete API.\n- GRN can only be deleted if it is in draft status.\n                ",
        "summary": "Delete GRN",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Received Notes (GRN)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "No response body"
          }
        }
      }
    },
    "/purchases/{document_type}/{po_id}/grns/perform_action/{id}/{action}/": {
      "put": {
        "operationId": "PerformActionGrn",
        "description": "Perform an action on a GRN.\n- `mark-received` mark the grn as received.\n- `undo-receive` undo the `mark-received` action.\n- `mark-final` finalize the wavg_landed_cost of the product. This action is only available for the PO GRNs.\n- `mark-received-and-final` marks the GRN as received and final in a single step. Equivalent to performing\n  `mark-received` followed by `mark-final`. Only available for PO GRNs (not Stock Transfers).\n- `undo-final` undo the `mark-final` action. This action is only available for the PO GRNs.\n- `add-due-quantity` adds all the due quantity from purchase order to grn.\n- `cancel` cancels the GRN. This action is only available when GRN is marked received.\nThe above actions are async. You will get the task status using the field `is_task_in_progress`.",
        "summary": "Performs Action on GRN",
        "parameters": [
          {
            "in": "path",
            "name": "action",
            "schema": {
              "type": "string",
              "enum": [
                "add-due-quantity",
                "cancel",
                "mark-final",
                "mark-received",
                "mark-received-and-final",
                "undo-receive"
              ]
            },
            "required": true
          },
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Received Notes (GRN)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GrnCRUD"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/purchases/{document_type}/{po_id}/lines/": {
      "get": {
        "operationId": "PoLineList",
        "description": "Lists PO Lines for a given PO.",
        "summary": "List PO Lines",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "error__isnull",
            "schema": {
              "type": "boolean"
            },
            "description": "Set to `false` to filter lines that have an error."
          },
          {
            "in": "query",
            "name": "is_due",
            "schema": {
              "type": "boolean"
            },
            "description": "Set to `true` to filter lines that have a due quantity."
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "notes",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "o",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "-id",
                  "id"
                ]
              }
            },
            "description": "Ordering\n\n* `id` - Id\n* `-id` - Id (descending)",
            "explode": false,
            "style": "form"
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "product",
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "quantity__isnull",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "supplier_sku",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "uom",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Purchase Orders/Lines"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedPoLineList"
                }
              }
            },
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "PoLineCreate",
        "description": "\nCreates a purchase order line.\n\nThe `pack_size` data is added at the time of creation,\nso `quantity` cannot be added at the time of creation.\nThis is becuase quantity should be a multiple of the pack size value.\nUse the line update API to add the `quantity`.\n\nRaises:\n- ValidationError if the PO is not in DRAFT status.\n- ValidationError if the product is already added in the PO.\n- ValidationError if the product is archived.\n- ValidationError if the product is a bundle product.\n- ValidationError if the PO already has 10000 lines.\n",
        "summary": "Create PO Line",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Purchase Orders/Lines"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PoLine"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoLine"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/purchases/{document_type}/{po_id}/lines/{id}/": {
      "put": {
        "operationId": "POLineUpdate",
        "description": "\nUpdate a purchase order line.\n\nRaises:\n- ValidationError if the PO is not in DRAFT status.\n        ",
        "summary": "Update PO Line",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Purchase Orders/Lines"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PoLineUpdate"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoLineUpdate"
                }
              }
            },
            "description": ""
          }
        }
      },
      "delete": {
        "operationId": "POLineDelete",
        "description": "\nDelete a purchase order line.\n\nRaises:\n- ValidationError if the PO is not in DRAFT status.\n        ",
        "summary": "Delete PO Line",
        "parameters": [
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "po_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Purchase Orders/Lines"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "No response body"
          }
        }
      }
    },
    "/purchases/{document_type}/perform_action/{id}/{action}/": {
      "put": {
        "operationId": "PerformActionPurchaseOrder",
        "description": "Perform action on the purchase order or stock trasnfer.\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\nThe action can have the following values:\n- `mark-incoming` Mark the PO as incoming.\n- `undo-mark-incoming` Undo mark incoming.\n- `close` Mark the PO as closed.\n- `undo-close` Reopen the PO.\n- `cancel` Cancel the order.\n- `receive-all-products` Receive all due products in a PO. This will create a GRN for receiving the products.\n- `generate-pdf` Generate a PDF for the PO.\n\nThe above actions are async. You will get the task status using the field `is_task_in_progress`.",
        "summary": "Perform Action on Order",
        "parameters": [
          {
            "in": "path",
            "name": "action",
            "schema": {
              "type": "string",
              "enum": [
                "cancel",
                "close",
                "generate-pdf",
                "mark-incoming",
                "receive-all-products",
                "undo-close",
                "undo-mark-incoming"
              ]
            },
            "required": true
          },
          {
            "in": "path",
            "name": "document_type",
            "schema": {
              "type": "string",
              "pattern": "^orders|stock-transfers$"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Purchase Orders"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderBase"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/purchases/contacts/": {
      "get": {
        "operationId": "SupplierList",
        "description": "\nSuppliers (Vendors) are used to create purchase orders.\n",
        "summary": "List of Suppliers",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "company_name",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "o",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "-code",
                  "-id",
                  "code",
                  "id"
                ]
              }
            },
            "description": "Ordering\n\n* `code` - Code\n* `-code` - Code (descending)\n* `id` - Id\n* `-id` - Id (descending)",
            "explode": false,
            "style": "form"
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Suppliers"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedContactList"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/purchases/contacts/{id}/": {
      "get": {
        "operationId": "SupplierRetrieve",
        "description": "\nSuppliers (Vendors) are used to create purchase orders.\n",
        "summary": "Retrieve a Supplier",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Suppliers"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/settings/taxes/": {
      "get": {
        "operationId": "TaxList",
        "description": "\nList all Taxes. The tax id of a purchase order line refers to one of these taxes.\nWhen you add a product to a purchase order, the tax of the supplier's purchase rate for the product is used to\ncalculate taxes.\n",
        "summary": "List Taxes",
        "parameters": [
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Tax"
                  }
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/settings/warehouses/": {
      "get": {
        "operationId": "WarehouseList",
        "description": "\nList of all warehouses sorted by priority.\n\nSumtracker supports inventory management at multiple warehouses. A product can be stored at\nmultiple warehouses. When creating stock adjustment, purchase orders and stock transfers you\nneed to mention the `warehouse_id` where you want the operation to take place.\n",
        "summary": "List Warehouses",
        "parameters": [
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Warehouse"
                  }
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/stock/adjustment/": {
      "post": {
        "operationId": "StockAdjustmentLineCreate",
        "description": "Adjust the inventory of a single product at a particular warehouse.",
        "summary": "Create Stock Adjustment Line",
        "tags": [
          "Stock Adjustment Line"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAdjustmentLineCreate"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockAdjustmentLineCreate"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/stock/adjustment/documents/": {
      "get": {
        "operationId": "StockAdjustmentDocumentList",
        "description": "\nStock adjustment documents are used to adjust the stock levels in bulk. You can add\nmultiple product in the document and based on the `adjustment_type` the stock levels will be adjusted.\nThe mark complete action is async. You will get the task status using the field `is_task_in_progress`.\n        ",
        "summary": "List Stock Adjustment Documents",
        "parameters": [
          {
            "in": "query",
            "name": "adjustment_type",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "created_range_after",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Created at"
          },
          {
            "in": "query",
            "name": "created_range_before",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Created at"
          },
          {
            "in": "query",
            "name": "is_complete",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "is_task_in_progress",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "notes",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "number",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "o",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "-id",
                  "-updated",
                  "id",
                  "updated"
                ]
              }
            },
            "description": "Ordering\n\n* `id` - Id\n* `-id` - Id (descending)\n* `updated` - Updated\n* `-updated` - Updated (descending)",
            "explode": false,
            "style": "form"
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "reason",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "updated_range_after",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Updated at"
          },
          {
            "in": "query",
            "name": "updated_range_before",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Updated at"
          },
          {
            "in": "query",
            "name": "warehouse",
            "schema": {
              "type": "number"
            }
          }
        ],
        "tags": [
          "Stock Adjustment Documents"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedStockAdjustmentDocumentList"
                }
              }
            },
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "StockAdjustmentDocumentCreate",
        "description": "API endpoint to create and list adjustment documents.",
        "summary": "Create Stock Adjustment Document",
        "tags": [
          "Stock Adjustment Documents"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAdjustmentDocument"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockAdjustmentDocument"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/stock/adjustment/documents/{document_id}/lines/": {
      "get": {
        "operationId": "StockAdjustmentDocumentLineList",
        "description": "List of adjustment lines for a given adjustment document.",
        "summary": "List Lines",
        "parameters": [
          {
            "in": "path",
            "name": "document_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "o",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "-id",
                  "id"
                ]
              }
            },
            "description": "Ordering\n\n* `id` - Id\n* `-id` - Id (descending)",
            "explode": false,
            "style": "form"
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "product",
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "quantity__isnull",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "tags": [
          "Stock Adjustment Documents/Lines"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedStockAdjustmentDocumentLineList"
                }
              }
            },
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "StockAdjustmentDocumentLineCreate",
        "description": "Create a new adjustment line item.",
        "summary": "Create Line",
        "parameters": [
          {
            "in": "path",
            "name": "document_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Stock Adjustment Documents/Lines"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAdjustmentDocumentLine"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockAdjustmentDocumentLine"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/stock/adjustment/documents/{document_id}/lines/{id}/": {
      "put": {
        "operationId": "StockAdjustmentDocumentLineUpdate",
        "description": "Update the quantity of a product in the adjustment line item.",
        "summary": "Update Line",
        "parameters": [
          {
            "in": "path",
            "name": "document_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Stock Adjustment Documents/Lines"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAdjustmentDocumentLineUpdate"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockAdjustmentDocumentLineUpdate"
                }
              }
            },
            "description": ""
          }
        }
      },
      "delete": {
        "operationId": "StockAdjustmentDocumentLineDelete",
        "description": "Delete the adjustment line item.",
        "summary": "Delete Line",
        "parameters": [
          {
            "in": "path",
            "name": "document_id",
            "schema": {
              "type": "integer"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Stock Adjustment Documents/Lines"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "No response body"
          }
        }
      }
    },
    "/stock/adjustment/documents/{id}/": {
      "get": {
        "operationId": "StockAdjustmentDocumentGet",
        "description": "Get the details of a single adjustment document.",
        "summary": "Get Stock Adjustment Document",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Stock Adjustment Documents"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockAdjustmentDocumentUpdate"
                }
              }
            },
            "description": ""
          }
        }
      },
      "put": {
        "operationId": "StockAdjustmentDocumentUpdate",
        "description": "Update the adjustment document.",
        "summary": "Update Stock Adjustment Document",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Stock Adjustment Documents"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAdjustmentDocumentUpdate"
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockAdjustmentDocumentUpdate"
                }
              }
            },
            "description": ""
          }
        }
      },
      "delete": {
        "operationId": "StockAdjustmentDocumentDelete",
        "description": "Deletes the adjustment document. Only documents with `is_complete` as False can be deleted.",
        "summary": "Delete Stock Adjustment Document",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Stock Adjustment Documents"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "No response body"
          }
        }
      }
    },
    "/stock/adjustment/documents/perform_action/{id}/mark-complete/": {
      "put": {
        "operationId": "PerformActionStockAdjustment",
        "description": "Mark the stock adjustment document as complete.\nThis will adjust the stock levels of all the products in the document.\nWhen you send the request to mark the document as complete, the field `is_task_in_progress` becomes `true`\nwhich means the background task has started now. When the field becomes `false` it means the task has finished\nand the document is now complete.",
        "summary": "Mark Complete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "tags": [
          "Stock Adjustment Documents"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockAdjustmentDocument"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/stock/levels/": {
      "get": {
        "operationId": "StockLevelList",
        "description": "\n⚠️ **DEPRECATED**: This API version will be deprecated on 24th November 2025 00:00 UTC.\nPlease migrate to API version 2025-11 which uses cursor pagination for better performance.\n\nList all non-bundle stock levels.\nStock levels have inventory information for a product at particular warehouse.\nThis API does not include bundle stock levels.\n- `in_stock` is the current stock.\n- `booked` is the stock which is reserved for unfulfilled orders.\n- `available` is the current stock minus the booked stock.\n- `incoming` is the stock which is pending to be received from purchase orders or stock transfers.\n\n**Migration Guide**: Use `/public-apis/2025-11/stock/stocklevels/` for improved cursor pagination.\n        ",
        "summary": "List Stock Levels",
        "parameters": [
          {
            "in": "query",
            "name": "available_max",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "available_min",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "booked_max",
            "schema": {
              "type": "integer",
              "maximum": 2147483647,
              "minimum": -2147483648
            }
          },
          {
            "in": "query",
            "name": "booked_min",
            "schema": {
              "type": "integer",
              "maximum": 2147483647,
              "minimum": -2147483648
            }
          },
          {
            "in": "query",
            "name": "in_stock_max",
            "schema": {
              "type": "integer",
              "maximum": 2147483647,
              "minimum": -2147483648
            }
          },
          {
            "in": "query",
            "name": "in_stock_min",
            "schema": {
              "type": "integer",
              "maximum": 2147483647,
              "minimum": -2147483648
            }
          },
          {
            "in": "query",
            "name": "incoming_max",
            "schema": {
              "type": "integer",
              "maximum": 2147483647,
              "minimum": -2147483648
            }
          },
          {
            "in": "query",
            "name": "incoming_min",
            "schema": {
              "type": "integer",
              "maximum": 2147483647,
              "minimum": -2147483648
            }
          },
          {
            "in": "query",
            "name": "is_below_threshold",
            "schema": {
              "type": "boolean"
            },
            "description": "Available + incoming stock is less than min level."
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "o",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "-available",
                  "-booked",
                  "-id",
                  "-in_stock",
                  "-incoming",
                  "-product__name",
                  "-product__sku",
                  "-product__variant_name",
                  "-product_id",
                  "-warehouse_id",
                  "available",
                  "booked",
                  "id",
                  "in_stock",
                  "incoming",
                  "product__name",
                  "product__sku",
                  "product__variant_name",
                  "product_id",
                  "warehouse_id"
                ]
              }
            },
            "description": "Ordering\n\n* `id` - Id\n* `-id` - Id (descending)\n* `product_id` - Product id\n* `-product_id` - Product id (descending)\n* `warehouse_id` - Warehouse id\n* `-warehouse_id` - Warehouse id (descending)\n* `product__sku` - Product  sku\n* `-product__sku` - Product  sku (descending)\n* `product__name` - Product  name\n* `-product__name` - Product  name (descending)\n* `product__variant_name` - Product  variant name\n* `-product__variant_name` - Product  variant name (descending)\n* `in_stock` - In stock\n* `-in_stock` - In stock (descending)\n* `booked` - Booked\n* `-booked` - Booked (descending)\n* `incoming` - Incoming\n* `-incoming` - Incoming (descending)\n* `available` - Available\n* `-available` - Available (descending)",
            "explode": false,
            "style": "form"
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "product",
            "schema": {
              "type": "number"
            },
            "description": "Product id"
          },
          {
            "in": "query",
            "name": "product_barcode",
            "schema": {
              "type": "string"
            },
            "description": "Product barcode. Case sensitive."
          },
          {
            "in": "query",
            "name": "product_categories",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Product category names separated by comma. A product type name also matches. Case insensitive.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "product_name",
            "schema": {
              "type": "string"
            },
            "description": "Product name. Case insensitive."
          },
          {
            "in": "query",
            "name": "product_sku",
            "schema": {
              "type": "string"
            },
            "description": "Product SKU. Case insensitive."
          },
          {
            "in": "query",
            "name": "product_tags",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "product_variant_name",
            "schema": {
              "type": "string"
            },
            "description": "Product variant name. Case insensitive."
          },
          {
            "in": "query",
            "name": "products",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "description": "Product ids separated by comma",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "warehouse",
            "schema": {
              "type": "number"
            },
            "description": "Warehouse id"
          }
        ],
        "tags": [
          "Stock"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedStockLevelList"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/stock/levels/bundles/": {
      "get": {
        "operationId": "StockLevelBundleList",
        "description": "\n⚠️ **DEPRECATED**: This API version will be deprecated on 24th November 2025 00:00 UTC.\nPlease migrate to API version 2025-11 which uses cursor pagination for better performance.\n\nList all bundle stock levels.\nEach bundle product has a list of component stock levels.\n\n### How is bundle available stock calculated?\nThe `available` stock of a bundle is based on the lowest available stock of its components.\nEach component in the bundle has a `component_quantity` which represents how many components are needed\nto make 1 bundle product. Based on the `available` stock of component divided by the `component_quantity`\nwe can calculate the `available` stock of the bundle.\n\n**Migration Guide**: Use `/public-apis/2025-11/stock/stocklevels/bundles/` for improved cursor pagination.\n        ",
        "summary": "List Bundle Stock Levels",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "o",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "-id",
                  "-product__name",
                  "-product__sku",
                  "-product__variant_name",
                  "-product_id",
                  "-warehouse_id",
                  "id",
                  "product__name",
                  "product__sku",
                  "product__variant_name",
                  "product_id",
                  "warehouse_id"
                ]
              }
            },
            "description": "Ordering\n\n* `id` - Id\n* `-id` - Id (descending)\n* `product_id` - Product id\n* `-product_id` - Product id (descending)\n* `warehouse_id` - Warehouse id\n* `-warehouse_id` - Warehouse id (descending)\n* `product__sku` - Product  sku\n* `-product__sku` - Product  sku (descending)\n* `product__name` - Product  name\n* `-product__name` - Product  name (descending)\n* `product__variant_name` - Product  variant name\n* `-product__variant_name` - Product  variant name (descending)",
            "explode": false,
            "style": "form"
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "The initial index from which to return the results.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "product",
            "schema": {
              "type": "number"
            },
            "description": "Product id"
          },
          {
            "in": "query",
            "name": "product_barcode",
            "schema": {
              "type": "string"
            },
            "description": "Product barcode. Case sensitive."
          },
          {
            "in": "query",
            "name": "product_categories",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Product category names separated by comma. A product type name also matches. Case insensitive.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "product_name",
            "schema": {
              "type": "string"
            },
            "description": "Product name. Case insensitive."
          },
          {
            "in": "query",
            "name": "product_sku",
            "schema": {
              "type": "string"
            },
            "description": "Product SKU. Case insensitive."
          },
          {
            "in": "query",
            "name": "product_tags",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Multiple values may be separated by commas.",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "product_variant_name",
            "schema": {
              "type": "string"
            },
            "description": "Product variant name. Case insensitive."
          },
          {
            "in": "query",
            "name": "products",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "description": "Product ids separated by comma",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "warehouse",
            "schema": {
              "type": "number"
            },
            "description": "Warehouse id"
          }
        ],
        "tags": [
          "Stock"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedStockLevelBundleList"
                }
              }
            },
            "description": ""
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Address": {
        "type": "object",
        "description": "This serializer makes all fields read-only. It also sets the user's account\ntimezone for the date time fields.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "company_name": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "first_name": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "last_name": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "phone": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "email": {
            "readOnly": true,
            "oneOf": [
              {
                "type": "string",
                "format": "email",
                "maxLength": 254
              },
              {
                "type": "string",
                "maxLength": 0
              }
            ]
          },
          "tax_num": {
            "type": "string",
            "readOnly": true,
            "maxLength": 20
          },
          "address_line_1": {
            "type": "string",
            "readOnly": true,
            "maxLength": 200
          },
          "address_line_2": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "city": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "state": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "pincode": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "country": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          }
        },
        "required": [
          "address_line_1",
          "address_line_2",
          "city",
          "company_name",
          "country",
          "email",
          "first_name",
          "id",
          "last_name",
          "phone",
          "pincode",
          "state",
          "tax_num"
        ]
      },
      "AdjustmentTypeEnum": {
        "enum": [
          "SET",
          "ADD",
          "SUB"
        ],
        "type": "string",
        "description": "* `SET` - SET\n* `ADD` - ADD\n* `SUB` - SUB"
      },
      "BundleLine": {
        "type": "object",
        "description": "This serializer makes all fields read-only. It also sets the user's account\ntimezone for the date time fields.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "product_id": {
            "type": "integer",
            "readOnly": true
          },
          "component_id": {
            "type": "integer",
            "readOnly": true
          },
          "component": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ],
            "readOnly": true
          },
          "quantity": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": 0,
            "readOnly": true
          }
        },
        "required": [
          "component",
          "component_id",
          "id",
          "product_id",
          "quantity"
        ]
      },
      "Contact": {
        "type": "object",
        "description": "Serializer for List of Suppliers.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "code": {
            "type": "string",
            "readOnly": true,
            "maxLength": 50
          },
          "first_name": {
            "type": "string",
            "readOnly": true,
            "maxLength": 200
          },
          "last_name": {
            "type": "string",
            "readOnly": true,
            "maxLength": 200
          },
          "company_name": {
            "type": "string",
            "readOnly": true,
            "maxLength": 200
          },
          "email": {
            "readOnly": true,
            "oneOf": [
              {
                "type": "string",
                "format": "email",
                "maxLength": 254
              },
              {
                "type": "string",
                "maxLength": 0
              }
            ]
          },
          "phone": {
            "type": "string",
            "readOnly": true,
            "maxLength": 200
          },
          "address_line_1": {
            "type": "string",
            "readOnly": true,
            "maxLength": 200
          },
          "address_line_2": {
            "type": "string",
            "readOnly": true,
            "maxLength": 200
          },
          "city": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "state": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "pincode": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "country": {
            "type": "string",
            "readOnly": true,
            "maxLength": 100
          },
          "payment_terms": {
            "type": "string",
            "readOnly": true,
            "maxLength": 1024
          },
          "notes": {
            "type": "string",
            "readOnly": true,
            "description": "Internal notes for the user's reference.",
            "maxLength": 1024
          },
          "currency": {
            "type": "string",
            "readOnly": true,
            "maxLength": 5
          }
        },
        "required": [
          "address_line_1",
          "address_line_2",
          "city",
          "code",
          "company_name",
          "country",
          "currency",
          "email",
          "first_name",
          "id",
          "last_name",
          "notes",
          "payment_terms",
          "phone",
          "pincode",
          "state"
        ]
      },
      "GrnCRUD": {
        "type": "object",
        "description": "Serializer used for performing CRUD on a GRN.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "number": {
            "type": "string",
            "readOnly": true
          },
          "is_task_in_progress": {
            "type": "boolean",
            "readOnly": true,
            "description": "Is any background task in progress. For example mark as complete task."
          },
          "action_performed": {
            "type": "string",
            "readOnly": true,
            "description": "The action performed on the document which initiated the task."
          },
          "notes": {
            "type": "string"
          },
          "total_quantity": {
            "type": "integer",
            "readOnly": true,
            "description": "Total sum of quantities from all associated lines within the document."
          },
          "extra_charges": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "extra_shipping": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "subtotal": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "total_tax": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "total_shipping": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "total_amount": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "purchase_order_id": {
            "type": "integer",
            "readOnly": true
          },
          "is_stock_transfer": {
            "type": "boolean",
            "readOnly": true
          },
          "delivery_time": {
            "type": "string",
            "format": "date",
            "readOnly": true
          },
          "reference": {
            "type": "string",
            "description": "Optional reference number or notes for this GRN.",
            "maxLength": 500
          },
          "warehouse_id": {
            "type": "integer",
            "description": "If GRN is created for ST then:\n1. warehouse_id cannot be same as from_warehouse_id\n2. warehouse_id cannot be updated once GRN is created"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StatusEnum"
              }
            ],
            "readOnly": true,
            "description": "Current status: DRAFT (editable) → RECEIVED (stock updated) → FINAL (costs applied) or CANCELLED\n\n* `DRAFT` - DRAFT\n* `RECEIVED` - RECEIVED\n* `FINAL` - FINAL\n* `CANCELLED` - CANCELLED"
          },
          "receive_by_time": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "User defines the expected delivery time."
          }
        },
        "required": [
          "action_performed",
          "created",
          "delivery_time",
          "extra_charges",
          "extra_shipping",
          "id",
          "is_stock_transfer",
          "is_task_in_progress",
          "number",
          "purchase_order_id",
          "status",
          "subtotal",
          "total_amount",
          "total_quantity",
          "total_shipping",
          "total_tax",
          "updated",
          "warehouse_id"
        ]
      },
      "GrnLineCreate": {
        "type": "object",
        "description": "Serializer used for listing the Grn instances and creating a new instance.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "quantity": {
            "type": "integer",
            "readOnly": true,
            "nullable": true
          },
          "grn_id": {
            "type": "integer",
            "readOnly": true
          },
          "poline_id": {
            "type": "integer"
          },
          "is_stock_transfer": {
            "type": "boolean",
            "readOnly": true
          },
          "line_subtotal": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "line_tax": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "line_total": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          }
        },
        "required": [
          "created",
          "grn_id",
          "id",
          "is_stock_transfer",
          "line_subtotal",
          "line_tax",
          "line_total",
          "poline_id",
          "quantity"
        ]
      },
      "GrnLineRUD": {
        "type": "object",
        "description": "Serializer used for retrieving, updating and deleting the Grn Instance.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "quantity": {
            "type": "integer",
            "description": "quantity in multiple of `pack_size`."
          },
          "grn_id": {
            "type": "integer",
            "readOnly": true
          },
          "poline_id": {
            "type": "integer",
            "readOnly": true
          },
          "is_stock_transfer": {
            "type": "boolean",
            "readOnly": true
          },
          "line_subtotal": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "line_tax": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "line_total": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          }
        },
        "required": [
          "created",
          "grn_id",
          "id",
          "is_stock_transfer",
          "line_subtotal",
          "line_tax",
          "line_total",
          "poline_id",
          "quantity"
        ]
      },
      "PaginatedBundleLineList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BundleLine"
            }
          }
        }
      },
      "PaginatedContactList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          }
        }
      },
      "PaginatedGrnCRUDList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GrnCRUD"
            }
          }
        }
      },
      "PaginatedGrnLineCreateList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GrnLineCreate"
            }
          }
        }
      },
      "PaginatedPoLineList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PoLine"
            }
          }
        }
      },
      "PaginatedProductList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          }
        }
      },
      "PaginatedPurchaseOrderListList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PurchaseOrderList"
            }
          }
        }
      },
      "PaginatedStockAdjustmentDocumentLineList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockAdjustmentDocumentLine"
            }
          }
        }
      },
      "PaginatedStockAdjustmentDocumentList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockAdjustmentDocument"
            }
          }
        }
      },
      "PaginatedStockLevelBundleList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockLevelBundle"
            }
          }
        }
      },
      "PaginatedStockLevelList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=400&limit=100"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?offset=200&limit=100"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockLevel"
            }
          }
        }
      },
      "PoLine": {
        "type": "object",
        "description": "Serializer used for CRUD operations of POLine.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "product_id": {
            "type": "integer"
          },
          "product": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ],
            "readOnly": true
          },
          "quantity": {
            "type": "integer",
            "readOnly": true,
            "nullable": true
          },
          "purchase_order_id": {
            "type": "integer",
            "readOnly": true
          },
          "is_stock_transfer": {
            "type": "boolean",
            "readOnly": true
          },
          "tax_id": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "delivered_quantity": {
            "type": "integer",
            "readOnly": true
          },
          "uom": {
            "type": "string",
            "readOnly": true
          },
          "pack_size": {
            "type": "integer",
            "readOnly": true
          },
          "supplier_sku": {
            "type": "string",
            "readOnly": true
          },
          "notes": {
            "type": "string",
            "readOnly": true
          },
          "tax_rate": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,8}(?:\\.\\d{0,6})?$",
            "readOnly": true
          },
          "cost": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "shipping_cost": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "moq": {
            "type": "integer",
            "readOnly": true
          },
          "line_subtotal": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "line_tax": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "line_total": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "error": {
            "type": "string",
            "readOnly": true,
            "nullable": true,
            "description": "Reason the line is not ready yet. Null when the line is fine. Blocks all document actions."
          }
        },
        "required": [
          "cost",
          "created",
          "delivered_quantity",
          "error",
          "id",
          "is_stock_transfer",
          "line_subtotal",
          "line_tax",
          "line_total",
          "moq",
          "notes",
          "pack_size",
          "product",
          "product_id",
          "purchase_order_id",
          "quantity",
          "shipping_cost",
          "supplier_sku",
          "tax_id",
          "tax_rate",
          "uom"
        ]
      },
      "PoLineUpdate": {
        "type": "object",
        "description": "Serializer for updating the POLine Instance.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "product_id": {
            "type": "integer",
            "readOnly": true
          },
          "product": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ],
            "readOnly": true
          },
          "quantity": {
            "type": "integer",
            "description": "quantity in multiple of `pack_size`."
          },
          "purchase_order_id": {
            "type": "integer",
            "readOnly": true
          },
          "is_stock_transfer": {
            "type": "boolean",
            "readOnly": true
          },
          "tax_id": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "delivered_quantity": {
            "type": "integer",
            "readOnly": true
          },
          "uom": {
            "type": "string",
            "readOnly": true
          },
          "pack_size": {
            "type": "integer",
            "readOnly": true
          },
          "supplier_sku": {
            "type": "string",
            "readOnly": true
          },
          "notes": {
            "type": "string",
            "maxLength": 200
          },
          "tax_rate": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,8}(?:\\.\\d{0,6})?$",
            "readOnly": true
          },
          "cost": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$"
          },
          "shipping_cost": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$"
          },
          "moq": {
            "type": "integer",
            "readOnly": true
          },
          "line_subtotal": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "line_tax": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "line_total": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "error": {
            "type": "string",
            "readOnly": true,
            "nullable": true,
            "description": "Reason the line is not ready yet. Null when the line is fine. Blocks all document actions."
          }
        },
        "required": [
          "created",
          "delivered_quantity",
          "error",
          "id",
          "is_stock_transfer",
          "line_subtotal",
          "line_tax",
          "line_total",
          "moq",
          "pack_size",
          "product",
          "product_id",
          "purchase_order_id",
          "quantity",
          "supplier_sku",
          "tax_id",
          "tax_rate",
          "uom"
        ]
      },
      "Product": {
        "type": "object",
        "description": "Product object.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "readOnly": true,
            "maxLength": 200
          },
          "sku": {
            "type": "string",
            "readOnly": true,
            "maxLength": 200
          },
          "variant_name": {
            "type": "string",
            "readOnly": true,
            "maxLength": 200
          },
          "barcode": {
            "type": "string",
            "readOnly": true,
            "maxLength": 200
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255
            },
            "readOnly": true,
            "nullable": true
          },
          "image_url": {
            "readOnly": true,
            "oneOf": [
              {
                "type": "string",
                "format": "uri",
                "maxLength": 4096
              },
              {
                "type": "string",
                "maxLength": 0
              }
            ]
          },
          "notes": {
            "type": "string",
            "readOnly": true,
            "maxLength": 500
          },
          "bundle_type": {
            "type": "string",
            "readOnly": true,
            "maxLength": 20
          },
          "wavg_landed_cost": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "uom": {
            "type": "string",
            "readOnly": true,
            "maxLength": 10
          }
        },
        "required": [
          "barcode",
          "bundle_type",
          "categories",
          "created",
          "id",
          "image_url",
          "name",
          "notes",
          "sku",
          "uom",
          "updated",
          "variant_name",
          "wavg_landed_cost"
        ]
      },
      "PurchaseOrderBase": {
        "type": "object",
        "description": "Purchase Order Base Serializer used for creating, updating and retrieving the PO+ST instance.",
        "properties": {
          "contact_id": {
            "type": "integer",
            "description": "Required to create a purchase order"
          },
          "warehouse_id": {
            "type": "integer"
          },
          "from_warehouse_id": {
            "type": "integer",
            "description": "Required to create a stock transfer"
          },
          "notes": {
            "type": "string"
          },
          "extra_charges": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$"
          },
          "extra_shipping": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$"
          },
          "confirmation_date": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Date the order was confirmed"
          },
          "ship_by_time": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Date by which the supplier is expected to ship the goods"
          },
          "expected_arrival_date": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Date the goods are expected to arrive at the warehouse"
          },
          "payment_terms": {
            "type": "string",
            "maxLength": 200
          },
          "reference": {
            "type": "string",
            "maxLength": 500
          },
          "shipping_carrier": {
            "type": "string",
            "maxLength": 200
          },
          "tracking_number": {
            "type": "string",
            "maxLength": 200
          },
          "tracking_url": {
            "oneOf": [
              {
                "type": "string",
                "format": "uri",
                "maxLength": 200
              },
              {
                "type": "string",
                "maxLength": 0
              }
            ]
          },
          "number": {
            "type": "string",
            "description": "Must be unique per client and document type. Generated automatically when not provided. The automatic number sequence advances even when a number is provided.",
            "maxLength": 20
          },
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "is_task_in_progress": {
            "type": "boolean",
            "readOnly": true,
            "description": "Is any background task in progress. For example mark as complete task."
          },
          "action_performed": {
            "type": "string",
            "readOnly": true,
            "description": "The action performed on the document which initiated the task."
          },
          "total_quantity": {
            "type": "integer",
            "readOnly": true,
            "description": "Total sum of quantities from all associated lines within the document."
          },
          "total_shipping": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "total_tax": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "total_amount": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "subtotal": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "status": {
            "type": "integer",
            "readOnly": true
          },
          "currency": {
            "type": "string",
            "readOnly": true
          },
          "conversion_rate": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "billing_address_id": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "billing_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "readOnly": true
          },
          "shipping_address_id": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "shipping_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "action_performed",
          "billing_address",
          "billing_address_id",
          "conversion_rate",
          "created",
          "currency",
          "id",
          "is_task_in_progress",
          "shipping_address",
          "shipping_address_id",
          "status",
          "subtotal",
          "total_amount",
          "total_quantity",
          "total_shipping",
          "total_tax",
          "updated",
          "warehouse_id"
        ]
      },
      "PurchaseOrderList": {
        "type": "object",
        "description": "Serializer used for getting the Purchase Orders List.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "contact_id": {
            "type": "integer",
            "readOnly": true
          },
          "warehouse_id": {
            "type": "integer",
            "readOnly": true
          },
          "from_warehouse_id": {
            "type": "integer",
            "readOnly": true
          },
          "number": {
            "type": "string",
            "readOnly": true,
            "maxLength": 20
          },
          "status": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648,
            "readOnly": true
          },
          "confirmation_date": {
            "type": "string",
            "format": "date",
            "readOnly": true,
            "nullable": true,
            "description": "Date of confirmed purchase order, when the po is marked incoming for the first time."
          },
          "ship_by_time": {
            "type": "string",
            "format": "date",
            "readOnly": true,
            "nullable": true,
            "description": "Date by which the supplier is expected to ship the goods"
          },
          "expected_arrival_date": {
            "type": "string",
            "format": "date",
            "readOnly": true,
            "nullable": true,
            "description": "Date of expected arrival of goods"
          },
          "notes": {
            "type": "string",
            "readOnly": true
          },
          "reference": {
            "type": "string",
            "readOnly": true,
            "maxLength": 500
          },
          "total_amount": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "total_quantity": {
            "type": "integer",
            "maximum": 9223372036854775807,
            "minimum": 0,
            "format": "int64",
            "readOnly": true,
            "description": "Total sum of quantities from all associated lines within the document."
          },
          "total_tax": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "total_shipping": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "is_task_in_progress": {
            "type": "boolean",
            "readOnly": true,
            "description": "Is any background task in progress. For example mark as complete task."
          },
          "action_performed": {
            "type": "string",
            "readOnly": true,
            "description": "The action performed on the document which initiated the task.",
            "maxLength": 1024
          },
          "currency": {
            "type": "string",
            "readOnly": true,
            "maxLength": 3
          },
          "conversion_rate": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          }
        },
        "required": [
          "action_performed",
          "confirmation_date",
          "contact_id",
          "conversion_rate",
          "created",
          "currency",
          "expected_arrival_date",
          "from_warehouse_id",
          "id",
          "is_task_in_progress",
          "notes",
          "number",
          "reference",
          "ship_by_time",
          "status",
          "total_amount",
          "total_quantity",
          "total_shipping",
          "total_tax",
          "updated",
          "warehouse_id"
        ]
      },
      "PurchaseOrderRUD": {
        "type": "object",
        "description": "Serializer used for retrieving, updating or deleting the PO instance.",
        "properties": {
          "contact_id": {
            "type": "integer",
            "readOnly": true
          },
          "warehouse_id": {
            "type": "integer",
            "readOnly": true
          },
          "from_warehouse_id": {
            "type": "integer",
            "readOnly": true
          },
          "notes": {
            "type": "string"
          },
          "extra_charges": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$"
          },
          "extra_shipping": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$"
          },
          "confirmation_date": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Date the order was confirmed"
          },
          "ship_by_time": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Date by which the supplier is expected to ship the goods"
          },
          "expected_arrival_date": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Date the goods are expected to arrive at the warehouse"
          },
          "payment_terms": {
            "type": "string",
            "maxLength": 200
          },
          "reference": {
            "type": "string",
            "maxLength": 500
          },
          "shipping_carrier": {
            "type": "string",
            "maxLength": 200
          },
          "tracking_number": {
            "type": "string",
            "maxLength": 200
          },
          "tracking_url": {
            "oneOf": [
              {
                "type": "string",
                "format": "uri",
                "maxLength": 200
              },
              {
                "type": "string",
                "maxLength": 0
              }
            ]
          },
          "number": {
            "type": "string",
            "description": "Not editable once the order is closed or cancelled. Must be unique per client and document type.",
            "maxLength": 20
          },
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "is_task_in_progress": {
            "type": "boolean",
            "readOnly": true,
            "description": "Is any background task in progress. For example mark as complete task."
          },
          "action_performed": {
            "type": "string",
            "readOnly": true,
            "description": "The action performed on the document which initiated the task."
          },
          "total_quantity": {
            "type": "integer",
            "readOnly": true,
            "description": "Total sum of quantities from all associated lines within the document."
          },
          "total_shipping": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "total_tax": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "total_amount": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "subtotal": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "status": {
            "type": "integer",
            "readOnly": true
          },
          "currency": {
            "type": "string",
            "readOnly": true
          },
          "conversion_rate": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "readOnly": true
          },
          "billing_address_id": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "billing_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "readOnly": true
          },
          "shipping_address_id": {
            "type": "integer",
            "nullable": true,
            "readOnly": true
          },
          "shipping_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "readOnly": true
          }
        },
        "required": [
          "action_performed",
          "billing_address",
          "billing_address_id",
          "contact_id",
          "conversion_rate",
          "created",
          "currency",
          "from_warehouse_id",
          "id",
          "is_task_in_progress",
          "shipping_address",
          "shipping_address_id",
          "status",
          "subtotal",
          "total_amount",
          "total_quantity",
          "total_shipping",
          "total_tax",
          "updated",
          "warehouse_id"
        ]
      },
      "StatusEnum": {
        "enum": [
          "DRAFT",
          "RECEIVED",
          "FINAL",
          "CANCELLED"
        ],
        "type": "string",
        "description": "* `DRAFT` - DRAFT\n* `RECEIVED` - RECEIVED\n* `FINAL` - FINAL\n* `CANCELLED` - CANCELLED"
      },
      "StockAdjustmentDocument": {
        "type": "object",
        "description": "StockAdjustmentDocument Serializer mixin",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "number": {
            "type": "string",
            "readOnly": true
          },
          "is_task_in_progress": {
            "type": "boolean",
            "readOnly": true,
            "description": "Is any background task in progress. For example mark as complete task."
          },
          "action_performed": {
            "type": "string",
            "readOnly": true,
            "description": "The action performed on the document which initiated the task."
          },
          "notes": {
            "type": "string"
          },
          "total_quantity": {
            "type": "integer",
            "readOnly": true,
            "description": "Total sum of quantities from all associated lines within the document."
          },
          "adjustment_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AdjustmentTypeEnum"
              }
            ],
            "description": "Can be either one of: SET, ADD, SUB\n\n* `SET` - SET\n* `ADD` - ADD\n* `SUB` - SUB"
          },
          "reason": {
            "type": "string",
            "maxLength": 1024
          },
          "warehouse_id": {
            "type": "integer"
          },
          "is_complete": {
            "type": "boolean",
            "readOnly": true,
            "description": "The status of the Adjust Stock Document. If false it means the document is still a draft and has no effect on the inventory."
          }
        },
        "required": [
          "action_performed",
          "adjustment_type",
          "created",
          "id",
          "is_complete",
          "is_task_in_progress",
          "number",
          "reason",
          "total_quantity",
          "updated",
          "warehouse_id"
        ]
      },
      "StockAdjustmentDocumentLine": {
        "type": "object",
        "description": "Mixin to inherit for stock adjustment document line serializers\nfor update and create.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "product_id": {
            "type": "integer"
          },
          "product": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ],
            "readOnly": true
          },
          "quantity": {
            "type": "integer",
            "description": "If the adjustment type of the document is \"ADD\" or \"SUB\" then the quantity should not be 0. A negative quantity is allowed for \"ADD\", where it decreases the stock. For \"SUB\" the quantity is subtracted from the stock, so it must be positive. A validation error is raised otherwise."
          },
          "adjustment_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AdjustmentTypeEnum"
              }
            ],
            "readOnly": true,
            "description": "Can be either one of: SET, ADD, SUB\n\n* `SET` - SET\n* `ADD` - ADD\n* `SUB` - SUB"
          },
          "warehouse_id": {
            "type": "integer",
            "readOnly": true
          },
          "reason": {
            "type": "string",
            "readOnly": true
          },
          "cost": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "nullable": true
          },
          "document_id": {
            "type": "integer",
            "readOnly": true
          },
          "is_complete": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "required": [
          "adjustment_type",
          "created",
          "document_id",
          "id",
          "is_complete",
          "product",
          "product_id",
          "quantity",
          "reason",
          "warehouse_id"
        ]
      },
      "StockAdjustmentDocumentLineUpdate": {
        "type": "object",
        "description": "Adjust Stock Line Serializer used in Update case.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "product_id": {
            "type": "integer",
            "readOnly": true
          },
          "product": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ],
            "readOnly": true
          },
          "quantity": {
            "type": "integer",
            "description": "If the adjustment type of the document is \"ADD\" or \"SUB\" then the quantity should not be 0. A negative quantity is allowed for \"ADD\", where it decreases the stock. For \"SUB\" the quantity is subtracted from the stock, so it must be positive. A validation error is raised otherwise."
          },
          "adjustment_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AdjustmentTypeEnum"
              }
            ],
            "readOnly": true,
            "description": "Can be either one of: SET, ADD, SUB\n\n* `SET` - SET\n* `ADD` - ADD\n* `SUB` - SUB"
          },
          "warehouse_id": {
            "type": "integer",
            "readOnly": true
          },
          "reason": {
            "type": "string",
            "readOnly": true
          },
          "cost": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "nullable": true
          },
          "document_id": {
            "type": "integer",
            "readOnly": true
          },
          "is_complete": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "required": [
          "adjustment_type",
          "created",
          "document_id",
          "id",
          "is_complete",
          "product",
          "product_id",
          "quantity",
          "reason",
          "warehouse_id"
        ]
      },
      "StockAdjustmentDocumentUpdate": {
        "type": "object",
        "description": "StockAdjustmentDocument Serializer mixin",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "number": {
            "type": "string",
            "readOnly": true
          },
          "is_task_in_progress": {
            "type": "boolean",
            "readOnly": true,
            "description": "Is any background task in progress. For example mark as complete task."
          },
          "action_performed": {
            "type": "string",
            "readOnly": true,
            "description": "The action performed on the document which initiated the task."
          },
          "notes": {
            "type": "string"
          },
          "total_quantity": {
            "type": "integer",
            "readOnly": true,
            "description": "Total sum of quantities from all associated lines within the document."
          },
          "adjustment_type": {
            "type": "string",
            "readOnly": true
          },
          "reason": {
            "type": "string",
            "readOnly": true
          },
          "warehouse_id": {
            "type": "integer",
            "readOnly": true
          },
          "is_complete": {
            "type": "boolean",
            "readOnly": true,
            "description": "The status of the Adjust Stock Document. If false it means the document is still a draft and has no effect on the inventory."
          }
        },
        "required": [
          "action_performed",
          "adjustment_type",
          "created",
          "id",
          "is_complete",
          "is_task_in_progress",
          "number",
          "reason",
          "total_quantity",
          "updated",
          "warehouse_id"
        ]
      },
      "StockAdjustmentLineCreate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "product_id": {
            "type": "integer"
          },
          "product": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ],
            "readOnly": true
          },
          "quantity": {
            "type": "integer",
            "description": "If the adjustment type is \"ADD\" or \"SUB\" then the quantity should not be 0. A negative quantity is allowed for \"ADD\", where it decreases the stock. For \"SUB\" the quantity is subtracted from the stock, so it must be positive. A validation error is raised otherwise."
          },
          "adjustment_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AdjustmentTypeEnum"
              }
            ],
            "description": "Can be either one of: SET, ADD, SUB\n\n* `SET` - SET\n* `ADD` - ADD\n* `SUB` - SUB"
          },
          "warehouse_id": {
            "type": "integer"
          },
          "reason": {
            "type": "string",
            "maxLength": 2048
          },
          "cost": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,10}(?:\\.\\d{0,4})?$",
            "nullable": true
          }
        },
        "required": [
          "adjustment_type",
          "created",
          "id",
          "product",
          "product_id",
          "quantity",
          "warehouse_id"
        ]
      },
      "StockLevel": {
        "type": "object",
        "description": "This serializer makes all fields read-only. It also sets the user's account\ntimezone for the date time fields.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "product_id": {
            "type": "integer",
            "readOnly": true
          },
          "product": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ],
            "readOnly": true
          },
          "warehouse_id": {
            "type": "integer",
            "readOnly": true
          },
          "in_stock": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648,
            "readOnly": true
          },
          "incoming": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648,
            "readOnly": true
          },
          "available": {
            "type": "integer",
            "readOnly": true
          },
          "booked": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648,
            "readOnly": true
          },
          "close_at_quantity": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648,
            "readOnly": true,
            "nullable": true
          }
        },
        "required": [
          "available",
          "booked",
          "close_at_quantity",
          "id",
          "in_stock",
          "incoming",
          "product",
          "product_id",
          "updated",
          "warehouse_id"
        ]
      },
      "StockLevelBundle": {
        "type": "object",
        "description": "Serializer for Bundle product stock level.\nIt has components field which is a list of component stock levels.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "product_id": {
            "type": "integer",
            "readOnly": true
          },
          "product": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ],
            "readOnly": true
          },
          "warehouse_id": {
            "type": "integer",
            "readOnly": true
          },
          "in_stock": {
            "type": "integer",
            "readOnly": true
          },
          "booked": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648,
            "readOnly": true
          },
          "available": {
            "type": "integer",
            "readOnly": true
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/_Component"
            },
            "readOnly": true
          }
        },
        "required": [
          "available",
          "booked",
          "components",
          "id",
          "in_stock",
          "product",
          "product_id",
          "warehouse_id"
        ]
      },
      "Tax": {
        "type": "object",
        "description": "This serializer makes all fields read-only. It also sets the user's account\ntimezone for the date time fields.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "readOnly": true,
            "maxLength": 50
          },
          "tax_rate": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,8}(?:\\.\\d{0,6})?$",
            "readOnly": true
          }
        },
        "required": [
          "id",
          "name",
          "tax_rate"
        ]
      },
      "Warehouse": {
        "type": "object",
        "description": "This serializer makes all fields read-only. It also sets the user's account\ntimezone for the date time fields.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "readOnly": true
          },
          "code": {
            "type": "string",
            "readOnly": true,
            "maxLength": 12
          },
          "priority": {
            "type": "integer",
            "maximum": 32767,
            "minimum": 0,
            "readOnly": true
          }
        },
        "required": [
          "code",
          "id",
          "name",
          "priority"
        ]
      },
      "_Component": {
        "type": "object",
        "description": "Bundle component stock level serializer.\nStock level serializer has a non-model field called component_quantity\nwhich is the quantity of the component in the bundle.",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true
          },
          "product": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ],
            "readOnly": true
          },
          "product_id": {
            "type": "integer",
            "readOnly": true
          },
          "warehouse_id": {
            "type": "integer",
            "readOnly": true
          },
          "in_stock": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648,
            "readOnly": true
          },
          "booked": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648,
            "readOnly": true
          },
          "available": {
            "type": "integer",
            "readOnly": true
          },
          "component_quantity": {
            "type": "integer",
            "readOnly": true
          },
          "possible_bundles": {
            "type": "integer",
            "readOnly": true
          },
          "close_at_quantity": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648,
            "readOnly": true,
            "nullable": true
          }
        },
        "required": [
          "available",
          "booked",
          "close_at_quantity",
          "component_quantity",
          "id",
          "in_stock",
          "possible_bundles",
          "product",
          "product_id",
          "warehouse_id"
        ]
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Api-Key based authentication with the header `Authorization: Api-Key <api-key-value>`"
      }
    }
  },
  "servers": [
    {
      "url": "https://inventory-api.sumtracker.com/api/version/2025-03",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Suppliers",
      "description": "Suppliers API."
    },
    {
      "name": "Purchase Orders",
      "description": "\nPurchase Orders API.\n\n**The purchase orders API and stock transfer API are common.**\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\nA Stock Transfer (ST) is used for moving stock from one warehouse to another.\n\nA Purchase Order (PO) is used for purchasing products from suppliers.\n\nAgainst each PO/ST,\n- You can make changes in relevant data only when PO status is `DRAFT` or `INCOMING`.\n- You can make 1 or more Receive Notes (GRNs) to receive the goods.\n\n                "
    },
    {
      "name": "Purchase Orders/Lines",
      "description": "\nPurchase Order Line Items API.\n\n\n**The purchase orders API and stock transfer API are common.**\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\nA Stock Transfer (ST) is used for moving stock from one warehouse to another.\n\nA Purchase Order (PO) is used for purchasing products from suppliers.\n\nAgainst each PO/ST,\n- You can make changes in relevant data only when PO status is `DRAFT` or `INCOMING`.\n- You can make 1 or more Receive Notes (GRNs) to receive the goods.\n\n\n### Conditions applicable to Purchase Order Line Items\n- A maximum of 10000 Line items are allowed in a document.\n- A document cannot have duplicate products in its line items.\n- A line item cannot have negative quantity.\n                "
    },
    {
      "name": "Received Notes (GRN)",
      "description": "\nGoods Received Notes (GRN) API.\n\n\nGRN is used to received products in a purchase order or a stock transfer.\n\nThe GRN API is common for both purchase orders and stock transfers.\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\n\n### Conditions applicable to Goods Received Notes\n- A GRN can be created when the PO is marked `INCOMING`.\n- GRN needs to be `RECEIVED` to increase the stock levels.\n                "
    },
    {
      "name": "Receive Notes/Lines",
      "description": "\nGRN Line Items API.\n\n\nGRN is used to received products in a purchase order or a stock transfer.\n\nThe GRN API is common for both purchase orders and stock transfers.\n\nThe URL param `document_type` is used to determine the type of document.\n- `orders` for purchase orders\n- `stock-transfers` for stock transfers\n\n\n### Conditions applicable to GRN Line Items\n- A maximum of 5000 Line items are allowed in a document.\n- Only products from the PO of the GRN can be added to the GRN.\n- A line item cannot have negative quantity.\n- A GRN cannot have duplicate products in its line items.\n                "
    },
    {
      "name": "Stock Adjustment Documents",
      "description": "\nStock Adjustments API.\n\nStock Adjustments are used to adjust stock levels.\n\nThere are two types of stock adjustments:\n- Single Adjustment to adjust the stock of a single product at a particular warehouse.\n- Stock Adjustment Document to adjust the stock of multiple products at the same warehouse.\n                "
    },
    {
      "name": "Stock Adjustment Documents/Lines",
      "description": "Stock Adjustment Document Line Items API."
    },
    {
      "name": "Stock",
      "description": "Stock API."
    },
    {
      "name": "Products",
      "description": "Products API."
    },
    {
      "name": "Settings",
      "description": "Settings API."
    }
  ]
}
