Accept Your First Payment
This guide walks through the shortest path to a working Truemed payment: create a payment session,
redirect the customer, listen for payment_session_complete, and fulfill only after the payment is
captured.
What you need first
The success_url redirect is for customer-facing confirmation. The webhook is the source of truth
for fulfillment.
Base URLs
Use the dev base URL to build and test, then switch to production for live payments.
Create a payment session
Create the session from your server when the customer chooses Truemed at checkout. All amounts are
integers in cents—12500 is $125.00.
The response includes the payment session id and the hosted Truemed redirect_url.
Store the id with your internal checkout or order record. This is the value sent back as
payment_id in the payment session webhook.
Redirect the customer
Send the customer to the redirect_url from the response. Truemed will guide them through the
health survey and HSA/FSA card entry, then redirect them back to your success_url or failure_url.
If the customer reaches your success_url, show an order-received or pending-confirmation message.
Do not ship, activate access, or otherwise fulfill the order from the redirect alone.
Want customers to stay on your site instead of redirecting away? The same flow can render inline—see Embedded Checkout (iFrame).
Handle the webhook
Configure a webhook endpoint in the Developer Dashboard
and subscribe to payment_session_complete.
Your endpoint should:
- Verify the webhook using the webhooks guide.
- Find the order associated with the webhook
payment_id. - Acknowledge receipt with any
2xxresponse, typically204 No Content. - Fulfill only after
statusiscaptured.
For your first payment flow, handle these statuses: