Skip to content

Haravan — Tồn kho ​

Xem tồn kho (Get stock levels) — haravan.get_inventory_levels ​

Stock on hand of given variants at given locations. Get location ids from list_locations and variant ids from list_variants or get_product.

Tác độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcócom.read_inventories

Input

FieldNhãnKiểuBắt buộcMô tả
variant_idsMã biến thểstringcóComma-separated variant ids. Pattern: ^\d+(,\d+)*$.
location_idsMã chi nhánhstringcóComma-separated location ids. Pattern: ^\d+(,\d+)*$.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
inventory_locationsTồn khoarray of objectStock per variant and location.
inventory_locations[].idintegerInventory record id.
inventory_locations[].loc_idintegerLocation id; matches list_locations.
inventory_locations[].product_idintegerProduct id.
inventory_locations[].variant_idintegerVariant id.
inventory_locations[].qty_onhandnumberQuantity physically in stock; can be negative.
inventory_locations[].qty_commitednumberQuantity reserved by orders.
inventory_locations[].qty_incomingnumberQuantity on its way to this location.
inventory_locations[].qty_availablenumberQuantity available for sale; can be negative.
inventory_locations[].updated_atstringWhen it was last updated (ISO 8601).

Điều chỉnh tồn kho (Adjust stock) — haravan.adjust_inventory ​

Add to (adjust) or overwrite (set) stock at one location.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEmediumcókhôngcom.write_inventories

Input

FieldNhãnKiểuBắt buộcMô tả
inventoryPhiếu điều chỉnhobjectcóThe adjustment.
inventory.location_idintegercóLocation id from list_locations.
inventory.typestringkhôngadjust adds to stock; set overwrites it. One of: adjust, set.
inventory.reasonstringkhôngReason: newproduct, returned, productionofgoods, damaged, shrinkage, promotion. One of: newproduct, returned, productionofgoods, damaged, shrinkage, promotion.
inventory.notestringkhôngNote.
inventory.line_itemsarray of objectcóUp to 200 items: product_id, product_variant_id, quantity.
inventory.line_items[].product_idintegercóProduct id.
inventory.line_items[].product_variant_idintegercóVariant id.
inventory.line_items[].quantityintegercóQuantity.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
inventoryPhiếu điều chỉnhobjectThe adjustment.
inventory.idintegerAdjustment id.
inventory.created_atstringWhen it was created (ISO 8601).
inventory.updated_atstringWhen it was last updated (ISO 8601).
inventory.adjust_numberstringAdjustment number, e.g. IA100017.
inventory.tran_datestringWhen the stock changed (ISO 8601).
inventory.location_idintegerLocation id; matches list_locations.
inventory.typestring | nulladjust adds to stock, set overwrites it; null in list replies and absent from the reply of adjust_inventory.
inventory.reasonstringnewproduct, returned, productionofgoods, damaged, shrinkage or promotion.
inventory.total_quantitynumberTotal quantity of this adjustment.
inventory.notestring | nullNote.
inventory.total_costnumberTotal cost of the adjusted stock, VND.
inventory.tagsstring | nullComma-separated tags.
inventory.line_itemsarray of objectAdjusted variants.
inventory.line_items[].idintegerLine item id.
inventory.line_items[].product_idintegerProduct id.
inventory.line_items[].product_variant_idintegerVariant id.
inventory.line_items[].quantitynumberQuantity; negative when stock was removed.
inventory.line_items[].skustring | nullSKU of the variant.
inventory.line_items[].barcodestring | nullBarcode of the variant.
inventory.line_items[].cost_amountnumberCost of this line, VND.

Danh sách phiếu điều chỉnh kho (List stock adjustments) — haravan.list_inventory_adjustments ​

List past stock adjustments.

Tác độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcócom.read_inventories

Input

