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."
        }
      ]
    }
  }
}
FieldDescription
error.codeMachine-readable enum — use for branching logic
error.messageHuman-readable explanation (English)
error.request_idSame as x-request-id response header
error.categoryCoarse grouping: AUTH_ERROR, RATE_LIMIT_ERROR, VALIDATION_ERROR, CHANNEL_ERROR, INTERNAL_ERROR
error.fieldOptional primary field path related to this error
error.detailsOptional object; validation may include details.fields: [{ field, code, message }]
error.upstreamOptional 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

HTTPWhen
400Unparseable JSON / generic validation
401Invalid API key
403Authenticated but not allowed (including fulfillment mode gate)
404Missing or inaccessible resource
409State / uniqueness conflict
422Parsed body fails business validation
429Rate limit / quota
500 / 502 / 503Internal or upstream failure

Error code reference {#error-codes}

The canonical machine-readable catalog is data/errors.catalog.json. Summary:

CodeHTTPCategoryWhen
INVALID_API_KEY401AUTH_ERRORInvalid or missing Bearer token
UNAUTHORIZED401AUTH_ERRORMissing or invalid API key (alias of INVALID_API_KEY)
CHANNEL_NOT_AUTHORIZED401AUTH_ERRORChannel not authorized for this app
FORBIDDEN403AUTH_ERRORKey valid but not permitted (e.g. channel not enabled)
INSUFFICIENT_SCOPE403AUTH_ERRORAPI key missing required scope for this route
CHANNEL_NOT_ENABLED403AUTH_ERRORChannel not enabled for this app
CHANNEL_AUTH_REQUIRED403AUTH_ERRORChannel authorization not completed
CHANNEL_AUTH_EXPIRED403AUTH_ERRORChannel authorization expired — re-authorize in Portal
CHANNEL_AUTH_REVOKED403AUTH_ERRORChannel authorization revoked
FULFILLMENT_MODE_NOT_SUPPORTED403AUTH_ERROR/v1/fulfillment/* on self-fulfillment app (maps draft FULFILLMENT_NOT_ENABLED)
FULFILLMENT_ACCESS_REQUIRED403AUTH_ERRORReserved — fulfillment access not granted
FULFILLMENT_ACCESS_SUSPENDED403AUTH_ERRORReserved — fulfillment access suspended
WAREHOUSE_AUTH_REQUIRED403AUTH_ERRORWarehouse fulfillment without warehouse authorization
WAREHOUSE_AUTH_EXPIRED403AUTH_ERRORWarehouse authorization expired
WAREHOUSE_AUTH_INVALID403AUTH_ERRORWarehouse rejected developer authentication
VALIDATION_ERROR400VALIDATION_ERRORMissing/invalid body fields, unsupported currency
UNSUPPORTED_CHANNEL400VALIDATION_ERRORUnknown channel value
UNSUPPORTED_FIELD400VALIDATION_ERRORField not allowed on this route (e.g. currency on product)
NOT_FOUND404VALIDATION_ERRORRoute or resource does not exist
CHANNEL_CAPABILITY_NOT_SUPPORTED400CHANNEL_ERROROperation not available on this channel
CHANNEL_UPSTREAM_ERROR502CHANNEL_ERRORMarketplace rejected the call (sanitized)
WAREHOUSE_UPSTREAM_ERROR502CHANNEL_ERRORWarehouse / fulfillment upstream failed (sanitized)
INTERNAL_ERROR500INTERNAL_ERRORUnexpected Gateway failure — retry with backoff
RATE_LIMIT_EXCEEDED429RATE_LIMIT_ERRORPer-minute / burst rate limit
QUOTA_EXCEEDED429RATE_LIMIT_ERRORDaily channel quota exhausted
PLATFORM_QUOTA_EXCEEDED429RATE_LIMIT_ERRORPlatform-wide channel capacity limit
IP_BLOCKED403AUTH_ERRORClient IP is on the access blocklist
APP_BLOCKED403AUTH_ERRORApplication is on the access blocklist
PAYMENT_DECLINED402VALIDATION_ERRORPayment declined (sandbox: sb_ord_pay_declined)
PAYMENT_INSUFFICIENT_FUNDS402VALIDATION_ERRORInsufficient funds (sandbox: sb_ord_pay_insufficient)
ORDER_ALREADY_PAID409VALIDATION_ERRORProcurement order already paid
SHIPMENT_ALREADY_PAID409VALIDATION_ERRORInternational shipment already paid
SHIPMENT_NOT_READY_FOR_PAYMENT409VALIDATION_ERRORShipment not ready for payment (packing / final weight not done — read message)
SHIPMENT_NOT_FOUND404VALIDATION_ERRORShipment missing or not owned (intercept)
SHIPMENT_NOT_INTERCEPTABLE409VALIDATION_ERRORCurrent shipment state cannot request intercept
SHIPMENT_INTERCEPTION_ALREADY_REQUESTED409VALIDATION_ERRORIntercept already requested
INVALID_INTERCEPTION_REASON422VALIDATION_ERRORIntercept reason CODE is invalid
INTERCEPTION_REMARK_REQUIRED422VALIDATION_ERRORremark required when reason is OTHER
ORDER_CANCELLED409VALIDATION_ERROROrder already cancelled
PRODUCT_UNAVAILABLE422VALIDATION_ERRORProduct unavailable / delisted
IDEMPOTENCY_CONFLICT409VALIDATION_ERRORDuplicate idempotency key (message-only warehouse duplicate external_shipment_id may land here)
EXTERNAL_ORDER_ID_ALREADY_EXISTS409VALIDATION_ERRORDuplicate inbound external_order_id or shipment external_shipment_id
SHIPMENT_CREATE_EXCEPTION400VALIDATION_ERRORCreate refused (missing item attributes, parcel not inbound, etc. — read message)
SHIPMENT_CREATE_FAILED400VALIDATION_ERRORShipment create failed (warehouse business refusal — read message)
SHIPMENT_NOT_CANCELLABLE409VALIDATION_ERRORShipment cannot be cancelled in current status
SHIPMENT_ALREADY_CANCELLED409VALIDATION_ERRORShipment already cancelled
PACKAGE_ALREADY_CONSOLIDATED409VALIDATION_ERRORParcel already in another shipment
PARCEL_NOT_FOUND404VALIDATION_ERRORInvalid or not yet inbound parcel (SHIPMENT_PACKAGE_NOT_FOUND)
INVALID_SHIPPING_CHANNEL400VALIDATION_ERRORBad shipping_channel_code
INSUFFICIENT_BALANCE402VALIDATION_ERRORFulfillment wallet too low (shipment pay / return confirm / etc.)
INBOUND_TRACKING_ALREADY_SHIPPED409VALIDATION_ERRORTracking already linked to a shipped package
INBOUND_TRACKING_ALREADY_EXISTS409VALIDATION_ERRORTracking already registered
INBOUND_VALIDATION_FAILED422VALIDATION_ERRORInbound field errors in details.fields
INBOUND_NOT_FOUND404VALIDATION_ERRORInbound missing or not owned
PACKAGE_NOT_FOUND404VALIDATION_ERRORPackage missing or not owned
INBOUND_NOT_EDITABLE409VALIDATION_ERRORInbound not editable in current state
INBOUND_ALREADY_RECEIVED409VALIDATION_ERRORAlready received at warehouse
INBOUND_PACKAGE_MISMATCH409VALIDATION_ERRORCannot link resource to given inbound/package
INVALID_TRACKING_NUMBER422VALIDATION_ERRORTracking number format invalid
PACKAGE_COUNT_INVALID422VALIDATION_ERRORInvalid package_count
TOTAL_VALUE_INVALID422VALIDATION_ERRORInvalid total_value
UNSUPPORTED_CURRENCY422VALIDATION_ERRORUnsupported currency (inbound: CNY/USD/KRW)
UNCLAIMED_PACKAGE_NOT_FOUND404VALIDATION_ERRORNo unclaimed package for this tracking number
PACKAGE_ALREADY_CLAIMED409VALIDATION_ERRORPackage already claimed
PACKAGE_NOT_CLAIMABLE409VALIDATION_ERRORNot claimable in current state
RETURN_NOT_FOUND404VALIDATION_ERRORReturn missing or not owned
RETURN_NOT_CONFIRMABLE409VALIDATION_ERRORReturn cannot be confirmed in current status
RETURN_NOT_CANCELLABLE409VALIDATION_ERRORReturn cannot be cancelled in current status
RETURN_ALREADY_RETURNED409VALIDATION_ERRORAlready returned
RETURN_ALREADY_CANCELLED409VALIDATION_ERRORAlready cancelled / voided
RETURN_FEE_NOT_READY409VALIDATION_ERRORReturn fee not calculated yet
RETURN_FEE_CHANGED409VALIDATION_ERRORConfirm amount ≠ current fee.total
PACKAGE_NOT_RETURNABLE409VALIDATION_ERRORPackage status blocks return
INVALID_RETURN_REASON422VALIDATION_ERRORUnknown return reason code
INVALID_RETURN_ADDRESS422VALIDATION_ERRORInvalid seller_return address
RETURN_VALIDATION_FAILED422VALIDATION_ERRORReturn field validation failed
VALUE_ADDED_SERVICE_NOT_FOUND422VALIDATION_ERRORUnknown VAS service_code
VALUE_ADDED_SERVICE_UNAVAILABLE422VALIDATION_ERRORVAS exists but currently unavailable
VALUE_ADDED_SERVICE_INVALID_STAGE422VALIDATION_ERRORVAS not allowed at this stage
VALUE_ADDED_SERVICE_QUANTITY_INVALID422VALIDATION_ERRORInvalid VAS quantity
SERVICE_REQUEST_NOT_FOUND404VALIDATION_ERRORService request missing
RESOURCE_NOT_FOUND404VALIDATION_ERRORRelated resource missing
RESOURCE_NOT_ELIGIBLE_FOR_SERVICE409VALIDATION_ERRORPackage/shipment not eligible for service
SERVICE_FEE_NOT_READY409VALIDATION_ERRORService fee not ready
SERVICE_FEE_CHANGED409VALIDATION_ERRORConfirm amount ≠ current service fee
SERVICE_REQUEST_VALIDATION_FAILED422VALIDATION_ERRORService request field validation failed
TRANSACTION_NOT_FOUND404VALIDATION_ERRORTransaction missing or not owned
INVOICE_NOT_FOUND404VALIDATION_ERRORInvoice missing or not owned
TRANSACTION_NOT_INVOICEABLE409VALIDATION_ERRORTransaction cannot be invoiced
TRANSACTION_ALREADY_INVOICED409VALIDATION_ERRORTransaction already invoiced
TRANSACTION_INVOICE_PENDING409VALIDATION_ERRORInvoice already pending for transaction
INVOICE_NOT_DOWNLOADABLE409VALIDATION_ERRORInvoice not issued yet
INVOICE_VALIDATION_FAILED422VALIDATION_ERRORInvoice request validation failed
INVOICE_CURRENCY_MISMATCH422VALIDATION_ERRORInvoice currency mismatch
INVALID_INVOICE_TITLE422VALIDATION_ERRORInvalid invoice title
INVALID_TAX_NUMBER422VALIDATION_ERRORInvalid tax number
INVALID_BILLING_ADDRESS422VALIDATION_ERRORbilling_address missing or invalid
TICKET_NOT_FOUND404VALIDATION_ERRORTicket missing or not owned by Application
TICKET_NOT_REPLYABLE409VALIDATION_ERRORTicket not replyable (e.g. closed)
TICKET_ALREADY_CLOSED409VALIDATION_ERRORTicket already closed
INVALID_TICKET_CATEGORY422VALIDATION_ERRORInvalid ticket category
INVALID_TICKET_PRIORITY422VALIDATION_ERRORInvalid ticket priority
INVALID_RELATED_RESOURCE422VALIDATION_ERRORInvalid related_resource type
TICKET_VALIDATION_FAILED422VALIDATION_ERRORTicket field validation failed
RELATED_RESOURCE_NOT_FOUND404VALIDATION_ERRORRelated business resource missing or not owned
MESSAGE_REQUIRED422VALIDATION_ERRORMessage body required
MESSAGE_TOO_LONG422VALIDATION_ERRORMessage 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 success before treating the call as completed
  • Inspect unavailable_lines (preview) or failed_offers (create)
  • Partial success: 1688 may return success: true with non-empty failed_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.

  1. Log request_id on every error path.
  2. Retry 429 and 500 with exponential backoff; do not retry 400 / 401 without fixing input.
  3. On 502 CHANNEL_UPSTREAM_ERROR, surface vendor message to ops; optionally retry once for transient outages.
  4. Order create: use external_order_id / Taobao outer_purchase_id for idempotency — see Procurement orders.

Get Support

Need integration help? Contact Developer Support at support@hiobuy.com · Response within 1–2 business days

Email support