1. Product Sync
Before initiating any checkout session, sync your product catalog with Gale. Each product includes metadata such as name, UPC/GTIN, and a unique product ID from your system. Endpoint:2. Eligibility Classification
Once products are synced, Gale automatically checks HSA/FSA eligibility against the SIGIS database. Each product response includes:hsa_fsa_eligible— boolean indicating whether the product qualifies for HSA/FSAmessage— a customer-facing explanation you can display on your storefront (e.g., “HSA/FSA accepted”, “Requires Letter of Medical Necessity”)
- Check the
hsa_fsa_eligiblefield on any product response - Query eligibility using the Check Eligibility endpoint
- Subscribe to webhook events (
product.updated) for real-time eligibility updates
3. Hosted Checkout Session
With eligible products in place, initiate a hosted checkout session using the Gale API. Endpoint:reference_id (your order or cart ID for correlation). A successful response returns a checkout_id and checkout_url which you redirect your customer to.
Gale automatically determines the checkout type based on product eligibility:
- Eligible - All items are HSA/FSA eligible, entire amount charged to HSA/FSA card
- Split - Mix of eligible and non-eligible items, Gale handles splitting payment across HSA/FSA and regular payment methods
- Regular - No items are eligible, standard payment processing
4. Payment Processing
The customer completes payment on Gale’s hosted checkout page. Once paid, an order is created.Order Lifecycle
Orders track both fulfillment and payment separately: Order Status (your fulfillment state):pending- Order created, awaiting paymentprocessing- Payment in progresscompleted- Payment successful, ready to fulfillfailed- Payment declinedcancelled- Order cancelled
pending- Payment not attemptedauthorized- Funds reserved (not yet captured)captured- Funds captured successfullyrefunded- Funds returned to customer
completed while payment is still authorized (not yet captured).
Most merchants only need to check: Order status === 'completed' means the order is paid and ready to ship.
Check order status anytime:
Three Key IDs
Keep these distinct:| ID | What it is | When you get it |
|---|---|---|
checkout_id | The checkout session you created | Returned when you create a checkout |
order_id | The payment record after successful payment | Returned in webhooks and order queries |
reference_id | Your own order/cart ID for correlation | You provide this when creating a checkout |
5. Webhook Notifications
Gale sends webhooks when important events occur. All payment flows (checkout sessions, payment links) create orders, so you’ll receive order webhooks.Common Webhooks
For Checkout Sessions:order.created- Order created after successful paymentorder.failed- Payment failedorder.refunded- Order was refunded
payment_link.paid- Customer paid the linkorder.created- Order created from the payment (fires afterpayment_link.paid)payment_link.expired- Link expired without payment
product.updated- Eligibility status changed (e.g., SIGIS update)
Setup
- Register your webhook URL in Settings > Webhooks in the Gale Dashboard
- Validate signatures using
X-Gale-Signatureheader - Respond with HTTP 200 within 5 seconds
- Gale retries failed deliveries with exponential backoff
6. Refunds
You can issue full refunds via the API:Summary
| Step | Description |
|---|---|
| Product Sync | Send your products to Gale |
| Eligibility | Check which items are HSA/FSA eligible |
| Create Checkout | Launch a hosted checkout session |
| Process Payment | Customer completes payment on Gale’s page |
| Listen to Webhooks | Receive real-time updates |
| Handle Refunds | Process returns via API or Dashboard |
