Understand environments
| Environment | Henry Shopping SDK configuration | Usage |
|---|---|---|
| Sandbox | environment: "sandbox" | Development and QA. Mirrors production data models and supports test card numbers. |
| Production | environment: "production" | Live traffic. Handles real shoppers, merchants, and payments. |
environment flag to match the target environment.
1. Configure credentials
1
Create sandbox API key
Generate a key from the Henry Sandbox
Dashboard. Scope it to the services you
plan to test.
2
Set up user tokens
Endpoints that manage user state or checkout sessions require both an
x-api-key along with a stable x-user-id.3
Request production access
When you’re ready to go live, contact your Henry representative or contact
us for production credentials. Rotate the values in your
secrets manager without redeploying code.
2. Exercise core scenarios
Run through the flows below using sandbox credentials before you promote:-
Product discovery: Exercise
client.products.searchandclient.products.retrieveDetailswith realistic queries to confirm filters, variant data, and catalog coverage. Capture representative sandbox responses so you can compare payload structures after the production cutover. -
Cart lifecycle: Validate
client.cart.items.add,client.cart.items.list,client.cart.items.remove, andclient.cart.items.clear. Check that totals, quantities, and optional variant checks update as expected and that idempotent retries behave gracefully. -
Hosted checkout: Launch
client.cart.createCheckoutin an iframe or redirect, walk through a sandbox purchase, and record the resulting order ID. Useclient.orders.retrieveStatusto confirm the order progresses through expected fulfillment states. -
Headless checkout (optional): Walk the full flow with
client.checkout.session.createQuote,client.checkout.session.listProducts, andclient.checkout.session.confirmCheckout. Pass bothx-user-idand the returnedsession_token, and make sure you persist those identifiers long enough to retry confirmation. -
Wallet card collection: Trigger
client.wallet.createCardCollectionand ensure your UI properly renders the hosted modal and handles the returnedmodal_urllifecycle. -
Merchant data: Fetch
client.merchants.listSupported()andclient.merchants.getShippingInfo()to preload brand-specific settings, shipping expectations, and pagination edge cases ahead of production.
3. Validate error handling
Henry Shopping SDK responses share a common envelope:{ success, status, message, data }. Confirm your integration logs the status and message values, inspects success before using payloads, and surfaces helpful recovery messaging whenever a call fails.
Simulating failures in the sandbox now makes it easier to debug production incidents later.
4. Promote to production
- Instantiate the SDK with production credentials (
apiKey+environment: "production"). - Rotate to production API key values in your secrets manager.
- Replay the smoke tests above with a small allowlisted merchant and shopper cohort using the same SDK helpers.
- Monitor orders in real time with
client.orders.retrieveStatus(orderId).

