Inventory Transfer API
Version: 1.0
Table of contents
- Overview
- Concepts and terminology
- Capabilities
- Business and API rules
- API operations
- Data definitions
- Search, filter, sort, and pagination
- Permissions and limitations
- Errors and exceptions
- Usage guidance for AI
- Sources
- Thông tin cần bổ sung
Overview
An inventory transfer moves the available quantity of inventory items from one location in a shop to another location. Transfers also form the shop's inventory transfer history.
This AI-facing Inventory Transfer API specification supports listing and filtering transfers, counting transfers, retrieving a specific transfer, creating a transfer, and receiving a transfer.
This specification covers exactly two write operations:
- Create an inventory transfer: creates a transfer of one or more product variants from a source location to a destination location.
- Receive an inventory transfer: records receipt of an existing transfer at its destination location.
Updating, cancelling, and deleting transfers are not documented.
Concepts and terminology
Transfer identifiers
| Field | Meaning |
|---|---|
id | Numeric identifier used in API paths such as /com/inventories/transfer/{transfer_id}/receive.json. |
transfer_number | Display number of the transfer, for example IT100001. It is distinct from the API id. |
line_items[].id | Identifier of one line item within the transfer. |
line_items[].product_id | Product identifier. |
line_items[].product_variant_id | Product-variant identifier. |
Use id, not transfer_number, as {transfer_id} in documented API paths.
Source and destination locations
| Field | Meaning |
|---|---|
from_loc_id | Location that transfers the inventory (source location). |
to_loc_id | Location that receives the inventory (destination location). |
Both fields hold Location IDs. Use the Location API to look up locations.
The list endpoint filters these fields with differently named parameters: from_location_id filters by from_loc_id, and to_location_id filters by to_loc_id.
Transfer status
status appears in responses. Response examples show the values Active and Received. The complete set of status values and their meanings is not specified.
Related timestamps are actived_at and received_at. Their exact relationship to status is not specified.
Transfer reasons
reason classifies the transfer. Documented valid values are:
| Value | Meaning |
|---|---|
newproduct | New product. Default when reason is not provided. |
returned | Returned products. |
productionofgoods | Production of more products. |
damaged | Damaged products. |
shrinkage | Loss. |
promotion | Promotion. |
The resource definition also describes transfer (Transfer), but transfer is not in the list of valid values. Whether transfer is accepted is not specified.
Capabilities
The documented API can:
- List transfers, filtered by source or destination location, with page-based pagination.
- Count transfers.
- Retrieve a transfer by its API
id. - Create a transfer between two locations.
- Receive an existing transfer.
The documented API does not provide endpoints to update, cancel, or delete a transfer. It does not document changing line items after creation, receiving part of a transfer, or searching by transfer_number.
To change the available quantity at a single location, use the separate Inventory Adjustment API.
Business and API rules
- A transfer moves quantity from the location in
from_loc_idto the location into_loc_id. - When stock is deducted from the source location and when it is added to the destination location is not specified for create or receive.
reasondefaults tonewproductwhen it is not provided on creation.totalis the total product quantity of the transfer. Whether the server calculates it fromline_itemsis not specified.- Tags are stored as a comma-separated string.
- Write request bodies use a
transferenvelope. - Response envelopes differ by operation:
transfersfor list,inventorytransferfor retrieve, andtransferfor create and receive. - The retrieve path,
/com/inventorytransfer/detail/{transfer_id}.json, differs from the/com/inventories/...paths used by the other operations.
API operations
Base URL: https://apis.haravan.com. JSON request examples use Content-Type: application/json and Accept: application/json; supply the integration's configured authentication and replace sample IDs with verified shop IDs. Examples are illustrative.
List inventory transfers
Purpose
Use this operation to retrieve multiple transfers, for example the transfer history of a shop or the transfers sent from or received at a specific location.
Endpoint
GET https://apis.haravan.com/com/inventories/transfers.json
Input
All inputs are query parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | not specified | No | Results per page. Default 50. |
page | not specified | No | Page to return. |
since_id | not specified | No | Return results after the specified API ID. |
from_location_id | number | No | Source Location ID; matches from_loc_id. |
to_location_id | number | No | Destination Location ID; matches to_loc_id. |
Output
Returns HTTP 200 OK with a transfers array. Each entry is an inventory transfer object, including its line_items.
Constraints
- The maximum value of
limitis not specified. - Filtering by status, reason, date, or
transfer_numberis not documented. - Sorting is not documented. The default sort order is not specified.
Examples
GET /com/inventories/transfers.json?page=1
GET /com/inventories/transfers.json?from_location_id=963414
Example response entry:
{
"transfers": [
{
"id": 1001030743,
"transfer_number": "IT100001",
"from_loc_id": 963414,
"to_loc_id": 1007284,
"reason": "shrinkage",
"tran_date": "2021-06-01T09:36:22.046Z",
"note": "Hoàn chuyển kho số #IT100000",
"total": 10,
"created_at": "2021-06-01T09:36:22.07Z",
"updated_at": "2021-07-08T01:49:29.734Z",
"status": "Received",
"actived_at": "2021-06-01T09:36:22.046Z",
"received_at": "2021-06-01T09:33:14.835Z",
"created_user": 200000493247,
"received_user": null,
"tags": null,
"line_items": [
{
"id": 1009626370,
"product_id": 1028183686,
"product_variant_id": 1061514767,
"quantity": 5,
"sku": "AO551",
"barcode": "AO551",
"variant_title": "Đen / S",
"product_name": "Váy Quây dài"
}
]
}
]
}
Count inventory transfers
Purpose
Use this operation when only the number of transfers is needed and the transfer objects themselves are unnecessary.
Endpoint
GET https://apis.haravan.com/com/inventories/transfers/count.json
Input
No query parameters are documented.
Output
Returns HTTP 200 OK with a numeric count.
Constraints
Whether the list filters from_location_id and to_location_id apply to the count is not specified.
Examples
GET /com/inventories/transfers/count.json
{
"count": 2
}
Retrieve an inventory transfer
Purpose
Use this operation when the API id of a specific transfer is known and the full transfer, including its line items, is required.
Endpoint
GET https://apis.haravan.com/com/inventorytransfer/detail/{transfer_id}.json
Input
| Parameter | Type | Required | Description |
|---|---|---|---|
transfer_id | number | Yes | Transfer API ID in the path. |
Output
Returns HTTP 200 OK with an inventorytransfer object.
Constraints
The error response for an unknown transfer_id is not specified.
Examples
GET /com/inventorytransfer/detail/1001030743.json
Create an inventory transfer
Purpose
Use this operation to transfer the quantity of one or more product variants from a source location to a destination location.
Endpoint
POST https://apis.haravan.com/com/inventories/transfer.json
Input
The request body uses a transfer envelope. Which fields are individually required is not specified.
| Parameter | Type | Required | Description |
|---|---|---|---|
transfer.from_loc_id | number | Included in example | Source Location ID. |
transfer.to_loc_id | number | Included in example | Destination Location ID. |
transfer.reason | string | Included in example | Documented transfer reason. Defaults to newproduct when not provided. |
transfer.note | string | Included in example | Note about the transfer. |
transfer.received_at | ISO 8601 timestamp | Included in example | Included in the request example; its meaning on creation is not specified. |
transfer.user_id | number | Included in example | User ID. See the User API. |
transfer.line_items | array of objects | Included in example | Variants to transfer. |
transfer.line_items[].product_id | number | Included in example | Product ID. |
transfer.line_items[].product_variant_id | number | Included in example | Product-variant ID. |
transfer.line_items[].quantity | number | Included in example | Quantity to transfer. |
Whether tags, tran_date, or other response fields can be set on creation is not specified.
Output
Returns HTTP 200 OK with the created transfer object.
Read transfer.id for later receive and retrieve calls, and transfer_number to report the transfer to the merchant.
Constraints
- Validation is not specified for a source location that equals the destination, a quantity greater than the available quantity at the source, or a variant that is not stocked at the source.
- Whether creating a transfer changes inventory immediately is not specified.
- Repeat-call behavior is not specified. A repeated request might create another transfer.
Examples
POST https://apis.haravan.com/com/inventories/transfer.json
Accept: application/json
Content-Type: application/json
{
"transfer": {
"from_loc_id": 479749,
"to_loc_id": 479754,
"note": "chuyển kho",
"reason": "newproduct",
"received_at": "2017-06-09T17:00:00Z",
"user_id": 3,
"line_items": [
{
"product_id": 10000260270,
"product_variant_id": 101021136,
"quantity": 1
}
]
}
}
Receive an inventory transfer
Purpose
Use this operation to record that an existing transfer has been received at its destination location.
Endpoint
POST https://apis.haravan.com/com/inventories/transfer/{transfer_id}/receive.json
Input
| Parameter | Type | Required | Description |
|---|---|---|---|
transfer_id | number | Yes | Transfer API ID in the path. |
transfer.user_id | number | Included in example | User ID in the transfer envelope. |
Per-line received quantities are not documented.
Output
Returns HTTP 200 OK with the transfer object.
The documented response example is identical to the create example and shows status: Active. The status value after a successful receive is not specified.
Constraints
- The transfer states in which receive is allowed are not specified.
- Partial receipt is not documented. The operation targets the whole transfer.
- Behavior when the transfer has already been received, and the inventory effect at each location, are not specified.
Examples
POST https://apis.haravan.com/com/inventories/transfer/1000100351/receive.json
Accept: application/json
Content-Type: application/json
{
"transfer": {
"user_id": 3
}
}
Data definitions
Core transfer fields
| Field | Type | Definition and constraints |
|---|---|---|
id | number | API identifier of the transfer. |
transfer_number | string | Display number of the transfer, distinct from API id. |
from_loc_id | number | Source Location ID. |
to_loc_id | number | Destination Location ID. |
reason | string | Documented transfer reason. |
status | string | Transfer status. Examples show Active and Received; the complete set is not specified. |
total | number | Total product quantity of the transfer. |
note | string | Note about the transfer. |
tags | string or null | Comma-separated tags attached by the shop owner. |
user_id | number or null | User identifier. See the User API. |
created_user | number | User shown as the creator in response examples. |
received_user | number or null | User shown as the receiver in response examples. |
tran_date | string | Transaction timestamp of the transfer. Its exact meaning is not specified. |
actived_at | string | Activation timestamp shown in response examples. |
received_at | string | Receipt timestamp shown in response examples. |
created_at | string | Creation timestamp. |
updated_at | string | Last-update timestamp. |
line_items | array | Transferred variants; see Line items. |
The relationship between user_id, created_user, and received_user is not specified.
Timestamps use ISO 8601. Examples use UTC with a Z suffix, for example 2021-06-01T09:36:22.07Z; the timezone of every response is not guaranteed.
Line items
| Field | Type | Meaning |
|---|---|---|
id | number | Line-item identifier. |
product_id | number | Product identifier. |
product_variant_id | number | Product-variant identifier. |
quantity | number | Transferred quantity of the variant. |
sku | string or null | SKU of the product variant. |
Response examples also include barcode, variant_title, product_name, and cost_amount; their contracts are not specified.
Other response fields
Response examples can include fields without definitions. Presence in an example does not establish writability, enum values, or business behavior.
Search, filter, sort, and pagination
- Use
from_location_idorto_location_idto filter transfers by source or destination location on the server. - Pagination is page-based through
page;limitdefaults to 50. The maximum limit is not specified. - Use
since_idto return transfers after a known API ID. - Sorting, field selection, and filtering by status, reason, date, or
transfer_numberare not documented.
Permissions and limitations
- The resource lists the scopes
com.read_inventoriesandcom.write_inventories. The scope required by each operation is not specified. - All Haravan APIs are subject to platform rate limits; the numeric threshold for inventory transfers is not specified. See API Rate Limits.
- Update, cancel, and delete operations for transfers are not documented.
- Partial receipt is not documented.
- Historical data limits are not documented.
Errors and exceptions
Only successful 200 OK responses are documented for these operations. Structured error payloads and operation-specific error status codes are not documented.
Callers must still account for these failure conditions or uncertainties:
- Missing or insufficient scope.
- Unknown
transfer_id, Location ID, product ID, or variant ID. - Invalid
reasonvalue. - Transfer quantity that cannot be fulfilled at the source location; exact validation is not documented.
- Receive called for a transfer in an ineligible state; exact state validation is not documented.
The exact HTTP status and error body for these cases are not specified and must not be invented.
Usage guidance for AI
- Supported write operations are create and receive.
- Use the API
idfor{transfer_id}; do not substitutetransfer_number. - Use
from_location_idandto_location_idas list filters, andfrom_loc_idandto_loc_idas resource fields. Do not swap these names. - Read the response envelope that matches the operation:
transfers,inventorytransfer, ortransfer. - Use
GET /com/inventories/transfers/count.jsonwhen only a count is needed. - Use location filters and pagination instead of retrieving all transfers for local processing.
- Use only documented
reasonvalues. - Do not call a write operation when the need is only to read transfer history.
- Do not report inventory as moved, deducted, or received based only on HTTP 200 or on
statusin an example. Retrieve the transfer to check its current state. - Retry safety is undocumented. A timeout does not prove a write failed; check whether the transfer exists or was received before calling again.
- When validation, state transitions, errors, or capabilities are not documented, treat them as unknown rather than assuming conventional behavior.
Sources
- Inventory Transfer API: routes, scopes, properties, reason values, and request/response examples.
Thông tin cần bổ sung
Các mục dưới đây cần dev xác nhận để hoàn thiện tools.
| API | Cần dev xác nhận |
|---|---|
| List / Count | Kiểu và giá trị tối đa của limit; thứ tự sắp xếp mặc định; Count có nhận filter theo kho không. |
| Create | Trường bắt buộc; ý nghĩa received_at khi tạo; có set được tags, tran_date không; reason có nhận transfer không; validation khi kho gửi trùng kho nhận, vượt tồn khả dụng, biến thể không có ở kho gửi; tồn kho bị trừ/cộng tại thời điểm nào. |
| Receive | Trạng thái được phép nhận; status sau khi nhận; có nhận một phần không; kết quả khi nhận lại phiếu đã nhận; tác động tồn kho tại kho nhận. |
| Dữ liệu | Danh sách đầy đủ giá trị status; ý nghĩa tran_date, actived_at; quan hệ giữa user_id, created_user, received_user; hợp đồng của barcode, variant_title, product_name, cost_amount. |
- Scope cần cho từng API (đọc/ghi).
- HTTP status và body lỗi cho ID không tồn tại, thiếu quyền, input sai, trạng thái không hợp lệ.
- Có API cập nhật, hủy hoặc xóa phiếu chuyển kho không.
- Cơ chế gọi lặp/idempotency và xác định kết quả sau timeout.