Theme

Technical guides

Error codes

The HLC API returns structured error codes with descriptive messages to facilitate debugging and error handling. Use these codes to implement user-friendly error messages and automated retry logic.


Error Code Categories

Error codes are prefixed by category:

  • SYS: System and authentication errors
  • ACC: Account and user management errors
  • ORD: Order processing and fulfillment errors
  • PMT: Payment and transaction errors
  • CAT: Catalog and product errors
  • SERV: Order creation and validation errors
  • CUST: Customer account errors
  • SHIP: Shipping address and delivery errors
  • PAYM: Payment and credit card errors
  • ORDR: Order line item errors
  • PROD: Product and variant errors
  • CREA: Order creation process errors

Error Code Reference

System Errors

CodeMeaning
SYS0001Invalid Token

Account Errors

CodeMeaning
ACC0001Request must contain at least one label
ACC0002No content found
ACC0003Invalid items in label update: {0}
ACC0004No invoice found
ACC0005Invoice number is mandatory

Order Errors

CodeMeaning
ORD0001dateFrom must be prior or equal to dateTo
ORD0002Sales orders creation disabled
ORD0003Doorstep Delivery access not granted
ORD0004Error during cart creation
ORD0005Delivery address is not valid
ORD0006ReturnAddressID is not valid
ORD0007Document language must be en or fr
ORD0008Product identifier cannot be resolved
ORD0009Product defined multiple times
ORD0010Not enough inventory available
ORD0011No content found
ORD0012Product not allowed for doorstep delivery
ORD0013Request must contain items
ORD0014Doorstep delivery payment preferences not set
ORD0015Call customer service to order product
ORD0016Items with missing quantities: {0}
ORD0017Order number is mandatory for tracking
ORD0018No tracking number found or not available yet
ORD0019Authorized dealers only for product {0}
ORD0020PO box addresses are not supported
ORD0021PurchaseOrderNumber is required and it must not exceed 60 characters
ORD0022Payload is not valid
ORD0023If a warehouse is provided, a delivery mode and a carrier account number are required
ORD0024Both carrier number and delivery mode are required if either is provided
ORD0025Delivery mode is not valid
ORD0099Order identifier is mandatory
ORD0500Unexpected validation error, contact HLC support

Payment Errors

CodeMeaning
PMT0001Transaction declined – try a different card
PMT0002Billing address verification failed
PMT0003Transaction declined – try a different card
PMT0004Invalid expiration date
PMT0005Withdrawal limit reached
PMT0006Insufficient funds
PMT0007Invalid security code
PMT0008Invalid account number
PMT0009Error – contact customer service
PMT0010Transaction declined – contact card provider
PMT0011Request declined – try again

Catalog Errors

CodeMeaning
CAT0001Invalid product status
CAT0002No content found

Order Creation Errors

CodeMeaning
SERV0001Order cannot be created because pricing settings are invalid. Either line pricing has to be set, or MustRetrieveLinePricing setting must be set to true
SERV0002Order cannot be created because the reference number is not set
SERV0003Order cannot be created because the reference number is not unique in the request
SERV0004Order cannot be created because the pool is invalid
SERV0005Order cannot be created because the order type is invalid
SERV0006AllowPartialDelivery cannot be set to true yet

Customer Errors

CodeMeaning
CUST1001Order cannot be retrieved because the account number is not specified
CUST1002Order cannot be created because the purchase order number is missing
CUST1003Order cannot be created because the customer doesn't have the right to order via the doorstep program
CUST1006Customer does not have any API configurations
CUST1007Customer requires a carrier account number

Shipping Errors

CodeMeaning
SHIP2001Order cannot be created because the shipping address is not specified
SHIP2002Order cannot be created because the warehouse is not set for some lines and MustUseDCHierachiesToRetrieveWarehouse is set to false
SHIP2003Order cannot be created because the delivery mode is not set for one or more lines and MustFreightShop is set to false
SHIP2004Order cannot be created because freight shopper could not find rates
SHIP2005Order cannot be created because the shipping address has an invalid state
SHIP2006Order cannot be created because the shipping address has an invalid country
SHIP2007Order cannot be created because the address is invalid
SHIP2008An error occur during the address validation ({0})
SHIP2009Order cannot be created because the shipping country must be the same as the company's country

Payment Errors (PAYM)

CodeMeaning
PAYM3001Credit card profile ID is not set up correctly
PAYM3002Order cannot be processed because one of the payment information is incorrect
PAYM3003Credit card or ACH profile ID is missing
PAYM3004Card authorization failed
PAYM3005ACH Payment validation failed

Order Line Item Errors

CodeMeaning
ORDR4001Item restricted
ORDR4002Order cannot be created because the following items cannot be sold via the doorstep program
ORDR4003Order cannot be created because the following items are now discontinued

Product Errors (PROD)

CodeMeaning
PROD5001The following variants do not exist

Order Creation Process Errors

CodeMeaning
CREA9001Order cannot be created because the creation process failed post-validations
CREA9002Pool not set
CREA9003Order cannot be created because freight shopper couldn't find rates
CREA9004Order cannot be created because an error happened while getting the freight and handling charges
CREA9005Not enough inventory to fulfill order

Implementation Example

Client-Side Error Mapping

const errorMessages = {
  SYS0001:
    'Your API key is invalid or has expired. Please check your credentials.',
  ORD0010:
    'Insufficient inventory available. Please reduce quantity or try again later.',
  PMT0001: 'Payment declined. Please try a different payment method.',
  PMT0006: 'Insufficient funds. Please use a different payment method.',
  ORD0003: 'Doorstep delivery is not available for your account.',
}

function getUserMessage(errorCode) {
  return (
    errorMessages[errorCode] ??
    'An unexpected error occurred. Please try again or contact support.'
  )
}

// Usage in error handling
try {
  const response = await fetch(`${apiUrl}/Orders/Create/Fulfillment`, {
    method: 'POST',
    headers: {
      Authorization: `ApiKey ${apiKey}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(orderData),
  })

  if (!response.ok) {
    const error = await response.json()
    throw new Error(getUserMessage(error.code))
  }

  const order = await response.json()
} catch (error) {
  console.error('Order creation failed:', error.message)
  // Display error.message to user
}
Previous
Testing