Integration Checklist
A comprehensive checklist to ensure your Hubble API integration is complete and production-ready.
Initial Setup and Authentication
- Ensure your system's IP addresses are pre-approved to access the API
- Store your
clientIdandclientSecretsecurely (environment variables, secrets manager) - Implement the token acquisition flow using
/v1/partners/auth/loginendpoint - Implement token refresh logic based on
expiresInSecsto maintain authentication - Include the
Authorization: Bearer {access_token}header in all API calls - Generate and include a unique
X-REQUEST-IDheader in all API requests - Log and retain X-REQUEST-ID for troubleshooting
Implementing Order Flow
Getting Brands
- Implement a periodic (daily/weekly) scheduled task to fetch available brands using
/v1/partners/products - Cache brand data locally to minimize API calls
- Filter out
INACTIVEbrands from user-facing catalog - Handle both
FIXEDandFLEXIBLEdenomination types - Validate denominations against brand's
amountRestrictionsbefore placing orders
Placing an Order
- Ensure request body includes correct product IDs, reference IDs, amounts, and customer details
- Adhere to all brand-specific amount restrictions:
minOrderAmount/maxOrderAmountminVoucherAmount/maxVoucherAmountmaxVouchersPerOrdermaxVouchersPerDenominationmaxDenominationsPerOrder
- Generate unique
referenceIdfor each order (max 40 characters, globally unique) - Implement handling for
PROCESSINGstatus:- Set up webhook listener for "Order Reached Terminal State"
- Implement polling starting 1 minute after order placement (max 5 attempts)
- Mark order as FAILED if still PROCESSING after 15 minutes
- Implement timeout handling:
- Use
/v1/partners/orders/by-reference/{referenceId}to check if order exists - 404 = not created, safe to retry with same referenceId
- Any other response = process based on returned status
- Use
Getting Order Details
- Use
/v1/partners/orders/{orderId}or/v1/partners/orders/by-reference/{referenceId}to fetch order details - Handle different voucher
cardTypevalues for display:CARD_NUMBER_SECURED— Show card number onlyPIN_NO_SECURED— Show PIN onlyCARD_AND_PIN_NO_SECURED— Show both
Handling Callbacks/Webhooks
- Set up endpoints on your server to receive callbacks for:
- Brand updates
- Wallet low balance notifications
- Order state changes
- Brand discount updates
- Implement signature verification using HMAC-SHA256
- Update brand information when Brand Updated webhook is received
- Alert operations team when Wallet Low Balance webhook is received
- Fetch full order details when Order Terminal State webhook is received
Wallet APIs
- Implement wallet balance checking using
/v1/partners/wallet/balance - Set up Wallet Low Balance webhook with appropriate threshold
- Establish process for wallet top-ups with Hubble account manager
- Monitor balance before high-volume operations
Error Handling and Validation
- Implement comprehensive error handling based on error codes
- Validate request bodies to avoid common errors (E150-E160)
- Map error codes to user-friendly messages
- Never expose raw error messages to end users
- Implement retry logic for transient errors (E200, E201)
- Handle rate limit errors (E400) gracefully
Testing and Go-live
- Thoroughly test the integration in staging environment
- Test handling of all order statuses:
- SUCCESS — vouchers displayed correctly
- FAILED — error handled, new referenceId for retry
- PROCESSING — polling or webhook working
- Verify webhook implementation receives and processes updates
- Conduct wallet balance management testing
- Test with various brands and denomination types
- Verify all amount restriction validations work
Production Transition
- Obtain production credentials from Hubble
- Update base URL to
https://api.myhubble.money - Whitelist production server IPs
- Configure production webhook endpoints
- Ensure production wallet has sufficient balance
- Understand and plan for rate limits
Post-launch Monitoring
- Set up monitoring for API response times and error rates
- Implement alerting for:
- Order success rate drops
- Wallet balance below threshold
- Error rate spikes
- Webhook delivery failures
- Monitor rate limit usage
- Track and analyze order patterns