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

Inventory adjusments properties

id

"id": 1206854680

A unique identifier for the inventory adjustment.

created_at

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

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

updated_at

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

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

adjust_number

"adjust_number": "IA100017"

The number of inventory adjustments.

tran_date

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

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

location_id

"location_id": 963414

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

type

"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

"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

"total_quantity": 50000

The quantity products of this inventory adjustment.

note

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

A note about the inventory adjustment.

total_cost

"total_cost": 150000000000.00

Total amount cost product of the inventory adjustment.

tags

"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

"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.

Endpoints

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

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

View response

				

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

View response

				

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 } ] } ] }
GET https://apis.haravan.com/com/inventories/adjustments/count.json 

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

{
    "count"2
}

Retrieves single the inventory adjustment by ID.

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

View response

				

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 } ] } }
POST https://apis.haravan.com/com/inventories/adjustorset.json 

Create an inventory adjustment.

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
            }
        ]
    }
}	

View response

				

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 } ] } }