{
  "openapi": "3.0.3",
  "info": {
    "title": "Sumtracker Public API v2025-11",
    "version": "2025-11",
    "description": "Deprecated. This version will be removed on 28 February 2027. Move to 2026-11, planned for release on 30 November 2026.\n\nPublic API endpoints which can be accessed using an API key generated from Sumtracker account."
  },
  "paths": {
    "/stock/levels/": {
      "get": {
        "operationId": "StockLevelList",
        "description": "List all non-bundle stock levels for given warehouse.\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\nRaises\n- ValidationError if either the warehouse or product is not provided.",
        "summary": "List Stock Levels",
        "parameters": [
          {
            "in": "query",
            "name": "available_max",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "available_min",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "booked_max",
            "schema": {
              "type": "integer",
              "maximum": 2147483647,
              "minimum": -2147483648
            }
          },
          {
            "in": "query",
            "name": "booked_min",
            "schema": {
              "type": "integer",
              "maximum": 2147483647,
              "minimum": -2147483648
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "The pagination cursor value.",
            "schema": {
              "type": "string"
            }
          },
          {
            "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",
                  "-in_stock",
                  "-incoming",
                  "-product_id",
                  "-warehouse_id",
                  "available",
                  "booked",
                  "in_stock",
                  "incoming",
                  "product_id",
                  "warehouse_id"
                ]
              }
            },
            "description": "Ordering\n\n* `product_id` - Product id\n* `-product_id` - Product id (descending)\n* `warehouse_id` - Warehouse id\n* `-warehouse_id` - Warehouse id (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"
          },
          {
            "in": "query",
            "name": "product",
            "schema": {
              "type": "number"
            },
            "description": "Product id. Either product or warehouse is required."
          },
          {
            "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. Either warehouse or product is required."
          }
        ],
        "tags": [
          "Stock"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedStockLevelList"
                }
              }
            },
            "description": ""
          }
        },
        "deprecated": true
      }
    },
    "/stock/levels/bundles/": {
      "get": {
        "operationId": "StockLevelBundleList",
        "description": "List 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\nRaises\n- ValidationError if warehouse not provided.",
        "summary": "List Bundle Stock Levels",
        "parameters": [
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "The pagination cursor value.",
            "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": [
                  "-product_id",
                  "-warehouse_id",
                  "product_id",
                  "warehouse_id"
                ]
              }
            },
            "description": "Ordering\n\n* `product_id` - Product id\n* `-product_id` - Product id (descending)\n* `warehouse_id` - Warehouse id\n* `-warehouse_id` - Warehouse id (descending)",
            "explode": false,
            "style": "form"
          },
          {
            "in": "query",
            "name": "product",
            "schema": {
              "type": "number"
            },
            "description": "Product id"
          },
          {
            "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. warehouse is required."
          }
        ],
        "tags": [
          "Stock"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedStockLevelBundleList"
                }
              }
            },
            "description": ""
          }
        },
        "deprecated": true
      }
    }
  },
  "components": {
    "schemas": {
      "PaginatedStockLevelBundleList": {
        "type": "object",
        "required": [
          "results"
        ],
        "properties": {
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?cursor=cD00ODY%3D\""
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?cursor=cj0xJnA9NDg3"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockLevelBundle"
            }
          }
        }
      },
      "PaginatedStockLevelList": {
        "type": "object",
        "required": [
          "results"
        ],
        "properties": {
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?cursor=cD00ODY%3D\""
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?cursor=cj0xJnA9NDg3"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StockLevel"
            }
          }
        }
      },
      "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"
        ]
      },
      "StockLevel": {
        "type": "object",
        "description": "The stock of a product at a warehouse.",
        "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": "The stock level of a bundle, with the stock levels of its components.",
        "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"
        ]
      },
      "_Component": {
        "type": "object",
        "description": "The stock level of a component of a bundle, with the quantity of the component in the bundle and the number of\nbundles its stock makes.",
        "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-11",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Stock",
      "description": "Stock API."
    }
  ]
}
