Skip to main content

Error Handling

Error Response Structure

{
"id": "E001",
"code": "SOMETHING_WENT_WRONG",
"message": "Something went wrong. We're working on it",
"requestId": "req_12345",
"debugMessage": "No resource found with the given ID",
"subErrors": [
{
"fieldName": "resourceId",
"message": "Resource ID is invalid",
"debugMessage": "Resource ID 404 not found in the database"
}
]
}

Response Fields

FieldDescription
idStable, granular identifier such as E160. Branch integration logic on this value. It is null for generic request-body validation failures; use code and subErrors[].fieldName in that case.
codeCoarse category shared by many IDs. Do not use it to distinguish specific error conditions. Values include SOMETHING_WENT_WRONG, RESOURCE_NOT_FOUND, INPUT_INVALID, OPERATION_NOT_ALLOWED, UNDEFINED_STATE, EXTERNAL_FAILURE, DATA_VALIDATION_ERROR, and AUTHENTICATION_FAILED.
messageHuman-readable description. It is not guaranteed to be safe for display to end users.
requestIdCorrelation ID. Include it when contacting Hubble support.
debugMessageInternal debugging context. Empty in production.
subErrorsField-level details, mainly populated for input-validation failures.

HTTP Status Codes

HTTP status reflects the failure category, not a fixed mapping for each error ID. Do not rely on status alone to distinguish errors.

StatusMeaning
400Nearly all partner-facing business errors (E1xxE4xx below), except E301
401Authentication failure, such as a bad or expired token
404Resource not found; returned with id: E001 when no more specific descriptor exists
500Unexpected/internal failures and E301 wallet inconsistency
E001 is a generic fallback

E001 is not a business error. It is used when no specific descriptor is available, including unhandled 500 and 404 responses. Treat it as an uncategorized failure, not as a specific condition to branch on.

The following is the complete authoritative list of error IDs returned by the API.

Brand Errors

CodeMessageRetryable
E100Brand is temporarily disabled owing to failuresYes, after a short wait
E101Brand is not enabled for you, please contact supportNo
E102Brand is not activeNo
E103Brand is not available for this business modelNo

Order Validation Errors

CodeMessageRetryable
E150This denomination is not available for this brandNo; fix the request
E151Order amount doesn't match the denomination amountNo; fix the request
E152Maximum denomination limit exceededNo; fix the request
E153Maximum number of denominations exceededNo; fix the request
E154Maximum number of vouchers per denomination exceededNo; fix the request
E155Please enter amount between &1 and &2No; fix the request
E156Max voucher count per order exceededNo; fix the request
E157Invalid denominations sentNo; fix the request
E158Denomination is out of stockNo; try a different denomination
E159Only single denomination allowed per orderNo; fix the request
E160Order already exists for reference idNo; see referenceId reuse
E161Discount amount cannot be greater than order amountNo; fix the request
E162Reference ID must be less than 40 charactersNo; fix the request
E163Denomination details are required for this brandNo; fix the request
E164Quantity allowed per denomination is: &1No; fix the request
E165Invalid quantity requestedNo; fix the request
E166Invalid request sent to provider, please verify and retryFix the request, then retry with a new referenceId

Voucher Generation Errors

CodeMessageRetryable
E200Voucher generation failed, please contact supportThe order is terminal and its wallet debit is automatically reversed. Retry with a new referenceId; contact support if it persists.
E201Provider polling failed, please contact supportYes; retry with a new referenceId after a short wait
E202Order cancellation failed, order is already in terminal stateNo
E203Order cancellation failed, order cant be cancelled before cutoff timeNo
E204Voucher generation is temporarily unavailable, please try again laterYes; retry with a new referenceId after a short wait

Order Cancellation Is Restricted

The cancel-order endpoint associated with E202 and E203 is not a general partner capability. It is enabled only for specific integrations. If it is not enabled for your account, calling it returns E303 (This feature is not available). Contact your Hubble account manager if you need cancellation support.

Partner Errors

CodeMessageRetryable
E300Insufficient wallet balanceNo; top up your wallet
E301Wallet balance is inconsistent, please contact adminNo; contact Hubble support
E302This resource is not availableNo
E303This feature is not availableNo
E304This resource already existsNo
E305Delivery details are not available for this orderNo
E306No vouchers are available for this orderNo
E307Voucher communication is not configured for you, please contact supportNo; contact Hubble support

Limit Errors

CodeMessageRetryable
E400Brand is temporarily unavailable, please try again laterYes, after a short wait

Retrying Safely

Only E100, E201, E204, E400, and generic 5xx or network-level failures are transient and safe to retry. Everything else is either a request problem that must be fixed or a terminal business state.

When retrying an order after it was created, use a new referenceId. The only case where the same referenceId is safe is when the Place Order request timed out and a lookup confirms that no order was created.

referenceId Reuse After a FAILED Order

If an order reaches FAILED, its wallet debit is automatically reversed, but its referenceId remains consumed. Calling Place Order with that same referenceId returns E160. Generate a new one for every retry attempt.

Voucher Refunds and Reversals

CANCELLED and REVERSED are system-driven order statuses, not states that partners generally trigger through the API. If a voucher needs to be refunded or reversed outside the automatic wallet reversal for a failed order, contact Hubble support.

Troubleshooting with Support

Provide the X-REQUEST-ID, full error response, timestamp, order or reference ID, and request payload with sensitive credentials removed. Retaining these details for every API call significantly speeds up investigation.