How subscriptions work
A payment token is a stored, reusable authorization to charge a customer’s HSA/FSA funds. You provision it once while the customer is present to qualify and enter their card, then charge it on your own billing schedule without them.
Truemed doesn’t manage plans, invoices, proration, or retries—your system owns the subscription and the schedule. Truemed owns one thing: whether this customer can pay for these items with HSA/FSA funds right now.
New to HSA/FSA payments? Read Core Concepts first, and build the one-time payment flow in Payment Sessions before adding subscriptions—the token flow builds directly on it.
What you’ll need
- A working Payment Sessions integration. Subscriptions reuse
create_payment_sessionand the same fulfillment rules. Get one-time payments working first. - A webhook endpoint subscribed to two events.
payment_session_completetells you whether a charge cleared;payment_token_updatedtells you when a token is usable. You need both. - Somewhere to store a token per customer. One
payment_tokenper subscription, alongside your own record of the billing schedule. - A way to act on
next_action. When a charge fails, Truemed returns an action and a URL. You need a path to get that in front of the customer—usually email plus a dashboard banner.
Vocabulary
Choose your provisioning path
There are two ways to get a token, depending on where the customer is coming from.
Free trials use the first path with total_amount: 0. See
New Subscriber.
How the flow works
Provision the token
Call one of the two endpoints above and redirect the customer to the redirect_url in the
response. The customer has to be present—this is where they qualify and enter their card.
The customer completes the survey and enters their card
Truemed runs the clinical intake and collects HSA/FSA card details, then returns the customer to
your success_url.
Wait for payment_token_updated
The webhook carries the payment_token—for example
dev_tm_token_8a1f0c2e-77b4-4f0a-9c31-2f5c7a9d4e10. Store it against the customer. Until it
arrives, you have no token. When you provision with tokenize: true, the same value also appears
on the captured payment_session_complete event, so you can correlate the two.
A token doesn’t exist until payment_token_updated arrives. If the customer abandons the flow, or no
LMN is issued, the webhook never fires and no token is ever provisioned. Don’t treat a successful
return to your success_url—or the postMessage in an embedded flow—as confirmation.