Skip to main content

Inventory Adjustment

Version: 1.0

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 Inventory Adjustment resource.

Properties


id : number

"id": 1206854680

A unique identifier for the inventory adjustment.

created_at : string

"created_at": "2021-05-13T07:29:20.1Z"

The date and time (ISO 8601 format) when the inventory adjustment was created.

updated_at : string

"updated_at":"2021-05-13T07:29:20.808Z"

The date and time (ISO 8601 format) when the inventory adjustment was last updated.

adjust_number : string

"adjust_number":"IA100017"

The number of inventory adjustments.

tran_date : string

"tran_date": "2021-05-13T07:29:20.079Z"

The date and time (ISO 8601 format) when the inventory adjustment was changed.

location_id : number

"location_id": 963414

The ID of the inventory. You can get location information at the Location API.

type : string

"type": "adjust"

Valid values are: adjust, set.

adjust: add the new quantity with the old quantity.

set: override the new quantity with the old quantity.

if the type was not transferred, the default type is "adjust".

reason : array

"reason": "newproduct"

Valid values are: newproduct , returned , productionofgoods , damaged , shrinkage , promotion .

newproduct: New product. returned: Refund product. productionofgoods: Produce more products. damaged: Damanged. shrinkage: Loss. promotion: Promotion. transfer: Transfer.

if the type was not transferred, the default type is "newproduct".

total_quantity : number

"total_quantity": 50000

The quantity products of this inventory adjustment.

note : string

"note": "hàng hư hỏng do nhà sản xuất"

A note about the inventory adjustment.

total_cost : number

"total_cost": 150000000000.00

Total amount cost product of the inventory adjustment.

tags : string

"tags": "Hư hỏng"

Tags that the shop owner has attached to the inventory adjustment, formatted as a string of comma-separated values.

line_items : array

Details
"line_items": [

{

"id": 1116232509,

"product_id": 1031046355,

"product_variant_id": 1068095306,

"quantity": 50000,

"cost_amount": 150000000000.00,

"sku": "IPOD123",

"barcode": "123_pink"

}
]

Best supports 200 items for a request.

  • id: A unique identifier for the item in this line item.

  • product_id: A unique identifier for this product.

  • product_variant_id: A unique identifier for this product variant.

  • quantity: The number of the item for this product variant.

  • sku: A unique identifier for this product variant.

  • barcode: The barcode, UPC, or ISBN number for this product.

Retrieves a list of inventory adjustments.

GET
https://apis.haravan.com/com/inventories/adjustments.json

Retrieves a list of inventory adjustments. You can filter resources by params.

Parameters


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
Details
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
Details

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 a count of the inventory adjustments.

GET
https://apis.haravan.com/com/inventories/adjustments/count.json

Retrieve the count of resources of the inventory adjustment.
  • GET https://apis.haravan.com/com/inventories/adjustments/count.json
Details

HTTP/1.1 200 OK

{
"count": 2
}

Retrieves single the inventory adjustments.

GET
https://apis.haravan.com/com/inventories/adjustments/{adjustment_id}.json

Retrieves single the inventory adjustment.
  • GET https://apis.haravan.com/com/inventories/adjustments/1186432974.json
Details

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.

POST
https://apis.haravan.com/com/inventories/adjustorset.json

Create an inventory adjustment.

  • POST https://apis.haravan.com/com/inventories/adjustorset.json

{
"inventory": {
"location_id": 963414,
"type": "set",
"reason": "newproduct",
"note": "update from api",
"line_items": [
{
"product_id": 1031046355,
"product_variant_id": 1068095306,
"quantity": 4
},
{
"product_id": 1031046356,
"product_variant_id": 1068095307,
"quantity": 9
}
]
}
}

The API best supports arrays of 100 items per request.