FieldNhãnKiểuBắt buộcMô tả
created_at_minTạo từstringkhôngCreated at or after (ISO 8601).
created_at_maxTạo đếnstringkhôngCreated at or before (ISO 8601).
pageTrangintegerkhôngPage number, from 1. Min 1.
limitSố kết quả mỗi trangintegerkhôngItems per page (1-50, default 50). Min 1. Max 50.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
adjustmentsPhiếu điều chỉnharray of objectAdjustments.
adjustments[].idintegerAdjustment id.
adjustments[].created_atstringWhen it was created (ISO 8601).
adjustments[].updated_atstringWhen it was last updated (ISO 8601).
adjustments[].adjust_numberstringAdjustment number, e.g. IA100017.
adjustments[].tran_datestringWhen the stock changed (ISO 8601).
adjustments[].location_idintegerLocation id; matches list_locations.
adjustments[].typestring | nulladjust adds to stock, set overwrites it; null in list replies and absent from the reply of adjust_inventory.
adjustments[].reasonstringnewproduct, returned, productionofgoods, damaged, shrinkage or promotion.
adjustments[].total_quantitynumberTotal quantity of this adjustment.
adjustments[].notestring | nullNote.
adjustments[].total_costnumberTotal cost of the adjusted stock, VND.
adjustments[].tagsstring | nullComma-separated tags.
adjustments[].line_itemsarray of objectAdjusted variants.
adjustments[].line_items[].idintegerLine item id.
adjustments[].line_items[].product_idintegerProduct id.
adjustments[].line_items[].product_variant_idintegerVariant id.
adjustments[].line_items[].quantitynumberQuantity; negative when stock was removed.
adjustments[].line_items[].skustring | nullSKU of the variant.
adjustments[].line_items[].barcodestring | nullBarcode of the variant.
adjustments[].line_items[].cost_amountnumberCost of this line, VND.

Danh sách phiếu chuyển kho (List stock transfers) — haravan.list_inventory_transfers ​

List stock transfers between locations.

Tác độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcócom.read_inventories

Input

FieldNhãnKiểuBắt buộcMô tả
created_at_minTạo từstringkhôngCreated at or after (ISO 8601).
created_at_maxTạo đếnstringkhôngCreated at or before (ISO 8601).
pageTrangintegerkhôngPage number, from 1. Min 1.
limitSố kết quả mỗi trangintegerkhôngItems per page (1-50, default 50). Min 1. Max 50.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
transfersPhiếu chuyển khoarray of objectTransfers.
transfers[].idintegerTransfer id.
transfers[].transfer_numberstringTransfer number, e.g. IT100001.
transfers[].from_loc_idintegerSource location id.
transfers[].to_loc_idintegerDestination location id.
transfers[].reasonstringnewproduct, returned, productionofgoods, damaged, shrinkage or promotion.
transfers[].tran_datestringWhen the transfer was made (ISO 8601).
transfers[].notestring | nullNote.
transfers[].totalnumberTotal quantity transferred.
transfers[].created_atstringWhen it was created (ISO 8601).
transfers[].updated_atstringWhen it was last updated (ISO 8601).
transfers[].statusstringTransfer status, e.g. Active or Received.
transfers[].actived_atstringWhen the transfer was activated (ISO 8601).
transfers[].received_atstring | nullWhen it was received (ISO 8601).
transfers[].created_userintegerStaff id who created the transfer.
transfers[].received_userinteger | nullStaff id who received it; null if not yet.
transfers[].tagsstring | nullComma-separated tags.
transfers[].line_itemsarray of objectTransferred variants.
transfers[].line_items[].idintegerLine item id.
transfers[].line_items[].product_idintegerProduct id.
transfers[].line_items[].product_variant_idintegerVariant id.
transfers[].line_items[].quantitynumberQuantity; negative when stock was removed.
transfers[].line_items[].skustring | nullSKU of the variant.
transfers[].line_items[].barcodestring | nullBarcode of the variant.
transfers[].line_items[].variant_titlestring | nullVariant title.
transfers[].line_items[].product_namestringProduct name.

Tạo phiếu chuyển kho (Create stock transfer) — haravan.create_inventory_transfer ​

Move stock from one location to another.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEmediumcókhôngcom.write_inventories

Input

