> 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.

# Checkout page messaging

> How to show HSA/FSA checkout messaging only when the customer's cart contains eligible items.

Surfacing Truemed messaging at the right moment in the checkout flow—when the cart actually
contains HSA/FSA-eligible items—can meaningfully improve conversion. Customers who might not
have thought to use their benefits are reminded at exactly the right time.

## Why this matters

Many customers have HSA/FSA funds available but don't actively think to use them during
checkout. A well-placed message ("Your cart may be covered by your HSA/FSA") acts as a
prompt that converts browsers into HSA/FSA payers—especially near year-end when customers
are motivated to spend remaining balances.

## What to show

Effective checkout messaging is:

* **Specific** — "X item(s) in your cart are HSA/FSA eligible" outperforms generic copy
* **Timely** — shown after cart assembly, before or during payment method selection
* **Actionable** — paired with a clear call to action: "Pay with Truemed →"

Example messages:

> "Some items in your cart may be covered by your HSA or FSA. Pay with Truemed to use your benefits."

> "2 items in your cart are HSA/FSA eligible. Use your pre-tax dollars at checkout."

## How to implement

### 1. Check cart eligibility

Use the [`check_truemed_checkout_method`](/api-reference/product-catalog/truemed-checkout-method)
endpoint to evaluate the items in the customer's cart. Pass all cart line items and receive
a decision on whether Truemed should be shown as a checkout option.

```js
// Called when the cart is updated or the checkout page loads
const response = await fetch('https://api.truemed.com/api/v1/product_catalog/truemed_checkout_method', {
  method: 'POST',
  body: JSON.stringify({
    items: cart.lineItems.map(item => ({
      sku: item.sku,
      name: item.name,
    })),
  }),
});
const { enabled } = await response.json();
```

### 2. Conditionally render the message

If the cart contains eligible items, display your HSA/FSA messaging banner and the
Truemed payment option. If not, hide it—don't show the option for carts that won't qualify.

```js
if (enabled) {
  document.getElementById('truemed-checkout-banner').style.display = 'block';
}
```

### 3. Tie it to cart changes

Re-check eligibility whenever the cart changes (items added, removed, or quantity updated)
so the messaging stays accurate throughout the checkout flow.

> **Note**
>
> The `check_truemed_checkout_method` endpoint evaluates eligibility based on item type—
> it does not factor in prices, discounts, or additional charges. Use it to make display
> decisions; the customer's actual checkout eligibility is confirmed during the Truemed
> payment session flow.

## Placement recommendations

| Location                     | Message type                                              |
| ---------------------------- | --------------------------------------------------------- |
| Cart page                    | Banner above checkout button                              |
| Checkout page (payment step) | Listed alongside other payment methods with HSA/FSA badge |
| Order confirmation email     | "You used your HSA/FSA — great choice!" reinforcement     |