You can track inventory adjustment history in your shop. Alternatively, you can use it to change the available quantity of an inventory item at a single location.
Authenticated access scopes: com.read_inventories, com.write_inventories
What you can do with Inventory Adjustment
The Haravan API lets you do the following with the Customer resource.
- GET https://apis.haravan.com/com/inventories/adjustments.json Retrieves a list of inventory adjustments.
- GET https://apis.haravan.com/com/inventories/adjustments/count.json Retrieve a count of the inventory adjustments.
- GET https://apis.haravan.com/com/inventories/adjustments/{inventory_adjustment_id}.json Retrieves single the inventory adjustments.
- POST https://apis.haravan.com/com/inventories/adjustorset.json Create an inventory adjustment.
Inventory adjusments properties
Endpoints
Retrieves a list of inventory adjustments. You can filter resources by params.
limit | Limit of the result. |
page | Page to show the result. |
since_id | Restrict results to after the specified ID |
location_id | Filter result by the specified location ID. |
reason | Filter result by the reason. |
Retrieve all of the resources of the inventory adjustment by page number. By default, the number of resources on the page is 50.
GET https://apis.haravan.com/com/inventories/adjustments.json?page=1
HTTP/1.1 200 OK
{ "adjustments": [ { "id": 1206854680, "created_at": "2021-05-13T07:29:20.1Z", "updated_at": "2021-05-13T07:29:20.808Z", "adjust_number": "IA100017", "tran_date": "2021-05-13T07:29:20.079Z", "location_id": 1007284, "type": null, "total_quantity": 1, "reason": "damaged", "note": null, "total_cost": 1000000.00, "tags": null, "line_items": [ { "id": 1124119453, "product_id": 1032963075, "product_variant_id": 1072106808, "quantity": -11, "cost_amount": -11000000.00, "sku": null, "barcode": null } ] }, { "id": 1186433005, "created_at": "2021-03-03T14:52:13.548Z", "updated_at": "2021-03-03T14:52:13.6Z", "adjust_number": "IA100016", "tran_date": "2021-03-03T14:52:13.519Z", "location_id": 963414, "type": null, "total_quantity": 50000, "reason": "productionofgoods", "note": null, "total_cost": 150000000000.00, "tags": null, "line_items": [ { "id": 1116232509, "product_id": 1031046355, "product_variant_id": 1068095306, "quantity": 50000, "cost_amount": 150000000000.00, "sku": null, "barcode": null } ] } ] }
Retrieve resources of the inventory adjustment by location id.
GET https://apis.haravan.com/com/inventories/adjustments.json?location_id=963414
HTTP/1.1 200 OK
{ "adjustments": [ { "id": 1206854680, "created_at": "2021-05-13T07:29:20.1Z", "updated_at": "2021-05-13T07:29:20.808Z", "adjust_number": "IA100017", "tran_date": "2021-05-13T07:29:20.079Z", "location_id": 963414, "type": null, "total_quantity": 1, "reason": "damaged", "note": null, "total_cost": 1000000.00, "tags": null, "line_items": [ { "id": 1124119453, "product_id": 1032963075, "product_variant_id": 1072106808, "quantity": -11, "cost_amount": -11000000.00, "sku": null, "barcode": null } ] }, { "id": 1186433005, "created_at": "2021-03-03T14:52:13.548Z", "updated_at": "2021-03-03T14:52:13.6Z", "adjust_number": "IA100016", "tran_date": "2021-03-03T14:52:13.519Z", "location_id": 963414, "type": null, "total_quantity": 50000, "reason": "productionofgoods", "note": null, "total_cost": 150000000000.00, "tags": null, "line_items": [ { "id": 1116232509, "product_id": 1031046355, "product_variant_id": 1068095306, "quantity": 50000, "cost_amount": 150000000000.00, "sku": null, "barcode": null } ] } ] }
Retrieve the count of resources of the inventory adjustment.
Retrieve the count of resources of the inventory adjustment.
GET https://apis.haravan.com/com/inventories/adjustments/count.json
Retrieves single the inventory adjustment.
Retrieves single the inventory adjustment by ID.
GET https://apis.haravan.com/com/inventories/adjustments/1186432974.json
HTTP/1.1 200 OK
{ "adjustment": { "id": 1186432974, "created_at": "2021-03-03T14:50:47.016Z", "updated_at": "2021-03-03T14:50:47.989Z", "adjust_number": "IA100015", "tran_date": "2021-03-03T14:50:47.001Z", "location_id": 963414, "type": null, "total_quantity": 1, "reason": "productionofgoods", "note": null, "total_cost": 3000000.00, "tags": null, "line_items": [ { "id": 1116232425, "product_id": 1031046355, "product_variant_id": 1068095306, "quantity": 1, "cost_amount": 3000000.00, "sku": null, "barcode": null } ] } }
Create an inventory adjustment. The line item best supports 200 items for a location. Otherwise, it will be easy to rate the limit error.
POST https://apis.haravan.com/com/inventories/adjustorset.json
{ "inventory": { "location_id": 963414, "type": "set", "reason": "newproduct", "note": "nhap tra", "line_items": [ { "product_id": 1031046355, "product_variant_id": 1068095306, "quantity": 4 } ] } }
HTTP/1.1 200 OK
{ "inventory": { "id": 1237485447, "created_at": "2021-07-20T10:26:55.084031Z", "updated_at": "2021-07-20T10:26:55.0840495Z", "adjust_number": "IA100019", "tran_date": "2021-07-20T10:26:55.0630306Z", "location_id": 963414, "total_quantity": 1, "reason": "newproduct", "note": "nhap tra", "total_cost": 0.0, "tags": null, "line_items": [ { "id": 1133262346, "product_id": 1031046355, "product_variant_id": 1068095306, "quantity": 1, "cost_amount": 0.00, "sku": null, "barcode": null } ] } }