Erreurs

HIOBuy utilise deux formes d’erreur : erreurs de protocole (non-2xx avec error) et échecs métier (HTTP 200 avec success: false sur certaines routes commande).

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

Référence des codes d’erreur {#error-codes}

Catalogue canonique : data/errors.catalog.json. Résumé :

CodeHTTPCategoryWhen
INVALID_API_KEY401AUTH_ERRORJeton Bearer invalide ou manquant
UNAUTHORIZED401AUTH_ERRORClé API manquante/invalide
CHANNEL_NOT_AUTHORIZED401AUTH_ERRORCanal non autorisé pour cette app
FORBIDDEN403AUTH_ERRORClé valide mais non autorisée
INSUFFICIENT_SCOPE403AUTH_ERRORScope requis manquant pour la route
CHANNEL_NOT_ENABLED403AUTH_ERRORCanal non activé pour cette app
CHANNEL_AUTH_REQUIRED403AUTH_ERRORAutorisation canal non terminée
CHANNEL_AUTH_EXPIRED403AUTH_ERRORAutorisation canal expirée — réautoriser dans le Portal
CHANNEL_AUTH_REVOKED403AUTH_ERRORAutorisation canal révoquée
FULFILLMENT_MODE_NOT_SUPPORTED403AUTH_ERROR/v1/fulfillment/* sur app self-fulfillment
FULFILLMENT_ACCESS_REQUIRED403AUTH_ERROR(Réservé) accès fulfillment non accordé
FULFILLMENT_ACCESS_SUSPENDED403AUTH_ERROR(Réservé) accès fulfillment suspendu
WAREHOUSE_AUTH_REQUIRED403AUTH_ERRORFulfillment entrepôt sans autorisation entrepôt
WAREHOUSE_AUTH_EXPIRED403AUTH_ERRORAutorisation entrepôt expirée
WAREHOUSE_AUTH_INVALID403AUTH_ERRORWarehouse rejected developer authentication
VALIDATION_ERROR400VALIDATION_ERRORChamps body manquants/invalides, devise non supportée
UNSUPPORTED_CHANNEL400VALIDATION_ERRORValeur channel inconnue
UNSUPPORTED_FIELD400VALIDATION_ERRORChamp non autorisé sur cette route
NOT_FOUND404VALIDATION_ERRORRoute ou ressource inexistante
CHANNEL_CAPABILITY_NOT_SUPPORTED400CHANNEL_ERROROpération indisponible sur ce canal
CHANNEL_UPSTREAM_ERROR502CHANNEL_ERRORMarketplace a rejeté l’appel (masqué)
WAREHOUSE_UPSTREAM_ERROR502CHANNEL_ERRORUpstream entrepôt/fulfillment en échec (masqué)
INTERNAL_ERROR500INTERNAL_ERRORÉchec Gateway inattendu — réessayer avec backoff
RATE_LIMIT_EXCEEDED429RATE_LIMIT_ERRORLimite de débit / minute
QUOTA_EXCEEDED429RATE_LIMIT_ERRORQuota journalier canal épuisé
PLATFORM_QUOTA_EXCEEDED429RATE_LIMIT_ERRORCapacité mensuelle plateforme
PAYMENT_DECLINED402VALIDATION_ERRORPaiement refusé
PAYMENT_INSUFFICIENT_FUNDS402VALIDATION_ERRORFonds insuffisants
ORDER_ALREADY_PAID409VALIDATION_ERRORCommande déjà payée
ORDER_CANCELLED409VALIDATION_ERRORCommande déjà annulée
PRODUCT_UNAVAILABLE422VALIDATION_ERRORProduit indisponible / retiré
IDEMPOTENCY_CONFLICT409VALIDATION_ERRORexternal_shipment_id ou clé d’idempotence en double
EXTERNAL_ORDER_ID_ALREADY_EXISTS409VALIDATION_ERRORexternal_order_id déjà utilisé dans l’app
PARCEL_NOT_FOUND404VALIDATION_ERRORParcel invalide ou pas encore inbound
INVALID_SHIPPING_CHANNEL400VALIDATION_ERRORshipping_channel_code invalide
INSUFFICIENT_BALANCE402VALIDATION_ERRORSolde portefeuille fulfillment trop bas
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 déjà lié à un colis expédié
INBOUND_TRACKING_ALREADY_EXISTS409VALIDATION_ERRORTracking déjà enregistré
INBOUND_VALIDATION_FAILED422VALIDATION_ERRORErreurs de champs inbound dans details.fields
INBOUND_NOT_FOUND404VALIDATION_ERRORInbound manquant ou non possédé
PACKAGE_NOT_FOUND404VALIDATION_ERRORColis manquant ou non possédé
INBOUND_NOT_EDITABLE409VALIDATION_ERRORInbound non modifiable dans cet état
INBOUND_ALREADY_RECEIVED409VALIDATION_ERRORDéjà réceptionné en entrepôt
INBOUND_PACKAGE_MISMATCH409VALIDATION_ERRORImpossible de lier à l’inbound/colis
INVALID_TRACKING_NUMBER422VALIDATION_ERRORFormat de tracking invalide
PACKAGE_COUNT_INVALID422VALIDATION_ERRORpackage_count invalide
TOTAL_VALUE_INVALID422VALIDATION_ERRORtotal_value invalide
UNSUPPORTED_CURRENCY422VALIDATION_ERRORDevise non supportée (inbound : CNY/USD/KRW)
UNCLAIMED_PACKAGE_NOT_FOUND404VALIDATION_ERRORColis non réclamé manquant
TRACKING_NUMBER_MISMATCH422VALIDATION_ERRORÉchec de correspondance exacte au claim
PACKAGE_ALREADY_CLAIMED409VALIDATION_ERRORColis déjà réclamé
PACKAGE_NOT_CLAIMABLE409VALIDATION_ERRORNon réclamable dans cet état
CLAIM_ATTEMPTS_EXCEEDED429RATE_LIMIT_ERRORTrop d’échecs de claim sur un ucp_*
RETURN_NOT_FOUND404VALIDATION_ERRORRetour manquant ou non possédé
RETURN_NOT_CONFIRMABLE409VALIDATION_ERRORRetour non confirmable
RETURN_NOT_CANCELLABLE409VALIDATION_ERRORRetour non annulable
RETURN_ALREADY_RETURNED409VALIDATION_ERRORDéjà retourné
RETURN_ALREADY_CANCELLED409VALIDATION_ERRORDéjà annulé / invalidé
RETURN_FEE_NOT_READY409VALIDATION_ERRORFrais de retour non calculés
RETURN_FEE_CHANGED409VALIDATION_ERRORMontant confirmé ≠ fee.total
PACKAGE_NOT_RETURNABLE409VALIDATION_ERRORStatut colis bloque le retour
INVALID_RETURN_REASON422VALIDATION_ERRORCode motif de retour inconnu
INVALID_RETURN_ADDRESS422VALIDATION_ERRORAdresse seller_return invalide
RETURN_VALIDATION_FAILED422VALIDATION_ERRORÉchec validation champs retour
VALUE_ADDED_SERVICE_NOT_FOUND422VALIDATION_ERRORservice_code VAS inconnu
VALUE_ADDED_SERVICE_UNAVAILABLE422VALIDATION_ERRORVAS existant mais indisponible
VALUE_ADDED_SERVICE_INVALID_STAGE422VALIDATION_ERRORVAS non autorisé à cette étape
VALUE_ADDED_SERVICE_QUANTITY_INVALID422VALIDATION_ERRORQuantité VAS invalide
SERVICE_REQUEST_NOT_FOUND404VALIDATION_ERRORDemande de service manquante
RESOURCE_NOT_FOUND404VALIDATION_ERRORRessource liée manquante
RESOURCE_NOT_ELIGIBLE_FOR_SERVICE409VALIDATION_ERRORColis/envoi non éligible
SERVICE_FEE_NOT_READY409VALIDATION_ERRORFrais de service non prêts
SERVICE_FEE_CHANGED409VALIDATION_ERRORMontant confirmé ≠ frais de service
SERVICE_REQUEST_VALIDATION_FAILED422VALIDATION_ERRORÉchec validation demande de service
TRANSACTION_NOT_FOUND404VALIDATION_ERRORTransaction manquante ou non possédée
INVOICE_NOT_FOUND404VALIDATION_ERRORFacture manquante ou non possédée
TRANSACTION_NOT_INVOICEABLE409VALIDATION_ERRORTransaction non facturable
TRANSACTION_ALREADY_INVOICED409VALIDATION_ERRORTransaction déjà facturée
TRANSACTION_INVOICE_PENDING409VALIDATION_ERRORFacture déjà en attente
INVOICE_NOT_DOWNLOADABLE409VALIDATION_ERRORFacture pas encore émise
INVOICE_VALIDATION_FAILED422VALIDATION_ERRORÉchec validation demande de facture
INVOICE_CURRENCY_MISMATCH422VALIDATION_ERRORDevise de facture incohérente
INVALID_INVOICE_TITLE422VALIDATION_ERRORTitre de facture invalide
INVALID_TAX_NUMBER422VALIDATION_ERRORNuméro fiscal invalide
INVALID_BILLING_ADDRESS422VALIDATION_ERRORbilling_address missing or invalid
TICKET_NOT_FOUND404VALIDATION_ERRORTicket manquant ou hors Application
TICKET_NOT_REPLYABLE409VALIDATION_ERRORTicket non répondable (ex. fermé)
TICKET_ALREADY_CLOSED409VALIDATION_ERRORTicket déjà fermé
INVALID_TICKET_CATEGORY422VALIDATION_ERRORCatégorie de ticket invalide
INVALID_TICKET_PRIORITY422VALIDATION_ERRORPriorité de ticket invalide
INVALID_RELATED_RESOURCE422VALIDATION_ERRORType related_resource invalide
TICKET_VALIDATION_FAILED422VALIDATION_ERRORÉchec validation champs ticket
RELATED_RESOURCE_NOT_FOUND404VALIDATION_ERRORRessource métier liée manquante
MESSAGE_REQUIRED422VALIDATION_ERRORCorps du message requis
MESSAGE_TOO_LONG422VALIDATION_ERRORMessage > 10000 caractères

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