The Barcode Scanning section of the InvenTree API schema is documented below.
InvenTree API 180¶
API for InvenTree - the intuitive open source inventory management system
Servers¶
Description | URL |
---|---|
http://localhost:8000 | http://localhost:8000 |
barcode¶
POST /api/barcode/¶
Description
Endpoint for handling generic barcode scan requests.
Barcode data are decoded by the client application, and sent to this endpoint (as a JSON object) for validation.
A barcode could follow the internal InvenTree barcode format, or it could match to a third-party barcode format (e.g. Digikey).
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
cookieAuth |
cookie | string | N/A | No | API key |
basicAuth |
header | string | N/A | No | Basic authentication |
tokenAuth |
header | string | N/A | No | Token-based authentication with required prefix "Token" |
Request body
{
"barcode": "string"
}
Schema of the request body
{
"description": "Generic serializer for receiving barcode data.",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
}
},
"required": [
"barcode"
],
"type": "object"
}
{
"barcode": "string"
}
Schema of the request body
{
"description": "Generic serializer for receiving barcode data.",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
}
},
"required": [
"barcode"
],
"type": "object"
}
{
"barcode": "string"
}
Schema of the request body
{
"description": "Generic serializer for receiving barcode data.",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
}
},
"required": [
"barcode"
],
"type": "object"
}
Response 201 Created
{
"barcode": "string"
}
Schema of the response body
{
"description": "Generic serializer for receiving barcode data.",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
}
},
"required": [
"barcode"
],
"type": "object"
}
POST /api/barcode/link/¶
Description
Endpoint for assigning a barcode to a stock item.
- This only works if the barcode is not already associated with an object in the database
- If the barcode does not match an object, then the barcode hash is assigned to the StockItem
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
cookieAuth |
cookie | string | N/A | No | API key |
basicAuth |
header | string | N/A | No | Basic authentication |
tokenAuth |
header | string | N/A | No | Token-based authentication with required prefix "Token" |
Request body
{
"barcode": "string",
"build": 0,
"manufacturerpart": 0,
"part": 0,
"purchaseorder": 0,
"returnorder": 0,
"salesorder": 0,
"stockitem": 0,
"stocklocation": 0,
"supplierpart": 0
}
Schema of the request body
{
"description": "Serializer class for linking a barcode to an internal model.",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"build": {
"nullable": true,
"title": "Build Order",
"type": "integer"
},
"manufacturerpart": {
"nullable": true,
"title": "manufacturer part",
"type": "integer"
},
"part": {
"nullable": true,
"type": "integer"
},
"purchaseorder": {
"nullable": true,
"title": "purchase order",
"type": "integer"
},
"returnorder": {
"nullable": true,
"title": "return order",
"type": "integer"
},
"salesorder": {
"nullable": true,
"title": "sales order",
"type": "integer"
},
"stockitem": {
"nullable": true,
"title": "stock item",
"type": "integer"
},
"stocklocation": {
"nullable": true,
"title": "Stock Location",
"type": "integer"
},
"supplierpart": {
"nullable": true,
"title": "supplier part",
"type": "integer"
}
},
"required": [
"barcode"
],
"type": "object"
}
{
"barcode": "string",
"build": 0,
"manufacturerpart": 0,
"part": 0,
"purchaseorder": 0,
"returnorder": 0,
"salesorder": 0,
"stockitem": 0,
"stocklocation": 0,
"supplierpart": 0
}
Schema of the request body
{
"description": "Serializer class for linking a barcode to an internal model.",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"build": {
"nullable": true,
"title": "Build Order",
"type": "integer"
},
"manufacturerpart": {
"nullable": true,
"title": "manufacturer part",
"type": "integer"
},
"part": {
"nullable": true,
"type": "integer"
},
"purchaseorder": {
"nullable": true,
"title": "purchase order",
"type": "integer"
},
"returnorder": {
"nullable": true,
"title": "return order",
"type": "integer"
},
"salesorder": {
"nullable": true,
"title": "sales order",
"type": "integer"
},
"stockitem": {
"nullable": true,
"title": "stock item",
"type": "integer"
},
"stocklocation": {
"nullable": true,
"title": "Stock Location",
"type": "integer"
},
"supplierpart": {
"nullable": true,
"title": "supplier part",
"type": "integer"
}
},
"required": [
"barcode"
],
"type": "object"
}
{
"barcode": "string",
"build": 0,
"manufacturerpart": 0,
"part": 0,
"purchaseorder": 0,
"returnorder": 0,
"salesorder": 0,
"stockitem": 0,
"stocklocation": 0,
"supplierpart": 0
}
Schema of the request body
{
"description": "Serializer class for linking a barcode to an internal model.",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"build": {
"nullable": true,
"title": "Build Order",
"type": "integer"
},
"manufacturerpart": {
"nullable": true,
"title": "manufacturer part",
"type": "integer"
},
"part": {
"nullable": true,
"type": "integer"
},
"purchaseorder": {
"nullable": true,
"title": "purchase order",
"type": "integer"
},
"returnorder": {
"nullable": true,
"title": "return order",
"type": "integer"
},
"salesorder": {
"nullable": true,
"title": "sales order",
"type": "integer"
},
"stockitem": {
"nullable": true,
"title": "stock item",
"type": "integer"
},
"stocklocation": {
"nullable": true,
"title": "Stock Location",
"type": "integer"
},
"supplierpart": {
"nullable": true,
"title": "supplier part",
"type": "integer"
}
},
"required": [
"barcode"
],
"type": "object"
}
Response 201 Created
{
"barcode": "string",
"build": 0,
"manufacturerpart": 0,
"part": 0,
"purchaseorder": 0,
"returnorder": 0,
"salesorder": 0,
"stockitem": 0,
"stocklocation": 0,
"supplierpart": 0
}
Schema of the response body
{
"description": "Serializer class for linking a barcode to an internal model.",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"build": {
"nullable": true,
"title": "Build Order",
"type": "integer"
},
"manufacturerpart": {
"nullable": true,
"title": "manufacturer part",
"type": "integer"
},
"part": {
"nullable": true,
"type": "integer"
},
"purchaseorder": {
"nullable": true,
"title": "purchase order",
"type": "integer"
},
"returnorder": {
"nullable": true,
"title": "return order",
"type": "integer"
},
"salesorder": {
"nullable": true,
"title": "sales order",
"type": "integer"
},
"stockitem": {
"nullable": true,
"title": "stock item",
"type": "integer"
},
"stocklocation": {
"nullable": true,
"title": "Stock Location",
"type": "integer"
},
"supplierpart": {
"nullable": true,
"title": "supplier part",
"type": "integer"
}
},
"required": [
"barcode"
],
"type": "object"
}
POST /api/barcode/po-allocate/¶
Description
Endpoint for allocating parts to a purchase order by scanning their barcode.
Note that the scanned barcode may point to:
- A Part object
- A ManufacturerPart object
- A SupplierPart object
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
cookieAuth |
cookie | string | N/A | No | API key |
basicAuth |
header | string | N/A | No | Basic authentication |
tokenAuth |
header | string | N/A | No | Token-based authentication with required prefix "Token" |
Request body
{
"barcode": "string",
"purchase_order": 0
}
Schema of the request body
{
"description": "Serializer for allocating items against a purchase order.\n\nThe scanned barcode could be a Part, ManufacturerPart or SupplierPart object",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"purchase_order": {
"description": "Purchase Order to allocate items against",
"type": "integer"
}
},
"required": [
"barcode",
"purchase_order"
],
"type": "object"
}
{
"barcode": "string",
"purchase_order": 0
}
Schema of the request body
{
"description": "Serializer for allocating items against a purchase order.\n\nThe scanned barcode could be a Part, ManufacturerPart or SupplierPart object",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"purchase_order": {
"description": "Purchase Order to allocate items against",
"type": "integer"
}
},
"required": [
"barcode",
"purchase_order"
],
"type": "object"
}
{
"barcode": "string",
"purchase_order": 0
}
Schema of the request body
{
"description": "Serializer for allocating items against a purchase order.\n\nThe scanned barcode could be a Part, ManufacturerPart or SupplierPart object",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"purchase_order": {
"description": "Purchase Order to allocate items against",
"type": "integer"
}
},
"required": [
"barcode",
"purchase_order"
],
"type": "object"
}
Response 201 Created
{
"barcode": "string",
"purchase_order": 0
}
Schema of the response body
{
"description": "Serializer for allocating items against a purchase order.\n\nThe scanned barcode could be a Part, ManufacturerPart or SupplierPart object",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"purchase_order": {
"description": "Purchase Order to allocate items against",
"type": "integer"
}
},
"required": [
"barcode",
"purchase_order"
],
"type": "object"
}
POST /api/barcode/po-receive/¶
Description
Endpoint for handling receiving parts by scanning their barcode.
Barcode data are decoded by the client application, and sent to this endpoint (as a JSON object) for validation.
The barcode should follow a third-party barcode format (e.g. Digikey) and ideally contain order_number and quantity information.
The following parameters are available:
- barcode: The raw barcode data (required)
- purchase_order: The purchase order containing the item to receive (optional)
- location: The destination location for the received item (optional)
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
cookieAuth |
cookie | string | N/A | No | API key |
basicAuth |
header | string | N/A | No | Basic authentication |
tokenAuth |
header | string | N/A | No | Token-based authentication with required prefix "Token" |
Request body
{
"barcode": "string",
"location": 0,
"purchase_order": 0
}
Schema of the request body
{
"description": "Serializer for receiving items against a purchase order.\n\nThe following additional fields may be specified:\n\n- purchase_order: PurchaseOrder object to receive items against\n- location: Location to receive items into",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"location": {
"description": "Location to receive items into",
"nullable": true,
"type": "integer"
},
"purchase_order": {
"description": "PurchaseOrder to receive items against",
"nullable": true,
"type": "integer"
}
},
"required": [
"barcode"
],
"type": "object"
}
{
"barcode": "string",
"location": 0,
"purchase_order": 0
}
Schema of the request body
{
"description": "Serializer for receiving items against a purchase order.\n\nThe following additional fields may be specified:\n\n- purchase_order: PurchaseOrder object to receive items against\n- location: Location to receive items into",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"location": {
"description": "Location to receive items into",
"nullable": true,
"type": "integer"
},
"purchase_order": {
"description": "PurchaseOrder to receive items against",
"nullable": true,
"type": "integer"
}
},
"required": [
"barcode"
],
"type": "object"
}
{
"barcode": "string",
"location": 0,
"purchase_order": 0
}
Schema of the request body
{
"description": "Serializer for receiving items against a purchase order.\n\nThe following additional fields may be specified:\n\n- purchase_order: PurchaseOrder object to receive items against\n- location: Location to receive items into",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"location": {
"description": "Location to receive items into",
"nullable": true,
"type": "integer"
},
"purchase_order": {
"description": "PurchaseOrder to receive items against",
"nullable": true,
"type": "integer"
}
},
"required": [
"barcode"
],
"type": "object"
}
Response 201 Created
{
"barcode": "string",
"location": 0,
"purchase_order": 0
}
Schema of the response body
{
"description": "Serializer for receiving items against a purchase order.\n\nThe following additional fields may be specified:\n\n- purchase_order: PurchaseOrder object to receive items against\n- location: Location to receive items into",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"location": {
"description": "Location to receive items into",
"nullable": true,
"type": "integer"
},
"purchase_order": {
"description": "PurchaseOrder to receive items against",
"nullable": true,
"type": "integer"
}
},
"required": [
"barcode"
],
"type": "object"
}
POST /api/barcode/so-allocate/¶
Description
Endpoint for allocating stock to a sales order, by scanning barcode.
The scanned barcode should map to a StockItem object.
Additional fields can be passed to the endpoint:
- SalesOrder (Required)
- Line Item
- Shipment
- Quantity
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
cookieAuth |
cookie | string | N/A | No | API key |
basicAuth |
header | string | N/A | No | Basic authentication |
tokenAuth |
header | string | N/A | No | Token-based authentication with required prefix "Token" |
Request body
{
"barcode": "string",
"line": 0,
"quantity": 0,
"sales_order": 0,
"shipment": 0
}
Schema of the request body
{
"description": "Serializr for allocating stock items to a sales order.\n\nThe scanned barcode must map to a StockItem object",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"line": {
"description": "Sales order line item to allocate items against",
"nullable": true,
"type": "integer"
},
"quantity": {
"description": "Quantity to allocate",
"type": "integer"
},
"sales_order": {
"description": "Sales Order to allocate items against",
"type": "integer"
},
"shipment": {
"description": "Sales order shipment to allocate items against",
"nullable": true,
"type": "integer"
}
},
"required": [
"barcode",
"sales_order"
],
"type": "object"
}
{
"barcode": "string",
"line": 0,
"quantity": 0,
"sales_order": 0,
"shipment": 0
}
Schema of the request body
{
"description": "Serializr for allocating stock items to a sales order.\n\nThe scanned barcode must map to a StockItem object",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"line": {
"description": "Sales order line item to allocate items against",
"nullable": true,
"type": "integer"
},
"quantity": {
"description": "Quantity to allocate",
"type": "integer"
},
"sales_order": {
"description": "Sales Order to allocate items against",
"type": "integer"
},
"shipment": {
"description": "Sales order shipment to allocate items against",
"nullable": true,
"type": "integer"
}
},
"required": [
"barcode",
"sales_order"
],
"type": "object"
}
{
"barcode": "string",
"line": 0,
"quantity": 0,
"sales_order": 0,
"shipment": 0
}
Schema of the request body
{
"description": "Serializr for allocating stock items to a sales order.\n\nThe scanned barcode must map to a StockItem object",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"line": {
"description": "Sales order line item to allocate items against",
"nullable": true,
"type": "integer"
},
"quantity": {
"description": "Quantity to allocate",
"type": "integer"
},
"sales_order": {
"description": "Sales Order to allocate items against",
"type": "integer"
},
"shipment": {
"description": "Sales order shipment to allocate items against",
"nullable": true,
"type": "integer"
}
},
"required": [
"barcode",
"sales_order"
],
"type": "object"
}
Response 201 Created
{
"barcode": "string",
"line": 0,
"quantity": 0,
"sales_order": 0,
"shipment": 0
}
Schema of the response body
{
"description": "Serializr for allocating stock items to a sales order.\n\nThe scanned barcode must map to a StockItem object",
"properties": {
"barcode": {
"description": "Scanned barcode data",
"maxLength": 4095,
"type": "string"
},
"line": {
"description": "Sales order line item to allocate items against",
"nullable": true,
"type": "integer"
},
"quantity": {
"description": "Quantity to allocate",
"type": "integer"
},
"sales_order": {
"description": "Sales Order to allocate items against",
"type": "integer"
},
"shipment": {
"description": "Sales order shipment to allocate items against",
"nullable": true,
"type": "integer"
}
},
"required": [
"barcode",
"sales_order"
],
"type": "object"
}
POST /api/barcode/unlink/¶
Description
Endpoint for unlinking / unassigning a custom barcode from a database object.
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
cookieAuth |
cookie | string | N/A | No | API key |
basicAuth |
header | string | N/A | No | Basic authentication |
tokenAuth |
header | string | N/A | No | Token-based authentication with required prefix "Token" |
Request body
{
"build": 0,
"manufacturerpart": 0,
"part": 0,
"purchaseorder": 0,
"returnorder": 0,
"salesorder": 0,
"stockitem": 0,
"stocklocation": 0,
"supplierpart": 0
}
Schema of the request body
{
"description": "Serializer class for unlinking a barcode from an internal model.",
"properties": {
"build": {
"nullable": true,
"title": "Build Order",
"type": "integer"
},
"manufacturerpart": {
"nullable": true,
"title": "manufacturer part",
"type": "integer"
},
"part": {
"nullable": true,
"type": "integer"
},
"purchaseorder": {
"nullable": true,
"title": "purchase order",
"type": "integer"
},
"returnorder": {
"nullable": true,
"title": "return order",
"type": "integer"
},
"salesorder": {
"nullable": true,
"title": "sales order",
"type": "integer"
},
"stockitem": {
"nullable": true,
"title": "stock item",
"type": "integer"
},
"stocklocation": {
"nullable": true,
"title": "Stock Location",
"type": "integer"
},
"supplierpart": {
"nullable": true,
"title": "supplier part",
"type": "integer"
}
},
"type": "object"
}
{
"build": 0,
"manufacturerpart": 0,
"part": 0,
"purchaseorder": 0,
"returnorder": 0,
"salesorder": 0,
"stockitem": 0,
"stocklocation": 0,
"supplierpart": 0
}
Schema of the request body
{
"description": "Serializer class for unlinking a barcode from an internal model.",
"properties": {
"build": {
"nullable": true,
"title": "Build Order",
"type": "integer"
},
"manufacturerpart": {
"nullable": true,
"title": "manufacturer part",
"type": "integer"
},
"part": {
"nullable": true,
"type": "integer"
},
"purchaseorder": {
"nullable": true,
"title": "purchase order",
"type": "integer"
},
"returnorder": {
"nullable": true,
"title": "return order",
"type": "integer"
},
"salesorder": {
"nullable": true,
"title": "sales order",
"type": "integer"
},
"stockitem": {
"nullable": true,
"title": "stock item",
"type": "integer"
},
"stocklocation": {
"nullable": true,
"title": "Stock Location",
"type": "integer"
},
"supplierpart": {
"nullable": true,
"title": "supplier part",
"type": "integer"
}
},
"type": "object"
}
{
"build": 0,
"manufacturerpart": 0,
"part": 0,
"purchaseorder": 0,
"returnorder": 0,
"salesorder": 0,
"stockitem": 0,
"stocklocation": 0,
"supplierpart": 0
}
Schema of the request body
{
"description": "Serializer class for unlinking a barcode from an internal model.",
"properties": {
"build": {
"nullable": true,
"title": "Build Order",
"type": "integer"
},
"manufacturerpart": {
"nullable": true,
"title": "manufacturer part",
"type": "integer"
},
"part": {
"nullable": true,
"type": "integer"
},
"purchaseorder": {
"nullable": true,
"title": "purchase order",
"type": "integer"
},
"returnorder": {
"nullable": true,
"title": "return order",
"type": "integer"
},
"salesorder": {
"nullable": true,
"title": "sales order",
"type": "integer"
},
"stockitem": {
"nullable": true,
"title": "stock item",
"type": "integer"
},
"stocklocation": {
"nullable": true,
"title": "Stock Location",
"type": "integer"
},
"supplierpart": {
"nullable": true,
"title": "supplier part",
"type": "integer"
}
},
"type": "object"
}
Response 201 Created
{
"build": 0,
"manufacturerpart": 0,
"part": 0,
"purchaseorder": 0,
"returnorder": 0,
"salesorder": 0,
"stockitem": 0,
"stocklocation": 0,
"supplierpart": 0
}
Schema of the response body
{
"description": "Serializer class for unlinking a barcode from an internal model.",
"properties": {
"build": {
"nullable": true,
"title": "Build Order",
"type": "integer"
},
"manufacturerpart": {
"nullable": true,
"title": "manufacturer part",
"type": "integer"
},
"part": {
"nullable": true,
"type": "integer"
},
"purchaseorder": {
"nullable": true,
"title": "purchase order",
"type": "integer"
},
"returnorder": {
"nullable": true,
"title": "return order",
"type": "integer"
},
"salesorder": {
"nullable": true,
"title": "sales order",
"type": "integer"
},
"stockitem": {
"nullable": true,
"title": "stock item",
"type": "integer"
},
"stocklocation": {
"nullable": true,
"title": "Stock Location",
"type": "integer"
},
"supplierpart": {
"nullable": true,
"title": "supplier part",
"type": "integer"
}
},
"type": "object"
}
Schemas¶
Barcode¶
Name | Type |
---|---|
barcode |
string |
BarcodeAssign¶
Name | Type |
---|---|
barcode |
string |
build |
integer| null |
manufacturerpart |
integer| null |
part |
integer| null |
purchaseorder |
integer| null |
returnorder |
integer| null |
salesorder |
integer| null |
stockitem |
integer| null |
stocklocation |
integer| null |
supplierpart |
integer| null |
BarcodePOAllocate¶
Name | Type |
---|---|
barcode |
string |
purchase_order |
integer |
BarcodePOReceive¶
Name | Type |
---|---|
barcode |
string |
location |
integer| null |
purchase_order |
integer| null |
BarcodeSOAllocate¶
Name | Type |
---|---|
barcode |
string |
line |
integer| null |
quantity |
integer |
sales_order |
integer |
shipment |
integer| null |
BarcodeUnassign¶
Name | Type |
---|---|
build |
integer| null |
manufacturerpart |
integer| null |
part |
integer| null |
purchaseorder |
integer| null |
returnorder |
integer| null |
salesorder |
integer| null |
stockitem |
integer| null |
stocklocation |
integer| null |
supplierpart |
integer| null |
Security schemes¶
Name | Type | Scheme | Description |
---|---|---|---|
basicAuth | http | basic | |
cookieAuth | apiKey | ||
tokenAuth | apiKey | Token-based authentication with required prefix "Token" |
More documentation¶
More information about InvenTree in the official docs