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 động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_inventories |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
variant_ids | Mã biến thể | string | có | Comma-separated variant ids. Pattern: ^\d+(,\d+)*$. |
location_ids | Mã chi nhánh | string | có | Comma-separated location ids. Pattern: ^\d+(,\d+)*$. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
inventory_locations | Tồn kho | array of object | Stock per variant and location. |
inventory_locations[].id | integer | Inventory record id. | |
inventory_locations[].loc_id | integer | Location id; matches list_locations. | |
inventory_locations[].product_id | integer | Product id. | |
inventory_locations[].variant_id | integer | Variant id. | |
inventory_locations[].qty_onhand | number | Quantity physically in stock; can be negative. | |
inventory_locations[].qty_commited | number | Quantity reserved by orders. | |
inventory_locations[].qty_incoming | number | Quantity on its way to this location. | |
inventory_locations[].qty_available | number | Quantity available for sale; can be negative. | |
inventory_locations[].updated_at | string | When 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 động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_inventories |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
inventory | Phiếu điều chỉnh | object | có | The adjustment. |
inventory.location_id | integer | có | Location id from list_locations. | |
inventory.type | string | không | adjust adds to stock; set overwrites it. One of: adjust, set. | |
inventory.reason | string | không | Reason: newproduct, returned, productionofgoods, damaged, shrinkage, promotion. One of: newproduct, returned, productionofgoods, damaged, shrinkage, promotion. | |
inventory.note | string | không | Note. | |
inventory.line_items | array of object | có | Up to 200 items: product_id, product_variant_id, quantity. | |
inventory.line_items[].product_id | integer | có | Product id. | |
inventory.line_items[].product_variant_id | integer | có | Variant id. | |
inventory.line_items[].quantity | integer | có | Quantity. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
inventory | Phiếu điều chỉnh | object | The adjustment. |
inventory.id | integer | Adjustment id. | |
inventory.created_at | string | When it was created (ISO 8601). | |
inventory.updated_at | string | When it was last updated (ISO 8601). | |
inventory.adjust_number | string | Adjustment number, e.g. IA100017. | |
inventory.tran_date | string | When the stock changed (ISO 8601). | |
inventory.location_id | integer | Location id; matches list_locations. | |
inventory.type | string | null | adjust adds to stock, set overwrites it; null in list replies and absent from the reply of adjust_inventory. | |
inventory.reason | string | newproduct, returned, productionofgoods, damaged, shrinkage or promotion. | |
inventory.total_quantity | number | Total quantity of this adjustment. | |
inventory.note | string | null | Note. | |
inventory.total_cost | number | Total cost of the adjusted stock, VND. | |
inventory.tags | string | null | Comma-separated tags. | |
inventory.line_items | array of object | Adjusted variants. | |
inventory.line_items[].id | integer | Line item id. | |
inventory.line_items[].product_id | integer | Product id. | |
inventory.line_items[].product_variant_id | integer | Variant id. | |
inventory.line_items[].quantity | number | Quantity; negative when stock was removed. | |
inventory.line_items[].sku | string | null | SKU of the variant. | |
inventory.line_items[].barcode | string | null | Barcode of the variant. | |
inventory.line_items[].cost_amount | number | Cost 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 động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_inventories |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
created_at_min | Tạo từ | string | không | Created at or after (ISO 8601). |
created_at_max | Tạo đến | string | không | Created at or before (ISO 8601). |
page | Trang | integer | không | Page number, from 1. Min 1. |
limit | Số kết quả mỗi trang | integer | không | Items per page (1-50, default 50). Min 1. Max 50. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
adjustments | Phiếu điều chỉnh | array of object | Adjustments. |
adjustments[].id | integer | Adjustment id. | |
adjustments[].created_at | string | When it was created (ISO 8601). | |
adjustments[].updated_at | string | When it was last updated (ISO 8601). | |
adjustments[].adjust_number | string | Adjustment number, e.g. IA100017. | |
adjustments[].tran_date | string | When the stock changed (ISO 8601). | |
adjustments[].location_id | integer | Location id; matches list_locations. | |
adjustments[].type | string | null | adjust adds to stock, set overwrites it; null in list replies and absent from the reply of adjust_inventory. | |
adjustments[].reason | string | newproduct, returned, productionofgoods, damaged, shrinkage or promotion. | |
adjustments[].total_quantity | number | Total quantity of this adjustment. | |
adjustments[].note | string | null | Note. | |
adjustments[].total_cost | number | Total cost of the adjusted stock, VND. | |
adjustments[].tags | string | null | Comma-separated tags. | |
adjustments[].line_items | array of object | Adjusted variants. | |
adjustments[].line_items[].id | integer | Line item id. | |
adjustments[].line_items[].product_id | integer | Product id. | |
adjustments[].line_items[].product_variant_id | integer | Variant id. | |
adjustments[].line_items[].quantity | number | Quantity; negative when stock was removed. | |
adjustments[].line_items[].sku | string | null | SKU of the variant. | |
adjustments[].line_items[].barcode | string | null | Barcode of the variant. | |
adjustments[].line_items[].cost_amount | number | Cost 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 động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_inventories |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
created_at_min | Tạo từ | string | không | Created at or after (ISO 8601). |
created_at_max | Tạo đến | string | không | Created at or before (ISO 8601). |
page | Trang | integer | không | Page number, from 1. Min 1. |
limit | Số kết quả mỗi trang | integer | không | Items per page (1-50, default 50). Min 1. Max 50. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
transfers | Phiếu chuyển kho | array of object | Transfers. |
transfers[].id | integer | Transfer id. | |
transfers[].transfer_number | string | Transfer number, e.g. IT100001. | |
transfers[].from_loc_id | integer | Source location id. | |
transfers[].to_loc_id | integer | Destination location id. | |
transfers[].reason | string | newproduct, returned, productionofgoods, damaged, shrinkage or promotion. | |
transfers[].tran_date | string | When the transfer was made (ISO 8601). | |
transfers[].note | string | null | Note. | |
transfers[].total | number | Total quantity transferred. | |
transfers[].created_at | string | When it was created (ISO 8601). | |
transfers[].updated_at | string | When it was last updated (ISO 8601). | |
transfers[].status | string | Transfer status, e.g. Active or Received. | |
transfers[].actived_at | string | When the transfer was activated (ISO 8601). | |
transfers[].received_at | string | null | When it was received (ISO 8601). | |
transfers[].created_user | integer | Staff id who created the transfer. | |
transfers[].received_user | integer | null | Staff id who received it; null if not yet. | |
transfers[].tags | string | null | Comma-separated tags. | |
transfers[].line_items | array of object | Transferred variants. | |
transfers[].line_items[].id | integer | Line item id. | |
transfers[].line_items[].product_id | integer | Product id. | |
transfers[].line_items[].product_variant_id | integer | Variant id. | |
transfers[].line_items[].quantity | number | Quantity; negative when stock was removed. | |
transfers[].line_items[].sku | string | null | SKU of the variant. | |
transfers[].line_items[].barcode | string | null | Barcode of the variant. | |
transfers[].line_items[].variant_title | string | null | Variant title. | |
transfers[].line_items[].product_name | string | Product name. |
Tạo phiếu chuyển kho (Create stock transfer) — haravan.create_inventory_transfer
Move stock from one location to another.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_inventories |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
transfer | Phiếu chuyển kho | object | có | The transfer. |
transfer.from_loc_id | integer | có | Source location id. | |
transfer.to_loc_id | integer | có | Destination location id. | |
transfer.reason | string | không | Reason: newproduct, returned, productionofgoods, damaged, shrinkage, promotion. One of: newproduct, returned, productionofgoods, damaged, shrinkage, promotion. | |
transfer.note | string | không | Note. | |
transfer.line_items | array of object | có | Up to 200 items: product_id, product_variant_id, quantity. | |
transfer.line_items[].product_id | integer | có | Product id. | |
transfer.line_items[].product_variant_id | integer | có | Variant id. | |
transfer.line_items[].quantity | integer | có | Quantity. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
transfer | Phiếu chuyển kho | object | The transfer. |
transfer.id | integer | Transfer id. | |
transfer.transfer_number | string | Transfer number, e.g. IT100001. | |
transfer.from_loc_id | integer | Source location id. | |
transfer.to_loc_id | integer | Destination location id. | |
transfer.reason | string | newproduct, returned, productionofgoods, damaged, shrinkage or promotion. | |
transfer.tran_date | string | When the transfer was made (ISO 8601). | |
transfer.note | string | null | Note. | |
transfer.total | number | Total quantity transferred. | |
transfer.created_at | string | When it was created (ISO 8601). | |
transfer.updated_at | string | When it was last updated (ISO 8601). | |
transfer.status | string | Transfer status, e.g. Active or Received. | |
transfer.actived_at | string | When the transfer was activated (ISO 8601). | |
transfer.received_at | string | null | When it was received (ISO 8601). | |
transfer.created_user | integer | Staff id who created the transfer. | |
transfer.received_user | integer | null | Staff id who received it; null if not yet. | |
transfer.tags | string | null | Comma-separated tags. | |
transfer.line_items | array of object | Transferred variants. | |
transfer.line_items[].id | integer | Line item id. | |
transfer.line_items[].product_id | integer | Product id. | |
transfer.line_items[].product_variant_id | integer | Variant id. | |
transfer.line_items[].quantity | number | Quantity; negative when stock was removed. | |
transfer.line_items[].sku | string | null | SKU of the variant. | |
transfer.line_items[].barcode | string | null | Barcode of the variant. | |
transfer.line_items[].variant_title | string | null | Variant title. | |
transfer.line_items[].product_name | string | Product 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 động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_inventories |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
transfer_id | Mã phiếu chuyển kho | integer | có | Transfer id. Min 1. |
transfer | Người nhận | object | không | Who received it. |
transfer.user_id | integer | không | Staff id. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
transfer | Phiếu chuyển kho | object | The transfer. |
transfer.id | integer | Transfer id. | |
transfer.transfer_number | string | Transfer number, e.g. IT100001. | |
transfer.from_loc_id | integer | Source location id. | |
transfer.to_loc_id | integer | Destination location id. | |
transfer.reason | string | newproduct, returned, productionofgoods, damaged, shrinkage or promotion. | |
transfer.tran_date | string | When the transfer was made (ISO 8601). | |
transfer.note | string | null | Note. | |
transfer.total | number | Total quantity transferred. | |
transfer.created_at | string | When it was created (ISO 8601). | |
transfer.updated_at | string | When it was last updated (ISO 8601). | |
transfer.status | string | Transfer status, e.g. Active or Received. | |
transfer.actived_at | string | When the transfer was activated (ISO 8601). | |
transfer.received_at | string | null | When it was received (ISO 8601). | |
transfer.created_user | integer | Staff id who created the transfer. | |
transfer.received_user | integer | null | Staff id who received it; null if not yet. | |
transfer.tags | string | null | Comma-separated tags. | |
transfer.line_items | array of object | Transferred variants. | |
transfer.line_items[].id | integer | Line item id. | |
transfer.line_items[].product_id | integer | Product id. | |
transfer.line_items[].product_variant_id | integer | Variant id. | |
transfer.line_items[].quantity | number | Quantity; negative when stock was removed. | |
transfer.line_items[].sku | string | null | SKU of the variant. | |
transfer.line_items[].barcode | string | null | Barcode of the variant. | |
transfer.line_items[].variant_title | string | null | Variant title. | |
transfer.line_items[].product_name | string | Product name. |