Errors
HIOBuy uses two error shapes: protocol errors (non-2xx HTTP with an error object) and business outcomes (HTTP 200 with success: false on some order routes).
Protocol errors (HTTP 4xx / 5xx) {#protocol-errors}
{
"error": {
"code": "INBOUND_VALIDATION_FAILED",
"message": "Some inbound information is missing or invalid.",
"request_id": "req_abc123",
"category": "VALIDATION_ERROR",
"field": "tracking_number",
"details": {
"fields": [
{
"field": "items[0].name",
"code": "REQUIRED",
"message": "Product name is required."
}
]
}
}
}| Field | Description |
|---|---|
error.code | Machine-readable enum — use for branching logic |
error.message | Human-readable explanation (English) |
error.request_id | Same as x-request-id response header |
error.category | Coarse grouping: AUTH_ERROR, RATE_LIMIT_ERROR, VALIDATION_ERROR, CHANNEL_ERROR, INTERNAL_ERROR |
error.field | Optional primary field path related to this error |
error.details | Optional object; validation may include details.fields: [{ field, code, message }] |
error.upstream | Optional vendor error summary on CHANNEL_UPSTREAM_ERROR (sanitized) |
Field-level details.fields[].code values: REQUIRED | INVALID_VALUE | INVALID_FORMAT | OUT_OF_RANGE.
HTTP status principles
| HTTP | When |
|---|---|
400 | Unparseable JSON / generic validation |
401 | Invalid API key |
403 | Authenticated but not allowed (including fulfillment mode gate) |
404 | Missing or inaccessible resource |
409 | State / uniqueness conflict |
422 | Parsed body fails business validation |
429 | Rate limit / quota |
500 / 502 / 503 | Internal or upstream failure |
Error code reference {#error-codes}
The canonical machine-readable catalog is data/errors.catalog.json. Summary:
| Code | HTTP | Category | When |
|---|---|---|---|
INVALID_API_KEY | 401 | AUTH_ERROR | Invalid or missing Bearer token |
UNAUTHORIZED | 401 | AUTH_ERROR | Missing or invalid API key (alias of INVALID_API_KEY) |
CHANNEL_NOT_AUTHORIZED | 401 | AUTH_ERROR | Channel not authorized for this app |
FORBIDDEN | 403 | AUTH_ERROR | Key valid but not permitted (e.g. channel not enabled) |
INSUFFICIENT_SCOPE | 403 | AUTH_ERROR | API key missing required scope for this route |
CHANNEL_NOT_ENABLED | 403 | AUTH_ERROR | Channel not enabled for this app |
CHANNEL_AUTH_REQUIRED | 403 | AUTH_ERROR | Channel authorization not completed |
CHANNEL_AUTH_EXPIRED | 403 | AUTH_ERROR | Channel authorization expired — re-authorize in Portal |
CHANNEL_AUTH_REVOKED | 403 | AUTH_ERROR | Channel authorization revoked |
FULFILLMENT_MODE_NOT_SUPPORTED | 403 | AUTH_ERROR | /v1/fulfillment/* on self-fulfillment app (maps draft FULFILLMENT_NOT_ENABLED) |
FULFILLMENT_ACCESS_REQUIRED | 403 | AUTH_ERROR | Reserved — fulfillment access not granted |
FULFILLMENT_ACCESS_SUSPENDED | 403 | AUTH_ERROR | Reserved — fulfillment access suspended |
WAREHOUSE_AUTH_REQUIRED | 403 | AUTH_ERROR | Warehouse fulfillment without warehouse authorization |
WAREHOUSE_AUTH_EXPIRED | 403 | AUTH_ERROR | Warehouse authorization expired |
WAREHOUSE_AUTH_INVALID | 403 | AUTH_ERROR | Warehouse rejected developer authentication |
VALIDATION_ERROR | 400 | VALIDATION_ERROR | Missing/invalid body fields, unsupported currency |
UNSUPPORTED_CHANNEL | 400 | VALIDATION_ERROR | Unknown channel value |
UNSUPPORTED_FIELD | 400 | VALIDATION_ERROR | Field not allowed on this route (e.g. currency on product) |
NOT_FOUND | 404 | VALIDATION_ERROR | Route or resource does not exist |
CHANNEL_CAPABILITY_NOT_SUPPORTED | 400 | CHANNEL_ERROR | Operation not available on this channel |
CHANNEL_UPSTREAM_ERROR | 502 | CHANNEL_ERROR | Marketplace rejected the call (sanitized) |
WAREHOUSE_UPSTREAM_ERROR | 502 | CHANNEL_ERROR | Warehouse / fulfillment upstream failed (sanitized) |
INTERNAL_ERROR | 500 | INTERNAL_ERROR | Unexpected Gateway failure — retry with backoff |
RATE_LIMIT_EXCEEDED | 429 | RATE_LIMIT_ERROR | Per-minute / burst rate limit |
QUOTA_EXCEEDED | 429 | RATE_LIMIT_ERROR | Daily channel quota exhausted |
PLATFORM_QUOTA_EXCEEDED | 429 | RATE_LIMIT_ERROR | Platform-wide channel capacity limit |
IP_BLOCKED | 403 | AUTH_ERROR | Client IP is on the access blocklist |
APP_BLOCKED | 403 | AUTH_ERROR | Application is on the access blocklist |
PAYMENT_DECLINED | 402 | VALIDATION_ERROR | Payment declined (sandbox: sb_ord_pay_declined) |
PAYMENT_INSUFFICIENT_FUNDS | 402 | VALIDATION_ERROR | Insufficient funds (sandbox: sb_ord_pay_insufficient) |
ORDER_ALREADY_PAID | 409 | VALIDATION_ERROR | Procurement order already paid |
SHIPMENT_ALREADY_PAID | 409 | VALIDATION_ERROR | International shipment already paid |
SHIPMENT_NOT_READY_FOR_PAYMENT | 409 | VALIDATION_ERROR | Shipment not ready for payment (packing / final weight not done — read message) |
SHIPMENT_NOT_FOUND | 404 | VALIDATION_ERROR | Shipment missing or not owned (intercept) |
SHIPMENT_NOT_INTERCEPTABLE | 409 | VALIDATION_ERROR | Current shipment state cannot request intercept |
SHIPMENT_INTERCEPTION_ALREADY_REQUESTED | 409 | VALIDATION_ERROR | Intercept already requested |
INVALID_INTERCEPTION_REASON | 422 | VALIDATION_ERROR | Intercept reason CODE is invalid |
INTERCEPTION_REMARK_REQUIRED | 422 | VALIDATION_ERROR | remark required when reason is OTHER |
ORDER_CANCELLED | 409 | VALIDATION_ERROR | Order already cancelled |
PRODUCT_UNAVAILABLE | 422 | VALIDATION_ERROR | Product unavailable / delisted |
IDEMPOTENCY_CONFLICT | 409 | VALIDATION_ERROR | Duplicate idempotency key (message-only warehouse duplicate external_shipment_id may land here) |
EXTERNAL_ORDER_ID_ALREADY_EXISTS | 409 | VALIDATION_ERROR | Duplicate inbound external_order_id or shipment external_shipment_id |
SHIPMENT_CREATE_EXCEPTION | 400 | VALIDATION_ERROR | Create refused (missing item attributes, parcel not inbound, etc. — read message) |
SHIPMENT_CREATE_FAILED | 400 | VALIDATION_ERROR | Shipment create failed (warehouse business refusal — read message) |
SHIPMENT_NOT_CANCELLABLE | 409 | VALIDATION_ERROR | Shipment cannot be cancelled in current status |
SHIPMENT_ALREADY_CANCELLED | 409 | VALIDATION_ERROR | Shipment already cancelled |
PACKAGE_ALREADY_CONSOLIDATED | 409 | VALIDATION_ERROR | Parcel already in another shipment |
PARCEL_NOT_FOUND | 404 | VALIDATION_ERROR | Invalid or not yet inbound parcel (SHIPMENT_PACKAGE_NOT_FOUND) |
INVALID_SHIPPING_CHANNEL | 400 | VALIDATION_ERROR | Bad shipping_channel_code |
INSUFFICIENT_BALANCE | 402 | VALIDATION_ERROR | Fulfillment wallet too low (shipment pay / return confirm / etc.) |
INBOUND_TRACKING_ALREADY_SHIPPED | 409 | VALIDATION_ERROR | Tracking already linked to a shipped package |
INBOUND_TRACKING_ALREADY_EXISTS | 409 | VALIDATION_ERROR | Tracking already registered |
INBOUND_VALIDATION_FAILED | 422 | VALIDATION_ERROR | Inbound field errors in details.fields |
INBOUND_NOT_FOUND | 404 | VALIDATION_ERROR | Inbound missing or not owned |
PACKAGE_NOT_FOUND | 404 | VALIDATION_ERROR | Package missing or not owned |
INBOUND_NOT_EDITABLE | 409 | VALIDATION_ERROR | Inbound not editable in current state |
INBOUND_ALREADY_RECEIVED | 409 | VALIDATION_ERROR | Already received at warehouse |
INBOUND_PACKAGE_MISMATCH | 409 | VALIDATION_ERROR | Cannot link resource to given inbound/package |
INVALID_TRACKING_NUMBER | 422 | VALIDATION_ERROR | Tracking number format invalid |
PACKAGE_COUNT_INVALID | 422 | VALIDATION_ERROR | Invalid package_count |
TOTAL_VALUE_INVALID | 422 | VALIDATION_ERROR | Invalid total_value |
UNSUPPORTED_CURRENCY | 422 | VALIDATION_ERROR | Unsupported currency (inbound: CNY/USD/KRW) |
UNCLAIMED_PACKAGE_NOT_FOUND | 404 | VALIDATION_ERROR | No unclaimed package for this tracking number |
PACKAGE_ALREADY_CLAIMED | 409 | VALIDATION_ERROR | Package already claimed |
PACKAGE_NOT_CLAIMABLE | 409 | VALIDATION_ERROR | Not claimable in current state |
RETURN_NOT_FOUND | 404 | VALIDATION_ERROR | Return missing or not owned |
RETURN_NOT_CONFIRMABLE | 409 | VALIDATION_ERROR | Return cannot be confirmed in current status |
RETURN_NOT_CANCELLABLE | 409 | VALIDATION_ERROR | Return cannot be cancelled in current status |
RETURN_ALREADY_RETURNED | 409 | VALIDATION_ERROR | Already returned |
RETURN_ALREADY_CANCELLED | 409 | VALIDATION_ERROR | Already cancelled / voided |
RETURN_FEE_NOT_READY | 409 | VALIDATION_ERROR | Return fee not calculated yet |
RETURN_FEE_CHANGED | 409 | VALIDATION_ERROR | Confirm amount ≠ current fee.total |
PACKAGE_NOT_RETURNABLE | 409 | VALIDATION_ERROR | Package status blocks return |
INVALID_RETURN_REASON | 422 | VALIDATION_ERROR | Unknown return reason code |
INVALID_RETURN_ADDRESS | 422 | VALIDATION_ERROR | Invalid seller_return address |
RETURN_VALIDATION_FAILED | 422 | VALIDATION_ERROR | Return field validation failed |
VALUE_ADDED_SERVICE_NOT_FOUND | 422 | VALIDATION_ERROR | Unknown VAS service_code |
VALUE_ADDED_SERVICE_UNAVAILABLE | 422 | VALIDATION_ERROR | VAS exists but currently unavailable |
VALUE_ADDED_SERVICE_INVALID_STAGE | 422 | VALIDATION_ERROR | VAS not allowed at this stage |
VALUE_ADDED_SERVICE_QUANTITY_INVALID | 422 | VALIDATION_ERROR | Invalid VAS quantity |
SERVICE_REQUEST_NOT_FOUND | 404 | VALIDATION_ERROR | Service request missing |
RESOURCE_NOT_FOUND | 404 | VALIDATION_ERROR | Related resource missing |
RESOURCE_NOT_ELIGIBLE_FOR_SERVICE | 409 | VALIDATION_ERROR | Package/shipment not eligible for service |
SERVICE_FEE_NOT_READY | 409 | VALIDATION_ERROR | Service fee not ready |
SERVICE_FEE_CHANGED | 409 | VALIDATION_ERROR | Confirm amount ≠ current service fee |
SERVICE_REQUEST_VALIDATION_FAILED | 422 | VALIDATION_ERROR | Service request field validation failed |
TRANSACTION_NOT_FOUND | 404 | VALIDATION_ERROR | Transaction missing or not owned |
INVOICE_NOT_FOUND | 404 | VALIDATION_ERROR | Invoice missing or not owned |
TRANSACTION_NOT_INVOICEABLE | 409 | VALIDATION_ERROR | Transaction cannot be invoiced |
TRANSACTION_ALREADY_INVOICED | 409 | VALIDATION_ERROR | Transaction already invoiced |
TRANSACTION_INVOICE_PENDING | 409 | VALIDATION_ERROR | Invoice already pending for transaction |
INVOICE_NOT_DOWNLOADABLE | 409 | VALIDATION_ERROR | Invoice not issued yet |
INVOICE_VALIDATION_FAILED | 422 | VALIDATION_ERROR | Invoice request validation failed |
INVOICE_CURRENCY_MISMATCH | 422 | VALIDATION_ERROR | Invoice currency mismatch |
INVALID_INVOICE_TITLE | 422 | VALIDATION_ERROR | Invalid invoice title |
INVALID_TAX_NUMBER | 422 | VALIDATION_ERROR | Invalid tax number |
INVALID_BILLING_ADDRESS | 422 | VALIDATION_ERROR | billing_address missing or invalid |
TICKET_NOT_FOUND | 404 | VALIDATION_ERROR | Ticket missing or not owned by Application |
TICKET_NOT_REPLYABLE | 409 | VALIDATION_ERROR | Ticket not replyable (e.g. closed) |
TICKET_ALREADY_CLOSED | 409 | VALIDATION_ERROR | Ticket already closed |
INVALID_TICKET_CATEGORY | 422 | VALIDATION_ERROR | Invalid ticket category |
INVALID_TICKET_PRIORITY | 422 | VALIDATION_ERROR | Invalid ticket priority |
INVALID_RELATED_RESOURCE | 422 | VALIDATION_ERROR | Invalid related_resource type |
TICKET_VALIDATION_FAILED | 422 | VALIDATION_ERROR | Ticket field validation failed |
RELATED_RESOURCE_NOT_FOUND | 404 | VALIDATION_ERROR | Related business resource missing or not owned |
MESSAGE_REQUIRED | 422 | VALIDATION_ERROR | Message body required |
MESSAGE_TOO_LONG | 422 | VALIDATION_ERROR | Message exceeds 10000 characters |
Business failures (HTTP 200) {#business-failures}
Procurement preview/create/pay may return HTTP 200 with success: false when the marketplace refuses the operation but the Gateway request was valid.
{
"channel": "1688",
"success": false,
"code": "ORDER_CREATE_FAILED",
"message": "One or more lines could not be purchased.",
"failed_offers": [
{
"offer_id": "...",
"spec_id": "...",
"error_code": "STOCK_NOT_ENOUGH",
"error_message": "Insufficient stock"
}
],
"request_id": "req_..."
}- Check
successbefore treating the call as completed - Inspect
unavailable_lines(preview) orfailed_offers(create) - Partial success: 1688 may return
success: truewith non-emptyfailed_offers
Product upstream failures {#upstream-product-errors}
Invalid Taobao口令, missing product, or vendor timeouts on product routes typically return 502 with CHANNEL_UPSTREAM_ERROR — not an empty product shell.
Recommended handling {#handling}
- Log
request_idon every error path. - Retry
429and500with exponential backoff; do not retry400/401without fixing input. - On
502 CHANNEL_UPSTREAM_ERROR, surface vendor message to ops; optionally retry once for transient outages. - Order create: use
external_order_id/ Taobaoouter_purchase_idfor idempotency — see Procurement orders.
Get Support
Need integration help? Contact Developer Support at support@hiobuy.com · Response within 1–2 business days