# Inventory Transactions
The inventory transactions endpoint groups several inventory transactions under a single endpoint detailed below:
- Purchasing: Is the process of purchasing items directly by branch/warehouse from a registered supplier.
- Transfer Sending: Is the process of sending inventory items from a single location to another.
- Quantity Adjustment: Is the process of deducting item quantities from the levels for customizale reasons.
- Return To Supplier: Is the process of returning purchased items to the supplier.
- Production: Is the process of manufacturing producible inventory items.
- Transfer Receiving: Is the process of receiving sent inventory items into the destinated location.
- Consumption from Production: Is an auto-created transaction that registers the consumption cost & quantity resulting from a production transaction.
- Consumption from Order: Is an auto-created transaction resulting from a sales order, that holds the quantity and cost of the consumed items.
- Return from Order: Is an auto-created transaction resulting from sales return operations.
- Waste from Order: Is an auto-created transaction resulting from waste actions on sales during void & returns.
- Return from Transfer : Is an auto-created transaction resulting from Transfer return operations
- Waste from Production : Is an auto-created transaction resulting from waste actions on production during preparing your Inventory Items.
# The Inventory Transaction Object
# Sample
{
"branch": {
"id": "8f7ab00a"
},
"other_branch": {
"id": "8f7a4061"
},
"supplier": {
"id": "12e4067d"
},
"order": {
"id": "8f7aafee"
},
"creator": {
"id": "8f8483ee"
},
"poster": {
"id": "8f8084fee"
},
"purchase_order": {
"id": "8f894839e"
},
"transfer_order": {
"id": "061aafee"
},
"other_transaction": {
"id": "8f858ee"
},
"items": [
{
"pivot": {
"quantity": 200,
"cost": 170
},
"id": "8f7bb0a6"
}
],
"reason": {
"id": "8f858ee"
},
"id": "8f897ac8",
"business_date": "2020-01-05",
"reference": "PUR-000001",
"type": 1,
"status": 4,
"paid_tax": 0,
"additional_cost": 0,
"notes": "Purchase from Supplier",
"invoice_number": "500100",
"invoice_date": "2020-01-03",
"created_at": "2020-01-05 06:38:52",
"updated_at": "2020-01-05 06:39:07",
"posted_at": "2020-01-05 06:39:07"
}
# Attributes
| Field | Type | Rule | Description |
|---|---|---|---|
id | string | Unique id of the inventory transaction | |
business_date | string | nullable | The business day of the inventory transaction |
reference | string | nullable | User friendly unique reference for the inventory transaction |
paid_tax | double | updatable | The tax amount paid for the inventory transaction |
type* | integer | The Inventory Transaction Type | |
status* | integer | The Inventory Transaction Status | |
additional_cost | double | updatable | Any additional cost related to the inventory transaction |
notes | string | nullable updatable | Notes on the inventory transaction. |
invoice_number | string | updatable | User entered invoice number of the inventory transaction |
invoice_date | string | updatable | The date of the invoice |
branch* | object | updatable includable | The Branch attached to the inventory transaction |
other_branch | object | updatable includable | The other Branch attached to the inventory transaction, e.g. receiving branch in transfer sending transaction |
supplier* | object | updatable includable | TheSupplier attached to the inventory transaction |
tag | object | nullable updatable includable | The Tag Details attached to the inventory transaction |
order | object | nullable includable | The Order attached to the inventory transaction |
creator* | object | updatable includable | The User who created the inventory transaction |
poster | object | updatable includable | The User who posted the inventory transaction |
reason | object | updatable includable | The Reason attached to the inventory transaction |
purchase_order | object | nullable includable | The Purchase Order attached to the inventory transaction |
transfer_order | object | nullable includable | The Transfer Order attached to the inventory transaction |
other_transaction | object | nullable includable | The Other Transaction attached to the inventory transaction |
items* | array | updatable includable | List of Inventory Items attached to the inventory transaction |
created_at | string | sortable | Time YYYY-MM-DD HH-MM-SS in UTC at which the inventory transaction was created. |
updated_at | string | sortable | Time YYYY-MM-DD HH-MM-SS in UTC at which the inventory transaction was updated. |
posted_at | string | Time YYYY-MM-DD HH-MM-SS in UTC at which the inventory transaction was posted. |
# Types
| Type | Description |
|---|---|
1 | Purchasing. |
2 | Transfer Sending. |
3 | Quantity Adjustment. |
4 | Return to Supplier. |
5 | Production. |
6 | Transfer Receiving. |
7 | Consumption from Production. |
8 | Consumption from Order. |
9 | Return from Order. |
10 | Waste from Order. |
11 | Return from Transfer. |
12 | Waste from production. |
# Statuses
| Type | Description |
|---|---|
1 | Draft. |
2 | Pending. |
3 | Declined. |
4 | Closed. |
# List Inventory Transactions
GET /inventory_transactions
# Scope
inventory.transactions.read
# Filters
idbusiness_datebusiness_date_afterbusiness_date_beforereferencetypestatusbranch_idother_branch_idsupplier_idreason_idorder_idinvoice_numbercreator_idposter_idpurchase_order_idtransfer_order_idother_transaction_idupdated_afterfor_branch_idcreated_onupdated_on
# Response
{
"data": [
{
"branch": {
"id": "8f7ab00a"
},
"other_branch": {
"id": "8f7a4061"
},
"supplier": {
"id": "12e4067d"
},
"order": {
"id": "8f7aafee"
},
"creator": {
"id": "8f8483ee"
},
"poster": {
"id": "8f8084fee"
},
"purchase_order": {
"id": "8f894839e"
},
"transfer_order": {
"id": "061aafee"
},
"other_transaction": {
"id": "8f858ee"
},
"items": [
{
"pivot": {
"quantity": 200,
"cost": 170
},
"id": "8f7bb0a6"
}
],
"reason": {
"id": "8f858ee"
},
"id": "8f897ac8",
"business_date": "2020-01-05",
"reference": "PUR-000001",
"type": 1,
"status": 4,
"paid_tax": 0,
"additional_cost": 0,
"notes": "Purchase from Supplier",
"invoice_number": "500100",
"invoice_date": "2020-01-03",
"created_at": "2020-01-05 06:38:52",
"updated_at": "2020-01-05 06:39:07",
"posted_at": "2020-01-05 06:39:07"
}
]
}
# Get Inventory Transaction
GET /inventory_transactions/{inventoryTransactionId}
# Scope
inventory.transactions.read
# Response
{
"data": {
"branch": {
"id": "8f7ab00a"
},
"other_branch": {
"id": "8f7a4061"
},
"supplier": {
"id": "12e4067d"
},
"order": {
"id": "8f7aafee"
},
"creator": {
"id": "8f8483ee"
},
"poster": {
"id": "8f8084fee"
},
"purchase_order": {
"id": "8f894839e"
},
"transfer_order": {
"id": "061aafee"
},
"other_transaction": {
"id": "8f858ee"
},
"items": [
{
"pivot": {
"quantity": 200,
"cost": 170
},
"id": "8f7bb0a6"
}
],
"reason": {
"id": "8f858ee"
},
"id": "8f897ac8",
"business_date": "2020-01-05",
"reference": "PUR-000001",
"type": 1,
"status": 4,
"paid_tax": 0,
"additional_cost": 0,
"notes": "Purchase from Supplier",
"invoice_number": "500100",
"invoice_date": "2020-01-03",
"created_at": "2020-01-05 06:38:52",
"updated_at": "2020-01-05 06:39:07",
"posted_at": "2020-01-05 06:39:07"
}
}
# Create Inventory Transaction
POST /inventory_transactions
# Scope
inventory.transactions.write
# Request
{
"reference": "PUR001",
"type": 1,
"status": 1,
"paid_tax": 10,
"additional_cost": 0,
"notes": "",
"invoice_number": null,
"invoice_date": null,
"branch_id": "8d207fc3",
"supplier_id": "8d207fc3",
"order_id": "8d207fc3",
"creator_id": "8d207fc3",
"poster_id": "8d207fc3",
"tag_id": "8d207fc3",
"reason_id":"8d207fc3",
"purchase_order_id": "8d207fc3",
"transfer_order_id": "8d207fc3",
"items": [
{
"id": "8d207fc3",
"quantity": 200,
"cost": 400
}
]
}
# Response
{
"data": {
"branch": {
"id": "8f7ab00a"
},
"other_branch": {
"id": "8f7a4061"
},
"supplier": {
"id": "12e4067d"
},
"order": {
"id": "8f7aafee"
},
"creator": {
"id": "8f8483ee"
},
"poster": {
"id": "8f8084fee"
},
"purchase_order": {
"id": "8f894839e"
},
"transfer_order": {
"id": "061aafee"
},
"other_transaction": {
"id": "8f858ee"
},
"items": [
{
"pivot": {
"quantity": 200,
"cost": 170
},
"id": "8f7bb0a6"
}
],
"reason": {
"id": "8f858ee"
},
"id": "8f897ac8",
"business_date": "2020-01-05",
"reference": "PUR-000001",
"type": 1,
"status": 4,
"paid_tax": 0,
"additional_cost": 0,
"notes": "Purchase from Supplier",
"invoice_number": "500100",
"invoice_date": "2020-01-03",
"created_at": "2020-01-05 06:38:52",
"updated_at": "2020-01-05 06:39:07",
"posted_at": "2020-01-05 06:39:07"
}
}
# Update Inventory Transaction
PUT /inventory_transactions/{inventoryTransactionId}
# Scope
inventory.transactions.write
# Request
{
"status": 1,
"paid_tax": 10,
"additional_cost": 0,
"notes": "",
"invoice_number": null,
"invoice_date": null,
"branch_id": "8d207fc3",
"supplier_id": "8d207fc3",
"order_id": "8d207fc3",
"creator_id": "8d207fc3",
"poster_id": "8d207fc3",
"tag_id": "8d207fc3",
"purchase_order_id": "8d207fc3",
"transfer_order_id": "8d207fc3",
"items": [
{
"id": "8d207fc3",
"quantity": 200,
"cost": 400
}
]
}
# Response
{
"data": {
"branch": {
"id": "8f7ab00a"
},
"other_branch": {
"id": "8f7a4061"
},
"supplier": {
"id": "12e4067d"
},
"order": {
"id": "8f7aafee"
},
"creator": {
"id": "8f8483ee"
},
"poster": {
"id": "8f8084fee"
},
"purchase_order": {
"id": "8f894839e"
},
"transfer_order": {
"id": "061aafee"
},
"other_transaction": {
"id": "8f858ee"
},
"items": [
{
"pivot": {
"quantity": 200,
"cost": 170
},
"id": "8f7bb0a6"
}
],
"reason": {
"id": "8f858ee"
},
"id": "8f897ac8",
"business_date": "2020-01-05",
"reference": "PUR-000001",
"type": 1,
"status": 4,
"paid_tax": 0,
"additional_cost": 0,
"notes": "Purchase from Supplier",
"invoice_number": "500100",
"invoice_date": "2020-01-03",
"created_at": "2020-01-05 06:38:52",
"updated_at": "2020-01-05 06:39:07",
"posted_at": "2020-01-05 06:39:07"
}
}
# Delete Inventory Transaction
DELETE /inventory_transactions/{inventoryTransactionId}
# Scope
inventory.transactions.write
The API will respond with 200 to indicate that the transaction has been deleted.