Errores

HIOBuy usa dos formas de error: errores de protocolo (no 2xx con error) y fallos de negocio (HTTP 200 con success: false en algunas rutas de pedido).

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

Referencia de códigos de error {#error-codes}

Catálogo canónico: data/errors.catalog.json. Resumen:

CodeHTTPCategoryWhen
INVALID_API_KEY401AUTH_ERRORBearer token inválido o ausente
UNAUTHORIZED401AUTH_ERRORAPI key ausente/inválida
CHANNEL_NOT_AUTHORIZED401AUTH_ERRORCanal no autorizado para esta app
FORBIDDEN403AUTH_ERRORClave válida pero sin permiso
INSUFFICIENT_SCOPE403AUTH_ERRORFalta el scope requerido de la ruta
CHANNEL_NOT_ENABLED403AUTH_ERRORCanal no habilitado para esta app
CHANNEL_AUTH_REQUIRED403AUTH_ERRORAutorización de canal incompleta
CHANNEL_AUTH_EXPIRED403AUTH_ERRORAutorización de canal vencida — reautorizar en Portal
CHANNEL_AUTH_REVOKED403AUTH_ERRORAutorización de canal revocada
FULFILLMENT_MODE_NOT_SUPPORTED403AUTH_ERROR/v1/fulfillment/* en app self-fulfillment
FULFILLMENT_ACCESS_REQUIRED403AUTH_ERROR(Reservado) acceso de fulfillment no otorgado
FULFILLMENT_ACCESS_SUSPENDED403AUTH_ERROR(Reservado) acceso de fulfillment suspendido
WAREHOUSE_AUTH_REQUIRED403AUTH_ERRORFulfillment de almacén sin autorización
WAREHOUSE_AUTH_EXPIRED403AUTH_ERRORAutorización de almacén vencida
WAREHOUSE_AUTH_INVALID403AUTH_ERRORWarehouse rejected developer authentication
VALIDATION_ERROR400VALIDATION_ERRORCampos body faltantes/inválidos, moneda no soportada
UNSUPPORTED_CHANNEL400VALIDATION_ERRORValor de channel desconocido
UNSUPPORTED_FIELD400VALIDATION_ERRORCampo no permitido en esta ruta
NOT_FOUND404VALIDATION_ERRORRuta o recurso inexistente
CHANNEL_CAPABILITY_NOT_SUPPORTED400CHANNEL_ERROROperación no disponible en este canal
CHANNEL_UPSTREAM_ERROR502CHANNEL_ERRORMarketplace rechazó la llamada (sanitizado)
WAREHOUSE_UPSTREAM_ERROR502CHANNEL_ERRORUpstream de almacén/fulfillment falló (sanitizado)
INTERNAL_ERROR500INTERNAL_ERRORFallo inesperado de Gateway — reintentar con backoff
RATE_LIMIT_EXCEEDED429RATE_LIMIT_ERRORLímite por minuto / ráfaga
QUOTA_EXCEEDED429RATE_LIMIT_ERRORCuota diaria del canal agotada
PLATFORM_QUOTA_EXCEEDED429RATE_LIMIT_ERRORCapacidad mensual de plataforma
PAYMENT_DECLINED402VALIDATION_ERRORPago rechazado
PAYMENT_INSUFFICIENT_FUNDS402VALIDATION_ERRORFondos insuficientes
ORDER_ALREADY_PAID409VALIDATION_ERRORPedido ya pagado
ORDER_CANCELLED409VALIDATION_ERRORPedido ya cancelado
PRODUCT_UNAVAILABLE422VALIDATION_ERRORProducto no disponible / dado de baja
IDEMPOTENCY_CONFLICT409VALIDATION_ERRORexternal_shipment_id o clave de idempotencia duplicada
EXTERNAL_ORDER_ID_ALREADY_EXISTS409VALIDATION_ERRORexternal_order_id ya usado en esta app
PARCEL_NOT_FOUND404VALIDATION_ERRORParcel inválido o aún no inbound
INVALID_SHIPPING_CHANNEL400VALIDATION_ERRORshipping_channel_code inválido
INSUFFICIENT_BALANCE402VALIDATION_ERRORSaldo de billetera de fulfillment bajo
SHIPMENT_ALREADY_PAID409VALIDATION_ERRORInternational shipment already paid
SHIPMENT_NOT_FOUND404VALIDATION_ERRORShipment missing or not owned
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
SHIPMENT_CREATE_EXCEPTION400VALIDATION_ERRORCreate refused (missing item attributes, parcel not inbound, etc. — 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
INBOUND_TRACKING_ALREADY_SHIPPED409VALIDATION_ERRORTracking ya vinculado a paquete enviado
INBOUND_TRACKING_ALREADY_EXISTS409VALIDATION_ERRORTracking ya registrado
INBOUND_VALIDATION_FAILED422VALIDATION_ERRORErrores de campos inbound en details.fields
INBOUND_NOT_FOUND404VALIDATION_ERRORInbound ausente o sin propiedad
PACKAGE_NOT_FOUND404VALIDATION_ERRORPaquete ausente o sin propiedad
INBOUND_NOT_EDITABLE409VALIDATION_ERRORInbound no editable en este estado
INBOUND_ALREADY_RECEIVED409VALIDATION_ERRORYa recibido en almacén
INBOUND_PACKAGE_MISMATCH409VALIDATION_ERRORNo se puede vincular al inbound/paquete
INVALID_TRACKING_NUMBER422VALIDATION_ERRORFormato de tracking inválido
PACKAGE_COUNT_INVALID422VALIDATION_ERRORpackage_count inválido
TOTAL_VALUE_INVALID422VALIDATION_ERRORtotal_value inválido
UNSUPPORTED_CURRENCY422VALIDATION_ERRORMoneda no soportada (inbound: CNY/USD/KRW)
UNCLAIMED_PACKAGE_NOT_FOUND404VALIDATION_ERRORPaquete no reclamado ausente
TRACKING_NUMBER_MISMATCH422VALIDATION_ERRORFallo de coincidencia exacta en claim
PACKAGE_ALREADY_CLAIMED409VALIDATION_ERRORPaquete ya reclamado
PACKAGE_NOT_CLAIMABLE409VALIDATION_ERRORNo reclamable en este estado
CLAIM_ATTEMPTS_EXCEEDED429RATE_LIMIT_ERRORDemasiados fallos de claim en un ucp_*
RETURN_NOT_FOUND404VALIDATION_ERRORDevolución ausente o sin propiedad
RETURN_NOT_CONFIRMABLE409VALIDATION_ERRORDevolución no confirmable
RETURN_NOT_CANCELLABLE409VALIDATION_ERRORDevolución no cancelable
RETURN_ALREADY_RETURNED409VALIDATION_ERRORYa devuelto
RETURN_ALREADY_CANCELLED409VALIDATION_ERRORYa cancelado / anulado
RETURN_FEE_NOT_READY409VALIDATION_ERRORTarifa de devolución aún no calculada
RETURN_FEE_CHANGED409VALIDATION_ERRORMonto confirmado ≠ fee.total
PACKAGE_NOT_RETURNABLE409VALIDATION_ERROREstado del paquete bloquea devolución
INVALID_RETURN_REASON422VALIDATION_ERRORCódigo de motivo de devolución desconocido
INVALID_RETURN_ADDRESS422VALIDATION_ERRORDirección seller_return inválida
RETURN_VALIDATION_FAILED422VALIDATION_ERRORFalló validación de campos de devolución
VALUE_ADDED_SERVICE_NOT_FOUND422VALIDATION_ERRORservice_code VAS desconocido
VALUE_ADDED_SERVICE_UNAVAILABLE422VALIDATION_ERRORVAS existe pero no disponible
VALUE_ADDED_SERVICE_INVALID_STAGE422VALIDATION_ERRORVAS no permitido en esta etapa
VALUE_ADDED_SERVICE_QUANTITY_INVALID422VALIDATION_ERRORCantidad VAS inválida
SERVICE_REQUEST_NOT_FOUND404VALIDATION_ERRORSolicitud de servicio ausente
RESOURCE_NOT_FOUND404VALIDATION_ERRORRecurso relacionado ausente
RESOURCE_NOT_ELIGIBLE_FOR_SERVICE409VALIDATION_ERRORPaquete/envío no elegible
SERVICE_FEE_NOT_READY409VALIDATION_ERRORTarifa de servicio no lista
SERVICE_FEE_CHANGED409VALIDATION_ERRORMonto confirmado ≠ tarifa de servicio
SERVICE_REQUEST_VALIDATION_FAILED422VALIDATION_ERRORFalló validación de solicitud de servicio
TRANSACTION_NOT_FOUND404VALIDATION_ERRORTransacción ausente o sin propiedad
INVOICE_NOT_FOUND404VALIDATION_ERRORFactura ausente o sin propiedad
TRANSACTION_NOT_INVOICEABLE409VALIDATION_ERRORTransacción no facturable
TRANSACTION_ALREADY_INVOICED409VALIDATION_ERRORTransacción ya facturada
TRANSACTION_INVOICE_PENDING409VALIDATION_ERRORFactura ya pendiente
INVOICE_NOT_DOWNLOADABLE409VALIDATION_ERRORFactura aún no emitida
INVOICE_VALIDATION_FAILED422VALIDATION_ERRORFalló validación de solicitud de factura
INVOICE_CURRENCY_MISMATCH422VALIDATION_ERRORMoneda de factura no coincide
INVALID_INVOICE_TITLE422VALIDATION_ERRORTítulo de factura inválido
INVALID_TAX_NUMBER422VALIDATION_ERRORNúmero fiscal inválido
INVALID_BILLING_ADDRESS422VALIDATION_ERRORbilling_address missing or invalid
TICKET_NOT_FOUND404VALIDATION_ERRORTicket ausente o fuera de Application
TICKET_NOT_REPLYABLE409VALIDATION_ERRORTicket no respondible (p. ej. cerrado)
TICKET_ALREADY_CLOSED409VALIDATION_ERRORTicket ya cerrado
INVALID_TICKET_CATEGORY422VALIDATION_ERRORCategoría de ticket inválida
INVALID_TICKET_PRIORITY422VALIDATION_ERRORPrioridad de ticket inválida
INVALID_RELATED_RESOURCE422VALIDATION_ERRORTipo related_resource inválido
TICKET_VALIDATION_FAILED422VALIDATION_ERRORFalló validación de campos de ticket
RELATED_RESOURCE_NOT_FOUND404VALIDATION_ERRORRecurso de negocio relacionado ausente
MESSAGE_REQUIRED422VALIDATION_ERRORCuerpo del mensaje requerido
MESSAGE_TOO_LONG422VALIDATION_ERRORMensaje supera 10000 caracteres

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