Skip to main content

Inventory Transfer API

Version: 1.0

Table of contents​

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:

Updating, cancelling, and deleting transfers are not documented.

Concepts and terminology​

Transfer identifiers​

FieldMeaning
idNumeric identifier used in API paths such as /com/inventories/transfer/{transfer_id}/receive.json.
transfer_numberDisplay number of the transfer, for example IT100001. It is distinct from the API id.
line_items[].idIdentifier of one line item within the transfer.
line_items[].product_idProduct identifier.
line_items[].product_variant_idProduct-variant identifier.

Use id, not transfer_number, as {transfer_id} in documented API paths.

Source and destination locations​

FieldMeaning
from_loc_idLocation that transfers the inventory (source location).
to_loc_idLocation 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:

ValueMeaning
newproductNew product. Default when reason is not provided.
returnedReturned products.
productionofgoodsProduction of more products.
damagedDamaged products.
shrinkageLoss.
promotionPromotion.

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_id to the location in to_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.
  • reason defaults to newproduct when it is not provided on creation.
  • total is the total product quantity of the transfer. Whether the server calculates it from line_items is not specified.
  • Tags are stored as a comma-separated string.
  • Write request bodies use a transfer envelope.
  • Response envelopes differ by operation: transfers for list, inventorytransfer for retrieve, and transfer for 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.

ParameterTypeRequiredDescription
limitnot specifiedNoResults per page. Default 50.
pagenot specifiedNoPage to return.
since_idnot specifiedNoReturn results after the specified API ID.
from_location_idnumberNoSource Location ID; matches from_loc_id.
to_location_idnumberNoDestination 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 limit is not specified.
  • Filtering by status, reason, date, or transfer_number is 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​

ParameterTypeRequiredDescription
transfer_idnumberYesTransfer 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.

ParameterTypeRequiredDescription
transfer.from_loc_idnumberIncluded in exampleSource Location ID.
transfer.to_loc_idnumberIncluded in exampleDestination Location ID.
transfer.reasonstringIncluded in exampleDocumented transfer reason. Defaults to newproduct when not provided.
transfer.notestringIncluded in exampleNote about the transfer.
transfer.received_atISO 8601 timestampIncluded in exampleIncluded in the request example; its meaning on creation is not specified.
transfer.user_idnumberIncluded in exampleUser ID. See the User API.
transfer.line_itemsarray of objectsIncluded in exampleVariants to transfer.
transfer.line_items[].product_idnumberIncluded in exampleProduct ID.
transfer.line_items[].product_variant_idnumberIncluded in exampleProduct-variant ID.
transfer.line_items[].quantitynumberIncluded in exampleQuantity 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​

ParameterTypeRequiredDescription
transfer_idnumberYesTransfer API ID in the path.
transfer.user_idnumberIncluded in exampleUser 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​

FieldTypeDefinition and constraints
idnumberAPI identifier of the transfer.
transfer_numberstringDisplay number of the transfer, distinct from API id.
from_loc_idnumberSource Location ID.
to_loc_idnumberDestination Location ID.
reasonstringDocumented transfer reason.
statusstringTransfer status. Examples show Active and Received; the complete set is not specified.
totalnumberTotal product quantity of the transfer.
notestringNote about the transfer.
tagsstring or nullComma-separated tags attached by the shop owner.
user_idnumber or nullUser identifier. See the User API.
created_usernumberUser shown as the creator in response examples.
received_usernumber or nullUser shown as the receiver in response examples.
tran_datestringTransaction timestamp of the transfer. Its exact meaning is not specified.
actived_atstringActivation timestamp shown in response examples.
received_atstringReceipt timestamp shown in response examples.
created_atstringCreation timestamp.
updated_atstringLast-update timestamp.
line_itemsarrayTransferred 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​

FieldTypeMeaning
idnumberLine-item identifier.
product_idnumberProduct identifier.
product_variant_idnumberProduct-variant identifier.
quantitynumberTransferred quantity of the variant.
skustring or nullSKU 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_id or to_location_id to filter transfers by source or destination location on the server.
  • Pagination is page-based through page; limit defaults to 50. The maximum limit is not specified.
  • Use since_id to return transfers after a known API ID.
  • Sorting, field selection, and filtering by status, reason, date, or transfer_number are not documented.

Permissions and limitations​

  • The resource lists the scopes com.read_inventories and com.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 reason value.
  • 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 id for {transfer_id}; do not substitute transfer_number.
  • Use from_location_id and to_location_id as list filters, and from_loc_id and to_loc_id as resource fields. Do not swap these names.
  • Read the response envelope that matches the operation: transfers, inventorytransfer, or transfer.
  • Use GET /com/inventories/transfers/count.json when only a count is needed.
  • Use location filters and pagination instead of retrieving all transfers for local processing.
  • Use only documented reason values.
  • 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 status in 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​

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.

APICần dev xác nhận
List / CountKiể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.
CreateTrườ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.
ReceiveTrạ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ệuDanh 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.