How Truemed Checkout Works

Truemed Checkout lets customers pay with HSA/FSA funds through a hosted payment flow. You create a payment session from your server, redirect the customer to Truemed, and receive the final payment result by webhook.

The key integration pattern is simple: use the redirect for the customer experience, and use the webhook for fulfillment decisions.

The integration surface

Integration pieceWhat it does
create_payment_sessionCreates the hosted Truemed checkout session.
redirect_urlSends the customer to Truemed to verify eligibility and pay.
success_urlReturns the customer to your confirmation page after checkout.
failure_urlReturns the customer to your checkout if they cannot complete payment.
payment_session_completeTells your server when the payment status changes.

Do not fulfill from the success_url redirect alone. Fulfill only after the payment_session_complete webhook sends status: captured.

One ID, several field names

A payment session has a single identifier—the id returned when you create it. The same value reappears under different field names depending on where you encounter it, but it is always that one id:

Where it appearsField name
create_payment_session responseid
Capture, void, cancel, and status paths{business_id}
payment_session_complete webhookpayment_id
success_url / failure_url templates{{payment_session_id}}

Store the id on your order when you create the session. You will use it to match the webhook, call capture/void/cancel, and reconcile later.

Don’t confuse the payment session id with the payment_token (pt_...) in the same response. The token is a separate identifier for recurring billing—not for managing this payment session.

How the flow works

1

Create a payment session

When the customer chooses Truemed at checkout, call create_payment_session from your server with the cart total, order items, customer details, success_url, and failure_url.

2

Redirect the customer to Truemed

Send the customer to the redirect_url returned in the response. Truemed collects the health survey details and HSA/FSA card information needed to process the payment. Prefer to keep customers on your site? Render the same flow inline with Embedded Checkout (iFrame).

3

Return the customer to your site

Truemed redirects the customer to your success_url or failure_url so your site can show the right customer-facing message.

4

Confirm the result by webhook

Truemed sends payment_session_complete whenever the payment session status changes. Your backend should update the order based on the webhook status.

5

Fulfill only after capture

For the default one-time payment flow, fulfill the order when the webhook sends status: captured. If the webhook sends status: rejected, cancel the order and notify the customer.

First payment vs. full lifecycle

Start with the smallest working path, then add deeper payment behavior when your checkout needs it.

If you need to…Read this
Build the first working payment flowAccept Your First Payment
Validate launch readinessImplementation Readiness Checklist
Handle webhook verification and fulfillmentWebhooks and Fulfillment
Understand all payment statusesPayment Lifecycle
Authorize now and capture laterManual/Delayed Capture
Show fees, discounts, shipping, and tax in checkoutItemized Fees and Discounts
Refund, cancel, or void a paymentRefunds, Cancels, and Voids