FieldNhãnKiểuBắt buộcMô tả
transferPhiếu chuyển khoobjectcóThe transfer.
transfer.from_loc_idintegercóSource location id.
transfer.to_loc_idintegercóDestination location id.
transfer.reasonstringkhôngReason: newproduct, returned, productionofgoods, damaged, shrinkage, promotion. One of: newproduct, returned, productionofgoods, damaged, shrinkage, promotion.
transfer.notestringkhôngNote.
transfer.line_itemsarray of objectcóUp to 200 items: product_id, product_variant_id, quantity.
transfer.line_items[].product_idintegercóProduct id.
transfer.line_items[].product_variant_idintegercóVariant id.
transfer.line_items[].quantityintegercóQuantity.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
transferPhiếu chuyển khoobjectThe transfer.
transfer.idintegerTransfer id.
transfer.transfer_numberstringTransfer number, e.g. IT100001.
transfer.from_loc_idintegerSource location id.
transfer.to_loc_idintegerDestination location id.
transfer.reasonstringnewproduct, returned, productionofgoods, damaged, shrinkage or promotion.
transfer.tran_datestringWhen the transfer was made (ISO 8601).
transfer.notestring | nullNote.
transfer.totalnumberTotal quantity transferred.
transfer.created_atstringWhen it was created (ISO 8601).
transfer.updated_atstringWhen it was last updated (ISO 8601).
transfer.statusstringTransfer status, e.g. Active or Received.
transfer.actived_atstringWhen the transfer was activated (ISO 8601).
transfer.received_atstring | nullWhen it was received (ISO 8601).
transfer.created_userintegerStaff id who created the transfer.
transfer.received_userinteger | nullStaff id who received it; null if not yet.
transfer.tagsstring | nullComma-separated tags.
transfer.line_itemsarray of objectTransferred variants.
transfer.line_items[].idintegerLine item id.
transfer.line_items[].product_idintegerProduct id.
transfer.line_items[].product_variant_idintegerVariant id.
transfer.line_items[].quantitynumberQuantity; negative when stock was removed.
transfer.line_items[].skustring | nullSKU of the variant.
transfer.line_items[].barcodestring | nullBarcode of the variant.
transfer.line_items[].variant_titlestring | nullVariant title.
transfer.line_items[].product_namestringProduct name.

Nhận hàng chuyển kho (Receive stock transfer) — haravan.receive_inventory_transfer ​

Mark a stock transfer as received at the destination.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEmediumcókhôngcom.write_inventories

Input

FieldNhãnKiểuBắt buộcMô tả
transfer_idMã phiếu chuyển khointegercóTransfer id. Min 1.
transferNgười nhậnobjectkhôngWho received it.
transfer.user_idintegerkhôngStaff id.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
transferPhiếu chuyển khoobjectThe transfer.
transfer.idintegerTransfer id.
transfer.transfer_numberstringTransfer number, e.g. IT100001.
transfer.from_loc_idintegerSource location id.
transfer.to_loc_idintegerDestination location id.
transfer.reasonstringnewproduct, returned, productionofgoods, damaged, shrinkage or promotion.
transfer.tran_datestringWhen the transfer was made (ISO 8601).
transfer.notestring | nullNote.
transfer.totalnumberTotal quantity transferred.
transfer.created_atstringWhen it was created (ISO 8601).
transfer.updated_atstringWhen it was last updated (ISO 8601).
transfer.statusstringTransfer status, e.g. Active or Received.
transfer.actived_atstringWhen the transfer was activated (ISO 8601).
transfer.received_atstring | nullWhen it was received (ISO 8601).
transfer.created_userintegerStaff id who created the transfer.
transfer.received_userinteger | nullStaff id who received it; null if not yet.
transfer.tagsstring | nullComma-separated tags.
transfer.line_itemsarray of objectTransferred variants.
transfer.line_items[].idintegerLine item id.
transfer.line_items[].product_idintegerProduct id.
transfer.line_items[].product_variant_idintegerVariant id.
transfer.line_items[].quantitynumberQuantity; negative when stock was removed.
transfer.line_items[].skustring | nullSKU of the variant.
transfer.line_items[].barcodestring | nullBarcode of the variant.
transfer.line_items[].variant_titlestring | nullVariant title.
transfer.line_items[].product_namestringProduct name.