Webhooks and Fulfillment
The payment_session_complete webhook is the fulfillment boundary for Truemed payments. Return URLs
help you show the right customer experience, but your backend should update and fulfill orders from
webhook statuses.
What to listen for
Subscribe to payment_session_complete
in the Developer Dashboard.
The webhook payload includes the fields your order system needs:
Example payload
A captured event for an immediate-capture session. All amounts are integers in cents
(12500 = $125.00).
The captures array and capture_amount reflect partial captures—there is no separate
partially_captured status. For an authorization session, capture_amount is absent until you
capture, and order_items carry total_capturable / quantity_capturable instead of the
refundable fields. payment_token (pt_...) appears only if you created the session with
tokenize: true or a payment_token.
Fulfillment rules
Do not fulfill from success_url. A customer can return to your site while the payment is still
processing.
Webhook handler checklist
- Verify the request using the webhooks guide.
- Find the internal order by
payment_idor by themetadatayou sent when creating the session. - Store the latest webhook
statuson the order. - Make fulfillment idempotent so webhook retries do not duplicate shipments, emails, or credits.
- Return a
2xxresponse after the event is stored or handled.
Retry behavior
Truemed retries failed webhook deliveries with backoff for up to 7 days. Treat each webhook as at-least-once delivery: your endpoint can receive the same status more than once.
Use your internal order state to make each action idempotent: