# Cost Adjustment Transactions
Cost Adjustment is an inventory transaction that is done to correct/override current inventory item costs.
# The Cost Adjustment Transaction Object
# Sample
{
"id": "8d2eb82d",
"business_date": "1982-05-28",
"reference": "CA1231",
"status": 1,
"notes": "",
"items": [
{
"pivot": {
"cost_per_unit": 10,
"previous_cost_per_unit": 5
},
"id": "8d2eb82c"
}
],
"branch": {
"id": "8d82ff0c-b165-48d7-bd7b"
},
"creator": {
"id": "8dtu2ff0c-b165-48d7-bd7b"
},
"poster": {
"id": "hrj674-b165-48d7-bd7b"
},
"created_at": "2019-03-13 17:58:48",
"updated_at": "2019-03-13 17:58:48"
}# Attributes
| Field | Type | Rule | Description |
|---|---|---|---|
id | string | Unique identifier for the cost adjustment transaction. | |
business_date | string | updatable nullable | The business date YYYY-MM-DD of the cost adjustment transaction. |
reference | string | nullable | Unique cost adjustment transaction reference |
status* | array | updatable | The cost adjustment transaction Status. |
notes | array | nullable updatable | User entered notes |
creator* | object | updatable includable | The User object who created the cost adjustment transaction. |
poster | object | nullable updatable includable | The User object who posted the cost adjustment transaction. |
branch* | object | updatable includable | The Branch attached to the cost adjustment transaction. |
items* | array | updatable includable | List of Inventory Items attached to the cost adjustment transaction. |
created_at | string | sortable | Time YYYY-MM-DD HH-MM-SS at which the cost adjustment transaction was created in UTC. |
updated_at | string | sortable | Time YYYY-MM-DD HH-MM-SS at which the cost adjustment transaction was updated in UTC. |
deleted_at | string | nullable | Time YYYY-MM-DD HH-MM-SS at which the cost adjustment transaction was deleted in UTC. |
# Statuses
| Type | Details |
|---|---|
1 | Draft. |
2 | Closed. |
# List Cost Adjustment Transactions
GET /cost_adjustments
# Scope
inventory.transactions.read
# Filters
idbusiness_datebusiness_date_afterbusiness_date_beforereferencestatusbranch_idcreator_idposter_idupdated_aftercreated_onupdated_on
# Response
{
"data": [
{
"id": "8d2eb82d",
"business_date": "1982-05-28",
"reference": "CA1231",
"status": 1,
"notes": "",
"items": [
{
"pivot": {
"cost_per_unit": 10,
"previous_cost_per_unit": 5
},
"id": "8d2eb82c"
}
],
"branch": {
"id": "8d82ff0c-b165-48d7-bd7b"
},
"creator": {
"id": "8dtu2ff0c-b165-48d7-bd7b"
},
"poster": {
"id": "hrj674-b165-48d7-bd7b"
},
"created_at": "2019-03-13 17:58:48",
"updated_at": "2019-03-13 17:58:48"
}
]
}# Get Cost Adjustment Transaction
GET /cost_adjustments/{costAdjustmentId}
# Scope
inventory.transactions.read
# Response
{
"data": {
"id": "8d2eb82d",
"business_date": "1982-05-28",
"reference": "CA1231",
"status": 1,
"notes": "",
"items": [
{
"pivot": {
"cost_per_unit": 10,
"previous_cost_per_unit": 5
},
"id": "8d2eb82c"
}
],
"branch": {
"id": "8d82ff0c-b165-48d7-bd7b"
},
"creator": {
"id": "8dtu2ff0c-b165-48d7-bd7b"
},
"poster": {
"id": "hrj674-b165-48d7-bd7b"
},
"created_at": "2019-03-13 17:58:48",
"updated_at": "2019-03-13 17:58:48"
}
# Create Cost Adjustment Transaction
POST /cost_adjustments
# Scope
inventory.transactions.write
# Request
{
"business_date": "2019-05-25",
"status": 1,
"notes": "",
"branch_id": "8d207fc3",
"creator_id": "8d207fc3",
"poster_id": "8d207fc3",
"items": [
{
"id": "8d207fc3",
"cost_per_unit": 10
}
]
}
# Response
{
"data": {
"id": "8d2eb82d",
"business_date": "1982-05-28",
"reference": "CA1231",
"status": 1,
"notes": "",
"items": [
{
"pivot": {
"cost_per_unit": 10,
"previous_cost_per_unit": 5
},
"id": "8d2eb82c"
}
],
"branch": {
"id": "8d82ff0c-b165-48d7-bd7b"
},
"creator": {
"id": "8dtu2ff0c-b165-48d7-bd7b"
},
"poster": {
"id": "hrj674-b165-48d7-bd7b"
},
"created_at": "2019-03-13 17:58:48",
"updated_at": "2019-03-13 17:58:48"
}
# Update Cost Adjustment Transaction
PUT /cost_adjustments/{costAdjustmentId}
# Scope
inventory.transactions.write
# Request
{
"business_date": "2019-05-25",
"status": 1,
"notes": "",
"branch_id": "8d207fc3",
"creator_id": "8d207fc3",
"poster_id": "8d207fc3",
"items": [
{
"id": "8d207fc3",
"cost_per_unit": 10
}
]
}
# Response
{
"data": {
"id": "8d2eb82d",
"business_date": "1982-05-28",
"reference": "CA1231",
"status": 1,
"notes": "",
"items": [
{
"pivot": {
"cost_per_unit": 10,
"previous_cost_per_unit": 5
},
"id": "8d2eb82c"
}
],
"branch": {
"id": "8d82ff0c-b165-48d7-bd7b"
},
"creator": {
"id": "8dtu2ff0c-b165-48d7-bd7b"
},
"poster": {
"id": "hrj674-b165-48d7-bd7b"
},
"created_at": "2019-03-13 17:58:48",
"updated_at": "2019-03-13 17:58:48"
}
# Delete Cost Adjustment Transaction
DELETE /cost_adjustments/{costAdjustmentId}
# Scope
inventory.transactions.write
The API will respond with 200 indicating that the transaction has been deleted.