> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://developers.truemed.com/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.truemed.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.truemed.com/_mcp/server.

# Testing

> How to test the full Truemed payment flow in the sandbox before going live.

Truemed's sandbox (dev) environment mirrors production, so you can run the entire payment flow end to
end—create a session, complete checkout, and receive the `payment_session_complete` webhook—without
moving real funds. The flow is identical to production; only the credentials and base URL differ.

## Set up the sandbox

| Step                                                     | Where                                                                                     |
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| Create a **sandbox API key**                             | [dev.truemed.com/developers/api-keys](https://dev.truemed.com/developers/api-keys)        |
| Point requests at the **dev base URL**                   | `https://dev-api.truemed.com/payments/v1/`                                                |
| Add a **sandbox webhook** for `payment_session_complete` | [dev.truemed.com/developers/webhooks](https://dev.truemed.com/developers/webhooks/manage) |

A sandbox key only works against the dev base URL. See
[Before You Begin](/guides/setup/api/payment-sessions/before-you-begin) for the full setup.

## Place a test payment

1. Create a payment session against the dev base URL, exactly as in
   [Accept Your First Payment](/guides/setup/api/payment-sessions/accept-your-first-payment).
2. Open the `redirect_url` from the response (or render it inline with
   [Embedded Checkout](/guides/setup/api/payment-sessions/i-frame-payment-session)) and complete the health
   survey as the customer would.
3. Enter the test card—no real funds move:

   * **Card number:** 4242 4242 4242 4242
   * **Expiration:** any future date
   * **CVC / ZIP:** any values

## Drive the outcome you want to test

A freshly completed test payment lands in `processing`. To move it to a terminal status, open the
**Payments** tab of the [Truemed dev dashboard](https://dev.truemed.com) and use the **Actions** menu
on the test payment:

| Dashboard action | What it does                                     | Use it to test                                               |
| ---------------- | ------------------------------------------------ | ------------------------------------------------------------ |
| **Approve LMN**  | Verifies the LMN; the payment proceeds           | your fulfillment path on `captured`                          |
| **Reject LMN**   | Rejects the LMN; the session moves to `rejected` | your cancel-and-notify path                                  |
| **Expire LMN**   | Approves the LMN, then marks it expired          | how you handle an expired LMN on future or recurring charges |

![Truemed dev dashboard Payments tab with the Actions menu open, showing Approve LMN, Expire LMN, and Reject LMN](/_fern-img/267769ec610e10bc2ca0c492c4f4e62f8f26e059b933e433757c57774b4572db.webp)

> **Note**
>
> Approving the LMN moves an immediate-capture session from `processing` to `captured`. For a
> [manual capture](/guides/setup/api/payment-sessions/manual-delayed-capture) session it moves to `authorized`—
> then capture or void it through the API. **Approve** and **Reject** appear only while the LMN
> verification is still pending. See [Payment Lifecycle](/guides/setup/api/payment-sessions/payment-lifecycle)
> for what each status means, and [Subscriptions](/guides/setup/api/subscriptions/overview) for the expired-LMN
> flow.

## Verify the result

* Confirm your endpoint received `payment_session_complete` with the expected `status`.
* Or retrieve the session directly:
  [`GET /payments/v1/payment_session/{business_id}`](/api-reference/payment-sessions/retrieve-payment-session).
* Check that `authorize_amount` and `capture_amount` match what you expect.

## Before you go live

* [ ] Swap the sandbox key for a **production key**, and the dev base URL for
  `https://api.truemed.com/payments/v1/`.
* [ ] Recreate your webhook in the **production** dashboard and subscribe it to
  `payment_session_complete`.
* [ ] Walk through the
  [Implementation Readiness Checklist](/guides/setup/api/payment-sessions/implementation-readiness-checklist).