Skip to content

Haravan — Inventory ​

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.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyescom.read_inventories

Input

FieldTypeRequiredDescription
variant_idsstringyesComma-separated variant ids. Pattern: ^\d+(,\d+)*$.
location_idsstringyesComma-separated location ids. Pattern: ^\d+(,\d+)*$.

Extra fields: ignored.

Output

FieldTypeDescription
inventory_locationsarray 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).

Adjust stock — haravan.adjust_inventory ​

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

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumyesnocom.write_inventories

Input

FieldTypeRequiredDescription
inventoryobjectyesThe adjustment.
inventory.location_idintegeryesLocation id from list_locations.
inventory.typestringnoadjust adds to stock; set overwrites it. One of: adjust, set.
inventory.reasonstringnoReason: newproduct, returned, productionofgoods, damaged, shrinkage, promotion. One of: newproduct, returned, productionofgoods, damaged, shrinkage, promotion.
inventory.notestringnoNote.
inventory.line_itemsarray of objectyesUp to 200 items: product_id, product_variant_id, quantity.
inventory.line_items[].product_idintegeryesProduct id.
inventory.line_items[].product_variant_idintegeryesVariant id.
inventory.line_items[].quantityintegeryesQuantity.

Extra fields: ignored.

Output

FieldTypeDescription
inventoryobjectThe 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.

List stock adjustments — haravan.list_inventory_adjustments ​

List past stock adjustments.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyescom.read_inventories

Input

FieldTypeRequiredDescription
created_at_minstringnoCreated at or after (ISO 8601).
created_at_maxstringnoCreated at or before (ISO 8601).
pageintegernoPage number, from 1. Min 1.
limitintegernoItems per page (1-50, default 50). Min 1. Max 50.

Extra fields: ignored.

Output

FieldTypeDescription
adjustmentsarray 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.

List stock transfers — haravan.list_inventory_transfers ​

List stock transfers between locations.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyescom.read_inventories

Input

FieldTypeRequiredDescription
created_at_minstringnoCreated at or after (ISO 8601).
created_at_maxstringnoCreated at or before (ISO 8601).
pageintegernoPage number, from 1. Min 1.
limitintegernoItems per page (1-50, default 50). Min 1. Max 50.

Extra fields: ignored.

Output

FieldTypeDescription
transfersarray 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.

Create stock transfer — haravan.create_inventory_transfer ​

Move stock from one location to another.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumyesnocom.write_inventories

Input

FieldTypeRequiredDescription
transferobjectyesThe transfer.
transfer.from_loc_idintegeryesSource location id.
transfer.to_loc_idintegeryesDestination location id.
transfer.reasonstringnoReason: newproduct, returned, productionofgoods, damaged, shrinkage, promotion. One of: newproduct, returned, productionofgoods, damaged, shrinkage, promotion.
transfer.notestringnoNote.
transfer.line_itemsarray of objectyesUp to 200 items: product_id, product_variant_id, quantity.
transfer.line_items[].product_idintegeryesProduct id.
transfer.line_items[].product_variant_idintegeryesVariant id.
transfer.line_items[].quantityintegeryesQuantity.

Extra fields: ignored.

Output

FieldTypeDescription
transferobjectThe 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.

Receive stock transfer — haravan.receive_inventory_transfer ​

Mark a stock transfer as received at the destination.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumyesnocom.write_inventories

Input

FieldTypeRequiredDescription
transfer_idintegeryesTransfer id. Min 1.
transferobjectnoWho received it.
transfer.user_idintegernoStaff id.

Extra fields: ignored.

Output

FieldTypeDescription
transferobjectThe 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.