{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Inventory Adjustments", "description": "Inventory Adjustments are used to synchronize the inventory/stock to account for things that occur outside the normal business like theft, damaged goods, data entry error etc.", "definitions": { "gendoc-attributes-schema": { "$ref": "#/components/schemas/inventory_adjustment-response" }, "inventory_adjustment-response": { "type": "object", "properties": { "inventory_adjustment_id": { "$ref": "#/components/schemas/inventory_adjustment_id" }, "date": { "$ref": "#/components/schemas/date" }, "reason": { "$ref": "#/components/schemas/reason" }, "reason_id": { "$ref": "#/components/schemas/reason_id" }, "description": { "$ref": "#/components/schemas/description" }, "reference_number": { "$ref": "#/components/schemas/reference_number" }, "adjustment_type": { "$ref": "#/components/schemas/adjustment_type" }, "line_items": { "$ref": "#/components/schemas/line_items" }, "location_id": { "$ref": "#/components/schemas/location_id" }, "location_name": { "$ref": "#/components/schemas/location_name" }, "total": { "$ref": "#/components/schemas/total" }, "custom_fields": { "$ref": "#/components/schemas/custom_fields" } } }, "inventory_adjustment_id": { "description": "Unique ID generated by the server for the inventory adjustment. This is used as an identifier.", "type": "string", "example": 4815000000044100 }, "date": { "description": "The date for the inventory adjustment.", "type": "string", "example": "2015-05-28" }, "reason": { "description": "The reason for the inventory adjustment.", "type": "string", "example": "Damaged goods" }, "reason_id": { "description": "Unique ID generated by the server for the reason. This is used as an identifier.", "type": "string", "example": 4815000000044110 }, "description": { "description": "Sample Description.", "type": "string", "example": "Just a sample description." }, "reference_number": { "description": "Reference number of the inventory adjustment.", "type": "string", "example": "REF-IA-00001" }, "adjustment_type": { "description": "The adjustment type should be either quantity or value.Allowed values are quantity and value only.", "type": "string", "enum": [ "quantity" ], "example": "quantity" }, "line_items": { "description": "An inventory adjustment can contain multiple line items. Each line item contains item_id,name,description,quantity_adjusted,unit,adjustment_account_id,location_id.", "type": "array", "items": { "type": "object", "properties": { "item_id": { "$ref": "#/components/schemas/item_id" }, "line_item_id": { "$ref": "#/components/schemas/line_item_id" }, "name": { "$ref": "#/components/schemas/name" }, "description": { "$ref": "#/components/schemas/description" }, "quantity_adjusted": { "$ref": "#/components/schemas/quantity_adjusted" }, "item_total": { "$ref": "#/components/schemas/item_total" }, "unit": { "$ref": "#/components/schemas/unit" }, "is_combo_product": { "$ref": "#/components/schemas/is_combo_product" }, "adjustment_account_id": { "$ref": "#/components/schemas/adjustment_account_id" }, "adjustment_account_name": { "$ref": "#/components/schemas/adjustment_account_name" }, "location_id": { "$ref": "#/components/schemas/location_id" }, "location_name": { "$ref": "#/components/schemas/location_name" }, "serial_numbers": { "$ref": "#/components/schemas/serial_numbers" }, "batches": { "$ref": "#/components/schemas/batches-response" }, "storages": { "$ref": "#/components/schemas/storages-response" } } } }, "item_id": { "description": "Unique ID generated by the server for the item. This is used as an identifier.", "type": "string", "example": 4815000000044100 }, "line_item_id": { "description": "Unique ID generated by the server for each line item. This is used as an identifier.", "type": "string", "example": 4815000000044897 }, "name": { "description": "Name of the line item.", "type": "string", "example": "Laptop-white/15inch/dell" }, "quantity_adjusted": { "description": "The adjusted quantity of the line item.It depends on adjustment_type and should be given only when adjustment_type is given as quantity.", "type": "number", "format": "double", "example": 10 }, "value_adjusted": { "description": "The adjusted value of the line item.It depends on adjustment_type and should be given only when adjustment_type is given as value.", "type": "number", "format": "double", "example": 250.5 }, "item_total": { "description": "Total of line item.", "type": "number", "format": "double", "example": 244 }, "unit": { "description": "Unit of line item.", "type": "string", "example": "qty" }, "is_combo_product": { "type": "boolean", "description": "Indicates if the product is a combo product", "example": false }, "adjustment_account_id": { "description": "Unique ID generated by the server for the Adjustment account.", "type": "string", "example": 4815000000000388 }, "adjustment_account_name": { "description": "Name of the Adjustment Account.", "type": "string", "example": "Cost of Goods Sold" }, "location_id": { "description": "Location ID", "type": "string", "example": "460000000038080" }, "location_name": { "description": "Name of the location", "type": "string", "example": "Head Office" }, "total": { "description": "Total value of the inventory adjustment.", "type": "number", "format": "double", "example": 350 }, "serial_numbers": { "description": "Serial numbers for the line item. Applicable only for items with serial tracking enabled.", "type": "array", "items": { "type": "string", "example": "ARMP-0078" } }, "batches": { "description": "Batches for the line item. For positive adjustments, create a new batch using batch_number or reference an existing batch using batch_id. For negative adjustments, reference an existing batch using batch_id with out_quantity. Applicable only for items with batch tracking enabled.", "type": "array", "items": { "type": "object", "properties": { "batch_id": { "description": "Unique identifier of an existing batch. Required for negative adjustments. For positive adjustments, use to add inward quantity to an existing batch instead of creating a new one.", "type": "string", "example": "6780203000000511440" }, "batch_number": { "description": "Batch number. Required for positive adjustments when creating a new batch.", "type": "string", "example": "BTC-TL-089" }, "external_batch_number": { "description": "External batch number from the manufacturer. Applicable for positive adjustments.", "type": "string", "example": "MFR-TL-089" }, "manufacturer_date": { "description": "Manufacturing date of the batch. Applicable for positive adjustments.", "type": "string", "example": "2026-05-12" }, "expiry_date": { "description": "Expiration date of the batch. Applicable for positive adjustments.", "type": "string", "example": "2026-12-16" }, "in_quantity": { "description": "Inward quantity for the batch. Applicable for positive adjustments.", "type": "number", "format": "float", "example": 2 }, "out_quantity": { "description": "Outward quantity from the batch. Applicable for negative adjustments.", "type": "number", "format": "float", "example": 2 }, "batch_in_id": { "description": "Unique identifier of the original inward batch entry to deduct stock from. Applicable for negative adjustments.", "type": "string", "example": "6780203000000511433" }, "storages": { "description": "Bin/storage locations allocated for stock against this batch.", "type": "array", "x-node_available_in": [ "Batch with Bin tracked items" ], "items": { "type": "object", "required": [ "storage_id" ], "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location. Applicable for both positive and negative adjustments.", "type": "string", "example": "6780203000000093225" }, "in_quantity": { "description": "Inward quantity into the bin. Applicable for positive adjustments.", "type": "number", "format": "float", "example": 2 }, "out_quantity": { "description": "Outward quantity from the bin. Applicable for negative adjustments.", "type": "number", "format": "float", "example": 2 } } } } } } }, "storages": { "description": "Bin/storage locations allocated for the line item. Applicable for both positive and negative adjustments. Applicable only for items with bin tracking enabled.", "type": "array", "items": { "type": "object", "required": [ "storage_id" ], "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location. Applicable for both positive and negative adjustments.", "type": "string", "example": "6780203000000093226" }, "in_quantity": { "description": "Inward quantity into the bin. Applicable for positive adjustments.", "type": "number", "format": "float", "example": 2 }, "out_quantity": { "description": "Outward quantity from the bin. Applicable for negative adjustments.", "type": "number", "format": "float", "example": 2 }, "serial_numbers": { "description": "Serial numbers allocated to this bin.", "type": "array", "x-node_available_in": [ "Serial with Bin tracked items" ], "items": { "type": "string", "example": "SR-RE-001" } } } } }, "batches-update": { "description": "Batches for the line item. Reference an existing batch entry using batch_id and batch_in_id. Applicable only for items with batch tracking enabled.", "type": "array", "items": { "type": "object", "required": [ "batch_id" ], "properties": { "batch_id": { "description": "Unique identifier of the batch. Applicable for both positive and negative adjustments.", "type": "string", "example": "6780203000001106001" }, "batch_number": { "description": "Batch number. Applicable for positive adjustments.", "type": "string", "example": "BTC-TL-089" }, "external_batch_number": { "description": "External batch number from the manufacturer. Applicable for positive adjustments.", "type": "string", "example": "MFR-TL-089" }, "manufacturer_date": { "description": "Manufacturing date of the batch. Applicable for positive adjustments.", "type": "string", "example": "2026-05-12" }, "expiry_date": { "description": "Expiration date of the batch. Applicable for positive adjustments.", "type": "string", "example": "2026-12-16" }, "in_quantity": { "description": "Inward quantity for the batch. Applicable for positive adjustments.", "type": "number", "format": "float", "example": 2 }, "out_quantity": { "description": "Outward quantity from the batch. Applicable for negative adjustments.", "type": "number", "format": "float", "example": 2 }, "batch_in_id": { "description": "Unique identifier of the original inward batch entry. Applicable for both positive and negative adjustments.", "type": "string", "example": "6780203000001106009" }, "storages": { "description": "Bin/storage locations allocated for stock against this batch.", "type": "array", "x-node_available_in": [ "Batch with Bin tracked items" ], "items": { "type": "object", "required": [ "storage_id" ], "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location. Applicable for both positive and negative adjustments.", "type": "string", "example": "6780203000000093225" }, "in_quantity": { "description": "Inward quantity into the bin. Applicable for positive adjustments.", "type": "number", "format": "float", "example": 2 }, "out_quantity": { "description": "Outward quantity from the bin. Applicable for negative adjustments.", "type": "number", "format": "float", "example": 2 }, "storage_in_id": { "description": "Unique identifier of the storage entry on the line item. Applicable for positive adjustments only when updating an existing entry.", "type": "string", "example": "6780203000001106004" }, "storage_out_id": { "description": "Unique identifier of the storage entry on the line item. Applicable for negative adjustments only when updating an existing entry.", "type": "string", "example": "6780203000001106024" } } } } } } }, "storages-update": { "description": "Bin/storage locations allocated for the line item. Applicable for both positive and negative adjustments. Applicable only for items with bin tracking enabled.", "type": "array", "items": { "type": "object", "required": [ "storage_id" ], "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location. Applicable for both positive and negative adjustments.", "type": "string", "example": "6780203000000093226" }, "in_quantity": { "description": "Inward quantity into the bin. Applicable for positive adjustments.", "type": "number", "format": "float", "example": 2 }, "out_quantity": { "description": "Outward quantity from the bin. Applicable for negative adjustments.", "type": "number", "format": "float", "example": 2 }, "storage_in_id": { "description": "Unique identifier of the storage entry on the line item. Applicable for positive adjustments only when updating an existing entry.", "type": "string", "example": "6780203000001106007" }, "storage_out_id": { "description": "Unique identifier of the storage entry on the line item. Applicable for negative adjustments only when updating an existing entry.", "type": "string", "example": "6780203000001106027" }, "serial_numbers": { "description": "Serial numbers allocated to this bin.", "type": "array", "x-node_available_in": [ "Serial with Bin tracked items" ], "items": { "type": "string", "example": "SR-RE-001" } } } } }, "batches-response": { "description": "Batches tracked for the line item. Returned for items with batch tracking enabled.", "type": "array", "items": { "type": "object", "properties": { "batch_id": { "description": "Unique identifier of the batch.", "type": "string", "example": "6780203000001106001" }, "batch_number": { "description": "Batch number.", "type": "string", "example": "BTC-TL-089" }, "external_batch_number": { "description": "External batch number from the manufacturer. Returned for positive adjustments.", "type": "string", "example": "MFR-TL-089" }, "manufacturer_date": { "description": "Manufacturing date of the batch. Returned for positive adjustments.", "type": "string", "example": "2026-05-12" }, "expiry_date": { "description": "Expiration date of the batch. Returned for positive adjustments.", "type": "string", "example": "2026-12-16" }, "in_quantity": { "description": "Inward quantity recorded for the batch. Returned for positive adjustments.", "type": "number", "format": "float", "example": 2 }, "out_quantity": { "description": "Outward quantity recorded for the batch. Returned for negative adjustments.", "type": "number", "format": "float", "example": 2 }, "batch_in_id": { "description": "Unique identifier of the original inward batch entry.", "type": "string", "example": "6780203000001106009" }, "storages": { "description": "Bin/storage locations recorded for stock against this batch.", "type": "array", "x-node_available_in": [ "Batch with Bin tracked items" ], "items": { "type": "object", "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location.", "type": "string", "example": "6780203000000093225" }, "storage_name": { "description": "Display name of the bin/storage location.", "type": "string", "example": "Bin A1" }, "in_quantity": { "description": "Inward quantity recorded against the bin. Returned for positive adjustments.", "type": "number", "format": "float", "example": 2 }, "out_quantity": { "description": "Outward quantity recorded against the bin. Returned for negative adjustments.", "type": "number", "format": "float", "example": 2 }, "storage_in_id": { "description": "Unique identifier of the storage entry on the line item. Returned for positive adjustments.", "type": "string", "example": "6780203000001106004" }, "storage_out_id": { "description": "Unique identifier of the storage entry on the line item. Returned for negative adjustments.", "type": "string", "example": "6780203000001106024" } } } } } } }, "storages-response": { "description": "Bin/storage locations tracked for the line item. Returned for items with bin tracking enabled.", "type": "array", "items": { "type": "object", "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location.", "type": "string", "example": "6780203000000093226" }, "storage_name": { "description": "Display name of the bin/storage location.", "type": "string", "example": "Bin A2" }, "in_quantity": { "description": "Inward quantity recorded against the bin. Returned for positive adjustments.", "type": "number", "format": "float", "example": 2 }, "out_quantity": { "description": "Outward quantity recorded against the bin. Returned for negative adjustments.", "type": "number", "format": "float", "example": 2 }, "storage_in_id": { "description": "Unique identifier of the storage entry on the line item. Returned for positive adjustments.", "type": "string", "example": "6780203000001106007" }, "storage_out_id": { "description": "Unique identifier of the storage entry on the line item. Returned for negative adjustments.", "type": "string", "example": "6780203000001106027" }, "serial_numbers": { "description": "Serial numbers allocated to this bin.", "type": "array", "x-node_available_in": [ "Serial with Bin tracked items" ], "items": { "type": "string", "example": "SR-RE-001" } } } } }, "customfield_id": { "type": "string", "description": "Unique ID of the custom field." }, "label": { "description": "Label of the Custom Field", "type": "string" }, "value": { "description": "Value of the Custom Field", "type": "string" }, "custom_fields": { "type": "array", "description": "List of custom fields associated with the inventory adjustment", "items": { "type": "object", "properties": { "customfield_id": { "$ref": "#/components/schemas/customfield_id" }, "label": { "$ref": "#/components/schemas/label" }, "value": { "$ref": "#/components/schemas/value" } } } }, "create-an-inventory-adjustment-request": { "required": [ "date", "reason", "adjustment_type", "line_items" ], "type": "object", "properties": { "date": { "$ref": "#/components/schemas/date" }, "reason": { "$ref": "#/components/schemas/reason" }, "description": { "$ref": "#/components/schemas/description" }, "reference_number": { "$ref": "#/components/schemas/reference_number" }, "adjustment_type": { "$ref": "#/components/schemas/adjustment_type" }, "custom_fields": { "$ref": "#/components/schemas/custom_fields" }, "location_id": { "$ref": "#/components/schemas/location_id" }, "line_items": { "description": "An inventory adjustment can contain multiple line items. Each line item contains item_id,name,description,quantity_adjusted,unit,adjustment_account_id,location_id.", "type": "array", "items": { "type": "object", "required": [ "item_id", "quantity_adjusted" ], "properties": { "item_id": { "$ref": "#/components/schemas/item_id" }, "name": { "$ref": "#/components/schemas/name" }, "description": { "$ref": "#/components/schemas/description" }, "quantity_adjusted": { "$ref": "#/components/schemas/quantity_adjusted" }, "item_total": { "$ref": "#/components/schemas/item_total" }, "unit": { "$ref": "#/components/schemas/unit" }, "is_combo_product": { "$ref": "#/components/schemas/is_combo_product" }, "adjustment_account_id": { "$ref": "#/components/schemas/adjustment_account_id" }, "adjustment_account_name": { "$ref": "#/components/schemas/adjustment_account_name" }, "location_id": { "$ref": "#/components/schemas/location_id" }, "serial_numbers": { "$ref": "#/components/schemas/serial_numbers" }, "batches": { "$ref": "#/components/schemas/batches" }, "storages": { "$ref": "#/components/schemas/storages" } } } } } }, "create-an-inventory-adjustment-response": { "type": "object", "properties": { "code": { "type": "integer", "example": 0, "readOnly": true }, "message": { "type": "string", "example": "Inventory Adjustment has been added", "readOnly": true }, "inventory_adjustment": { "$ref": "#/components/schemas/inventory_adjustment-response" } } }, "list-all-the-inventory-adjustments-response": { "type": "object", "properties": { "code": { "type": "integer", "example": 0, "readOnly": true }, "message": { "type": "string", "example": "success", "readOnly": true }, "inventory_adjustments": { "type": "array", "items": { "type": "object", "properties": { "inventory_adjustment_id": { "$ref": "#/components/schemas/inventory_adjustment_id" }, "date": { "$ref": "#/components/schemas/date" }, "reason": { "$ref": "#/components/schemas/reason" }, "reason_id": { "$ref": "#/components/schemas/reason_id" }, "description": { "$ref": "#/components/schemas/description" }, "reference_number": { "$ref": "#/components/schemas/reference_number" }, "adjustment_type": { "$ref": "#/components/schemas/adjustment_type" }, "total": { "$ref": "#/components/schemas/total" }, "custom_fields": { "$ref": "#/components/schemas/custom_fields" } } } } } }, "update-an-inventory-adjustment-request": { "required": [ "date", "reason", "adjustment_type", "line_items" ], "type": "object", "properties": { "date": { "$ref": "#/components/schemas/date" }, "reason": { "$ref": "#/components/schemas/reason" }, "description": { "$ref": "#/components/schemas/description" }, "reference_number": { "$ref": "#/components/schemas/reference_number" }, "adjustment_type": { "$ref": "#/components/schemas/adjustment_type" }, "custom_fields": { "$ref": "#/components/schemas/custom_fields" }, "location_id": { "$ref": "#/components/schemas/location_id" }, "line_items": { "description": "An inventory adjustment can contain multiple line items. Each line item contains item_id,line_item_id,name,description,quantity_adjusted,unit,adjustment_account_id,location_id.", "type": "array", "items": { "type": "object", "required": [ "item_id", "quantity_adjusted" ], "properties": { "line_item_id": { "$ref": "#/components/schemas/line_item_id" }, "item_id": { "$ref": "#/components/schemas/item_id" }, "name": { "$ref": "#/components/schemas/name" }, "description": { "$ref": "#/components/schemas/description" }, "quantity_adjusted": { "$ref": "#/components/schemas/quantity_adjusted" }, "item_total": { "$ref": "#/components/schemas/item_total" }, "unit": { "$ref": "#/components/schemas/unit" }, "is_combo_product": { "$ref": "#/components/schemas/is_combo_product" }, "adjustment_account_id": { "$ref": "#/components/schemas/adjustment_account_id" }, "adjustment_account_name": { "$ref": "#/components/schemas/adjustment_account_name" }, "location_id": { "$ref": "#/components/schemas/location_id" }, "serial_numbers": { "$ref": "#/components/schemas/serial_numbers" }, "batches": { "$ref": "#/components/schemas/batches-update" }, "storages": { "$ref": "#/components/schemas/storages-update" } } } } } }, "update-an-inventory-adjustment-response": { "type": "object", "properties": { "code": { "type": "integer", "example": 0, "readOnly": true }, "message": { "type": "string", "example": "success", "readOnly": true }, "inventory_adjustment": { "type": "object", "properties": { "inventory_adjustment_id": { "$ref": "#/components/schemas/inventory_adjustment_id" }, "date": { "$ref": "#/components/schemas/date" }, "reason": { "$ref": "#/components/schemas/reason" }, "reason_id": { "$ref": "#/components/schemas/reason_id" }, "description": { "$ref": "#/components/schemas/description" }, "reference_number": { "$ref": "#/components/schemas/reference_number" }, "adjustment_type": { "$ref": "#/components/schemas/adjustment_type" }, "line_items": { "$ref": "#/components/schemas/line_items" }, "location_id": { "$ref": "#/components/schemas/location_id" }, "location_name": { "$ref": "#/components/schemas/location_name" }, "total": { "$ref": "#/components/schemas/total" }, "custom_fields": { "$ref": "#/components/schemas/custom_fields" } } } } }, "retrieve-an-inventory-adjustment-response": { "type": "object", "properties": { "code": { "type": "integer", "example": 0, "readOnly": true }, "message": { "type": "string", "example": "success", "readOnly": true }, "inventory_adjustment": { "type": "object", "properties": { "inventory_adjustment_id": { "$ref": "#/components/schemas/inventory_adjustment_id" }, "date": { "$ref": "#/components/schemas/date" }, "reason": { "$ref": "#/components/schemas/reason" }, "reason_id": { "$ref": "#/components/schemas/reason_id" }, "description": { "$ref": "#/components/schemas/description" }, "reference_number": { "$ref": "#/components/schemas/reference_number" }, "adjustment_type": { "$ref": "#/components/schemas/adjustment_type" }, "line_items": { "$ref": "#/components/schemas/line_items" }, "location_id": { "$ref": "#/components/schemas/location_id" }, "location_name": { "$ref": "#/components/schemas/location_name" }, "total": { "$ref": "#/components/schemas/total" }, "custom_fields": { "$ref": "#/components/schemas/custom_fields" } } } } }, "delete-an-inventory-adjustment-response": { "type": "object", "properties": { "code": { "type": "integer", "example": 0, "readOnly": true }, "message": { "type": "string", "example": "Inventory Adjustment(s) has been deleted", "readOnly": true } } }, "approval-action-response": { "type": "object", "properties": { "code": { "type": "integer", "example": 0, "readOnly": true }, "message": { "type": "string", "example": "success", "readOnly": true } } }, "reject-request": { "type": "object", "properties": { "reason": { "description": "Reason for rejecting the inventory adjustment. Max-length [500].", "type": "string", "example": "Quantities do not match the physical count." } } } } }