{"openapi":"3.1.0","info":{"title":"API Reference","version":"1.0.0"},"paths":{"/payments/v1/create_payment_session":{"post":{"operationId":"paymentSessions_createPaymentSession","summary":"Create a new payment session for HSA/FSA checkout","description":"Create a payment session to begin the \"Pay with Truemed\" checkout flow. Call this endpoint after the customer clicks \"Checkout with Truemed\" or similar. The customer is redirected to Truemed to complete a health survey and enter HSA/FSA card details, then redirected back to your site via the provided `success_url` or `failure_url`.\n\nThe outcome is communicated asynchronously via the\n[`payment_session_complete`](/api-reference/payment-sessions/payment-session-completed-webhook) webhook.\n\n## Request Notes\n\n- `total_amount` **(Required)**: The total amount in cents to charge the user, inclusive of discounts, shipping, taxes, and other fees being collected by the partner\n  - **IMPORTANT**: total_amount must equal the sum of:\n    - `payment.amount_details.total_additional_charges`\n    - `payment.amount_details.total_discounts`\n    - For each order_item, the sum of:\n      - `item.quantity * item.price`\n      - `item.amount_details.total_additional_charges`\n      - `item.amount_details.total_discounts`\n- `amount_details` **(Required)**: [Read further here](/guides/payment-sessions/itemized-fees-and-discounts)\n- `success_url` **(Required)**: Where to redirect the user to after Truemed successfully processes a payment\n  - This is often used to display an order confirmation screen, or similar\n  - **Templating**:\n    - We support limited templating of this URL parameter. Any part of the URL string containing `{{payment_session_id}}` will be replaced by the `id` (UUID) returned by this call.\n    - **IMPORTANT**: The template variable must be EXACTLY `{{payment_session_id}}` - no spaces around the braces on either side.\n  - For unattended payment flows using payment tokens, the meaning of the `success_url` is slightly different. In such cases a payment may fail because the stored payment methods are expired or otherwise declined. When those failures occur, we will return a 422 status with a `redirect_url` to our page for updating stored payment methods. Merchants should email or otherwise notify users of the need to update their stored payment methods using this url. When users successfully complete that page, they will be redirected to the `success_url` provided here.\n- `failure_url` **(Required)**: When the payment fails in an irrecoverable way, or the user is ineligible to spend HSA/FSA funds on the purchase\n  - We attempt to recover from incorrect CVV, or other card detail errors by prompting the user for retry\n  - The exact failure reason will be communicated in the call to the partner's `payment_session_complete` callback\n  - **Templating**:\n    - We support limited templating of this URL parameter. Any part of the URL string containing `{{payment_session_id}}` will be replaced by the `id` (UUID) returned by this call.\n    - **IMPORTANT**: The template variable must be EXACTLY `{{payment_session_id}}` - no spaces around the braces on either side.\n  - For unattended payment flows using payment tokens, the meaning of the `failure_url` is slightly different. In such cases a payment may fail because the stored payment methods are expired or otherwise declined. When those failures occur, we will return a 422 status with a `redirect_url` to our page for updating stored payment methods. Merchants should email or otherwise notify users of the need to update their stored payment methods using this url. When users start but cancel the update before fully completing the process, they will be redirected to the `failure_url` provided here.\n- `customer_state` **(Optional)**: The 2-letter ISO 3166-2:US code for a region, _without the_ US- _prefix_. For example, California should be provided as CA and Rhode Island as RI\n  - If `customer_state` is provided, the state of residence question in the health survey will be prefilled with the full state name that corresponds to the ISO code.\n- `metadata` **(Optional)**: - Will be echoed back in the webhook and detail view if present.\n  - **IMPORTANT**: This must be a string. If you want to include JSON, encode it as a string.\n  - **IMPORTANT**: DO NOT INCLUDE sensitive information in this field.\n- `kind` **(Optional)**: one of the following:\n  - `one_time_payment` **(DEFAULT)**: The charge is not a subscription related charge. This is the default if this field is not set.\n  - `authorization`: A `one_time_payment` authorization hold only, must be manually captured or voided with a follow up API call.\n- `payment_token` **(Conditionally required)**: the ID returned by Truemed on initial recurring charges (when `tokenize=True`).\n  - When `payment_token` is provided, customer identity is derived from the token's user. Any `customer_email` or `customer_name` values in the request are ignored.\n- `tokenize` **(Optional)**: `True` or `False` - set to `True` to enable subsequent charges. Must be `False` if `payment_token` is provided.\n- `request_multicapture` **(Optional)**: `True` or `False` - set to `True` to request [multi-capture](/guides/setup/api/payment-sessions/manual-delayed-capture#capturing-in-multiple-parts) on this authorization. The card network confirms availability for each transaction; check `multicapture_available` on the authorized webhook before you split an order.\n  - **IMPORTANT**: This field requires multi-capture to be enabled on your sales channel, and cannot be combined with `tokenize=true` or `payment_token`. Otherwise the request fails with `FeatureNotEnabled`.\n  - Only meaningful with `kind=authorization`. On a `one_time_payment` the charge captures immediately, so the flag is accepted but does nothing.\n  - When `multicapture_available` is `false`, the session supports a single capture, and a capture sent with `final: false` is rejected.\n- `display_next_bill_info` **(Optional)**: Partners should only provide this field if they want to initiate a free trial subscription for the customer. The information in this object will be displayed on Truemed's checkout page to provide more context to the customer when submitting their payment method(s)\n  - `total_amount`: The amount in cents the customer will be charged when the free trial period ends\n  - `date`: A YYYY-MM-DD string indicating the date the free trial period ends\n  - **IMPORTANT**: This field requires `tokenize=true` and `total_amount=0` (free trial subscriptions only)\n\n### Idempotency\n\n`idempotency_key` lets you safely retry a request (e.g. after a network blip, or to dedupe between concurrent retries) without creating a duplicate payment session.\n\n- **Identical retry**: If you call this endpoint again with the same `idempotency_key` and the same key request fields, you'll get back the same payment session `id` (HTTP `200`). The session is **not** re-created.\n- **Reused key with a different request**: If you reuse the `idempotency_key` but change one of the key fields, you'll get a `400 IdempotencyViolation`. The `message` will name the specific field(s) that diverged so you can debug.\n\n**Fields compared** (must match the original request to be treated as a retry):\n\n- `customer_email` — compared case-insensitively (`User@example.com` matches `user@example.com`)\n- `total_amount`\n- `success_url`, `failure_url`\n- `order_items` (name, sku, quantity, price, `item_id`, and item-level amount details)\n- `kind`\n- `payment_token` (when present on the retry)\n- `display_next_bill_info.total_amount`, `display_next_bill_info.date`, and the implied `is_free_trial` flag (when present on the original)\n\n**Fields not compared** — differences in these fields do not affect idempotency matching:\n\n- `customer_name`\n- `metadata`\n- `customer_state`\n- `survey_config`\n- `billing_name`, `billing_address`, `shipping_name`, `shipping_address`\n- `request_multicapture`, `test_config`, and other request configuration\n\nIf a retry sends different values for any of these, the original payment session is still returned — the new values are not applied to the existing session.\n\n**How `order_items` is compared.** Line order does not matter, and neither does the order of the entries inside a line's `amount_details`. A cart carrying the same line twice must replay with it twice. `item_id` is part of a line's identity: omit it and Truemed provisions one, so a retry that adds your own id is rejected. Send the same `item_id` on both calls, or omit it on both.\n\nThe `400` carries no payment session `id`. If you lost the original response, find the session with [list payment sessions](/api-reference/payment-sessions/list-payment-session).\n\n### iFrame Payment Session\n\nIf `use_iframe` is set to `true`, `redirect_url` will be iframe-compatible. When the customer\nfinishes, the iframe posts one completion message to your page:\n\n```json\n{ \"success\": true, \"redirectUrl\": \"https://example.com/success\" }\n```\n\n`redirectUrl` echoes the `success_url` or `failure_url` from your request, matching `success`. See\nthe [Embedded Checkout guide](/guides/setup/api/payment-sessions/i-frame-payment-session) for how to\nrender the flow, validate the message's origin, and handle it.\n\n## Response Notes\n\n### Success Case\n\nHTTP Status: `200`\n\n- `id` - the unique ID for this checkout session. The same `id` will be returned if the endpoint is called again with the same `idempotency_key` **and** the request's key fields match the original (see [Idempotency](#idempotency) below).\n  - Associate this id with your internal representation of a checkout session, if applicable\n- `redirect_url` - the URL that the partner should redirect the customer to\n  - Typically this would be done after the user presses a \"Checkout with Truemed\" button or similar on the partner's site\n  - The user will perform the following steps on Truemed's platform\n    - Complete a health survey to determine eligibility to spend HSA/FSA funds on the purchase\n    - Enter HSA/FSA card details, and confirm the purchase\n  - The status of the checkout session will be communicated back to the partner via the `payment_session_complete` webhook\n\n### Bad Request\n\nHTTP Status: `400`\n\nIf a field is missing or the request is otherwise can't be processed, we'll return a `400` with the following fields:\n\n- `error`: Can be one of:\n  - `MissingRequiredParameter`: A required field is not present in the request\n  - `InvalidRequestParameter`: A field value is invalid (e.g., malformed email, invalid URL)\n  - `TotalAmountInvalid`: The `total_amount` field is either:\n    - Not greater than or equal to the sum of the `object_item` `amount` fields\n    - The `total_amount` is 0\n    - The `total_amount` is negative\n  - `OrderItemsInvalid`: The `order_items` array failed validation\n  - `IdempotencyViolation`: An `idempotency_key` was reused with different request parameters. The `message` names the specific field(s) that diverged from the original request. See [Idempotency](#idempotency) below for which fields are compared.\n  - `ServerError`: There was an internal server error.\n    - Requests can be retried as long as the `idempotency-key` is the same.\n  - `SessionPending`: A charge to the existing payment method is unable to be processed because the user has yet to enter a payment method.\n    - This is only possible when creating a charge using a `payment_token` before the user has finished the initial checkout (for the `payment_session` created with `tokenize=True`).\n  - `TokenizeNotSupported`: Both `tokenize=True` and `payment_token` were set. You can't tokenize a payment session if the session is being billed back to a prior one using a `payment_token`.\n  - `FeatureNotEnabled`: A required merchant feature is not enabled - for example Stripe configuration, or `request_multicapture=true` on a sales channel without multi-capture enabled or in combination with `tokenize` or `payment_token`\n- `message`: A human-readable description of the error\n\n### Unprocessable Entity\n\nHTTP Status: `422`\n\nIf a `payment_token` was provided and the `token` requires customer intervention before it can be used again, a `422` will be returned.\n\n- `next_action`: The action the customer must take. Can be one of the following:\n  - `UpdatePaymentMethod`: Customer must enter a new payment method.\n  - `TakeHealthSurvey`: Customer must retake the health survey\n- `redirect_url`: Contains a URI through which the customer can correct the `payment_token`.","tags":["paymentSessions"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentSessionResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentSessionBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for CreatePaymentSessionRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentSessionRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/payments/v1/payment_session/{business_id}":{"get":{"operationId":"paymentSessions_retrievePaymentSession","summary":"Retrieve the current status of a payment session","description":"Get the status of a payment session based on the payment session id.\n\n## Request Notes\n\nTo get the status of a Payment Session object, call the detail view with the ID of the\npayment session returned by the `create_payment_session` endpoint.\n\n## Response Notes\n\n- `status` - the status of the initial payment, an enum with one of the following values:\n  - `captured` - payment has completed\n  - `canceled` - payment was canceled before the user entered payment information via a call\n    to our cancel API.\n  - `pending` - payment has not been successfully completed yet.\n  - `processing` - the customer has entered their payment information, but it is under review\n    by Truemed\n    - Any customer facing communication should indicate successful payment at this point,\n      such as on the `success_url`.\n    - The merchant should not fulfill the order until the Payment Session Webhook indicates\n      that the payment has been captured.\n  - `rejected` - While in the `processing` state, Truemed reviewed and rejected the payment\n    session.\n    - The merchant should not fulfill these orders, and should communicate failure to the\n      user via email.\n  - `authorized` - an auth hold has been placed on the customer's card.\n  - `authorization_voided` - the auth hold has been voided via a call to our Void Session api.\n  - `authorization_expired` - the auth hold has expired and we were not able to re-auth the\n    transaction. This state is only possible after a call to our Manual Capture api, and is\n    only set after we attempt a re-auth hold on the existing payment method.\n- `status_summary` - a summary of the overall payment session. This includes refunds and\n  disputes, and is an enum of the following values:\n  - `Incomplete` - Customer started checkout but did not complete\n  - `Authorized` - Auth hold placed on customer's payment method\n  - `Captured` - Payment has been processed\n  - `Partially Captured` - The payment has been partially processed\n  - `Refunded` - The full amount charged in this order has been refunded to customer\n  - `Partially Refunded` - Part of the original order has been refunded to the customer\n  - `Disputed` - The transaction has been disputed by the customer\n  - `Voided` - The payment was voided by the partner\n  - `Expired` - The partner did not capture an authorized session before it expired\n- `order_items` - a list of order items, with the following fields per item:\n  - `item_id` - The item_id that uniquely identifies this item. If the client specified one\n    when creating the Payment Session, that item_id will be returned.\n  - `name` - the name of the item\n  - `price` - the unit price in cents charged for the item\n  - `quantity` - the number of this item in the cart\n  - `sku` - the partner's SKU for the item\n  - `total_refundable` **(Optional)** - If the Payment Session has been captured, this value\n    will be the remaining amount refundable for this item. Otherwise it will not be included.\n  - `quantity_refundable` **(Optional)** - If the Payment Session has been captured, this\n    value will be the remaining quantity refundable for this item. Otherwise it will not be\n    included.\n  - `total_capturable` **(Optional)** - If the Payment Session is an authorization and is\n    currently authorized, this value will be the remaining amount capturable for this item.\n    Otherwise it will not be included.\n  - `quantity_capturable` **(Optional)** - If the Payment Session is an authorization and is\n    currently authorized, this value will be the remaining quantity capturable for this item.\n    Otherwise it will not be included.\n- `capture_amount` **(Optional)** - the amount of funds actually captured.\n  - For payment sessions of `kind=one_time_payment` this field will always be present and\n    will be the same as `authorize_amount`.\n  - For payment sessions of `kind=authorization` this field will not be present until the\n    funds have been captured (via a call to Manual Capture).\n- `capture_failed_on` **(Optional)** - the time the capture permanently failed. Present only for the\n  rare session whose capture could not be completed; null otherwise.\n- `capture_failed_details` **(Optional)** - a generic message indicating the capture could not be\n  completed. Null when `capture_failed_on` is null.\n- `capture_failed_amount_collected` **(Optional)** - funds already collected on a partially-charged\n  split payment before the capture failed; null otherwise.","tags":["paymentSessions"],"parameters":[{"name":"business_id","in":"path","description":"The payment session ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSessionDetailResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievePaymentSessionBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievePaymentSessionNotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/payments/v1/payment_sessions":{"get":{"operationId":"paymentSessions_listPaymentSession","summary":"List payment sessions with filtering and pagination","description":"All payment sessions created with the Create payment session API call can be listed\nvia a GET to `/payments/v1/payment_sessions`.\n\nBy default, all payment sessions, including those that are pending, created as auth\nholds and those that have been manually voided or captured will be listed. Options are\nprovided for granular filtering, pagination, and search.\n\n## Pagination\n\nAll results are paginated, with 30 per page. The response field `pagination` contains\ninformation on how many payment sessions there are and how many pages are available\nfor the filtered query.\n\n## Sorting\n\nPayment sessions are sorted by the date they are created, with newer ones being returned first.\n\n# Response Notes\n\nThe response is an array of payment sessions in the `payment_sessions` key. A few things to point out about\nthe response payload:\n\n- `order_items` **(Optional)** - The list of the current state of the order items passed into\n  `create_payment_session` if `include_order_items` is True\n  - `total_refundable` **(Optional)** - If the Payment Session has been captured, this value\n    will be the remaining amount refundable for this item. Otherwise it will not be included.\n  - `quantity_refundable` **(Optional)** - If the Payment Session has been captured, this\n    value will be the remaining quantity refundable for this item. Otherwise it will not be\n    included.\n  - `total_capturable` **(Optional)** - If the Payment Session is an authorization and is\n    currently authorized, this value will be the remaining amount capturable for this item.\n    Otherwise it will not be included.\n  - `quantity_capturable` **(Optional)** - If the Payment Session is an authorization and is\n    currently authorized, this value will be the remaining quantity capturable for this item.\n    Otherwise it will not be included.\n- `authorized_on` - the date the payment was authorized in ISO 8601 format\n  - example: \"2024-06-13T16:03:07.473Z\"\n  - For `kind`: `one_time_payment`, this will be the same as `captured_on`\n- `refund_amount` **(Optional)** - int\n  - Only present when `summarize_refunds=True` is included in the request.\n  - The sum of processed refunds for the payment session, **in cents**\n- `truemed_fee` **(Optional)** - decimal - **in dollars**\n  - Only present when `include_truemed_fee=True` is included in the request.\n  - The fee collected by truemed for this payment session.\n\nThe response also includes a `pagination` object:\n\n```\n{\n  \"pagination\": {\n    \"current_page\": 1,\n    \"page_size\": 30,\n    \"count\": 54,\n    \"last_page\": 2\n  },\n  \"payment_sessions\": [\n    ]\n}\n```\n\n- `current_page` - the page requested. If none was provided, this will default to 1.\n- `page_size` - the number of `payment_session`'s per page, which is always 30.\n- `count` - the total number of `payment_session`'s matching the filters provided.\n- `last_page` - the last page.\n  - You can iterate through pages by providing integers up to `last_page` in the `page`\n    parameter.","tags":["paymentSessions"],"parameters":[{"name":"page","in":"query","description":"Optional field indicating which page to access. Defaults to 1.","required":false,"schema":{"type":"integer"}},{"name":"page_size","in":"query","description":"Optional field indicating the number of records per page. Defaults to 30.","required":false,"schema":{"type":"integer"}},{"name":"filter_pending","in":"query","description":"Filter out pending payment sessions.","required":false,"schema":{"type":"boolean"}},{"name":"filter_voided","in":"query","description":"Filter out voided payment sessions.","required":false,"schema":{"type":"boolean"}},{"name":"include_metadata","in":"query","description":"Include metadata field in the response.","required":false,"schema":{"type":"boolean"}},{"name":"include_order_items","in":"query","description":"Include order items in the response.","required":false,"schema":{"type":"boolean"}},{"name":"search","in":"query","description":"Search by payment session ID, user business ID, email, or name.","required":false,"schema":{"type":"string"}},{"name":"created_on_start","in":"query","description":"Filter payment sessions created on or after this date (ISO 8601 format).","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"created_on_end","in":"query","description":"Filter payment sessions created on or before this date (ISO 8601 format).","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"captured_on_start","in":"query","description":"Filter payment sessions captured on or after this date (ISO 8601 format).","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"captured_on_end","in":"query","description":"Filter payment sessions captured on or before this date (ISO 8601 format).","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"include_refunds","in":"query","description":"Include refund details in the response (default: true).","required":false,"schema":{"type":"boolean"}},{"name":"include_disputes","in":"query","description":"Include dispute details in the response (default: true).","required":false,"schema":{"type":"boolean"}},{"name":"kind","in":"query","description":"Filter by payment kind (comma-separated list: one_time_payment, authorization).","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"status","in":"query","description":"Filter by payment session status (comma-separated list).","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"summarize_refunds","in":"query","description":"Include refund_amount summary instead of full refund details.","required":false,"schema":{"type":"boolean"}},{"name":"include_truemed_fee","in":"query","description":"Include Truemed fee in the response.","required":false,"schema":{"type":"boolean"}},{"name":"payment_token","in":"query","description":"Filter payment sessions by payment token ID.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSessionListResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPaymentSessionBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/payments/v1/payment_session/{business_id}/capture":{"post":{"operationId":"paymentSessions_capturePaymentSession","summary":"Capture a previously authorized payment session","description":"The `capture_payment_session` endpoint should be called after [`create_payment_session`](/api-reference/payment-sessions/create-payment-session)\nhas been called with `kind` of `authorization` as outlined in [Manual/Delayed Capture](/guides/setup/api/payment-sessions/manual-delayed-capture).\n\nThe failure or success status is communicated to the partner via a [`payment_session_complete`](/api-reference/payment-sessions/payment-session-completed-webhook)\nwebhook as before.\n\n## Request Notes\n\n- **`total_amount`** *(Required)* - The amount in cents to charge, including any tax and fees you're collecting. Captures together can't exceed the session's `total_amount`; to collect more, void and create a new session.\n- **`item_details`** *(Required)* - The units in this capture, each referencing an `item_id` from the session's `order_items`.\n  - Without multi-capture, an item keeps the same per-unit cost (`total / quantity`) in every capture, and `total_amount` must equal the sum of the `total` values, except on a single capture of the whole order, the only capture that may also carry order-level shipping, fees and discounts.\n- **`final`** *(Optional, defaults to `true`)* - `false` keeps the rest of the authorization for a later capture. It requires [`multicapture_available`](/api-reference/payment-sessions/payment-session-completed-webhook) to be `true` on the authorized `payment_session_complete` webhook; otherwise the request fails with `ValidationError`.\n  - A final capture releases whatever it doesn't collect.\n  - To close without collecting more, send `total_amount: 0` with empty `item_details` after at least one earlier capture, or [void the session](/api-reference/payment-sessions/void-payment-session).\n- **`amount_details`** and **`item_details[].amount_details`** *(Optional, multi-capture only)* - The charges and discounts this capture carries, in the same shape as at session creation. Other sessions reject them with `InvalidItemizedData`.\n\n## Multi-capture sessions\n\nMulti-capture must be enabled for your integration by Truemed Support. See [Capturing in multiple parts](/guides/setup/api/payment-sessions/manual-delayed-capture#capturing-in-multiple-parts) for setup and integration guidance.\n\nAfter authorization, split a session only when [`multicapture_available`](/api-reference/payment-sessions/payment-session-completed-webhook) is `true` on the `payment_session_complete` webhook. When it's `false`, a `final: false` capture is rejected and a final capture releases whatever it doesn't collect.\n\nEach capture may include any remaining quantity of an order item, down to a single unit, and items may be captured in any order. Across all captures, the total quantity for an `item_id` cannot exceed its quantity in the original order.\n\nSend `final: false` when more captures will follow. `final: true` closes the session and releases any uncollected amount. A capture also closes the session if it collects the entire remaining balance.\n\n**Without `amount_details`**, Truemed infers the order-level part:\n\n- `total_amount` can be up to these units' session totals plus the net order-level money still owed on the session (`order_level_charges_remaining` less `order_level_discounts_remaining`).\n- Below the units' totals, the session's order-level discounts are applied: up to these items' share on a non-final capture, up to all that remain on a final. Anything lower is money you chose not to collect, and it can't be captured later.\n\n**With `amount_details`**, you declare it. If a session's first capture sends no `amount_details`, later captures can't send them either; a final capture without `amount_details` collects what's left. A session whose first capture declares can mix declared and inferred captures.\n\n- `amount_details` can be declared at the top level of the capture or per item.\n- At the item level, the unit price × `quantity`, plus its charges, minus its discounts, must equal its `total`. A discount declared on an item belongs to that item.\n- At the capture level, the items' totals plus its charges minus its discounts must equal `total_amount`.\n- In a capture that declares `amount_details` at either level, an item that omits `amount_details` or sends `amount_details: {}` uses the item-level charges and discounts provided to [`create_payment_session`](/api-reference/payment-sessions/create-payment-session). Its `total` must equal the unit price × `quantity`, plus the captured units' share of those charges, minus their share of those discounts. At the capture level, omitting `amount_details` or sending `amount_details: {}` declares no order-level charges or discounts.\n- Declared charges must fit within [`order_level_charges_remaining`](/api-reference/payment-sessions/payment-session-completed-webhook), and declared discounts must fit within [`order_level_discounts_remaining`](/api-reference/payment-sessions/payment-session-completed-webhook); the two are checked separately. An item's discount beyond what's left is money you chose not to collect on that item; a capture-level one is rejected.\n\n**Partial quantities:** the cumulative limit is the captured units' proportional share of `max_capture_amount`, rounded half up, plus up to one cent per captured unit, and never more than `max_capture_amount`. For example, when `max_capture_amount` is `1000` and `quantity` is `3`, the item's captures may total up to `334` after one unit, `669` after two, and `1000` after all three. See [Partial quantities: why a rounding rule, and which one](/guides/setup/api/payment-sessions/manual-delayed-capture#partial-quantities-why-a-rounding-rule-and-which-one).\n\n**Card minimum:** no card is charged less than \\$0.50 in one capture, so a capture under \\$0.50 in total is rejected.\n\n## Response Notes\n\n### Success Case\n\nHTTP Status: `200`\n\n- **`id`** - The ID of the payment session that was captured, the same value that `create_payment_session` returned.\n- **`capture_id`** - The ID of this capture. Pass it as `capture_id` to [Create Refund](/api-reference/payment-sessions/create-refund) to refund against this capture. The same ID is returned if the endpoint is called again with the same `idempotency_key`. It is omitted for a zero-amount final capture, which only releases the uncaptured remainder.\n\n### Bad Request\n\nHTTP Status: `400`\n\nIf a field is missing or the request otherwise can't be processed, we'll return a `400` with the following fields:\n\n- **`error`** - can be one of:\n  - `MissingField`: One of the required fields is not present in the request.\n  - `TotalAmountInvalid`: The amount can't be accepted: more than these items and the order-level money still owed allow, more than is still authorized, negative, under \\$0.50, a zero amount where it isn't allowed, or declared amounts that don't add up to `total_amount` or don't fit the order-level charges or discounts still unused. On a multi-capture session the `message` explains what to change. A rejected capture records nothing.\n  - `PaymentSessionDoesNotExist`: The `payment_session_id` does not exist.\n  - `ServerError`: There was an internal server error. Requests can be retried as long as the `idempotency_key` is the same.\n  - `SessionVoided`: The session has already been voided via a call to [`/payment_session/{payment_session_id}/void`](/api-reference/payment-sessions/void-payment-session).\n  - `SessionExpired`: The auth hold has expired and we were unable to recharge the customer for the amount requested.\n  - `SessionPending`: The user hasn't completed the Truemed checkout flow (survey, CC entry form).\n  - `SessionCaptured`: You're attempting to capture a payment_session that has already been captured. This error **will never** be returned if reissuing a capture call **with the same idempotency key** - the return value will be the same as the first call.\n  - `ImmediateCapture`: The payment session wasn't created with `kind=authorization`.\n  - `InvalidItemizedData`: An `item_details` entry is invalid (a bad quantity or total, or more than is left of the item), an item's declared `amount_details` don't add up to its `total`, `amount_details` on a session without multi-capture, or, on a multi-capture session, the same `item_id` sent twice, or `amount_details` on a capture after the session's first capture declared none. The `message` names the item and the value.\n  - `ValidationError`: `final: false` on a session without multi-capture.\n  - `InvalidRequestParameter`: `amount_details` is malformed, for example `total_discounts` without `discounts_details`.\n- **`message`** - Indication of which field was missing, details on how the total amount was invalid, or details on voided sessions.","tags":["paymentSessions"],"parameters":[{"name":"business_id","in":"path","description":"The UUID of the payment session returned by create_payment_session.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSessionCaptureResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapturePaymentSessionBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for PaymentSessionCaptureRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSessionCaptureRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/payments/v1/payment_session/{business_id}/cancel":{"post":{"operationId":"paymentSessions_cancelPaymentSession","summary":"Cancel a pending payment session before completion","description":"The `cancel` API exists so that merchant partners can manage cart lifecycles.\nIn an ideal world, the customer experience would roughly be outlined by:\n\n<Steps>\n  <Step title=\"Customer adds items to cart\">\n    The customer browses your store and adds items to their shopping cart.\n  </Step>\n  <Step title=\"Customer initiates Truemed checkout\">\n    The customer clicks the \"Checkout with Truemed\" button to begin the payment process.\n  </Step>\n  <Step title=\"Create payment session\">\n    The partner calls `create_payment_session`, and an inventory lock is placed on the items in the cart to ensure they can be fulfilled when payment is captured.\n  </Step>\n  <Step title=\"Customer completes checkout\">\n    The customer completes the survey and enters payment information in the Truemed interface.\n  </Step>\n  <Step title=\"Fulfill the order\">\n    The merchant listens for the Partner webhook callback and fulfills the inventory locked above.\n  </Step>\n</Steps>\n\n## Deviations from the Happy Path\n\nIn the flow above, there are a few steps the customer can take that would void the\nexisting session.\n\nThe customer could:\n\n- **Navigate away from Truemed during the survey, and modify their cart.** This\n  dictates a new idempotency key (e.g.: a new `payment_session`). As part of clean up\n  and to ensure the customer can't navigate back to the now outdated survey link, the\n  old payment session must be canceled.\n- **Take too long to complete the survey and finalize payment.** The merchant may wish\n  to cancel the `payment_session` and release the lock on inventory as it appears the\n  customer is no longer interested in making the purchase.\n\n## Customer Experience for Canceled Sessions\n\nIf this API is used to cancel a pending session, the customer will be shown a page\nindicating that the checkout session has timed out and a link will be provided to\n\"Go back to checkout\" which will return them to the `failure_url` provided in\n`create_payment_session`.\n\nThe page presented by the `failure_url` should be generic and display a relevant\nmessage asking the customer to checkout again if it has been too long.\n\n\"Too long\" is defined by our merchant partners depending on their inventory management.\nWe recommend 48-72 hours as customers will sometimes move funds into their HSA prior to\ncompleting checkout.\n\n# API Overview\n\nThe `cancel_payment_session` endpoint can be called after `create_payment_session` has\nbeen called, but before the customer has entered their payment information, for either\n`kind=authorization` or `kind=one_time_payment`.\n\nThe failure or success status is communicated to the partner via a webhook\n`payment_session_complete` as before.\n\n## Request Notes\n\nThere are no required fields for the request body, you simply call the endpoint with\nthe `payment_session_id` in the URL. The cancel API can be called repeatedly without an\nidempotency key and the same result will be returned.\n\n**Important** - you will only get a single callback queued on successful cancelation\n(albeit, invoked multiple times in the case of failures) as outlined in Partner webhook,\neven if you call the cancel endpoint multiple times.\n\n## Response Notes\n\n### Success Case\n\nHTTP Status: `200`\n\nNote: `order_items.sku` - the partner's SKU for the item. The value of this field will\nbe the SKU provided by the partner in the [`create_payment_session`](/api-reference/payment-sessions/create-payment-session)\nrequest. If the partner does not provide a SKU value for an item on creation of the payment, this\nkey will not be present.\n\n### Failure Case\n\nHTTP Status: `400`\n\nIf a field is missing or the request otherwise can't be processed, we'll return a `400`\nwith the following fields:\n\n- `error` - can be one of:\n  - `InvalidPaymentId` - the `payment_session_id` does not exist.\n  - `ServerError` - There was an internal server error. Requests can be retried.\n  - `SessionCaptured` - The session has already been captured via a call to\n    `/payment_session/{payment_session_id}/capture` and can no longer be canceled. In\n    this case, to return funds to the customer, you'll need to issue a refund.\n  - `SessionAuthorized` - The session has already been authorized. The user has\n    completed the survey and entered their credit card information. In this case, the\n    session should be voided via the Void Session API, and the customer should be\n    informed that their order has been canceled.\n- `message` - Details on the above conditions.","tags":["paymentSessions"],"parameters":[{"name":"business_id","in":"path","description":"The payment session ID to cancel.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSessionCancelResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelPaymentSessionBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/payments/v1/payment_session/{business_id}/void":{"post":{"operationId":"paymentSessions_voidPaymentSession","summary":"Void an authorized payment session before capture","description":"The `void_payment_session` endpoint should be called after\n[`create_payment_session`](/api-reference/payment-sessions/create-payment-session)\nhas been called with `kind` of `authorization` as outlined in [Create Payment Session\n(Manual Capture)](/guides/setup/api/payment-sessions/manual-delayed-capture).\n\nOn a [multi-capture](/guides/setup/api/payment-sessions/manual-delayed-capture#capturing-in-multiple-parts)\nsession that is `partially_captured`, a void keeps the amount already captured and releases the\nuncaptured remainder. The session then reports `captured`, and you can refund its captures.\n\nA void is rejected while a capture on the session is still processing. Retry after that capture\ncompletes.\n\nThe failure or success status is communicated to the partner via a\n[`payment_session_complete`](/api-reference/payment-sessions/payment-session-completed-webhook) webhook as before.\n\n## Response Notes\n\n### Success Case\n\nHTTP Status: `200`\n\n- `id` - the unique ID for this void session. This same ID will be returned if the endpoint\n  is called with the same `idempotency_key`\n  - Associate this id with your internal representation of a checkout session, if applicable\n\n### Failure Case:\n\nHTTP Status: `400`\n\nIf a field is missing or the request is otherwise can't be processed, we'll return a `400`\nwith the following fields:\n\n- `error` - can be one of:\n  - `MissingField`: one of the required fields is not present in the request\n  - `PaymentSessionDoesNotExist` - the `payment_session_id` does not exist.\n  - `ServerError`: There was an internal server error.\n    - Requests can be retried as long as the `idempotency-key` is the same.\n  - `SessionCaptured` - The session has already received a final capture via a call to\n    [`/payment_session/{payment_session_id}/capture`](/api-reference/payment-sessions/capture-payment-session)\n    and can no longer be voided.\n    - In this case, to return funds to the customer, you'll need to issue a refund.\n  - `SessionPending` - The survey hasn't been completed by the customer, and no auth hold\n    has been placed, so there is no auth hold to void yet.\n  - `ImmediateCapture` - The caller is attempting to void a payment_session that wasn't\n    created with `kind=authorization`\n  - `ValidationError` - A capture on the session is still processing. Retry the void after\n    that capture completes.\n- `message`:\n  - Indication of one of the following:\n    - Which field was missing\n    - Details on how the total amount was invalid\n    - Details on captured sessions.","tags":["paymentSessions"],"parameters":[{"name":"business_id","in":"path","description":"The UUID of the payment session returned by create_payment_session.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSessionVoidResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidPaymentSessionBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for PaymentSessionVoidRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSessionVoidRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/payments/v1/refund":{"post":{"operationId":"paymentSessions_createRefund","summary":"Create a full or partial refund for a captured payment","description":"Use this endpoint to refund payments Truemed has already processed on your behalf. Partial refunds are supported.\n\n## Request Notes\n\n<Warning>\nThe amount requested must be less than or equal to the total amount that the\npayment was originally created with.\n</Warning>\n\n### Itemizing a refund\n\n`amount` is what Truemed refunds. `item_details` tells Truemed how to attribute that amount across\nthe order's lines.\n\n- Set each `item_details[].total` to the amount you are refunding for that line. It cannot exceed\n  that item's `total_refundable` from\n  [Get Payment Status](/api-reference/payment-sessions/retrieve-payment-session). When a capture declared\n  tax or shipping on the item, `total_refundable` includes it, so refunding the item returns its tax and\n  shipping with it.\n- Set `item_details[].quantity` to 0 to refund dollars without units. Use this for the rest of a line\n  after an earlier partial refund already returned its units. The dollars stay on that line, and\n  its eligibility determines how Truemed splits the refund across cards.\n- Across all lines, the totals must not sum above `amount`.\n- The totals may sum below `amount`. Truemed applies the remainder to the capture the refund targets\n  (see [Multi-capture sessions](#multi-capture-sessions)).\n\n### Multi-capture sessions\n\nA refund on a session with more than one capture, or on a `partially_captured` session, needs either\n`item_details` or `capture_id` to say where the money comes from.\n\n- **With `item_details`:** Truemed refunds each item from the captures that took it, so one refund can\n  cover items from several captures. When an item's units span captures, Truemed refunds units from a\n  capture that recorded them at the unit price you're refunding, and otherwise the oldest capture's\n  units first. If an item doesn't fit what its captures still have refundable, Truemed\n  rejects the refund with `InvalidItemizedData`. A `quantity: 0` line refunds dollars from the one\n  capture of that item with money left; when more than one has money left, pass `capture_id`.\n- **With `capture_id`:** the refund applies to that capture only. Use the `capture_id` from the capture\n  response, or `captures[].id` from\n  [Get Payment Status](/api-reference/payment-sessions/retrieve-payment-session). Use it to refund\n  shipping or another amount with no line item, or to choose which capture an item's units come from.\n- Without `item_details`, pass `capture_id` when any capture did not complete. With `item_details`,\n  Truemed refunds only money that completed captures collected.\n- You can refund while the session is still `partially_captured`. Every capture has already charged\n  the customer, so the refund returns that money and the uncaptured remainder stays held for later\n  captures. Truemed rejects the refund if another capture is still processing.\n- When the item totals sum below `amount`, the remainder comes from the capture the refund names, or\n  without `capture_id`, from the oldest capture with money left.\n- A refund reverses what each capture recorded for the units. Units of one item captured in different captures may have been captured for different amounts.\n- A refund never frees up authorization. Captures after a refund are still limited to the amount that\n  was never captured.\n\n### Order-level charges and discounts\n\n`create_payment_session` accepts an `amount_details` object at the order level, carrying charges and\ndiscounts that belong to the order rather than to any single line. Shipping and tax behave the same\nway.\n\nBecause Truemed tracks `total_refundable` per item, an order-level amount appears in no item's\n`total_refundable`. For a full refund, set `amount` to the full captured amount and each\n`item_details[].total` to that item's `total_refundable`. The item totals then sum below `amount` by\nthe order-level amount, and Truemed applies that remainder to the capture the refund targets.\n\nOn a partial refund, `amount` sets how much of an order-level charge returns. To return none of it,\nset `amount` equal to the sum of your item totals.\n\n### How much returns to the HSA/FSA card\n\nTruemed derives the eligible amount of a refund from the lines you itemize:\n\n- When every itemized line qualifies for HSA/FSA spending, the whole `amount` counts as eligible.\n- Otherwise Truemed pro-rates `amount` by the eligible ratio of the itemized lines.\n- Eligible spending that the regular card paid returns there first. The remaining eligible amount\n  returns to the HSA/FSA card, and the rest returns to the regular card.\n- Truemed caps each card's share at its remaining refundable balance. If the regular card cannot\n  cover its share, the shortfall returns to the HSA/FSA card within that card's refundable balance.\n\n### Returning an amount that belongs to no item\n\nSome refunds have no line behind them: a goodwill credit for a late delivery, or shipping returned on\nits own. Omit `item_details` and send `amount` alone. An empty `item_details` list is the same request.\n\nWhen a refund names no items, Truemed treats the refund as HSA/FSA-eligible first, up to the remaining\neligible amount. Eligible spending that the regular card paid returns there first. Truemed then uses\nthe HSA/FSA card's refundable balance and returns the rest to the regular card.\nName the lines in `item_details` to allocate the refund by those lines' eligible share.\n\nTwo caps apply either way, both measured against earlier refunds. `amount` cannot exceed what the\norder still has left to return. The refund's eligible amount cannot exceed the eligible amount still\noutstanding. Once no eligible amount remains, later refunds go to the regular card first, subject to\neach card's refundable balance.\n\nItemizing is still worth doing when the refund does follow specific lines. It keeps each line's\nremaining refundable amount accurate and puts the refund against that line on the customer's receipt.\nWithout it the refund is allocated correctly and capped the same way, but it appears as an\norder-level adjustment and the individual lines keep their original refundable amounts.\n\n## Response Notes\n\n### Bad Request\n\nHTTP Status: `400`\n\nIf a field is missing or the request is otherwise can't be processed, we'll return a `400`\nwith the following fields:\n\n- `error` - can be one of:\n  - `MissingField`: one of the required fields is not present in the request\n  - `AmountInvalid`: the `amount` field is negative, 0, or greater than the amount remaining\n    available to refund on the payment\n  - `InvalidItemizedData`: an `item_details` entry is invalid, including, on a multi-capture session, the same `item_id` sent more\n    than once, or an item that doesn't fit what its captures still have refundable. Send each item once, with its\n    combined quantity and total.\n  - `InvalidPaymentId`: requesting to refund a payment that does not exist\n  - `ChargeDisputed`: Payment session has a pending dispute. Can't refund until the dispute is\n    resolved. Lost disputes reduce the remaining refundable amount but no longer block refunds\n    of the undisputed remainder.\n  - `NoSessionCaptures`: The payment session can't be refunded because there haven't been any\n    funds captured.\n  - `ValidationError`: Truemed does not allow the refund in the session's current state. For example,\n    a refund with neither `capture_id` nor `item_details` on a session with more than one capture, on\n    a `partially_captured` session, or on a session with a capture that did not complete. Other causes: another capture or a void is\n    still processing, or the session collected no funds.\n- `message`:\n  - Indication of one of the following:\n    - Which field was missing\n    - Details on how the amount was invalid\n    - Invalid payment id","tags":["paymentSessions"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRefundResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRefundBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for CreateRefundRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRefundRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/payment_tokens/create":{"post":{"operationId":"paymentTokens_createPaymentToken","summary":"Create a payment token for recurring billing","description":"Payment tokens can be created outside of the\n[`create_payment_session`](/api-reference/payment-sessions/create-payment-session) API call. This is most\ncommonly used to support existing subscription customers, allowing them to move their subscriptions\nto their HSA/FSA. Use [`create_payment_session`](/api-reference/payment-sessions/create-payment-session)\nwith `tokenize=True` to create a subscription as part of a checkout flow, such as the first order in a subscription,\nor free trials.\n\n<Info title=\"Entering General Availability in Late October 2025\">\nFor early access, contact your Truemed sales engineer.\n</Info>\n\n# Overview\n\nThis endpoint supports creating a `payment_token` outside of the\n[`create_payment_session`](/api-reference/payment-sessions/create-payment-session) flow,\nand is commonly used to support giving the option to existing subscribers to pay with their\nHSA/FSA. This endpoint can also be used to \"store a payment method with Truemed\" inside of a\nuser dashboard. Subscription free-trials are possible with this endpoint, though we recommend\nusing [`create_payment_session`](/api-reference/payment-sessions/create-payment-session) for trials\nfor consistency with the standard checkout experience.\n\nThis endpoint returns **the ID of a new `provision_token_request`, NOT a new `payment_token`**.\nThe `payment_token` itself will be available upon receipt of the\n[`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook with the corresponding\n`provision_token_request_id`. In order to support backfills in the case of unforeseen downtime\n(a webhook that goes unacknowledged, or is missed), you can also query the status of the\n`provision_token_request` directly as outlined in our\n[`retrieve_provision_token_request`](/api-reference/payment-tokens/retrieve-payment-token-provision-request) docs.\n\n<Warning title=\"This endpoint creates a Token Provision Request NOT a Payment Token\">\nPartners only receive valid `payment_tokens` via the\n[`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook. A payment token can't be issued\nuntil the user successfully completes the tele-health survey and/or enters payment information.\nA callback is used to indicate the customer has completed token setup with Truemed.\n</Warning>\n\nThe diagram below outlines the customer flow when using this endpoint:\n\n<Steps>\n  <Step title=\"Create payment token\">\n    The merchant partner calls `create_payment_token` and receives a `provision_token_request_id` and a `redirect_url`. Persist the `provision_token_request_id` on your customer record before redirecting the customer — it is what links the `payment_token_updated` webhook back to them.\n  </Step>\n  <Step title=\"Customer completes Truemed checkout\">\n    The customer is redirected to the `redirect_url` and completes the tele-health survey and enters payment information.\n  </Step>\n  <Step title=\"Customer returns to merchant\">\n    The customer is redirected to the `success_url` provided by the merchant during the initial call to `create_payment_token`.\n  </Step>\n  <Step title=\"Receive payment token\">\n    Truemed issues a [`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook including the newly provisioned `payment_token`. Link it to existing data in your backend using the `provision_token_request_id` you persisted before the redirect, or the `metadata` you sent on the `create_payment_token` call — the webhook echoes both. It does not carry the customer's email or name.\n  </Step>\n</Steps>\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant Partner\n    participant Truemed\n\n    User->>Partner: Add HSA/FSA card option\n    Partner->>Truemed: create_payment_token request\n    Truemed-->>Partner: redirect_url response\n    Partner-->>User: Redirect to redirect_url\n    User->>Truemed: Complete eligibility survey\n    Note over User: User eligible for HSA/FSA\n    Truemed-->>User: Show payment method form\n    User->>Truemed: Enter HSA/FSA card details\n    Note over User: Payment method stored\n    Truemed->>Partner: payment_token_callback webhook\n    Truemed-->>User: Redirect to success_url\n```\n\n<Note>\nThe webhook/callback is invoked at the same time the user is being redirected to the\n`success_url` - we don't guarantee that it will be called before the redirect.\n</Note>\n\n<Info title=\"Customer In The Flow\">\n**The customer must be in the flow** when calling this endpoint, typically from within a\nsubscription management dashboard.\n</Info>\n\n**Primary Use Cases for this Endpoint:**\n\n- **Supporting existing customers**\n  - You may have existing subscriptions customers that want to move their subscription over to\n    their HSA/FSA card. Providing a \"use your HSA/FSA via Truemed\" button within a subscription\n    management dashboard powered by this endpoint allows you to do that.\n- **Store payment method with Truemed**\n  - Allow customers to add an HSA to their account for future use\n- **Free-trial support (non preferred)**\n  - Allowing customers to qualify for a given subscription and store their payment info for\n    future use.\n  - ⚠️ **We recommend using `create_payment_session` with `tokenize=True` for free trials** as\n    outlined in the main subscription guide to reflect the fact that the customer is \"checking\n    out\", though at no-cost.\n\n<Warning title=\"Truemed does not handle your subscription\">\nAll subscription related fields here are to enhance the customer experience, you'll need your\nown subscription management system.\n</Warning>\n\n## Request Notes\n\n- **success_url** (Required): Where to redirect the user to after the customer successfully\n  completes the tele-health survey and their payment method(s) have been stored.\n  - This is often used to display a confirmation screen, or similar\n- **failure_url** (Required): When the user opts to not complete the tele-health survey or selects\n  \"cancel\" during the process, or when the user is ineligible to spend HSA/FSA funds on the items\n  in the request.\n  - We attempt to recover from incorrect CVV, or other card detail errors by prompting the user\n    for retry\n- **customer_state** (Optional): The 2-letter ISO 3166-2:US code for a region, without the `US-`\n  prefix. For example, California should be provided as `CA` and Rhode Island as `RI`.\n  - If `customer_state` is provided, the state of residence question in the health survey will be\n    prefilled with the full state name that corresponds to the ISO code.\n- **metadata** (Optional): Will be echoed back in the\n  [`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook and detail endpoint if present.\n  - **Important**: This must be a string. If you want to include JSON, encode it as a string.\n  - **Important**: DO NOT INCLUDE sensitive information in this field.\n- **use_iframe** (Optional): Optional query parameter that can be used to modify the response's\n  `redirect_url` so it can be used and communicated with in an iframe.\n\n## iFrame Support\n\nIf `use_iframe` is set to `true`, `redirect_url` will be iframe-compatible. When the customer\nfinishes, the iframe posts one completion message to your page:\n\n```json\n{ \"success\": true, \"redirectUrl\": \"https://example.com/success\" }\n```\n\n`redirectUrl` echoes the `success_url` or `failure_url` from your request, matching `success`. See\nthe [Embedded Checkout guide](/guides/setup/api/payment-sessions/i-frame-payment-session) for how to\nrender the flow, validate the message's origin, and handle it.\n\n## Response Notes\n\n### Success Case\n\n**HTTP Status: 200:**\n\n- **provision_token_request_id**: A UUID that represents this creation request.\n  - This ID is returned along with the provisioned `payment_token` in the\n    [`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook.\n  - You can query the status of this request using the\n    [`retrieve_provision_token_request`](/api-reference/payment-tokens/retrieve-payment-token-provision-request) endpoint.\n- **redirect_url**: Contains a URI through which the customer can complete the `payment_token`.\n\n### Bad Request\n\n**HTTP Status: 400**\n\nIf a field is missing or the request otherwise can't be processed, we'll return a 400 with the\nfollowing fields:\n\n- **error**: Can be one of:\n  - `MissingField`: One of the required fields is not present in the request\n  - `IdempotencyViolation`: An `idempotency_key` was reused with different request parameters or\n    the customer email specified in the request already has a payment token provisioned. Check to\n    see if a [`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook was already received for\n    this customer. To update, use the [`update_payment_token`](/api-reference/payment-tokens/update-payment-token)\n    endpoint.\n  - `WaitingForVerification`: If the lmn verification process has started, you cannot attempt to\n    call this endpoint again for the same customer email. If you receive this error, please wait\n    for the [`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook and then use the\n    [`update_payment_token`](/api-reference/payment-tokens/update-payment-token) endpoint.\n  - `ServerError`: There was an internal server error.\n    - Requests can be retried as long as the `idempotency_key` is the same.\n  - `ValidationError`: There was an issue with the request. Check the `message` field for the\n    exact issue.\n- **message**: Detailed string explaining the reason for the failure.","tags":["paymentTokens"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentTokenResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentTokenBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for CreatePaymentTokenRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentTokenRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/payment_tokens/{payment_token}":{"get":{"operationId":"paymentTokens_retrievePaymentToken","summary":"Retrieve details of a stored payment token","description":"Get data back for a given `payment_token`.\n\nThis endpoint returns details about the `payment_token` specified in the URL path.\nThis endpoint can be used to populate information on a user facing dashboard,\nsuch as the last 4 of the card(s) on file and the expiration dates.\n\nPartners should store expiration dates of cards on file and preemptively encourage\nusers to update their payment methods (using a call to\n[`update_payment_token`](/api-reference/payment-tokens/update-payment-token)) to avoid the failure scenarios\noutlined in our [subscriptions guide](/guides/subscriptions/subsequent-billing-periods).\n\n## Request Notes\n\n**Path Params:**\n- **payment_token** (Required): The `payment_token` string provided by the\n  [`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook.","tags":["paymentTokens"],"parameters":[{"name":"payment_token","in":"path","description":"The payment token to get details for","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTokenResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievePaymentTokenBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievePaymentTokenNotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/payment_tokens":{"get":{"operationId":"paymentTokens_listPaymentToken","summary":"List payment tokens with filtering and pagination","description":"Lists all payment tokens created with the [`create_payment_token`](/api-reference/payment-tokens/create-payment-token)\nand [`create_payment_session`](/api-reference/payment-sessions/create-payment-session) endpoints.\n\nThis endpoint returns a paginated view of all payment tokens\nassociated with the API key used in the request header, sorted by their `created_at`\ndate in descending order. Optional search fields are provided to aid in finding the\ntoken or tokens associated with a given user.","tags":["paymentTokens"],"parameters":[{"name":"page","in":"query","description":"Optional field indicating which page to access. Defaults to 1.","required":false,"schema":{"type":"integer"}},{"name":"page_size","in":"query","description":"Optional field indicating the number of records per page. Defaults to 30.","required":false,"schema":{"type":"integer"}},{"name":"email","in":"query","description":"The email to search for. Partial matches supported, using 'includes' semantics.","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","description":"The name to search for. Partial matches supported, using 'includes' semantics.","required":false,"schema":{"type":"string"}},{"name":"card_expires_before","in":"query","description":"Filter payment tokens with cards expiring on or before this month (YYYY-MM format, e.g., '2024-06')","required":false,"schema":{"type":"string"}},{"name":"lmn_expires_before","in":"query","description":"Filter payment tokens whose `lmn_expires_at` is on or before this date (YYYY-MM-DD format, e.g., '2024-06-15'), including tokens whose LMN has already expired.","required":false,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTokenListResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPaymentTokenBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/payment_tokens/{payment_token}/update":{"post":{"operationId":"paymentTokens_updatePaymentToken","summary":"Update metadata on a stored payment token","description":"Endpoint allowing your customers to update their payment method(s) and/or requalify\nafter a cart change.\n\n## Overview\n\nThe `update_payment_token` endpoint is available for partners to call when customers\nchange the items in their subscription or when they want to update their card(s) on\nfile.\n\nIf `update_card_info=False` and only the `order_items` are being updated, the user\n**may or may not need to retake the tele-health survey** depending on a variety of\nfactors. The `next_action` field in the response body will indicate what the customer\nmust do next, and a `redirect_url` will be provided if the customer needs to take action.\n\nIf you call this endpoint and the `next_action` is not `None`, and a `redirect_url` is\npresent, we don't guarantee you can invoke\n[`create_payment_session`](/api-reference/payment-sessions/create-payment-session) with the `payment_token` until the user\nhas completed the action and you've received the\n[`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook.\n\n<Info title=\"Customer In The Flow\">\nThe customer must be in the flow when calling this endpoint, typically from within a\nsubscription management dashboard.\n</Info>\n\n**Primary Use Cases for this Endpoint:**\n\n- Allowing customers to update their card(s) on file with Truemed\n- Ensuring that the user is still eligible to use their HSA/FSA after a cart/subscription\n  change.\n  - If the customer must requalify by retaking the tele-health survey, the `next_action`\n    will be `HealthSurvey`, which can be taken by redirecting the customer to the\n    `redirect_url`.\n- Changing the email address for a customer's token after the customer changes their email with you.\n\n<Warning title=\"Truemed does not handle subscription management\">\nAll subscription related fields here are to enhance the customer experience, a dedicated\nsubscription management system is needed on the partner's side.\n</Warning>\n\nThe diagram below outlines the customer flow when using this endpoint:\n\n<Steps>\n  <Step title=\"Partner invokes update\">\n    Partner invokes `update_payment_token` triggered by a customer action. The customer is either updating their payment method(s) or has made a change to the items in their subscription.\n  </Step>\n  <Step title=\"Customer completes next action\">\n    The partner redirects the customer to the `redirect_url` if `next_action` is not `None`. The customer completes the required action on Truemed's site.\n  </Step>\n  <Step title=\"Customer returns to partner\">\n    The customer is redirected to the `success_url` upon completion of the next action on Truemed's site.\n  </Step>\n  <Step title=\"Receive update confirmation\">\n    Truemed issues a [`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook indicating that the `payment_token` has been updated.\n  </Step>\n</Steps>\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant Partner\n    participant Truemed\n\n    User->>Partner: Update payment method or cart\n    Partner->>Truemed: update_payment_token request\n    Truemed-->>Partner: redirect_url response\n    Partner-->>User: Redirect to redirect_url (if needed)\n    User->>Truemed: Complete survey or update card\n    Note over User: User eligible or card updated\n    Truemed->>Partner: payment_token_updated webhook\n    Truemed-->>User: Redirect to success_url\n```\n\n<Note>\nThe webhook/callback is invoked at the same time the user is being redirected\nto the `success_url` - we don't guarantee that it will be called before the redirect.\n</Note>\n\n## Updating the Customer's Email\n\nWhen a customer changes their email address with you, send the new address in `customer_email`.\nTruemed sends receipts and Letter of Medical Necessity (LMN) notifications for this token to that\naddress from then on, and returns it as `customer_email` on the token.\n\n- Verify that the new address belongs to the same customer before you send it. Truemed does not\n  verify it.\n- This is the only way to change the token's email. `create_payment_session` ignores\n  `customer_email` when the request includes `payment_token`.\n- The change applies to this token only. The customer's Truemed account and dashboard login do not\n  change. To change their login email, the customer contacts Truemed Support.\n- A request that sends only `customer_email` returns `next_action` `None` and no `redirect_url`.\n\n## Request Notes\n\n- **update_card_info** (Optional): boolean - Indicates if this request is to update the\n  card(s) on file.\n  - If set to `True`, the response will always include `redirect_url` so the user can\n    update their payment method(s) on file with Truemed.\n- **order_items** (Optional): An array of `order_item` objects, each with the following\n  fields:\n  - **name** (Required): string - the name of the item.\n  - **sku** (Required): sku - the SKU or id for this product.\n  - **NOTES**: This should only be supplied when the user is changing the items associated\n    with a given subscription\n- **success_url** (Required): Where to redirect the user to after the customer successfully\n  completes the tele-health survey and/or updates their payment method(s).\n  - This is often used to display a confirmation screen, or similar\n- **failure_url** (Required): When the user opts to not complete the tele-health survey or\n  selects \"cancel\" during the process, or when the user is ineligible to spend HSA/FSA funds\n  on the items in the request.\n  - We attempt to recover from incorrect CVV, or other card detail errors by prompting the\n    user for retry\n- **use_iframe** (Optional): Optional query parameter that can be used to modify the\n  response's `redirect_url` so it can be used and communicated with in an iframe.\n- **customer_email** (Optional): string - The customer's new email address for this token. See\n  [Updating the Customer's Email](#updating-the-customers-email).\n- **metadata** (Optional): Any additional data supplied by the partner. This will be echoed\n  back in the `payment_token_updated` webhook after the `update_payment_token` flow is\n  complete.\n  - **Important**: This must be a string. If you want to include JSON, encode it as a string.\n  - **Important**: DO NOT INCLUDE sensitive information in this field.\n\n## iFrame Support\n\nIf `use_iframe` is set to `true`, `redirect_url` will be iframe-compatible. When the customer\nfinishes, the iframe posts one completion message to your page:\n\n```json\n{ \"success\": true, \"redirectUrl\": \"https://example.com/success\" }\n```\n\n`redirectUrl` echoes the `success_url` or `failure_url` from your request, matching `success`. See\nthe [Embedded Checkout guide](/guides/setup/api/payment-sessions/i-frame-payment-session) for how to\nrender the flow, validate the message's origin, and handle it.\n\n## Response Notes\n\n### Success Case\n\n**HTTP Status: 200:**\n\n- **next_action**: The action the customer must take. Can be one of the following:\n  - `UpdatePaymentMethod`: Customer must enter a new payment method.\n  - `HealthSurvey`: Customer must take the health survey\n  - `None`: There is no other action needed at this time.\n- **redirect_url**: Contains a URI through which the customer can complete the\n  `payment_token`. If `next_action=None`, this field won't be present.\n\n### Bad Request\n\n**HTTP Status: 400**\n\nIf a field is missing or the request otherwise can't be processed, we'll return a 400 with\nthe following fields:\n\n- **error**: Can be one of:\n  - `MissingField`: One of the required fields is not present in the request\n  - `IdempotencyViolation`: An `idempotency_key` was reused with different request parameters\n  - `ServerError`: There was an internal server error.\n    - Requests can be retried as long as the `idempotency_key` is the same.\n  - `InvalidToken`: The requested token was not found\n  - `IneligibleItemAdded`: A new item is ineligible for HSA/FSA spend. Can be returned when\n    requesting to update the items associated with a customer's `payment_token`\n- **message**: Indication of one of the following:\n  - Which field was missing\n  - Details on how the total amount was invalid","tags":["paymentTokens"],"parameters":[{"name":"payment_token","in":"path","description":"The payment token to update","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentTokenResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentTokenBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentTokenNotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for UpdatePaymentTokenRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentTokenRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/payment_tokens/{payment_token}/delete":{"post":{"operationId":"paymentTokens_deletePaymentToken","summary":"Delete a stored payment token and its associated methods","description":"Invoke this endpoint to invalidate a `payment_token`.\n\nThe delete endpoint removes the `payment_token` after which the token will no longer\nwork for calls to [`create_payment_session`](/api-reference/payment-sessions/create-payment-session).\n\nThe request body should be empty.\n\n\n## Response Notes\n\n### Success Case\n\n**HTTP Status: 204** - No content is returned on successful deletion.\n\n### Error Cases\n\n**HTTP Status: 404** - If the `payment_token` is not found or does not belong to the\nrequesting sales channel.","tags":["paymentTokens"],"parameters":[{"name":"payment_token","in":"path","description":"The payment token to delete.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTokenDeleteResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePaymentTokenBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/payment_tokens/provision_request/{provision_token_request_id}":{"get":{"operationId":"paymentTokens_retrievePaymentTokenProvisionRequest","summary":"Retrieve the status of a payment token provision request","description":"Check the status of a [`create_payment_token`](/api-reference/payment-tokens/create-payment-token)\nor [`update_payment_token`](/api-reference/payment-tokens/update-payment-token) API calls.\n\nThe `retrieve_provision_token_request` endpoint returns details about the request to\ncreate or update a `payment_token`. This endpoint is only provided as a fall back to\nthe [`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook and is only necessary\nfor as fallback for the [`payment_token_updated`](/api-reference/payment-tokens/payment-token-updated-webhook) webhook.\n\n## Request Notes\n\n**Path Params:**\n- **provision_token_request_id** (Required): The `provision_token_request_id` string\n  returned by Truemed to the partner either:\n  - in response to a [`create_payment_token`](/api-reference/payment-tokens/create-payment-token) request\n  - in a response to a [`update_payment_token`](/api-reference/payment-tokens/update-payment-token) request\n\n## Response Notes\n\n### Success Case\n\n**HTTP Status: 200**\n\n- **payment_token** (Optional): string - the `payment_token` created as part of the\n  `provision_request`, if one exists. Null otherwise.\n  - Use the [`retrieve_payment_token`](/api-reference/payment-tokens/retrieve-payment-token) endpoint to get\n    more information on the token.\n- **metadata**: (Optional) - returned if supplied in the call to\n  [`create_payment_token`](/api-reference/payment-tokens/create-payment-token).","tags":["paymentTokens"],"parameters":[{"name":"provision_token_request_id","in":"path","description":"The ID of a ProvisionTokenRequest returned via create_payment_token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTokenProvisionRequestDetailResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievePaymentTokenProvisionRequestBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/disputes/{business_id}":{"get":{"operationId":"disputes_retrieveDispute","summary":"Retrieve a single dispute, including its canonical state, deadlines, and evidence requirements","description":"Retrieve a single dispute by its Truemed `dispute_id`, with everything you need to decide how to respond: its canonical state and phase, the reason code, the disputed amount and currency, the evidence deadline, and the recommended evidence for the dispute's reason. Only disputes on your own sales channel's payments are accessible — any other ID returns 404.\n\n## Response Notes\n\n`state` is processor-agnostic. Every dispute, whatever the processor, maps to one of eight canonical states:\n\n| State | Meaning |\n|-------|---------|\n| `inquiry` | A pre-dispute warning or retrieval request. Not yet a chargeback; no funds withdrawn. |\n| `needs_response` | An open chargeback awaiting your evidence by `due_by`. The only state you can `accept`. |\n| `under_review` | Evidence submitted; the processor or card network is deciding. |\n| `won` | Resolved in your favor; funds retained. |\n| `lost` | Resolved against you; funds withdrawn. |\n| `accepted` | You conceded the dispute (see Accept Dispute). |\n| `expired` | The evidence deadline passed with no response. |\n| `closed` | An inquiry that resolved without becoming a chargeback — a favorable no-contest outcome, tracked separately from `won`. |\n\n- `phase` (`inquiry`, `dispute`, `pre_arbitration`, `arbitration`) is **orthogonal** to `state`: it tells you which round of the lifecycle you're in, not whether the dispute is open or resolved.\n- `outcome` is null until the dispute reaches a terminal state (`won`, `lost`, `accepted`, `expired`, `closed`).\n- `amount` is the **original disputed amount in cents** and does not change with the outcome; `currency` is the ISO code.\n- `due_by` is set only while the dispute is challengeable — it's null for inquiries and for resolved disputes.\n- `evidence_requirements` is the recommended evidence for this dispute's `reason`, resolved by Truemed: a `merchant_explanation` narrative (Markdown) plus categories grouped by weight into `compelling`, `supporting`, and `other`, each entry carrying its canonical `category`, display `label`, helper `description`, and whether it takes free text and/or a file.\n- `counters` is the full chain of evidence submissions (counters) for this dispute across phases.\n- State, amounts, and deadlines are read-only and advance only through processor events. The only writable fields are exposed through Accept Dispute and Update Dispute Metadata.","tags":["disputes"],"parameters":[{"name":"business_id","in":"path","description":"The Truemed dispute ID (UUID).","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeDetailResource"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveDisputeBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/disputes":{"get":{"operationId":"disputes_listDispute","summary":"List disputes for the authenticated sales channel with filtering and pagination","description":"List the card disputes — chargebacks and the pre-dispute inquiries that precede them — raised against payments you've taken through Truemed. Use it to drive a disputes queue in your own dashboard, surface disputes whose evidence deadline is approaching, or reconcile against your records by processor dispute ID. Results are scoped to the sales channel your API key authenticates as: you only ever see disputes on your own payments.\n\nDisputes are returned newest first and paginated with `page` / `page_size` (default 30 per page, max 100). The response `pagination` object reports `current_page`, `page_size`, `total_count`, and `last_page`.\n\n## Request Notes\n\nAll filters are optional and combine with AND:\n\n- `state`, `phase`, `reason` — exact match on the canonical enums. See the Get Dispute endpoint for the full state model.\n- `amount_gte` / `amount_lte` — disputed amount in **cents**, inclusive on both bounds.\n- `created_gte` / `created_lte` — dispute creation time, **inclusive** on both bounds. Pass ISO 8601 datetimes, e.g. `2026-01-01T00:00:00Z`.\n- `due_before` — only disputes whose evidence deadline (`due_by`) falls **strictly before** this datetime. Disputes with no deadline — inquiries and already-resolved disputes both have a null `due_by` — are excluded by this filter. Use it together with `state=needs_response` to build a \"deadline approaching\" view.\n\n## Response Notes\n\nEach item is the same `Dispute` object returned by Get Dispute. Use the stable `dispute_id` (a Truemed UUID) for the detail, accept, and metadata endpoints; use `processor_dispute_id` (e.g. Stripe `du_…`) to reconcile against the processor. State, amounts, and deadlines are read-only — they advance only through processor events, never through this API.","tags":["disputes"],"parameters":[{"name":"page","in":"query","description":"Optional field indicating which page to access. Defaults to 1.","required":false,"schema":{"type":"integer"}},{"name":"page_size","in":"query","description":"Optional field indicating the number of records per page. Defaults to 30.","required":false,"schema":{"type":"integer"}},{"name":"state","in":"query","description":"Filter by canonical state.","required":false,"schema":{"type":"string"}},{"name":"phase","in":"query","description":"Filter by phase.","required":false,"schema":{"type":"string"}},{"name":"reason","in":"query","description":"Filter by reason.","required":false,"schema":{"type":"string"}},{"name":"amount_gte","in":"query","description":"Only disputes with amount >= this (cents).","required":false,"schema":{"type":"integer"}},{"name":"amount_lte","in":"query","description":"Only disputes with amount <= this (cents).","required":false,"schema":{"type":"integer"}},{"name":"created_gte","in":"query","description":"Only disputes created on/after this date.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"created_lte","in":"query","description":"Only disputes created on/before this date.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"due_before","in":"query","description":"Only disputes whose evidence deadline is before this date.","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeListResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDisputeBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/disputes/{business_id}/accept":{"post":{"operationId":"disputes_acceptDispute","summary":"Accept (concede) a dispute, conceding the disputed amount","description":"Accept (concede) a dispute when you don't intend to contest it — for example when the charge was already refunded outside Truemed, or when contesting a low-value chargeback isn't worth the effort. Accepting concedes the disputed amount to the cardholder and closes the dispute with the processor.\n\nThis is **terminal**: the dispute moves to the `accepted` state and cannot be reopened. Only disputes in `needs_response` (an open chargeback awaiting evidence) can be accepted. Inquiries are warnings rather than chargebacks, and disputes already in a terminal state are immutable — accepting either returns `400`. The call is idempotent: accepting a dispute that's already `accepted` returns its current state instead of erroring, so a retried request is safe.","tags":["disputes"],"parameters":[{"name":"business_id","in":"path","description":"The Truemed dispute ID (UUID).","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeResource"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptDisputeBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/disputes/{business_id}/counters":{"post":{"operationId":"disputes_createDisputeCounter","summary":"Create a draft evidence counter for a dispute","description":"Start composing your evidence response to a dispute by creating a draft \"counter\". A counter holds your categorized evidence (each item is a canonical evidence category plus free text and/or attached files) for one round of a dispute, and is continuously saved as a draft so you don't lose work before submitting.\n\nThere is **at most one open draft per dispute round**. Calling this when a draft already exists returns that draft rather than creating a duplicate, so it's safe to call on page load. Any attached `file_ids` must reference files you uploaded via the Files API; referencing a file you don't own returns `422`.","tags":["disputes"],"parameters":[{"name":"business_id","in":"path","description":"The Truemed dispute ID (UUID).","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterResource"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDisputeCounterBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for CounterCreateRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterCreateRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/disputes/{business_id}/counters/{counter_id}":{"post":{"operationId":"disputes_updateDisputeCounter","summary":"Save (upsert) a draft evidence counter; optimistic-locked for autosave","description":"Save a draft counter's evidence. This is a full replacement of the draft's `evidence_items`, built for autosave — call it as the merchant edits. Only a counter still in the `draft` state can be saved; saving a submitted or withdrawn counter returns `400`.\n\nPass the `revision` you last read. If the counter changed since then (e.g. another tab saved it), the request is rejected with `409` so you can reload rather than silently clobber the newer edit. Any attached `file_ids` must reference files you own, or the save is rejected with `422`.","tags":["disputes"],"parameters":[{"name":"business_id","in":"path","description":"The Truemed dispute ID (UUID).","required":true,"schema":{"type":"string"}},{"name":"counter_id","in":"path","description":"The Truemed counter ID (UUID).","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterResource"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDisputeCounterBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for CounterUpsertRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterUpsertRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/disputes/{business_id}/counters/{counter_id}/submit":{"post":{"operationId":"disputes_submitDisputeCounter","summary":"Submit a draft evidence counter to the processor (one-shot)","description":"Submit a draft counter's evidence to the payment processor. This is **one-shot and terminal for this round**: the evidence is sent to the processor as your final response, the counter moves to `submitted`, and it can no longer be edited.\n\nOnly a `draft` counter on a dispute that is currently awaiting a response (e.g. Stripe `needs_response`) can be submitted — otherwise the call returns `400`. Every attached file must both belong to you and have passed a malware scan (`clean`); otherwise the submission is rejected with `422` and nothing is sent. The dispute itself transitions (e.g. to `under_review`) when the processor's webhook confirms receipt, not synchronously here.","tags":["disputes"],"parameters":[{"name":"business_id","in":"path","description":"The Truemed dispute ID (UUID).","required":true,"schema":{"type":"string"}},{"name":"counter_id","in":"path","description":"The Truemed counter ID (UUID).","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterResource"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDisputeCounterBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/disputes/{business_id}/counters/{counter_id}/withdraw":{"post":{"operationId":"disputes_withdrawDisputeCounter","summary":"Withdraw (discard) a draft evidence counter","description":"Discard a draft counter you no longer want. The counter moves to `withdrawn` and stops appearing in the dispute's counter list. Only a `draft` can be withdrawn — withdrawing a submitted counter returns `400` (a submitted response is already with the processor and can't be retracted here).","tags":["disputes"],"parameters":[{"name":"business_id","in":"path","description":"The Truemed dispute ID (UUID).","required":true,"schema":{"type":"string"}},{"name":"counter_id","in":"path","description":"The Truemed counter ID (UUID).","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterResource"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawDisputeCounterBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/disputes/{business_id}/metadata":{"post":{"operationId":"disputes_updateDisputeMetadata","summary":"Update a dispute's metadata (only metadata is mutable)","description":"Attach your own metadata to a dispute — an internal case ID, the teammate who owns it, a link to your evidence workspace, free-form notes — so you can correlate Truemed disputes with your own systems.\n\nThis is a **full replace**, not a merge: the `metadata` object you send overwrites whatever was stored, so include every key you want to keep. Metadata is the only writable part of a dispute; its state, phase, reason, amounts, and deadlines are owned by the processor and are read-only. Scoped to your sales channel — you can only update metadata on your own disputes.","tags":["disputes"],"parameters":[{"name":"business_id","in":"path","description":"The Truemed dispute ID (UUID).","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeResource"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDisputeMetadataBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for DisputeMetadataRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeMetadataRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/qualification_session/{qualification_session_id}":{"get":{"operationId":"qualificationSessions_retrieveQualificationSession","summary":"Retrieve details and eligibility result of a qualification session","description":"Get the status of a `qualification_session` based on the `qualification_session_id`.\n\n## Request Notes\n\nTo get the status of a Qualification Session object, call the detail view with the ID\nof the qualification session returned by the\n[Qualification Session Completed](/api-reference/qualification-sessions/qualification-status-updated-webhook)\nwebhook.","tags":["qualificationSessions"],"parameters":[{"name":"qualification_session_id","in":"path","description":"The qualification session ID from the URL path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualificationSessionResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveQualificationSessionBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/qualification_sessions":{"get":{"operationId":"qualificationSessions_listQualificationSession","summary":"List qualification sessions with filtering and pagination","description":"Returns a paginated view of all Qualification Sessions associated with the API key used\nin the request header, sorted by their `created_at` date. Optional search fields are provided\nto aid in finding the session or sessions associated with a given user.\n\n## Request Notes\n\nQuery Params:\n\n- `status` (Optional): filter Qualification Sessions by status. The supported values\n  and their meanings are listed in the parameter's description below.\n- `page` (Optional): int - the page to retrieve, defaults to 1. 30 entries are\n  returned per page.\n\n## Response Notes\n\n### Bad Request\n\nHTTP Status: 400\n\nIf a field is missing or the request otherwise can't be processed, we'll return a 400 with\nthe following fields:\n\n- **error**: Can be one of:\n    - `ValidationError`: invalid request\n- **message**: Details on how the request was invalid","tags":["qualificationSessions"],"parameters":[{"name":"page","in":"query","description":"Optional field indicating which page to access. Defaults to 1.","required":false,"schema":{"type":"integer"}},{"name":"page_size","in":"query","description":"Optional field indicating the number of records per page. Defaults to 30.","required":false,"schema":{"type":"integer"}},{"name":"user_id","in":"query","description":"An optional user_id to search for.","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"An optional filter to only return sessions with the given status. One of:\n- `pending` — The session was created; the shopper hasn't completed the survey yet.\n- `processing` — The shopper completed the survey and it is under review.\n- `approved` — The shopper holds a valid Letter of Medical Necessity covering the items in this order.\n- `rejected` — The shopper is ineligible for a Letter of Medical Necessity for the items in this order.","required":false,"schema":{"type":"string"}},{"name":"expires_at","in":"query","description":"Filter by expiration date (YYYY-MM-DD format)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"search","in":"query","description":"Search across user name, email, user_business_id, utm, and external_user_id fields.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualificationSessionListResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListQualificationSessionBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/qualification_session/{qualification_session_id}/update":{"post":{"operationId":"qualificationSessions_updateQualificationSession","summary":"Update mutable fields on a qualification session","description":"Keep a qualification session in sync with your own records after you've created it. Attach your internal user identifier, store free-form metadata, and adjust the redirect URLs a customer returns to once they finish qualifying.\n\n## Request Notes\n\n- `idempotency_key` makes retries safe: a duplicate POST with the same key against the same qualification session is deduplicated and returns the original response, while reusing a key with a different payload returns a `400` validation error.\n- `user_id` is set-when-null only: you can supply it while the qualification session has no `user_id` yet, but attempting to overwrite a non-null value returns the documented `user_id_already_set` error code. Stale-value corrections must route through Truemed support, not this endpoint.\n- `metadata` is a JSON-encoded string echoing the same convention used by the create endpoint.\n- `success_url` and `failure_url` are still stored when supplied, but have no effect once the qualification session reaches a terminal status (`approved` / `rejected`) — the customer has already completed the flow and won't be redirected again.\n\n## Response Notes\n\n- `status` is a read-only passthrough — qualification-session status is never mutable via this endpoint. Status changes occur through the survey-submission and LMN-clinical-review flows.","tags":["qualificationSessions"],"parameters":[{"name":"qualification_session_id","in":"path","description":"The qualification session ID from the URL path.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualificationSessionResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualificationSessionBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for UpdateQualificationSessionRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualificationSessionRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/product_catalog/items/list":{"get":{"operationId":"productCatalog_listCatalogItems","summary":"List catalog items with eligibility and pagination","description":"Lists catalog items for the authenticated merchant, including current HSA/FSA eligibility for each item.\n\nThis endpoint is intended to complement the `Item Eligibility Updated` webhook: use the webhook to receive ongoing updates, and use this endpoint to enumerate items that were already categorized before webhook ingestion began (or to reconcile after a gap).\n\nUse `eligibility` to scope the response to a specific eligibility state, and `updated_after` to incrementally sync only items changed since the last poll.\n\n### Computing the HSA/FSA-eligible amount\n\nItems eligible only for the margin over an everyday equivalent carry that equivalent's price as `comparable_item_price_cents`:\n\n```\neligible_amount = max(0, unit_price - comparable_item_price_cents) * quantity\n```\n\nIt is absent when the full price is eligible, and when the item cannot be charged to an HSA/FSA card.\n\n### Keeping `comparable_item_price_cents` current\n\nTruemed reviews these prices about monthly. A change fires no webhook and does not advance `updated_at`, so re-read the catalog in full at least monthly. The charged amount is settled at checkout.","tags":["productCatalog"],"parameters":[{"name":"page","in":"query","description":"Optional field indicating which page to access. Defaults to 1.","required":false,"schema":{"type":"integer"}},{"name":"page_size","in":"query","description":"Optional field indicating the number of records per page. Defaults to 30.","required":false,"schema":{"type":"integer"}},{"name":"eligibility","in":"query","description":"Filter results to items whose eligibility matches the given value. Items that have no eligibility yet are excluded when this filter is set.","required":false,"schema":{"type":"string"}},{"name":"updated_after","in":"query","description":"Return only catalog items whose last update is at or after this ISO 8601 timestamp. Useful for incremental sync after `Item Eligibility Updated` webhooks.","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListItemsResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCatalogItemsBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/product_catalog/truemed_checkout_method":{"post":{"operationId":"productCatalog_truemedCheckoutMethod","summary":"Check if Truemed checkout is available for a cart","description":"This endpoint is intended to be used to make yes/no decisions about whether to display Truemed as a checkout option for a given set of items. It is limited in that it does not determine whether or not an order containing the items will truly be eligible for Truemed checkout because it does not receive prices, discounts nor additional charges. Any new items received will be created and subsequently categorized.","tags":["productCatalog"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TruemedCheckoutMethodResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TruemedCheckoutMethodBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for TruemedCheckoutMethodRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TruemedCheckoutMethodRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/product_catalog/items/create":{"post":{"operationId":"productCatalog_createItem","summary":"Create a new item in the product catalog","description":"Create a catalog item. The product will not be immediately categorized.","tags":["productCatalog"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateItemResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateItemBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateItemConflictResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for CreateItemRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateItemRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/product_catalog/items/update":{"post":{"operationId":"productCatalog_updateItem","summary":"Update an existing item in the product catalog","description":"Update an item in the product catalog. The product will not be immediately re-categorized.","tags":["productCatalog"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateItemResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateItemBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for UpdateItemRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateItemRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/product_catalog/items/detail":{"post":{"operationId":"productCatalog_getItemDetail","summary":"Retrieve details and eligibility status of a catalog item","description":"Retrieve details of a catalog item by SKU.","tags":["productCatalog"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetailItemResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetItemDetailBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for DetailItemRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetailItemRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/eligibility":{"get":{"operationId":"eligibility_retrieveCatalogEligibility","summary":"Retrieve HSA/FSA catalog eligibility","description":"Returns every item in your catalog that can be charged to an HSA/FSA card, with no customer in context.\n\nThis is **catalog eligibility** — a property of the product. An item appears here when its eligibility category\nis HSA/FSA-payable for your merchant account, whether it requires a Letter of Medical Necessity or is\npre-approved and requires none. It is the widest possible answer: everything a customer *could* be eligible\nfor, before anyone has qualified.\n\nWhether a *particular* customer can put one of these items on their HSA/FSA card is a separate question —\n**customer eligibility** — answered by the keyed forms of this endpoint. Use this form to mark eligible items\nwherever you present your catalog, and a keyed form once you know who is shopping.\n\nBecause no customer is identified, `eligibility_status` and `lmn_expires_at` are both null. Nothing in the response depends\non a customer, so it is safe to cache for as long as your catalog is stable.","tags":["eligibility"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EligibilityResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveCatalogEligibilityBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/eligibility/provision_request/{provision_token_request_id}":{"get":{"operationId":"eligibility_retrieveProvisionRequestEligibility","summary":"Retrieve HSA/FSA customer eligibility by provision request","description":"Returns **customer eligibility** for a customer who does not hold a payment token yet, keyed on the provision\nrequest id you received from `create_payment_token`.\n\nThe token-keyed form and this one answer the same question — which items *this* customer can charge to their\nHSA/FSA card. Use this one for a customer's first order, where you have a provision request but no token;\nswitch to the token form once the token arrives.\n\nThe two are keyed differently, and that is deliberate. A provision request names a customer and nothing else,\nso this form counts the letters that customer earned on your sales channel. The token form has a token to\ncount letters through as well, and counts both.\n\nThe window this form exists for is the one before a token: the customer has answered the survey, no clinician\nhas decided, so nothing has been minted to key the token form on, and you still need something to present your\ncatalog with. `pending` is the ordinary answer here, where on the token form it is the rare one. In that state\n`items` carries what the survey predicts the letter will cover, intersected with your catalog, and\n`lmn_expires_at` is null because no letter exists yet. Those items are a prediction, not a decision — present\nthem as provisional. `items` is empty only while the survey itself is unfinished.\n\nOnce a clinician decides, this key keeps working and starts answering exactly as the token-keyed form does:\n`approved`, `expired`, `rejected`, or `never_requested`, with a real coverage date where one exists (inclusive,\nUTC). That makes\nit a reliable poll if the `payment_token.updated` webhook is ever lost — and unlike the Retrieve Provision Token\nRequest endpoint, whose `payment_token` is null for both outcomes, this one tells a pending letter apart from a\nrejected one.","tags":["eligibility"],"parameters":[{"name":"provision_token_request_id","in":"path","description":"The ID of the ProvisionTokenRequest returned by create_payment_token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EligibilityResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveProvisionRequestEligibilityBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/eligibility/token/{token_id}":{"get":{"operationId":"eligibility_retrieveTokenEligibility","summary":"Retrieve HSA/FSA customer eligibility by payment token","description":"Returns the items *this* customer can charge to their HSA/FSA card, and when that stops being true.\n\nThis is **customer eligibility** — a property of the person rather than the product. It is catalog eligibility\nnarrowed to one customer: an item appears here only when they hold a verified, unexpired Letter of Medical\nNecessity covering its eligibility category, or when that category is pre-approved and needs no letter at all.\n\n`eligibility_status` and `lmn_expires_at` answer for the payment token you name, not for whoever holds it.\nThey count the letters reachable through the token together with the letters the holder earned on your sales\nchannel. A customer who answers our health survey under a second email address earns their letter on that\naddress while the token stays where it was minted, and counting both is what keeps that letter visible here.\nThe `payment_token.updated` webhook counts the same letters, so a token reads the same way on both surfaces.\nThe provision-request form answers for a customer who holds no token yet, and is keyed on the customer.\n\n`eligibility_status` is a statement of fact, not an instruction, and each value earns a different response from\nyou — the per-value meanings are listed on the enum. In short: `approved` is the steady state; `expired` is your\nrenewal trigger, while every item keeps charging to the backup card meanwhile; `never_requested` calls for a\nfirst-time qualification prompt rather than a renewal one; `rejected` means suppress the prompt rather than\nsending the customer round again, since we have already emailed them the outcome; and `pending` means wait.\n\n`pending` is rare on this form, because a payment token is normally minted only once a letter has been decided.\nIt appears when a customer who is not currently covered has a survey under review — a requalification in\nflight, most often.\n\nAn empty `items` list under `approved` is worth reporting to us rather than to your customer: it means a live\nqualification exists but nothing in your catalog falls under it any more, which a re-survey cannot fix.\n\nRead it on whatever schedule suits you; the answer is stable through `lmn_expires_at` (inclusive, UTC).","tags":["eligibility"],"parameters":[{"name":"token_id","in":"path","description":"The payment token returned by create_payment_token, in its prefixed form","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EligibilityResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveTokenEligibilityBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/files/create":{"post":{"operationId":"files_createFile","summary":"Create a file and get a presigned upload URL","description":"Creates a file record and returns a presigned upload URL plus the form fields to include in the multipart POST.\n\nUpload the file directly to the returned URL, then reference it by `file_id` from other resources. The upload URL expires 10 minutes after creation, so request it as part of the same flow that performs the upload.\n\nEach `purpose` enforces its own MIME allowlist and maximum file size, validated before the presigned URL is issued — a `content_type` or `size_bytes` outside the purpose's limits is rejected with a 400.\n\n| Purpose | Allowed content types | Max file size |\n| --- | --- | --- |\n| `dispute_evidence` | `application/pdf`, `image/png`, `image/jpeg`, `image/tiff` | 5 MB |","tags":["files"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileCreateResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFileBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"requestBody":{"description":"Request body for FileCreateRequest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileCreateRequest"}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/files/{file_id}":{"get":{"operationId":"files_retrieveFile","summary":"Retrieve a file and get a presigned download URL","description":"Returns file metadata and, for clean-scanned files, a short-lived presigned download URL scoped to the owning sales channel. Files that are still scanning or quarantined are not downloadable.","tags":["files"],"parameters":[{"name":"file_id","in":"path","description":"The public file identifier.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDetailResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrieveFileBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/files":{"get":{"operationId":"files_listFile","summary":"List files and their metadata","description":"Returns metadata (including size) for files owned by the authenticated sales channel, optionally filtered by a set of ids and/or a purpose.","tags":["files"],"parameters":[{"name":"page","in":"query","description":"Optional field indicating which page to access. Defaults to 1.","required":false,"schema":{"type":"integer"}},{"name":"page_size","in":"query","description":"Optional field indicating the number of records per page. Defaults to 30.","required":false,"schema":{"type":"integer"}},{"name":"ids","in":"query","description":"Comma-separated file ids to fetch, e.g. id1,id2.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"purpose","in":"query","description":"Restrict to files of this purpose, e.g. dispute_evidence.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileListResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFileBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/reconciliation/payouts":{"get":{"operationId":"reconciliations_listPayoutReconciliation","summary":"List reconciliation payouts","description":"Returns a paginated list of payouts for the authenticated merchant within the specified date range.","tags":["reconciliations"],"parameters":[{"name":"page","in":"query","description":"Optional field indicating which page to access. Defaults to 1.","required":false,"schema":{"type":"integer"}},{"name":"page_size","in":"query","description":"Number of results per page. Defaults to 30. Maximum 1000.","required":false,"schema":{"type":"integer"}},{"name":"start_date","in":"query","description":"Start of the date range, inclusive (YYYY-MM-DD).","required":true,"schema":{"type":"string","format":"date"}},{"name":"end_date","in":"query","description":"End of the date range, inclusive (YYYY-MM-DD).","required":true,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutReconciliationListResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPayoutReconciliationBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}},"/api/v1/reconciliation/transactions":{"get":{"operationId":"reconciliations_listTransactionReconciliation","summary":"List reconciliation transaction rows","description":"Returns a paginated list of transaction reconciliation data for the authenticated merchant within the specified date range.","tags":["reconciliations"],"parameters":[{"name":"page","in":"query","description":"Optional field indicating which page to access. Defaults to 1.","required":false,"schema":{"type":"integer"}},{"name":"page_size","in":"query","description":"Optional field indicating the number of records per page. Defaults to 30.","required":false,"schema":{"type":"integer"}},{"name":"start_date","in":"query","description":"Start of the date range, inclusive (YYYY-MM-DD).","required":true,"schema":{"type":"string","format":"date"}},{"name":"end_date","in":"query","description":"End of the date range, inclusive (YYYY-MM-DD).","required":true,"schema":{"type":"string","format":"date"}},{"name":"payout_ids","in":"query","description":"Comma-separated payout IDs to filter by, e.g. po_1,po_2.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"include_pending_payouts","in":"query","description":"When true (default), include transactions not yet associated with a payout. When false, return only rows with an associated payout.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionReconciliationListResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTransactionReconciliationBadRequestResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"405":{"description":"Method Not Allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MethodNotAllowedResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerErrorResponse"}}}},"501":{"description":"Not Implemented","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotImplementedResponse"}}}}},"security":[{"truemed-api-key-rest":[]}]}}},"tags":[{"name":"paymentSessions"},{"name":"paymentTokens"},{"name":"disputes"},{"name":"qualificationSessions"},{"name":"productCatalog"},{"name":"eligibility"},{"name":"files"},{"name":"reconciliations"}],"servers":[{"url":"https://dev-api.truemed.com","description":"Development server"},{"url":"https://api.truemed.com","description":"Production server"}],"webhooks":{"paymentSessions_paymentSessionCaptureFailedWebhook":{"post":{"operationId":"paymentSessions_paymentSessionCaptureFailedWebhook","summary":"Payment Session Capture Failed Webhook","description":"Truemed sends this webhook when a payment session's capture permanently fails after all\nautomatic retries have been exhausted, meaning the order will not be paid unless you take action.\n\nTerminal capture failures are exceedingly rare — the vast majority of integrations will never\nreceive this event and do not need to build special handling for it. Subscribe only if you want to\nbe notified in the uncommon case that a payment session can never be captured.\n\nThis is distinct from the `payment_session_complete` webhook: a capture failure is terminal, so you\nwill not receive a later `captured` status for the same session. Do not fulfill the order when you\nreceive this event.\n\nIf part of a split payment was collected before the capture failed, `amount_collected` reports the\namount already charged to the customer; it is null when nothing was collected.\n\n**Authentication**: Verify the request comes from Truemed by checking that the API key is present in\nthe `x-truemed-api-key` HTTP header.\n\n## Request Notes\n\nHeaders:\n\n- `x-truemed-api-key` - The partner's API key.\n\nNotable fields:\n\n- `payment_session_id` - the payment session whose capture failed.\n- `failed_at` - when the capture was determined to have permanently failed.\n- `failure_details` - a generic message indicating the capture could not be completed.\n- `amount_collected` - funds already collected on a partially-charged split payment; null otherwise.","responses":{"200":{"description":"Webhook received successfully"}},"requestBody":{"description":"Webhook payload for paymentsessioncapturefailed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureFailedResource"}}}}}},"paymentSessions_paymentSessionCompletedWebhook":{"post":{"operationId":"paymentSessions_paymentSessionCompletedWebhook","summary":"Payment Session Complete Webhook","description":"The partner is required to implement an endpoint that Truemed can send requests to inform\nof the checkout status.\n\nWe'll call the `payment_session_complete` webhook once each time the `status` of the\n`payment_session` changes, including sessions that have been canceled, voided, and captured.\nFor delayed capture, we'll issue the webhook call for authorization (when the customer first\nsuccessfully enters card information), and again after the partner has manually captured funds\nvia the capture api.\n\nIn successful payment cases, we'll first issue a webhook indicating that the `payment_session`\nhas transition from `pending` to `processing`, after which you can expect a webhook\ntransitioning from `processing` to `captured` (in the default / immediate capture cases), and\nto `authorized` in the case of [Manual/Delayed Capture](/guides/payment-sessions/manual-delayed-capture).\n\n<Warning title=\"Important\">\nOrders should not be fulfilled until a webhook is received with a status\nof `captured`.\n</Warning>\n\n**Authentication**: Partners should verify the request comes from Truemed by checking that\nthe API key is present in the `x-truemed-api-key` HTTP header.\n\n## Request Notes\n\nHeaders:\n\n- `x-truemed-api-key` - The partner's API key.\n\nNotable fields:\n\n- `status` - the status of the payment from Truemed's perspective\n  - `captured` - payment has completed\n  - `canceled` - payment was canceled before the user entered payment information via a call\n    to our cancel API.\n  - `pending` - payment has not been successfully completed yet.\n  - `processing` - the customer has entered their payment information, but it is under review\n    by Truemed\n    - Any customer facing communication should indicate successful payment at this point,\n      such as on the `success_url`.\n    - The merchant should not fulfill the order until the Payment Session Webhook indicates\n      that the payment has been captured.\n  - `rejected` - While in the `processing` state, Truemed reviewed and rejected the payment\n    session.\n    - The merchant should not fulfill these orders, and should communicate failure to the\n      user via email.\n  - `authorized` - an auth hold has been placed on the customer's card.\n  - `authorization_voided` - the auth hold has been voided via a call to our Void Session api.\n  - `authorization_expired` - the auth hold has expired and we were not able to re-auth the\n    transaction. This state is only possible after a call to our Manual Capture api, and is\n    only set after we attempt a re-auth hold on the existing payment method.\n- `capture_amount` **(Optional)** - the amount of funds actually captured.\n  - For payment sessions of `kind=one_time_payment` this field will always be present and\n    will be the same as `authorize_amount`.\n  - For payment sessions of `kind=authorization` this field will not be present until the\n    funds have been captured (via a call to Manual Capture).\n- `order_items` - a list of order items, with the following fields per item:\n  - `total_refundable` **(Optional)** - If the Payment Session has been captured, this value\n    will be the remaining amount refundable for this item. Otherwise it will not be included.\n  - `quantity_refundable` **(Optional)** - If the Payment Session has been captured, this\n    value will be the remaining quantity refundable for this item. Otherwise it will not be\n    included.\n  - `total_capturable` **(Optional)** - If the Payment Session is an authorization and is\n    currently authorized, this value will be the remaining amount capturable for this item.\n    Otherwise it will not be included.\n  - `quantity_capturable` **(Optional)** - If the Payment Session is an authorization and is\n    currently authorized, this value will be the remaining quantity capturable for this item.\n    Otherwise it will not be included.\n- `payment_token` **(Optional)** - Optional string indicating the `payment_token` used for\n  the payment session. This field will be set only if the partner provided `tokenize=True` or\n  a `payment_token` in the `create_payment_session` request, as outlined in our Subscriptions\n  Flow\n\n## Response Body Documentation\n\n### Success Case\n\nHTTP Status: `204`\n\nThe partner does not need to include any content in the body\n\n### Failure Case\n\nTruemed will retry the requests to your backend with backoff for up to 7 days","responses":{"200":{"description":"Webhook received successfully"}},"requestBody":{"description":"Webhook payload for paymentsessioncompleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusUpdateWebhookPayload"}}}}}},"paymentTokens_paymentTokenUpdatedWebhook":{"post":{"operationId":"paymentTokens_paymentTokenUpdatedWebhook","summary":"Payment Token Updated Webhook","description":"The partner is required to implement an endpoint that Truemed requests to inform the partner\nof updates made to payment tokens which back customer subscriptions.\n\nThe `payment_token_updated` webhook is invoked when:\n\n1. A `payment_token` is provisioned using [`create_payment_session`](/api-reference/payment-sessions/create-payment-session)\n2. A customer updates their payment token due to one of the failure cases outlined in the\n   subscriptions guide, or as part of [`update_payment_token`](/api-reference/payment-tokens/update-payment-token)\n3. A `payment_token` is provisioned using [`create_payment_token`](/api-reference/payment-tokens/create-payment-token)\n4. A customer's letter of medical necessity is rejected, on sales channels configured to provision\n   a token anyway. The `payment_token` is still provisioned so the outcome can be matched back to\n   the `provision_token_request_id`, but it carries no HSA/FSA eligibility: charges against it\n   route entirely to the credit/debit card. Ask your Truemed contact to enable this if you would\n   rather take the order on the customer's backup card than lose it.\n\nThe request body includes the `payment_token`, and one of 3 optional IDs mapping back to the\noriginating entity (`payment_session_id`, `failed_payment_session_id`, or\n`provision_token_request_id`).\n\nOnce you receive this webhook, the `payment_token` can successfully be used in subsequent\ncalls to [`create_payment_session`](/api-reference/payment-sessions/create-payment-session).\n\n**Authentication**: Partners should verify the request comes from Truemed by checking that\nthe API key is present in the `x-truemed-api-key` HTTP header.\n\n## Request Notes\n\n- `payment_token`: the `payment_token` returned to the partner by Truemed in response to a\n  [`create_payment_session`](/api-reference/payment-sessions/create-payment-session) request\n  when `tokenize` was set to `True`\n- `payment_session_id`: **(Optional)** the `id` of the `payment_session` returned by\n  `create_payment_session`\n  - This is used if the `payment_token` was provisioned as part of a `create_payment_session`\n    with `tokenize=true`.\n- `failed_payment_session_id`: **(Optional)** the `id` returned to the partner by Truemed in\n  response to a `create_payment_session` request\n  - Only present if the `payment_token` was used in [`create_payment_session`](/api-reference/payment-sessions/create-payment-session)\n    and failed to be charged as outlined in the failure cases in the [Subscriptions Guide](/guides/subscriptions/overview).\n- `provision_token_request_id`: **(Optional)**\n  - Present when provisioning/updating a `payment_token` with a call to\n    [`create_payment_token`](/api-reference/payment-tokens/create-payment-token) or\n    [`update_payment_token`](/api-reference/payment-tokens/update-payment-token)\n- `eligibility_status`: where the customer's clinical eligibility stands at the moment the webhook\n  is sent\n  - Sent on every `payment_token_updated`, including the card-update and requalification ones, so it\n    always describes the customer's current standing rather than only the change that prompted the\n    webhook.\n  - This is a clinical status, not a payment one. `create_payment_session` returns a `status`\n    describing the payment; the two are different vocabularies and the names are kept apart on purpose.\n  - It answers *whether* the customer is covered. For *which* of your items that covers, and until\n    when, use the eligibility read.\n\n## Response Notes\n\n### Success Case\n\nHTTP Status: `204`\n\nThe partner does not need to include any content in the body, but MUST respond with `204`.\n\n### Failure Case\n\nTruemed will retry the requests to your backend with backoff for up to 7 days","responses":{"200":{"description":"Webhook received successfully"}},"requestBody":{"description":"Webhook payload for paymenttokenupdated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTokenUpdatedWebhookPayload"}}}}}},"disputes_disputeClosedWebhook":{"post":{"operationId":"disputes_disputeClosedWebhook","summary":"Dispute Closed Webhook","description":"Truemed calls your endpoint when a dispute reaches a terminal state — a chargeback outcome (`won`, `lost`,\n`accepted`, or `expired`) or a surfaced inquiry the bank drops (`closed`). A re-sync of an already-terminal dispute\ndoes not re-fire this event, and an inquiry already terminal the first time Truemed sees it fires nothing at all.\n\n**Authentication**: Requests are HMAC-SHA256 signed. The `x-truemed-signature` header carries a timestamp and\nthe signature in the form `t=<unix-timestamp>,v0=<hex-signature>`. Compute HMAC-SHA256 over\n`<t>.<raw-request-body>` with your webhook signing secret and compare the hex digest to `v0`. Sign the raw body\nbytes exactly as received, since re-serializing the JSON changes the bytes and breaks the signature.\n\n## Payload\n\nThe signed body is the standard Truemed envelope:\n\n- `webhook_delivery_id` - Delivery id (`dlv_…`). Retries of the same event repeat the same value; use it to\n  deduplicate.\n- `event_type` - The wire event name (`dispute.created`, `dispute.updated`, or `dispute.closed`).\n- `data` - The full canonical dispute, the same shape returned by `GET /api/v1/disputes/{dispute_id}` — including\n  `dispute_id`, `state`, `phase`, `reason`, `amount`, `due_by`, `counters`, and `metadata`. Null fields are\n  omitted. Payloads carry canonical Truemed fields and the public `dispute_id` UUID only, never raw processor\n  shapes. Always key your records on `dispute_id`.\n\n(Unsigned legacy endpoints receive the `data` object as the flat top-level body, with no envelope and no\n`event_type`.)\n\nThe model is **notify, then fetch**: the snapshot is complete enough to act on directly, and you can re-fetch the\ndispute for authoritative state when a delivery is delayed or retried out of order.\n\n**Inquiries notify too, with one exception.** A live inquiry fires `dispute.created` / `dispute.updated` just like\na chargeback, so you can respond to pre-empt its escalation. If the bank later drops a surfaced inquiry, the terminal\n`closed` state fires `dispute.closed` — so `dispute.closed` marks any terminal outcome, whether a chargeback result\n(`won` / `lost` / `accepted` / `expired`) or a dropped inquiry (`closed`). The only silent case is an inquiry that\nopens and closes between webhook deliveries — already terminal the first time Truemed sees it — which fires no webhook.\n\n## Response Notes\n\nReturn HTTP `204` with an empty body. Truemed retries failed deliveries with backoff for up to 7 days.","responses":{"200":{"description":"Webhook received successfully"}},"requestBody":{"description":"Webhook payload for disputeclosed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeWebhookPayload"}}}}}},"disputes_disputeCreatedWebhook":{"post":{"operationId":"disputes_disputeCreatedWebhook","summary":"Dispute Created Webhook","description":"Truemed calls your endpoint when a dispute first becomes visible to you — a new chargeback, or a live inquiry you\ncan respond to in order to pre-empt its escalation. An inquiry that later escalates into a chargeback phase fires\n`dispute.created` again for the chargeback.\n\n**Authentication**: Requests are HMAC-SHA256 signed. The `x-truemed-signature` header carries a timestamp and\nthe signature in the form `t=<unix-timestamp>,v0=<hex-signature>`. Compute HMAC-SHA256 over\n`<t>.<raw-request-body>` with your webhook signing secret and compare the hex digest to `v0`. Sign the raw body\nbytes exactly as received, since re-serializing the JSON changes the bytes and breaks the signature.\n\n## Payload\n\nThe signed body is the standard Truemed envelope:\n\n- `webhook_delivery_id` - Delivery id (`dlv_…`). Retries of the same event repeat the same value; use it to\n  deduplicate.\n- `event_type` - The wire event name (`dispute.created`, `dispute.updated`, or `dispute.closed`).\n- `data` - The full canonical dispute, the same shape returned by `GET /api/v1/disputes/{dispute_id}` — including\n  `dispute_id`, `state`, `phase`, `reason`, `amount`, `due_by`, `counters`, and `metadata`. Null fields are\n  omitted. Payloads carry canonical Truemed fields and the public `dispute_id` UUID only, never raw processor\n  shapes. Always key your records on `dispute_id`.\n\n(Unsigned legacy endpoints receive the `data` object as the flat top-level body, with no envelope and no\n`event_type`.)\n\nThe model is **notify, then fetch**: the snapshot is complete enough to act on directly, and you can re-fetch the\ndispute for authoritative state when a delivery is delayed or retried out of order.\n\n**Inquiries notify too, with one exception.** A live inquiry fires `dispute.created` / `dispute.updated` just like\na chargeback, so you can respond to pre-empt its escalation. If the bank later drops a surfaced inquiry, the terminal\n`closed` state fires `dispute.closed` — so `dispute.closed` marks any terminal outcome, whether a chargeback result\n(`won` / `lost` / `accepted` / `expired`) or a dropped inquiry (`closed`). The only silent case is an inquiry that\nopens and closes between webhook deliveries — already terminal the first time Truemed sees it — which fires no webhook.\n\n## Response Notes\n\nReturn HTTP `204` with an empty body. Truemed retries failed deliveries with backoff for up to 7 days.","responses":{"200":{"description":"Webhook received successfully"}},"requestBody":{"description":"Webhook payload for disputecreated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeWebhookPayload"}}}}}},"disputes_disputeUpdatedWebhook":{"post":{"operationId":"disputes_disputeUpdatedWebhook","summary":"Dispute Updated Webhook","description":"Truemed calls your endpoint when an open dispute's `state` or `phase` changes — for example, after you\nsubmit evidence and it moves to `under_review`. An update that changes neither `state` nor `phase` is\nsilent.\n\n**Authentication**: Requests are HMAC-SHA256 signed. The `x-truemed-signature` header carries a timestamp and\nthe signature in the form `t=<unix-timestamp>,v0=<hex-signature>`. Compute HMAC-SHA256 over\n`<t>.<raw-request-body>` with your webhook signing secret and compare the hex digest to `v0`. Sign the raw body\nbytes exactly as received, since re-serializing the JSON changes the bytes and breaks the signature.\n\n## Payload\n\nThe signed body is the standard Truemed envelope:\n\n- `webhook_delivery_id` - Delivery id (`dlv_…`). Retries of the same event repeat the same value; use it to\n  deduplicate.\n- `event_type` - The wire event name (`dispute.created`, `dispute.updated`, or `dispute.closed`).\n- `data` - The full canonical dispute, the same shape returned by `GET /api/v1/disputes/{dispute_id}` — including\n  `dispute_id`, `state`, `phase`, `reason`, `amount`, `due_by`, `counters`, and `metadata`. Null fields are\n  omitted. Payloads carry canonical Truemed fields and the public `dispute_id` UUID only, never raw processor\n  shapes. Always key your records on `dispute_id`.\n\n(Unsigned legacy endpoints receive the `data` object as the flat top-level body, with no envelope and no\n`event_type`.)\n\nThe model is **notify, then fetch**: the snapshot is complete enough to act on directly, and you can re-fetch the\ndispute for authoritative state when a delivery is delayed or retried out of order.\n\n**Inquiries notify too, with one exception.** A live inquiry fires `dispute.created` / `dispute.updated` just like\na chargeback, so you can respond to pre-empt its escalation. If the bank later drops a surfaced inquiry, the terminal\n`closed` state fires `dispute.closed` — so `dispute.closed` marks any terminal outcome, whether a chargeback result\n(`won` / `lost` / `accepted` / `expired`) or a dropped inquiry (`closed`). The only silent case is an inquiry that\nopens and closes between webhook deliveries — already terminal the first time Truemed sees it — which fires no webhook.\n\n## Response Notes\n\nReturn HTTP `204` with an empty body. Truemed retries failed deliveries with backoff for up to 7 days.","responses":{"200":{"description":"Webhook received successfully"}},"requestBody":{"description":"Webhook payload for disputeupdated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeWebhookPayload"}}}}}},"qualificationSessions_qualificationStatusUpdatedWebhook":{"post":{"operationId":"qualificationSessions_qualificationStatusUpdatedWebhook","summary":"Qualification Session Complete Webhook","description":"The partner is required to implement an endpoint that Truemed requests to inform the partner\nof the `qualification_session` status.\n\nThe `qualification_session_complete` webhook will only be called once for each qualification\nsession, on status change to `approved`, or `rejected`.\n\n**Authentication**: Partners should verify the request comes from Truemed by checking that\nthe API key is present in the `x-truemed-api-key` HTTP header.\n\n## Request Notes\n\n- `status` - the status of the qualification session, an enum with one of the following\n  values:\n  - `pending` - the user hasn't has not completed the survey\n  - `processing` - the user has completed the session and it is under review\n  - `approved` - the user has been issued a Letter-of-Medical-Necessity\n  - `rejected` - the user is ineligible to receive a Letter-of-Medical-Necessity\n- `expires_at`: **(Optional)** - the datetime at which the Letter-of-Medical-Necessity expires\n  - If the Letter-of-Medical-Necessity hasn't been issued, this field will be `null`.\n- `user_id`: **(Optional)** - the `user_id` provided in the qualification session redirect\n  URL param\n  - This field will be `null` if `user_id` wasn't provided in the URL for creation.\n- `source`: **(Optional)** - the `source` provided in the qualification session redirect URL\n  param\n  - This field will be `null` if `source` wasn't provided in the URL for creation.\n\n## Response Notes\n\n### Success Case\n\nHTTP Status: `204`\n\nThe partner does not need to include any content in the body.\n\n### Failure Case\n\nTruemed will retry the requests to your backend with backoff for up to 7 days","responses":{"200":{"description":"Webhook received successfully"}},"requestBody":{"description":"Webhook payload for qualificationstatusupdated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualificationSessionStatusUpdatedWebhookPayload"}}}}}},"productCatalog_itemEligibilityUpdatedWebhook":{"post":{"operationId":"productCatalog_itemEligibilityUpdatedWebhook","summary":"Item Eligibility Updated Webhook","description":"The partner can implement an endpoint that Truemed calls when the HSA/FSA eligibility status\nof an item changes.\n\nThis webhook is triggered when:\n\n1. An item's eligibility is updated (e.g., from `ineligible` to `eligible_with_lmn`)\n2. An item's eligibility status is first determined\n\n**Authentication**: Signed webhooks are HMAC-SHA256 signed. The `x-truemed-signature` header carries a\ntimestamp and the signature in the form `t=<unix-timestamp>,v0=<hex-signature>`. Compute HMAC-SHA256 over\n`<t>.<raw-request-body>` with your webhook signing secret and compare the hex digest to `v0`. Sign the raw\nbody bytes exactly as received, since re-serializing the JSON changes the bytes and breaks the signature.\nUnsigned (legacy) webhooks instead send the API key verbatim in the `x-truemed-api-key` header.\n\n## Request Notes\n\nThe signed body wraps an event envelope inside the delivery envelope, so the catalog item is at\n`data.data.object`:\n\n```json\n{\n  \"webhook_delivery_id\": \"dlv_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4\",\n  \"event_type\": \"product_catalog.item.eligibility_updated\",\n  \"data\": {\n    \"event_type\": \"product_catalog.item.eligibility_updated\",\n    \"timestamp\": \"2026-01-15T12:00:00Z\",\n    \"data\": {\n      \"object\": {\n        \"sku\": \"ITEM-001\",\n        \"name\": \"Compression Knee Brace\",\n        \"eligibility\": \"eligible_with_lmn\",\n        \"reviewed_at\": \"2026-01-15T11:59:58Z\"\n      }\n    }\n  }\n}\n```\n\nFields:\n\n- `webhook_delivery_id` - Delivery id (`dlv_…`). Retries of the same event repeat the same value; use it to\n  deduplicate. Signed deliveries only.\n- `event_type` - The event type identifier: `product_catalog.item.eligibility_updated`. Carried on both the\n  delivery envelope and the inner event envelope, with the same value.\n- `data.timestamp` - ISO-8601 timestamp of when the event occurred\n- `data.data.object` - The item details including:\n  - `sku` - The SKU of the item\n  - `name` - The name of the item\n  - `eligibility` - The HSA/FSA eligibility status:\n    - `eligible` - Item is default eligible for HSA/FSA\n    - `eligible_with_lmn` - Item is eligible with a Letter of Medical Necessity\n    - `ineligible` - Item is not eligible for HSA/FSA\n  - `reviewed_at` - ISO-8601 timestamp of when the item's eligibility was last decided\n\nUnsigned (legacy) webhooks receive the inner event envelope as the top-level body — `{event_type,\ntimestamp, data: {object}}` — with no `webhook_delivery_id`. The item is at `data.object`.\n\n## Response Notes\n\n### Success Case\n\nHTTP Status: `204`\n\nThe partner does not need to include any content in the body.\n\n### Failure Case\n\nTruemed will retry the requests to your backend with backoff for up to 7 days","responses":{"200":{"description":"Webhook received successfully"}},"requestBody":{"description":"Webhook payload for productcatalogitemeligibilityupdated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCatalogItemEligibilityUpdatedWebhookPayload"}}}}}}},"components":{"schemas":{"PaymentSessionAmountDetail":{"type":"object","properties":{"amount":{"type":"integer","description":"The amount in cents for this discount or charge."},"name":{"type":"string","description":"The name or description of the discount or charge."}},"required":["amount","name"],"title":"PaymentSessionAmountDetail"},"PaymentSessionAmountDetails":{"type":"object","properties":{"additional_charges_details":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PaymentSessionAmountDetail"},"description":"An array of individual additional charge line items with names and amounts."},"discounts_details":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PaymentSessionAmountDetail"},"description":"An array of individual discount line items with names and amounts."},"total_additional_charges":{"type":["integer","null"],"description":"The total amount of additional charges (e.g., shipping, tax), in cents."},"total_discounts":{"type":["integer","null"],"description":"The total amount of discounts applied, in cents."}},"title":"PaymentSessionAmountDetails"},"Address":{"type":"object","properties":{"city":{"type":"string","description":"City for address"},"country":{"type":["string","null"],"description":"2-letter ISO 3166 for address"},"line1":{"type":"string","description":"First line of address"},"line2":{"type":["string","null"],"description":"Second line of address"},"postal_code":{"type":"string","description":"Zip code for address"},"state":{"type":"string","description":"State for address"}},"required":["city","line1","postal_code","state"],"title":"Address"},"NextBillInfo":{"type":"object","properties":{"date":{"type":"string","format":"date"},"total_amount":{"type":"integer"}},"required":["date","total_amount"],"title":"NextBillInfo"},"PurchaseKind":{"type":"string","enum":["one_time_payment","authorization"],"description":"Enum for the kind of payment\n\nThis determines how the payment will be captured\n- OneTimePayment means captured by Truemed automatically\n- Authorization means manually captured by the requesting merchant","title":"PurchaseKind"},"PaymentSessionOrderItem":{"type":"object","properties":{"amount":{"type":["integer","null"],"description":"The total amount for this line item in cents. Either amount or price must be provided."},"amount_details":{"$ref":"#/components/schemas/PaymentSessionAmountDetails","description":"Optional itemized discounts and charges for this item."},"item_id":{"type":["string","null"],"description":"A unique identifier for this order item within the payment."},"name":{"type":"string","description":"The name of the item."},"price":{"type":["integer","null"],"description":"The unit price in cents for the item. Either amount or price must be provided."},"quantity":{"type":"integer","description":"The number of this item in the cart."},"sku":{"type":"string","description":"The SKU (Stock Keeping Unit) for this item."}},"required":["amount_details","name","quantity","sku"],"title":"PaymentSessionOrderItem"},"SurveyConfig":{"type":"object","properties":{"hide_back_to_checkout_cta":{"type":"boolean","description":"Provide as true to hide the 'Back to checkout' CTA in the survey if the user fails to qualify."}},"required":["hide_back_to_checkout_cta"],"title":"SurveyConfig"},"CreatePaymentSessionRequest":{"type":"object","properties":{"amount_details":{"$ref":"#/components/schemas/PaymentSessionAmountDetails","description":"Additional amount details including discounts and charges."},"billing_address":{"oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}],"description":"The Billing address for the order (used for better fraud detection)"},"billing_name":{"type":["string","null"],"description":"The first and last name of the person for billing (used for better fraud detection)."},"customer_email":{"type":"string","description":"The email address for the customer. Required unless you send `payment_token`. When you send `payment_token`, Truemed ignores this field and uses the email stored on the token. To change that email, call `update_payment_token`."},"customer_name":{"type":"string","description":"The first and last name of the customer."},"customer_state":{"type":["string","null"],"description":"The 2-letter ISO 3166-2:US code for a region, without the US- prefix."},"display_next_bill_info":{"oneOf":[{"$ref":"#/components/schemas/NextBillInfo"},{"type":"null"}],"description":"Information about the next bill for free trial sessions."},"failure_url":{"type":"string","maxLength":4096,"description":"When the payment fails in an irrecoverable way, or the user is ineligible to spend HSA/FSA funds on the purchase."},"idempotency_key":{"type":"string","description":"A unique identifier for the checkout session, used to safely retry this request. If the same `idempotency_key` is sent again with a request whose key fields match the original (`customer_email` (case-insensitive), `total_amount`, `success_url`, `failure_url`, `order_items`, `kind`, `payment_token`, and any `display_next_bill_info` fields), the original payment session is returned. If the key is reused with a different request, a `400 IdempotencyViolation` is returned naming the field(s) that diverged. `customer_name`, `metadata`, and survey configuration are not part of the idempotency comparison."},"kind":{"oneOf":[{"$ref":"#/components/schemas/PurchaseKind"},{"type":"null"}],"default":"one_time_payment","description":"One of the following: one_time_payment (DEFAULT), authorization."},"metadata":{"type":["string","null"],"description":"Will be echoed back in the webhook and detail view if present."},"order_items":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSessionOrderItem"},"description":"A list of order items."},"payment_token":{"type":["string","null"],"description":"The ID returned by Truemed on initial recurring charges (when tokenize=True). When you send it, Truemed charges the customer who owns the token and ignores `customer_email` and `customer_name`."},"request_multicapture":{"type":["boolean","null"],"default":false,"description":"Request multi-capture on this authorization so you can capture it more than once. Needs `kind: \"authorization\"` and multi-capture enabled for your sales channel, and can't be combined with `tokenize` or `payment_token`. The card network confirms availability for each transaction, and Truemed returns the result as `multicapture_available`; check it before you split an order. If `total_amount` differs from the items' totals, name the difference in `amount_details`. See [Manual and delayed capture](/guides/setup/api/payment-sessions/manual-delayed-capture#capturing-in-multiple-parts)."},"shipping_address":{"oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}],"description":"The shipping address for the payment session."},"shipping_name":{"type":["string","null"],"description":"The first and last name of the person for shipping (used for better fraud detection)."},"success_url":{"type":"string","maxLength":4096,"description":"Where to redirect the user to after Truemed successfully processes a payment."},"survey_config":{"oneOf":[{"$ref":"#/components/schemas/SurveyConfig"},{"type":"null"}],"description":"Allows the partner to customize the health survey."},"tokenize":{"type":["boolean","null"],"default":false,"description":"True or False - set to True to enable subsequent charges."},"total_amount":{"type":"integer","description":"The total amount in cents to charge the user, inclusive of discounts, shipping, taxes, and other fees being collected by the partner."},"use_iframe":{"type":["boolean","null"],"default":false,"description":"Optional query parameter that can be used to modify the response's redirect_url so it can be used and communicated with in an iframe."}},"required":["amount_details","customer_email","customer_name","failure_url","idempotency_key","order_items","success_url","total_amount"],"title":"CreatePaymentSessionRequest"},"CreatePaymentSessionResponse":{"type":"object","properties":{"authorization_expires_at":{"type":["string","null"],"format":"date-time","description":"The latest UTC time at which the authorization is valid for capture. Null until the session has an authorized transaction. When the transaction has multiple active payments (e.g. HSA + credit), this is the earliest expiration across them."},"id":{"type":"string","description":"The unique ID for this checkout session."},"lmn_expires_at":{"type":["string","null"],"format":"date","description":"When the Letter of Medical Necessity covering this customer expires (inclusive, UTC). Null for sessions that are not tokenized, and for a customer who holds no letter on this sales channel. While a letter is live this is the earliest expiration among them; once none is, it is when the last one lapsed. This is the same value the customer-eligibility endpoints return, so renewal can be driven off whichever call you already make."},"message":{"type":["string","null"],"description":"Optional message for the response."},"next_action":{"type":["string","null"],"description":"The next action required for the payment."},"payment_token":{"type":["string","null"],"description":"The payment token for recurring payments."},"redirect_url":{"type":["string","null"],"description":"The URL that the partner should redirect the customer to."}},"required":["id"],"title":"CreatePaymentSessionResponse"},"CreatePaymentSessionBadRequestResponseError":{"type":"string","enum":["FeatureNotEnabled","IdempotencyViolation","InvalidRequestParameter","MissingRequiredParameter","OrderItemsInvalid","SessionPending","TokenizeNotSupported","TotalAmountInvalid","ValidationError"],"title":"CreatePaymentSessionBadRequestResponseError"},"CreatePaymentSessionBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CreatePaymentSessionBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"CreatePaymentSessionBadRequestResponse"},"NotFoundResponseError":{"type":"string","enum":["NotFound"],"title":"NotFoundResponseError"},"NotFoundResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotFoundResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"NotFoundResponse"},"MethodNotAllowedResponseError":{"type":"string","enum":["MethodNotAllowed"],"title":"MethodNotAllowedResponseError"},"MethodNotAllowedResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/MethodNotAllowedResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"MethodNotAllowedResponse"},"ServerErrorResponseError":{"type":"string","enum":["ServerError"],"title":"ServerErrorResponseError"},"ServerErrorResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ServerErrorResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"ServerErrorResponse"},"NotImplementedResponseError":{"type":"string","enum":["NotImplemented"],"title":"NotImplementedResponseError"},"NotImplementedResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/NotImplementedResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"NotImplementedResponse"},"CapturedItemDetails":{"type":"object","properties":{"amount_details":{"oneOf":[{"$ref":"#/components/schemas/PaymentSessionAmountDetails"},{"type":"null"}],"description":"The charges and discounts the capture declared on this item, as sent: empty when it declared none of its own, absent when the capture was inferred."},"item_id":{"type":"string","description":"ID that uniquely identifies the item within the Payment; optionally specified when creating the payment and retrievable from payment session status or list payment sessions. On a multi-capture session, list each item once per request."},"order_level_captured":{"type":["integer","null"],"description":"The order-level money this capture declared on this item beyond what the item was created for, in cents, included in `total`. Refundable with the item."},"quantity":{"type":"integer","description":"The units of this item the capture recorded."},"total":{"type":"integer","description":"What the capture collected for these units, in cents, including the order-level money declared on the item (`order_level_captured`)."}},"required":["item_id","quantity","total"],"title":"CapturedItemDetails"},"PaymentSessionCaptureDetails":{"type":"object","properties":{"amount_details":{"oneOf":[{"$ref":"#/components/schemas/PaymentSessionAmountDetails"},{"type":"null"}],"description":"The order-level charges and discounts this capture declared, as sent: empty when only its items declared, absent when nothing was declared."},"amount_refundable":{"type":"integer","description":"The amount in cents still refundable against this capture — the captured amount net of prior refunds and any dispute-locked funds. Use this as the ceiling for a refund targeting this capture."},"capture_amount":{"type":"integer","description":"The amount captured in cents for this capture."},"captured_at":{"type":"string","description":"ISO-8601 timestamp of when this capture completed."},"id":{"type":"string","description":"The stable id of this capture; pass it as `capture_id` to refund against it."},"item_details":{"type":"array","items":{"$ref":"#/components/schemas/CapturedItemDetails"},"description":"The per-item breakdown of this capture (empty for amount-only captures)."},"order_level_captured":{"type":["integer","null"],"description":"The order-level money this capture collected beyond its items' totals, in cents: order-level charges minus order-level discounts. `item_details[].total` plus this is `capture_amount`. Multi-capture sessions only."}},"required":["amount_refundable","capture_amount","captured_at","id","item_details"],"title":"PaymentSessionCaptureDetails"},"DisputePhase":{"type":"string","enum":["inquiry","dispute","pre_arbitration","arbitration"],"description":"Which round of a dispute this is — orthogonal to `DisputeState` (comparison doc §4.3/§5).","title":"DisputePhase"},"DisputeReason":{"type":"string","enum":["credit_not_processed","duplicate","fraudulent","general","noncompliant","product_not_received","product_unacceptable","subscription_canceled","unrecognized"],"description":"Canonical, card-network dispute reason — the only reasons Truemed can receive, since it settles\nHSA/FSA card payments over Stripe and never ACH/bank-debit. The enum is the processor-independent\ncontract: each processor adapter maps its native reason vocabulary into this set (Adyen's raw\ncard-scheme reason codes collapse into these buckets), so the enum itself carries no processor specifics.\n\nHuman labels live in `_DISPUTE_REASON_LABELS`, exposed via `.label` — the single backend contract the\nfrontend and merchant emails hydrate from instead of maintaining their own label maps.","title":"DisputeReason"},"DisputeState":{"type":"string","enum":["inquiry","needs_response","under_review","won","lost","accepted","expired","closed"],"description":"Canonical, processor-agnostic dispute state — the 8-state model in the Processor Disputes\nComparison doc §4.3. Distinct from the Stripe-shaped `DisputeStatus`: a processor adapter maps\nraw status/eventCodes → (DisputeState, DisputePhase). `closed` is the favorable no-contest\ninquiry outcome (excluded from win-rate), kept separate from `won`.","title":"DisputeState"},"DisputeStatusPublic":{"type":"string","enum":["Lost","Won","Closed","Investigating","Under Review","Unknown"],"description":"The public facing status for the dispute.","title":"DisputeStatusPublic"},"DisputeDetails":{"type":"object","properties":{"amount":{"type":["integer","null"],"default":0,"description":"The original disputed amount in cents. Always reflects what the dispute was filed for, independent of resolution. For Won disputes this stays non-zero even though `withdrawn_amount` becomes 0 after reinstatement, so consumers can show 'this dispute was for $X' regardless of outcome."},"description":{"type":"string","description":"Further details about the state of a dispute."},"dispute_id":{"type":"string","description":"Stable Truemed dispute ID (UUID). Use this as the dispute's identifier."},"disputed_on":{"type":"string","format":"date-time","description":"The date that the dispute was created."},"phase":{"oneOf":[{"$ref":"#/components/schemas/DisputePhase"},{"type":"null"}],"description":"Which round of the dispute (inquiry, dispute, pre-arbitration, arbitration)."},"processor_dispute_id":{"type":"string","description":"Raw payment-processor dispute ID (e.g. Stripe `du_…`). Provided for reconciliation against processor records; prefer `dispute_id` (the stable Truemed UUID) as the identifier."},"reason":{"$ref":"#/components/schemas/DisputeReason","description":"Specific reason the dispute was created."},"resolved_on":{"type":["string","null"],"format":"date-time","description":"The date that the dispute was resolved."},"state":{"$ref":"#/components/schemas/DisputeState","description":"Canonical dispute state. Finer-grained than `status`: distinguishes `inquiry` and `needs_response` (both surfaced as `Investigating` in `status`)."},"status":{"$ref":"#/components/schemas/DisputeStatusPublic","description":"Status of this dispute."},"withdrawn_amount":{"type":["integer","null"],"default":0,"description":"The total amount of money withdrawn based on the ruling."}},"required":["description","dispute_id","disputed_on","processor_dispute_id","reason","state","status"],"title":"DisputeDetails"},"PaymentSessionOrderItemDetails":{"type":"object","properties":{"amount":{"type":["integer","null"],"description":"The total amount for this line item in cents (quantity × price)."},"amount_details":{"oneOf":[{"$ref":"#/components/schemas/PaymentSessionAmountDetails"},{"type":"null"}],"description":"Itemized discounts and charges applied to this specific item."},"item_id":{"type":["string","null"],"description":"Optional unique identifier for this item provided by the merchant."},"max_capture_amount":{"type":["integer","null"],"description":"This item's allocated share of the session, in cents: its `total` plus `order_level_charges_share` minus `order_level_discounts_share`. Not a hard limit: an inferred capture may also collect order-level money the session still owes. Multi-capture sessions only, once authorized."},"max_capture_amount_remaining":{"type":["integer","null"],"description":"What's left of `max_capture_amount` after earlier captures of this item, in cents. 0 once all its units are captured or the session closes, and while the session awaits LMN verification."},"name":{"type":"string","description":"The name of the item."},"order_level_charges_share":{"type":["integer","null"],"description":"This item's share of the session's order-level shipping, tax and fees, in cents."},"order_level_discounts_share":{"type":["integer","null"],"description":"This item's share of the session's order-level discounts, in cents. A discount a capture declares on an item moves to that item."},"price":{"type":"integer","description":"The unit price in cents charged for the item."},"quantity":{"type":"integer","description":"The number of this item in the cart."},"quantity_capturable":{"type":["integer","null"],"description":"The quantity of this item that can still be captured (for manual capture authorizations)."},"quantity_refundable":{"type":["integer","null"],"description":"The quantity of this item that can be refunded."},"sku":{"type":["string","null"],"description":"The SKU (Stock Keeping Unit) for this item."},"total":{"type":"integer","description":"The post-discount, post-charge line total in cents — `(price × quantity) + total_additional_charges - total_discounts`. Use this when displaying the per-item total or when computing capture `item_details.total` for a fresh capture."},"total_capturable":{"type":["integer","null"],"description":"The total amount in cents that can still be captured for this item."},"total_refundable":{"type":["integer","null"],"description":"The total amount in cents that can be refunded for this item. Truemed tracks this per item, so an order-level charge or discount appears in none of them: when the session carried a top-level `amount_details`, the sum of `total_refundable` across items falls below the session's refundable amount."}},"required":["name","price","quantity","total"],"title":"PaymentSessionOrderItemDetails"},"RefundDetails":{"type":"object","properties":{"amount":{"type":"integer","description":"The amount refunded, in cents."},"id":{"type":"string","description":"The UUID of the refund."},"refunded_on":{"type":"string","format":"date-time","description":"The date the refund was made in ISO 8601 format. Example: \"2024-06-13T16:03:08.386Z\""},"truemed_fee_returned":{"type":["integer","null"],"default":0,"description":"The amount of Truemed fees returned with this refund, in cents."}},"required":["amount","id","refunded_on"],"title":"RefundDetails"},"PaymentSessionStatus":{"type":"string","enum":["pending","canceled","processing","rejected","authorized","authorization_expired","authorization_voided","partially_captured","captured"],"title":"PaymentSessionStatus"},"CustomerFacingTransactionStatus":{"type":"string","enum":["Incomplete","Canceled","Rejected","Processing","Authorized","Voided","Expired","Partially Captured","Captured","Partially Refunded","Refunded","PartiallyDisputed","Disputed"],"title":"CustomerFacingTransactionStatus"},"PaymentSessionDetailResponseTruemedFee":{"oneOf":[{"type":"number","format":"double"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"description":"The fee that Truemed received from the payment session. Will return 0 until the session has been captured.","title":"PaymentSessionDetailResponseTruemedFee"},"PaymentSessionDetailResponse":{"type":"object","properties":{"amount_details":{"oneOf":[{"$ref":"#/components/schemas/PaymentSessionAmountDetails"},{"type":"null"}],"description":"Detailed breakdown of the payment amount."},"authorization_expires_at":{"type":["string","null"],"format":"date-time","description":"The latest UTC time at which the authorization is valid for capture. Null until the session has an authorized transaction. When the transaction has multiple active payments (e.g. HSA + credit), this is the earliest expiration across them."},"authorize_amount":{"type":"integer","description":"The amount the user's card will be authorized for. In the case of `kind=one_time_payment`, this will always the same same as `capture_amount`."},"capture_amount":{"type":["integer","null"],"description":"The amount of funds actually captured."},"capture_failed_amount_collected":{"type":["integer","null"],"description":"The amount of funds already collected on a capture that permanently failed. Set when part of a split payment succeeded before the capture failed; null otherwise."},"capture_failed_details":{"type":["string","null"],"description":"A generic message indicating the capture could not be completed. Null when capture_failed_on is null."},"capture_failed_on":{"type":["string","null"],"format":"date-time","description":"The UTC time at which capturing the authorized funds permanently failed. Null unless the capture will not be retried."},"captures":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSessionCaptureDetails"},"description":"The completed captures for this payment session, each addressable by `id` when issuing a refund (`capture_id`), in the order the captures were made. Empty until the session has at least one completed capture."},"created_at":{"type":"string","format":"date-time","description":"The date and time when the payment session was created."},"customer_business_id":{"type":["string","null"],"description":"The business id of the customer."},"disputes":{"type":"array","items":{"$ref":"#/components/schemas/DisputeDetails"},"description":"A list of dispute objects that will be empty if the payment has no associated disputes."},"email":{"type":["string","null"],"description":"The email of the user who executed the payment."},"is_testing":{"type":"boolean","description":"Whether the payment was executed in a test environment."},"kind":{"$ref":"#/components/schemas/PurchaseKind","description":"The type of payment session."},"metadata":{"type":["string","null"],"description":"Optional field echoed back if present in the call to `create_payment_session`."},"multicapture_available":{"type":["boolean","null"],"description":"Whether this session can be captured more than once. Truemed requests multi-capture for sessions created with `request_multicapture: true`, and the card network confirms it for each transaction; this is `true` only when every card the customer paid with supports it. When it's `false`, a `final: false` capture is rejected. Present once authorized, for sessions created with `request_multicapture: true`."},"name":{"type":["string","null"],"description":"The name of the user who executed the payment."},"order_items":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSessionOrderItemDetails"},"description":"A list of order items."},"order_level_charges_remaining":{"type":["integer","null"],"description":"Order-level shipping, tax and fees that no capture has collected yet, in cents. 0 once the session closes; refunds don't add back to it. Multi-capture sessions only, once authorized."},"order_level_discounts_remaining":{"type":["integer","null"],"description":"Order-level discounts that no capture has applied yet, in cents. 0 once the session closes; refunds don't add back to it. Multi-capture sessions only, once authorized."},"payment_session_id":{"type":"string","description":"The id of the payment session."},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/RefundDetails"},"description":"A list of refund objects that will be empty if the payment has no associated refunds."},"status":{"$ref":"#/components/schemas/PaymentSessionStatus","description":"The status of the initial payment."},"status_summary":{"$ref":"#/components/schemas/CustomerFacingTransactionStatus","description":"A summary of the overall payment session."},"stripe_payment_id":{"type":["string","null"],"description":"The Stripe payment id."},"total_amount":{"type":"integer","description":"The total amount captured, in cents."},"truemed_fee":{"oneOf":[{"$ref":"#/components/schemas/PaymentSessionDetailResponseTruemedFee"},{"type":"null"}],"description":"The fee that Truemed received from the payment session. Will return 0 until the session has been captured."}},"required":["authorize_amount","captures","created_at","disputes","is_testing","kind","order_items","payment_session_id","refunds","status","status_summary","total_amount"],"title":"PaymentSessionDetailResponse"},"RetrievePaymentSessionBadRequestResponseError":{"type":"string","enum":["MissingField","TotalAmountInvalid","ValidationError"],"title":"RetrievePaymentSessionBadRequestResponseError"},"RetrievePaymentSessionBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RetrievePaymentSessionBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"RetrievePaymentSessionBadRequestResponse"},"RetrievePaymentSessionNotFoundResponseError":{"type":"string","enum":["InvalidPaymentId","NotFound"],"title":"RetrievePaymentSessionNotFoundResponseError"},"RetrievePaymentSessionNotFoundResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RetrievePaymentSessionNotFoundResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"RetrievePaymentSessionNotFoundResponse"},"PaginationBody":{"type":"object","properties":{"count":{"type":"integer","description":"The total number of items associated with the provided API key."},"current_page":{"type":"integer","description":"The page requested. If none was provided, this will default to 1."},"last_page":{"type":"integer","description":"The last page. You can iterate through pages by providing integers up to last_page in the page parameter."},"page_size":{"type":"integer","description":"The number of items per page applied to this response."}},"required":["count","current_page","last_page","page_size"],"title":"PaginationBody"},"PaymentSessionDetailsTruemedFee":{"oneOf":[{"type":"number","format":"double"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"description":"Only present when include_trumed_fee=True is included in the request. The fee collected by truemed for this payment session. Will return 0 until the session has been captured.","title":"PaymentSessionDetailsTruemedFee"},"UserDetails":{"type":"object","properties":{"business_id":{"type":"string","description":"The unique business ID of the user."},"email":{"type":"string","description":"The email of the user who executed the payment."},"name":{"type":"string","description":"The name of the user who executed the payment."}},"required":["business_id","email","name"],"title":"UserDetails"},"PaymentSessionDetails":{"type":"object","properties":{"amount_details":{"oneOf":[{"$ref":"#/components/schemas/PaymentSessionAmountDetails"},{"type":"null"}],"description":"Detailed breakdown of the payment amount including discounts and charges."},"authorize_amount":{"type":"integer","description":"The total_amount passed into `create_payment_session`."},"authorized_on":{"type":["string","null"],"format":"date-time","description":"The date the payment was authorized in ISO 8601 format. Example: \"2024-06-13T16:03:07.473Z\". For kind: one_time_payment, this will be the same as captured_on."},"capture_amount":{"type":["integer","null"],"description":"For one time payments, same as authorize_amount. Otherwise, the captured amount."},"captured_on":{"type":["string","null"],"format":"date-time","description":"The date the payment was captured in ISO 8601 format. Example: \"2024-06-13T16:03:07.473Z\"."},"created_at":{"type":"string","format":"date-time","description":"The date the payment session was created in ISO 8601 format. Example: \"2024-06-13T16:03:07.473Z\"."},"disputes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/DisputeDetails"},"description":"An array of dispute objects. Included if include_disputes is True (by default)."},"id":{"type":"string","description":"The UUID returned by `create_payment_session`."},"idempotency_key":{"type":"string","description":"The idempotency key passed into create_payment_session."},"is_testing":{"type":"boolean","description":"The testing flag."},"kind":{"$ref":"#/components/schemas/PurchaseKind","description":"The payment kind, either one_time_payment or authorization."},"metadata":{"type":["string","null"],"description":"The raw `metadata` field passed into `create_payment_session`."},"order_items":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PaymentSessionOrderItemDetails"},"description":"The list of the current state of the order items passed into `create_payment_session` if `include_order_items` is True."},"refund_amount":{"type":["integer","null"],"description":"Only present when summarize_refunds=True is included in the request. The sum of processed refunds for the payment session, in cents."},"refund_count":{"type":"integer","description":"The number of refunds made on this payment."},"refunds":{"type":["array","null"],"items":{"$ref":"#/components/schemas/RefundDetails"},"description":"An array of refund objects. Included if include_refunds is True (by default)."},"status":{"$ref":"#/components/schemas/PaymentSessionStatus","description":"Status of the Payment Session (pending, processing, captured, authorized, or authorization_voided, or rejected)."},"status_summary":{"$ref":"#/components/schemas/CustomerFacingTransactionStatus","description":"A summary of the overall payment session status."},"stripe_payment_id":{"type":["string","null"],"description":"The Stripe payment ID associated with this payment session."},"truemed_fee":{"oneOf":[{"$ref":"#/components/schemas/PaymentSessionDetailsTruemedFee"},{"type":"null"}],"description":"Only present when include_trumed_fee=True is included in the request. The fee collected by truemed for this payment session. Will return 0 until the session has been captured."},"user":{"$ref":"#/components/schemas/UserDetails","description":"The user attached to the payment session."}},"required":["authorize_amount","created_at","id","idempotency_key","is_testing","kind","refund_count","status","status_summary","user"],"title":"PaymentSessionDetails"},"PaymentSessionListResponse":{"type":"object","properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationBody"},{"type":"null"}],"description":"A pagination object with information about the current page, page size, total count, and last page."},"payment_sessions":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSessionDetails"},"description":"List of payment session details."}},"required":["payment_sessions"],"title":"PaymentSessionListResponse"},"ListPaymentSessionBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"ListPaymentSessionBadRequestResponseError"},"ListPaymentSessionBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ListPaymentSessionBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"ListPaymentSessionBadRequestResponse"},"CaptureItemDetails":{"type":"object","properties":{"amount_details":{"oneOf":[{"$ref":"#/components/schemas/PaymentSessionAmountDetails"},{"type":"null"}],"description":"This item's charges and discounts in this capture, in the session-creation shape. The unit price times `quantity`, plus charges, minus discounts, must equal `total`. To declare no charges or discounts, send a zero total with an empty details list. Multi-capture sessions only, and only when the session's first capture declared amounts."},"item_id":{"type":"string","description":"ID that uniquely identifies the item within the Payment; optionally specified when creating the payment and retrievable from payment session status or list payment sessions. On a multi-capture session, list each item once per request."},"quantity":{"type":"integer","description":"The quantity to capture for this order_item, up to the quantity_capturable for the item, retrievable from payment session status or list payment sessions."},"total":{"type":"integer","description":"The total amount in cents to capture for this order_item. Without `amount_details`, up to the item's total_capturable, retrievable from payment session status or list payment sessions; with them, it also includes the order-level money declared on the item. In a capture that declares amounts, an item sent without `amount_details`, or with an empty object, declares the charges and discounts its units were created with."}},"required":["item_id","quantity","total"],"title":"CaptureItemDetails"},"PaymentSessionCaptureRequest":{"type":"object","properties":{"amount_details":{"oneOf":[{"$ref":"#/components/schemas/PaymentSessionAmountDetails"},{"type":"null"}],"description":"Order-level charges and discounts this capture carries beyond its items, in the session-creation shape. The items' totals plus charges minus discounts must equal `total_amount`. To declare no charges or discounts, send a zero total with an empty details list. Multi-capture sessions only, and only when the session's first capture declared amounts: once a capture sends none, later captures are rejected if they do."},"final":{"type":"boolean","default":true,"description":"Defaults to `true`, which releases whatever this capture doesn't collect. `false` keeps the rest authorized for a later capture; it needs multi-capture (see `multicapture_available`)."},"idempotency_key":{"type":"string","description":"Allows the endpoint to be called multiple times. It must be unique to the capture session."},"item_details":{"type":"array","items":{"$ref":"#/components/schemas/CaptureItemDetails"},"description":"A list of items being captured in the capture request."},"total_amount":{"type":"integer","description":"The total amount in cents to charge the user, inclusive of taxes and fees being collected by the partner. Must be less than or equal to the total_amount passed in when creating the payment session. If an amount more than the initial authorization should be captured, void the initial auth hold and create a new one."}},"required":["idempotency_key","item_details","total_amount"],"title":"PaymentSessionCaptureRequest"},"PaymentSessionCaptureResponse":{"type":"object","properties":{"capture_id":{"type":["string","null"],"description":"The ID of this capture. Pass it as `capture_id` to the refund endpoint to refund against this capture. The same ID is returned if the endpoint is called again with the same idempotency_key. Omitted for a zero-amount final capture, which only releases the uncaptured remainder and cannot be refunded."},"id":{"type":"string","description":"The ID of the payment session that was captured, the same value returned by create_payment_session. Use `capture_id` to identify this capture."}},"required":["id"],"title":"PaymentSessionCaptureResponse"},"CapturePaymentSessionBadRequestResponseError":{"type":"string","enum":["ImmediateCapture","InvalidRequestParameter","SessionCaptured","SessionExpired","SessionPending","SessionVoided","TotalAmountInvalid","ValidationError"],"title":"CapturePaymentSessionBadRequestResponseError"},"CapturePaymentSessionBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CapturePaymentSessionBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"CapturePaymentSessionBadRequestResponse"},"PaymentSessionCancelResponse":{"type":"object","properties":{"metadata":{"type":["string","null"],"description":"Optional field echoed back if present in the call to create_payment_session."},"order_items":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSessionOrderItem"},"description":"A list of order items."},"status":{"$ref":"#/components/schemas/PaymentSessionStatus","description":"The status field of the payment_session. When the payment session is pending, it will be marked as `canceled`."}},"required":["order_items","status"],"title":"PaymentSessionCancelResponse"},"CancelPaymentSessionBadRequestResponseError":{"type":"string","enum":["SessionAuthorized","SessionCaptured","TotalAmountInvalid","ValidationError"],"title":"CancelPaymentSessionBadRequestResponseError"},"CancelPaymentSessionBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CancelPaymentSessionBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"CancelPaymentSessionBadRequestResponse"},"PaymentSessionVoidRequest":{"type":"object","properties":{"idempotency_key":{"type":"string","description":"Allows the endpoint to be called multiple times. It must be unique to the void session call."}},"required":["idempotency_key"],"title":"PaymentSessionVoidRequest"},"PaymentSessionVoidResponse":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID for this void session. This same ID will be returned if the endpoint is called with the same idempotency_key. Associate this id with your internal representation of a checkout session, if applicable."}},"required":["id"],"title":"PaymentSessionVoidResponse"},"VoidPaymentSessionBadRequestResponseError":{"type":"string","enum":["ImmediateCapture","SessionCaptured","SessionNotAuthorized","SessionVoided","TotalAmountInvalid","ValidationError"],"title":"VoidPaymentSessionBadRequestResponseError"},"VoidPaymentSessionBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/VoidPaymentSessionBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"VoidPaymentSessionBadRequestResponse"},"RefundItemDetails":{"type":"object","properties":{"item_id":{"type":"string","description":"ID that uniquely identifies the item within the Payment; optionally specified when creating the payment and retrievable from payment session status or list payment sessions. On a multi-capture session, list each item once per request."},"quantity":{"type":"integer","description":"The number of units of this item being refunded, up to `quantity_refundable` from payment session status or list payment sessions. Use 0 to refund dollars without units, for example the rest of a line after an earlier partial refund already returned its units."},"total":{"type":"integer","description":"The amount in cents being refunded for this item, up to `total_refundable` from payment session status or list payment sessions. Across all items these totals must not sum above the refund's `amount`. They may sum below it, and Truemed applies the remainder to the capture the refund targets."}},"required":["item_id","quantity","total"],"title":"RefundItemDetails"},"RefundReasons":{"type":"string","enum":["customer_request","duplicate_payment","fraudulent"],"description":"Why a refund was issued. The vocabulary maps to the card networks' standard refund reasons.","title":"RefundReasons"},"CreateRefundRequest":{"type":"object","properties":{"amount":{"type":"integer","description":"The amount you wish to refund in cents. Cannot be greater than the total_amount originally charged."},"capture_id":{"type":["string","null"],"description":"The ID of the capture to refund, from `capture_id` in the capture response or `captures[].id` in the payment session status. A refund with `capture_id` applies to that capture only. Required when the session has more than one capture or is still `partially_captured`, unless the refund lists `item_details`: each item is then refunded from the captures that took it. Optional when a closed session has only one capture."},"idempotency_key":{"type":"string","description":"Allows the endpoint to be called multiple times, and must be unique to the refund request."},"item_details":{"type":["array","null"],"items":{"$ref":"#/components/schemas/RefundItemDetails"},"description":"The items to refund. Truemed pro-rates `amount` by the eligible ratio of these lines to determine the refund's eligible amount. Eligible spending that the regular card paid returns there first. The remaining eligible amount returns to the HSA/FSA card, and the rest returns to the regular card. If the regular card cannot cover its share, the shortfall returns to the HSA/FSA card within its refundable balance. Omit this field, or send an empty list, and Truemed uses eligible-first allocation based on the remaining eligible amount and each card's refundable balance. That refund applies to the order rather than to any line, so each line's `total_refundable` and `quantity_refundable` stay unchanged. If the items sum below `amount`, Truemed applies the remainder to the capture the refund targets."},"payment_id":{"type":"string","description":"The id returned to the partner by Truemed in response to a `create_payment_session` request."},"reason":{"$ref":"#/components/schemas/RefundReasons","description":"Why you are initiating this refund request: customer_request - the customer requested a refund; fraudulent - the payment was fraudulent; duplicate_payment - the user checked out with HSA/FSA multiple times for one purchase.\n\nOne of:\n- `customer_request` — The refund was requested by the customer.\n- `duplicate_payment` — The charge was a duplicate.\n- `fraudulent` — The charge was fraudulent; this feeds the fraud signal."}},"required":["amount","idempotency_key","payment_id","reason"],"title":"CreateRefundRequest"},"CreateRefundResponse":{"type":"object","properties":{"refund_id":{"type":"string","description":"The unique ID for this refund. Multiple refunds can be associated with a single payment, in the case of partial refunds."}},"required":["refund_id"],"title":"CreateRefundResponse"},"CreateRefundBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"CreateRefundBadRequestResponseError"},"CreateRefundBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CreateRefundBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"CreateRefundBadRequestResponse"},"PaymentTokenOrderItemSku":{"type":"object","properties":{"sku":{"type":"string","description":"The SKU of the item as configured in your catalog"}},"required":["sku"],"title":"PaymentTokenOrderItemSku"},"CreatePaymentTokenRequest":{"type":"object","properties":{"customer_email":{"type":"string","format":"email","description":"The customer's email"},"customer_name":{"type":"string","description":"The customer's full name"},"customer_state":{"type":["string","null"],"description":"Set this to pre-fill the answer to the State of Residence question in the health survey. The 2-letter ISO 3166-2:US code for a region, without the US- prefix"},"failure_url":{"type":"string","description":"Where Truemed sends the customer when they opt out of HSA/FSA, do not qualify in the survey, or cancel a payment method update. In an iframe, Truemed returns this URL in the completion message instead of navigating."},"idempotency_key":{"type":"string","description":"A unique ID that allows safely retrying the request without performing the same operation twice"},"metadata":{"type":["string","null"],"description":"A JSON string containing any custom key-value pairs. This string will be returned in the payment_session_complete webhook if provided"},"order_items":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PaymentTokenOrderItemSku"},"description":"The initial list of items for this subscription. Required unless this sales channel is configured for full-catalog qualification, in which case it may be omitted."},"success_url":{"type":"string","description":"Where Truemed should redirect the customer after successfully completing checkout"},"use_iframe":{"type":"boolean","default":false,"description":"Set to true to render the survey and card entry inline on your own page instead of redirecting the customer. The returned redirect_url becomes an iframe src, and the result arrives as a postMessage rather than a redirect. See the Embedded checkout (iFrame) guide."}},"required":["customer_email","customer_name","failure_url","idempotency_key","success_url"],"title":"CreatePaymentTokenRequest"},"CreatePaymentTokenResponse":{"type":"object","properties":{"provision_token_request_id":{"type":"string","description":"A UUID that represents this creation request"},"redirect_url":{"type":"string","description":"Contains a URI through which the customer can complete the payment token provisioning"}},"required":["provision_token_request_id","redirect_url"],"title":"CreatePaymentTokenResponse"},"CreatePaymentTokenBadRequestResponseError":{"type":"string","enum":["FeatureNotEnabled","IdempotencyViolation","InvalidRequestParameter","TotalAmountInvalid","ValidationError","WaitingForVerification"],"title":"CreatePaymentTokenBadRequestResponseError"},"CreatePaymentTokenBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CreatePaymentTokenBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"CreatePaymentTokenBadRequestResponse"},"PaymentMethodResponse":{"type":"object","properties":{"expiration":{"type":["string","null"],"description":"A MM/YYYY formatted string specifying the month and year the card on file will expire."},"last4":{"type":["string","null"],"description":"The last 4 digits of the CC number associated with this payment method."},"payment_method_updated_at":{"type":["string","null"],"description":"ISO 8601 formatted DateTime object that represents the date and time the `payment_method` was last updated by the customer."}},"title":"PaymentMethodResponse"},"PaymentTokenResponse":{"type":"object","properties":{"created_at":{"type":"string","description":"ISO 8601 formatted date and time the `payment_token` was created at."},"customer_email":{"type":"string","description":"The customer's current email for this `payment_token`. Truemed sends receipts and Letter of Medical Necessity (LMN) notifications for this token to this email. Change it with `update_payment_token`."},"customer_name":{"type":"string","description":"The first and last name of the customer associated with this `payment_token`."},"lmn_expires_at":{"type":["string","null"],"format":"date","description":"ISO 8601 formatted date when this payment token's HSA/FSA coverage ends (inclusive, UTC). Counts letters earned on the token's own sessions and letters its customer earned on this sales channel, matching the date the Payment Token Updated webhook reports for the same token. Null if the customer holds no verified LMN. Prompt the customer to requalify before this date."},"payment_methods":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PaymentMethodResponse"},"description":"An optional array of payment_method objects."},"payment_token":{"type":"string","description":"The payment token identifier."}},"required":["created_at","customer_email","customer_name","payment_token"],"title":"PaymentTokenResponse"},"RetrievePaymentTokenBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"RetrievePaymentTokenBadRequestResponseError"},"RetrievePaymentTokenBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RetrievePaymentTokenBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"RetrievePaymentTokenBadRequestResponse"},"RetrievePaymentTokenNotFoundResponseError":{"type":"string","enum":["InvalidToken","NotFound"],"title":"RetrievePaymentTokenNotFoundResponseError"},"RetrievePaymentTokenNotFoundResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RetrievePaymentTokenNotFoundResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"RetrievePaymentTokenNotFoundResponse"},"PaymentTokenListResponse":{"type":"object","properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationBody"},{"type":"null"}],"description":"A pagination object with information about the current page, page size, total count, and last page."},"payment_tokens":{"type":"array","items":{"$ref":"#/components/schemas/PaymentTokenResponse"},"description":"An array of `payment_token` objects."}},"required":["payment_tokens"],"title":"PaymentTokenListResponse"},"ListPaymentTokenBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"ListPaymentTokenBadRequestResponseError"},"ListPaymentTokenBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ListPaymentTokenBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"ListPaymentTokenBadRequestResponse"},"UpdatedOrderItemsRequest":{"type":"object","properties":{"name":{"type":"string","description":"The name of the order item"},"sku":{"type":"string","description":"The SKU of the item"}},"required":["name","sku"],"title":"UpdatedOrderItemsRequest"},"UpdatePaymentTokenRequest":{"type":"object","properties":{"customer_email":{"type":["string","null"],"format":"email","description":"The customer's new email address. Verify that it belongs to the same customer before you send it. Truemed sends receipts and Letter of Medical Necessity (LMN) notifications for this token to this email from now on. The customer's Truemed account and dashboard login do not change."},"failure_url":{"type":"string","description":"Where Truemed sends the customer when they opt out of HSA/FSA, do not qualify in the survey, or cancel a payment method update. In an iframe, Truemed returns this URL in the completion message instead of navigating."},"metadata":{"type":["string","null"],"description":"Merchants can use this free-form field to store extra information with the payment token"},"order_items":{"type":["array","null"],"items":{"$ref":"#/components/schemas/UpdatedOrderItemsRequest"},"description":"Updated list of items for this subscription. Required when `renew_eligibility` is true, or when none of `update_card_info`, `metadata` or `customer_email` is set, unless this sales channel is configured for full-catalog qualification. A full-catalog channel needs at least one of `update_card_info`, `metadata`, `customer_email`, `order_items` or `renew_eligibility`. On a full-catalog channel, eligibility is checked against the whole catalog only when `renew_eligibility` is true, and these items do not narrow it."},"renew_eligibility":{"type":"boolean","default":false,"description":"Set to true to ask the customer to requalify. The response is `TakeHealthSurvey` when the customer's LMN is missing, rejected, expired, or expires within 30 days, and `None` otherwise. When the token has no backup card and an item needs one, the response is `UpdatePaymentMethod` instead. The items are `order_items`, or the whole catalog on a full-catalog channel. Use lmn_expires_at from Retrieve or List Payment Token responses or the Payment Token Updated Webhook payload to identify upcoming expirations. On a full-catalog channel, this is the only update that can return a survey."},"success_url":{"type":"string","description":"Where Truemed should redirect the customer after successfully completing the next action"},"update_card_info":{"type":"boolean","default":false,"description":"Set to true to allow the Truemed checkout flow to update the user's card information"},"use_iframe":{"type":"boolean","default":false,"description":"If true, the customer should be redirected to the `redirect_url` using an iframe."}},"required":["failure_url","success_url"],"title":"UpdatePaymentTokenRequest"},"NextActionType":{"type":"string","enum":["UpdatePaymentMethod","TakeHealthSurvey","None"],"title":"NextActionType"},"UpdatePaymentTokenResponse":{"type":"object","properties":{"next_action":{"$ref":"#/components/schemas/NextActionType","description":"Next action required for this payment token, if any."},"redirect_url":{"type":["string","null"],"description":"A URI through which the customer can correct the payment_token."}},"required":["next_action","redirect_url"],"title":"UpdatePaymentTokenResponse"},"UpdatePaymentTokenBadRequestResponseError":{"type":"string","enum":["FeatureNotEnabled","TotalAmountInvalid","ValidationError"],"title":"UpdatePaymentTokenBadRequestResponseError"},"UpdatePaymentTokenBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/UpdatePaymentTokenBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"UpdatePaymentTokenBadRequestResponse"},"UpdatePaymentTokenNotFoundResponseError":{"type":"string","enum":["InvalidToken","NotFound"],"title":"UpdatePaymentTokenNotFoundResponseError"},"UpdatePaymentTokenNotFoundResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/UpdatePaymentTokenNotFoundResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"UpdatePaymentTokenNotFoundResponse"},"PaymentTokenDeleteResponse":{"type":"object","properties":{},"title":"PaymentTokenDeleteResponse"},"DeletePaymentTokenBadRequestResponseError":{"type":"string","enum":["FeatureNotEnabled","TotalAmountInvalid","ValidationError"],"title":"DeletePaymentTokenBadRequestResponseError"},"DeletePaymentTokenBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/DeletePaymentTokenBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"DeletePaymentTokenBadRequestResponse"},"PaymentTokenProvisionRequestDetailResponse":{"type":"object","properties":{"metadata":{"type":["string","null"],"description":"The metadata string you provided as part of the create_payment_token request for the ProvisionTokenRequest. Will be null if no metadata was provided"},"payment_token":{"type":["string","null"],"description":"The PaymentToken created as part of create_payment_token for the ProvisionTokenRequest. Will be null if the PaymentToken has not been provisioned yet"}},"required":["metadata","payment_token"],"title":"PaymentTokenProvisionRequestDetailResponse"},"RetrievePaymentTokenProvisionRequestBadRequestResponseError":{"type":"string","enum":["FeatureNotEnabled","TotalAmountInvalid","ValidationError"],"title":"RetrievePaymentTokenProvisionRequestBadRequestResponseError"},"RetrievePaymentTokenProvisionRequestBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RetrievePaymentTokenProvisionRequestBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"RetrievePaymentTokenProvisionRequestBadRequestResponse"},"EvidenceCategory":{"type":"string","enum":["product_description","customer_communication","customer_name","customer_email","customer_purchase_ip","customer_signature","billing_address","receipt","shipping_documentation","shipping_tracking_number","service_documentation","service_date","access_activity_log","refund_policy","refund_policy_disclosure","refund_refusal_explanation","cancellation_policy","cancellation_policy_disclosure","cancellation_rebuttal","duplicate_charge_documentation","duplicate_charge_explanation","uncategorized"],"description":"Canonical evidence categories (comparison doc §4.3). The vocabulary is Stripe-derived (the values match\nStripe's evidence field names today), but each processor adapter maps these to its native evidence fields, so\nthe API/dashboard speak these categories rather than any one processor's schema.\n\nHuman labels live in `_EVIDENCE_CATEGORY_LABELS`, exposed via `.label` — the backend contract the frontend\nand merchant emails hydrate from instead of hardcoding their own label maps.","title":"EvidenceCategory"},"EvidenceItem":{"type":"object","properties":{"category":{"$ref":"#/components/schemas/EvidenceCategory","description":"Canonical evidence category; the adapter maps it to the processor's evidence fields."},"file_ids":{"type":"array","items":{"type":"string"},"default":[],"description":"File IDs (from the Files API) attached for this category; must be owned by you."},"text":{"type":["string","null"],"description":"Free-text evidence for this category."}},"required":["category"],"title":"EvidenceItem"},"CounterState":{"type":"string","enum":["draft","submitted","withdrawn","superseded"],"description":"Lifecycle of a dispute-evidence response (a \"counter\").\n\n`draft` autosaves; `submitted` is terminal-for-this-round (one-shot to the processor); `withdrawn` is a\ndiscarded draft; `superseded` is a prior round's submission once a new phase opens. Only `draft` is mutable.","title":"CounterState"},"CounterResource":{"type":"object","properties":{"counter_id":{"type":"string","description":"Stable Truemed counter ID (UUID)."},"created_at":{"type":"string","format":"date-time","description":"When this counter was created."},"evidence_items":{"type":"array","items":{"$ref":"#/components/schemas/EvidenceItem"},"default":[],"description":"The categorized evidence captured on this counter."},"phase":{"$ref":"#/components/schemas/DisputePhase","description":"Dispute phase this counter responds to."},"revision":{"type":"integer","description":"Optimistic-lock revision; echo it back on the next draft save to detect conflicts."},"state":{"$ref":"#/components/schemas/CounterState","description":"Counter lifecycle state."},"submitted_at":{"type":["string","null"],"format":"date-time","description":"When this counter was submitted to the processor."},"submitted_by":{"type":["string","null"],"description":"Email of the dashboard user who submitted this counter; null for drafts or API-key submissions."},"updated_at":{"type":"string","format":"date-time","description":"When this counter was last updated."}},"required":["counter_id","created_at","phase","revision","state","updated_at"],"title":"CounterResource"},"DisputeEvidenceCategorySpec":{"type":"object","properties":{"category":{"$ref":"#/components/schemas/EvidenceCategory","description":"Canonical evidence category."},"description":{"type":"string","description":"Merchant-facing helper text explaining what to provide; empty when the category has none."},"file":{"type":"boolean","description":"Whether the category accepts a file upload."},"label":{"type":"string","description":"Merchant-facing display label for the category."},"text":{"type":"boolean","description":"Whether the category accepts free text."}},"required":["category","description","file","label","text"],"title":"DisputeEvidenceCategorySpec"},"DisputeEvidenceRequirements":{"type":"object","properties":{"compelling":{"type":"array","items":{"$ref":"#/components/schemas/DisputeEvidenceCategorySpec"},"default":[],"description":"Evidence most likely to overturn the dispute, in display order."},"merchant_explanation":{"type":"string","default":"","description":"Truemed's reason-specific narrative (Markdown) on how to contest this dispute. Empty when the reason has no configured guidance."},"other":{"type":"array","items":{"$ref":"#/components/schemas/DisputeEvidenceCategorySpec"},"default":[],"description":"Every remaining category the processor accepts, so nothing is unreachable in the form."},"supporting":{"type":"array","items":{"$ref":"#/components/schemas/DisputeEvidenceCategorySpec"},"default":[],"description":"Additional recommended evidence (supporting and context tiers), in display order."}},"title":"DisputeEvidenceRequirements"},"DisputeOutcome":{"type":"string","enum":["won","lost","accepted","expired","closed"],"description":"Denormalized terminal outcome of a dispute; null until terminal.","title":"DisputeOutcome"},"PaymentSummaryResource":{"type":"object","properties":{"order_id":{"type":["string","null"],"description":"ID (UUID) of the Truemed payment session or order the disputed payment belongs to. For a payment session it matches `payment_session_id`. Null when the payment has no linked record."}},"title":"PaymentSummaryResource"},"IntegrationPlatform":{"type":"string","enum":["STRIPE","FAKE","EXTERNAL"],"description":"Payment platforms supported by the public dispute API.","title":"IntegrationPlatform"},"DisputeDetailResource":{"type":"object","properties":{"amount":{"type":"integer","description":"The original disputed amount in cents, independent of resolution."},"counters":{"type":"array","items":{"$ref":"#/components/schemas/CounterResource"},"default":[],"description":"Evidence counters for this dispute (the full chain across phases)."},"created_at":{"type":"string","format":"date-time","description":"When the dispute was created."},"currency":{"type":"string","description":"ISO currency code of the disputed amount."},"dispute_id":{"type":"string","description":"Stable Truemed dispute ID (UUID). Use this as the dispute's identifier."},"due_by":{"type":["string","null"],"format":"date-time","description":"Evidence submission deadline, if the dispute is challengeable."},"evidence_requirements":{"$ref":"#/components/schemas/DisputeEvidenceRequirements","description":"Recommended evidence for this dispute's reason, grouped by weight (compelling / supporting / other), plus Truemed's merchant narrative on how to contest."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"default":{},"description":"Arbitrary merchant-set metadata."},"network_reason_code":{"type":["string","null"],"description":"Raw card-network reason code behind the dispute (e.g. Visa `10.4`), if provided."},"outcome":{"oneOf":[{"$ref":"#/components/schemas/DisputeOutcome"},{"type":"null"}],"description":"Terminal outcome; null until the dispute resolves."},"payment":{"$ref":"#/components/schemas/PaymentSummaryResource","description":"Summary of the payment the dispute was filed against."},"payment_session_id":{"type":["string","null"],"description":"The Truemed payment session this dispute belongs to. Null for disputes on non-payment-session charges."},"phase":{"oneOf":[{"$ref":"#/components/schemas/DisputePhase"},{"type":"null"}],"description":"Which round of the dispute (inquiry, dispute, pre-arbitration, arbitration)."},"prior_dispute_id":{"type":["string","null"],"description":"Truemed dispute ID (UUID) of the prior round in a pre-arbitration/re-filing chain, if any."},"processor":{"$ref":"#/components/schemas/IntegrationPlatform","description":"Payment processor the dispute originated from."},"processor_dispute_id":{"type":"string","description":"Raw payment-processor dispute ID (e.g. Stripe `du_…`), for reconciliation."},"reason":{"$ref":"#/components/schemas/DisputeReason","description":"Canonical reason the dispute was filed."},"resolved_at":{"type":["string","null"],"format":"date-time","description":"When the dispute reached a terminal state."},"state":{"$ref":"#/components/schemas/DisputeState","description":"Canonical dispute state."}},"required":["amount","created_at","currency","dispute_id","payment","processor","processor_dispute_id","reason","state"],"title":"DisputeDetailResource"},"RetrieveDisputeBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"RetrieveDisputeBadRequestResponseError"},"RetrieveDisputeBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RetrieveDisputeBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"RetrieveDisputeBadRequestResponse"},"DisputeResource":{"type":"object","properties":{"amount":{"type":"integer","description":"The original disputed amount in cents, independent of resolution."},"counters":{"type":"array","items":{"$ref":"#/components/schemas/CounterResource"},"default":[],"description":"Evidence counters for this dispute (the full chain across phases)."},"created_at":{"type":"string","format":"date-time","description":"When the dispute was created."},"currency":{"type":"string","description":"ISO currency code of the disputed amount."},"dispute_id":{"type":"string","description":"Stable Truemed dispute ID (UUID). Use this as the dispute's identifier."},"due_by":{"type":["string","null"],"format":"date-time","description":"Evidence submission deadline, if the dispute is challengeable."},"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"default":{},"description":"Arbitrary merchant-set metadata."},"network_reason_code":{"type":["string","null"],"description":"Raw card-network reason code behind the dispute (e.g. Visa `10.4`), if provided."},"outcome":{"oneOf":[{"$ref":"#/components/schemas/DisputeOutcome"},{"type":"null"}],"description":"Terminal outcome; null until the dispute resolves."},"payment_session_id":{"type":["string","null"],"description":"The Truemed payment session this dispute belongs to. Null for disputes on non-payment-session charges."},"phase":{"oneOf":[{"$ref":"#/components/schemas/DisputePhase"},{"type":"null"}],"description":"Which round of the dispute (inquiry, dispute, pre-arbitration, arbitration)."},"prior_dispute_id":{"type":["string","null"],"description":"Truemed dispute ID (UUID) of the prior round in a pre-arbitration/re-filing chain, if any."},"processor":{"$ref":"#/components/schemas/IntegrationPlatform","description":"Payment processor the dispute originated from."},"processor_dispute_id":{"type":"string","description":"Raw payment-processor dispute ID (e.g. Stripe `du_…`), for reconciliation."},"reason":{"$ref":"#/components/schemas/DisputeReason","description":"Canonical reason the dispute was filed."},"resolved_at":{"type":["string","null"],"format":"date-time","description":"When the dispute reached a terminal state."},"state":{"$ref":"#/components/schemas/DisputeState","description":"Canonical dispute state."}},"required":["amount","created_at","currency","dispute_id","processor","processor_dispute_id","reason","state"],"title":"DisputeResource"},"DisputeListResponse":{"type":"object","properties":{"disputes":{"type":"array","items":{"$ref":"#/components/schemas/DisputeResource"},"description":"The page of disputes for the authenticated sales channel."},"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationBody"},{"type":"null"}],"description":"A pagination object with information about the current page, page size, total count, and last page."}},"required":["disputes"],"title":"DisputeListResponse"},"ListDisputeBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"ListDisputeBadRequestResponseError"},"ListDisputeBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ListDisputeBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"ListDisputeBadRequestResponse"},"AcceptDisputeBadRequestResponseError":{"type":"string","enum":["BadRequest","TotalAmountInvalid","ValidationError"],"title":"AcceptDisputeBadRequestResponseError"},"AcceptDisputeBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/AcceptDisputeBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"AcceptDisputeBadRequestResponse"},"CounterCreateRequest":{"type":"object","properties":{"evidence_items":{"type":"array","items":{"$ref":"#/components/schemas/EvidenceItem"},"default":[],"description":"Initial categorized evidence for the draft."}},"title":"CounterCreateRequest"},"CreateDisputeCounterBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"CreateDisputeCounterBadRequestResponseError"},"CreateDisputeCounterBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CreateDisputeCounterBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"CreateDisputeCounterBadRequestResponse"},"CounterUpsertRequest":{"type":"object","properties":{"evidence_items":{"type":"array","items":{"$ref":"#/components/schemas/EvidenceItem"},"default":[],"description":"Full replacement of the draft's categorized evidence."},"revision":{"type":"integer","description":"The revision you last read; the save is rejected (409) if the counter changed since."}},"required":["revision"],"title":"CounterUpsertRequest"},"UpdateDisputeCounterBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"UpdateDisputeCounterBadRequestResponseError"},"UpdateDisputeCounterBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/UpdateDisputeCounterBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"UpdateDisputeCounterBadRequestResponse"},"SubmitDisputeCounterBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"SubmitDisputeCounterBadRequestResponseError"},"SubmitDisputeCounterBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/SubmitDisputeCounterBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"SubmitDisputeCounterBadRequestResponse"},"WithdrawDisputeCounterBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"WithdrawDisputeCounterBadRequestResponseError"},"WithdrawDisputeCounterBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/WithdrawDisputeCounterBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"WithdrawDisputeCounterBadRequestResponse"},"DisputeMetadataRequest":{"type":"object","properties":{"metadata":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Replaces the dispute's metadata. Only metadata is mutable; state/amounts/deadlines are read-only."}},"required":["metadata"],"title":"DisputeMetadataRequest"},"UpdateDisputeMetadataBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"UpdateDisputeMetadataBadRequestResponseError"},"UpdateDisputeMetadataBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/UpdateDisputeMetadataBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"UpdateDisputeMetadataBadRequestResponse"},"QualificationSessionStatusSummary":{"type":"string","enum":["pending","processing","approved","rejected"],"description":"Qualification status summary for the **v1** qualification-session surface.\n\nIts wire values are the long-standing v1 contract (`pending`/`processing`/`approved`/`rejected`);\nthe v2 Truemed Session surface uses ``TruemedSessionQualificationStatus`` with its own vocabulary,\nso the two evolve independently and v1 clients keep the values they already depend on.\n\nIt abstracts the internal nuances of the qualification session and LMN verification status. It is\nto be used by merchants external to Truemed.","title":"QualificationSessionStatusSummary"},"QualificationSessionResponse":{"type":"object","properties":{"charge_group_created_at":{"type":["string","null"],"format":"date-time","description":"When the charge group was created."},"created_at":{"type":["string","null"],"format":"date-time","description":"When the qualification session was created."},"customer_status":{"type":["string","null"],"description":"The customer's status."},"eligible_amount":{"type":["number","null"],"format":"double","description":"The eligible amount for this qualification."},"email":{"type":["string","null"],"description":"The email address of the consumer who completed the qualification session."},"expires_at":{"type":["string","null"],"format":"date-time","description":"The datetime at which the Letter-of-Medical-Necessity expires (inclusive, UTC)."},"fee":{"type":["number","null"],"format":"double","description":"The fee amount for this qualification."},"lmn_reviewed_at":{"type":["string","null"],"format":"date-time","description":"When the Letter of Medical Necessity was reviewed."},"qualification_session_id":{"type":"string","description":"The id of the qualification session."},"session_type":{"type":["string","null"],"description":"The type of qualification session."},"skus_param":{"type":["string","null"],"description":"The SKUs parameter from the qualification session."},"source":{"type":["string","null"],"description":"The source provided in the qualification session redirect URL param."},"status":{"$ref":"#/components/schemas/QualificationSessionStatusSummary","description":"The status of the qualification session.\n\nOne of:\n- `pending` — The session was created; the shopper hasn't completed the survey yet.\n- `processing` — The shopper completed the survey and it is under review.\n- `approved` — The shopper holds a valid Letter of Medical Necessity covering the items in this order.\n- `rejected` — The shopper is ineligible for a Letter of Medical Necessity for the items in this order."},"stripe_invoice_id":{"type":["string","null"],"description":"The Stripe invoice ID associated with this qualification."},"stripe_invoice_number":{"type":["string","null"],"description":"The Stripe invoice number."},"stripe_invoice_paid_at":{"type":["string","null"],"format":"date-time","description":"When the Stripe invoice was paid."},"user_business_id":{"type":["string","null"],"description":"The user's business ID."},"user_id":{"type":["string","null"],"description":"The user_id provided in the qualification session redirect URL param."},"user_name":{"type":["string","null"],"description":"The user's name (may be null if PII is hidden)."}},"required":["qualification_session_id","status"],"title":"QualificationSessionResponse"},"RetrieveQualificationSessionBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"RetrieveQualificationSessionBadRequestResponseError"},"RetrieveQualificationSessionBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RetrieveQualificationSessionBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"RetrieveQualificationSessionBadRequestResponse"},"QualificationSessionListResponse":{"type":"object","properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationBody"},{"type":"null"}],"description":"A pagination object with information about the current page, page size, total count, and last page."},"qualification_sessions":{"type":"array","items":{"$ref":"#/components/schemas/QualificationSessionResponse"},"description":"An array of qualification_session objects."}},"required":["qualification_sessions"],"title":"QualificationSessionListResponse"},"ListQualificationSessionBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"ListQualificationSessionBadRequestResponseError"},"ListQualificationSessionBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ListQualificationSessionBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"ListQualificationSessionBadRequestResponse"},"UpdateQualificationSessionRequest":{"type":"object","properties":{"failure_url":{"type":["string","null"],"maxLength":2048,"description":"Where Truemed sends the customer when they opt out of HSA/FSA or do not qualify in the survey. If omitted, the current failure URL is unchanged. In an iframe, Truemed returns this URL in the completion message instead of navigating. Has no effect once the qualification session reaches a terminal status."},"idempotency_key":{"type":"string","maxLength":255,"description":"A unique key for safely retrying the request, scoped to this qualification session. Duplicate POSTs with the same key against the same qualification session are deduplicated and return the original response."},"metadata":{"type":["string","null"],"maxLength":4096,"description":"Optional metadata string (JSON-encoded by convention)."},"success_url":{"type":["string","null"],"maxLength":2048,"description":"Optional success redirect URL. Has no effect once the qualification session reaches a terminal status."},"user_id":{"type":["string","null"],"maxLength":255,"description":"Your stable, opaque identifier for the shopper. Can only be set when the qualification session does not already have one — attempting to overwrite an existing value returns the `user_id_already_set` error. To correct a previously set value, contact Truemed support."}},"required":["idempotency_key"],"title":"UpdateQualificationSessionRequest"},"UpdateQualificationSessionResponse":{"type":"object","properties":{"qualification_session_id":{"type":"string","description":"The qualification_session_id that was updated (echoed from the path param)."},"status":{"$ref":"#/components/schemas/QualificationSessionStatusSummary","description":"Current status summary of the qualification session. This endpoint does not change the status.\n\nOne of:\n- `pending` — The session was created; the shopper hasn't completed the survey yet.\n- `processing` — The shopper completed the survey and it is under review.\n- `approved` — The shopper holds a valid Letter of Medical Necessity covering the items in this order.\n- `rejected` — The shopper is ineligible for a Letter of Medical Necessity for the items in this order."}},"required":["qualification_session_id","status"],"title":"UpdateQualificationSessionResponse"},"UpdateQualificationSessionBadRequestResponseError":{"type":"string","enum":["BadRequest","TotalAmountInvalid","ValidationError"],"title":"UpdateQualificationSessionBadRequestResponseError"},"UpdateQualificationSessionBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/UpdateQualificationSessionBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"UpdateQualificationSessionBadRequestResponse"},"CatalogItemEligibility":{"type":"string","enum":["eligible","eligible_with_lmn","ineligible"],"description":"HSA/FSA eligibility status for catalog items.","title":"CatalogItemEligibility"},"CatalogItemDetail":{"type":"object","properties":{"comparable_item_price_cents":{"type":["integer","null"],"description":"The amount, in cents, deducted from each unit of this item before any of it can reach an HSA/FSA card."},"created_at":{"type":"string","format":"date-time","description":"The date and time the catalog item was created."},"description":{"type":["string","null"],"description":"An optional description of the catalog item."},"eligibility":{"oneOf":[{"$ref":"#/components/schemas/CatalogItemEligibility"},{"type":"null"}],"description":"HSA/FSA eligibility status for the catalog item."},"gtin":{"type":["string","null"],"description":"The GTIN of the catalog item."},"image_urls":{"type":["array","null"],"items":{"type":"string"},"description":"Optional array of image URLs associated with the catalog item."},"metadata":{"type":["string","null"],"description":"Optional metadata string for the catalog item."},"name":{"type":"string","description":"The name of the catalog item."},"product_id":{"type":["string","null"],"description":"The product ID of the product which this catalog item is a variant of."},"reviewed_at":{"type":["string","null"],"format":"date-time","description":"The date and time the catalog item's eligibility was last decided. Present whenever `eligibility` is."},"sku":{"type":"string","description":"The SKU of the catalog item."},"url":{"type":["string","null"],"description":"An optional display page URL for the catalog item."}},"required":["created_at","name","sku"],"title":"CatalogItemDetail"},"ListItemsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CatalogItemDetail"},"description":"An array of catalog item objects for the current page."},"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationBody"},{"type":"null"}],"description":"A pagination object with information about the current page, page size, total count, and last page."}},"required":["data"],"title":"ListItemsResponse"},"ListCatalogItemsBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"ListCatalogItemsBadRequestResponseError"},"ListCatalogItemsBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ListCatalogItemsBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"ListCatalogItemsBadRequestResponse"},"TruemedCheckoutMethodItemInfo":{"type":"object","properties":{"name":{"type":"string","description":"The name of the catalog item."},"product_id":{"type":["string","null"],"description":"The product ID of the parent product which this catalog item is a variant of."},"sku":{"type":"string","description":"The SKU of the catalog item."}},"required":["name","sku"],"title":"TruemedCheckoutMethodItemInfo"},"TruemedCheckoutMethodRequest":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TruemedCheckoutMethodItemInfo"},"description":"The items to check eligibility for."}},"required":["items"],"title":"TruemedCheckoutMethodRequest"},"TruemedCheckoutMethodResponse":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the set of items is enabled for checkout with Truemed."}},"required":["enabled"],"title":"TruemedCheckoutMethodResponse"},"TruemedCheckoutMethodBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"TruemedCheckoutMethodBadRequestResponseError"},"TruemedCheckoutMethodBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/TruemedCheckoutMethodBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"TruemedCheckoutMethodBadRequestResponse"},"CreateItemRequest":{"type":"object","properties":{"description":{"type":"string","description":"The description of the item."},"gtin":{"type":["string","null"],"description":"The GTIN of the catalog item."},"image_urls":{"type":"array","items":{"type":"string"},"description":"An array of image URLs of the item."},"metadata":{"type":["string","null"],"description":"Optional metadata string for the catalog item."},"name":{"type":"string","description":"The name of the catalog item."},"product_id":{"type":["string","null"],"description":"The product ID of the product which this catalog item is a variant of."},"sku":{"type":"string","description":"The SKU of the catalog item."},"url":{"type":"string","description":"The display page URL for the item."}},"required":["description","image_urls","name","sku","url"],"title":"CreateItemRequest"},"CreateItemResponse":{"type":"object","properties":{},"title":"CreateItemResponse"},"CreateItemBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"CreateItemBadRequestResponseError"},"CreateItemBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CreateItemBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"CreateItemBadRequestResponse"},"CreateItemConflictResponseError":{"type":"string","enum":["Conflict"],"title":"CreateItemConflictResponseError"},"CreateItemConflictResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CreateItemConflictResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"CreateItemConflictResponse"},"UpdateItemRequest":{"type":"object","properties":{"description":{"type":"string","description":"The description of the item."},"gtin":{"type":["string","null"],"description":"The GTIN of the catalog item."},"image_urls":{"type":"array","items":{"type":"string"},"description":"An array of image URLs of the item."},"metadata":{"type":["string","null"],"description":"Optional metadata string for the catalog item."},"name":{"type":"string","description":"The name of the catalog item."},"product_id":{"type":["string","null"],"description":"The product ID of the product which this catalog item is a variant of."},"sku":{"type":"string","description":"The SKU of the catalog item."},"url":{"type":"string","description":"The display page URL for the item."}},"required":["description","image_urls","name","sku","url"],"title":"UpdateItemRequest"},"UpdateItemResponse":{"type":"object","properties":{},"title":"UpdateItemResponse"},"UpdateItemBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"UpdateItemBadRequestResponseError"},"UpdateItemBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/UpdateItemBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"UpdateItemBadRequestResponse"},"DetailItemRequest":{"type":"object","properties":{"sku":{"type":"string","description":"The SKU of the catalog item to retrieve."}},"required":["sku"],"title":"DetailItemRequest"},"DetailItemResponse":{"type":"object","properties":{"object":{"$ref":"#/components/schemas/CatalogItemDetail","description":"The catalog item detail."}},"required":["object"],"title":"DetailItemResponse"},"GetItemDetailBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"GetItemDetailBadRequestResponseError"},"GetItemDetailBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/GetItemDetailBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"GetItemDetailBadRequestResponse"},"EligibilityStatus":{"type":"string","enum":["approved","pending","expired","rejected","never_requested"],"description":"Where a customer's clinical eligibility stands. A statement of fact, never an instruction.","title":"EligibilityStatus"},"EligibilityResponse":{"type":"object","properties":{"eligibility_status":{"oneOf":[{"$ref":"#/components/schemas/EligibilityStatus"},{"type":"null"}],"description":"Where this customer's clinical eligibility stands. Named apart from the payment `status` on other Truemed payloads, which is a different vocabulary. Per-value meanings are listed on the enum. Null for catalog eligibility, which identifies no customer.\n\nOne of:\n- `approved` — A verified, unexpired letter stands for this customer.\n- `pending` — A survey is with a clinician; the outcome is not decided yet.\n- `expired` — The letter that covered this customer has lapsed and not been renewed.\n- `rejected` — A clinician reviewed this customer's most recent survey and declined it.\n- `never_requested` — No letter has ever been requested for this customer here."},"items":{"type":"array","items":{"type":"string"},"description":"The catalog items that can be charged to an HSA/FSA card, each identified exactly as it is in order_items when you charge."},"lmn_expires_at":{"type":["string","null"],"format":"date","description":"When the letter determining this customer's coverage expires (inclusive, UTC). Null for catalog eligibility, which identifies no customer."}},"required":["items"],"title":"EligibilityResponse"},"RetrieveCatalogEligibilityBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"RetrieveCatalogEligibilityBadRequestResponseError"},"RetrieveCatalogEligibilityBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RetrieveCatalogEligibilityBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"RetrieveCatalogEligibilityBadRequestResponse"},"RetrieveProvisionRequestEligibilityBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"RetrieveProvisionRequestEligibilityBadRequestResponseError"},"RetrieveProvisionRequestEligibilityBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RetrieveProvisionRequestEligibilityBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"RetrieveProvisionRequestEligibilityBadRequestResponse"},"RetrieveTokenEligibilityBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"RetrieveTokenEligibilityBadRequestResponseError"},"RetrieveTokenEligibilityBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RetrieveTokenEligibilityBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"RetrieveTokenEligibilityBadRequestResponse"},"FilePurpose":{"type":"string","enum":["dispute_evidence"],"description":"Business domain a file belongs to. Extensible — each value maps to one ``*FileManager``.","title":"FilePurpose"},"FileCreateRequest":{"type":"object","properties":{"content_type":{"type":"string","description":"The file's MIME type, e.g. application/pdf. Must be allowed for the given purpose."},"filename":{"type":"string","maxLength":255,"description":"The original filename, e.g. receipt.pdf."},"purpose":{"$ref":"#/components/schemas/FilePurpose","description":"The business domain the file is for (e.g. dispute_evidence)."},"size_bytes":{"type":"integer","description":"The file size in bytes. Must be within the per-purpose maximum."}},"required":["content_type","filename","purpose","size_bytes"],"title":"FileCreateRequest"},"FileCreateResponse":{"type":"object","properties":{"expires_at":{"type":"string","format":"date-time","description":"When the presigned upload URL expires (10 minutes after creation)."},"file_id":{"type":"string","description":"The public file identifier. Reference this id from other resources."},"upload_fields":{"type":"object","additionalProperties":{"type":"string"},"description":"Form fields to include in the multipart upload POST, before the file part."},"upload_url":{"type":"string","description":"Presigned URL to POST the file to (multipart/form-data)."}},"required":["expires_at","file_id","upload_fields","upload_url"],"title":"FileCreateResponse"},"CreateFileBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"CreateFileBadRequestResponseError"},"CreateFileBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CreateFileBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"CreateFileBadRequestResponse"},"FileScanStatus":{"type":"string","enum":["pending_scan","clean","quarantined"],"description":"Malware-scan gate. Evidence attach + download only accept ``Clean`` files.","title":"FileScanStatus"},"FileDetailResponse":{"type":"object","properties":{"content_type":{"type":"string","description":"The file's MIME type, e.g. application/pdf."},"download_url":{"type":"string","description":"Short-lived presigned download URL (5 minutes). Always present in a 200 response; non-clean files return 409 rather than a 200 with this field absent."},"file_id":{"type":"string","description":"The public file identifier."},"filename":{"type":"string","description":"The stored filename."},"scan_status":{"$ref":"#/components/schemas/FileScanStatus","description":"Malware-scan status. Downloads are only available once the file is clean."},"size_bytes":{"type":"integer","description":"The file size in bytes."}},"required":["content_type","download_url","file_id","filename","scan_status","size_bytes"],"title":"FileDetailResponse"},"RetrieveFileBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"RetrieveFileBadRequestResponseError"},"RetrieveFileBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/RetrieveFileBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"RetrieveFileBadRequestResponse"},"FileSummary":{"type":"object","properties":{"content_type":{"type":"string","description":"The file's MIME type, e.g. application/pdf."},"file_id":{"type":"string","description":"The public file identifier."},"filename":{"type":"string","description":"The stored filename."},"scan_status":{"$ref":"#/components/schemas/FileScanStatus","description":"Malware-scan status. Downloads are only available once the file is clean."},"size_bytes":{"type":"integer","description":"The file size in bytes."}},"required":["content_type","file_id","filename","scan_status","size_bytes"],"title":"FileSummary"},"FileListResponse":{"type":"object","properties":{"files":{"type":"array","items":{"$ref":"#/components/schemas/FileSummary"},"description":"Files owned by the authenticated sales channel matching the filters."},"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationBody"},{"type":"null"}],"description":"A pagination object with information about the current page, page size, total count, and last page."}},"required":["files"],"title":"FileListResponse"},"ListFileBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"ListFileBadRequestResponseError"},"ListFileBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ListFileBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"ListFileBadRequestResponse"},"PayoutReconciliationDataAmount":{"oneOf":[{"type":"number","format":"double"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"description":"Payout amount in dollars.","title":"PayoutReconciliationDataAmount"},"PayoutReconciliationData":{"type":"object","properties":{"amount":{"$ref":"#/components/schemas/PayoutReconciliationDataAmount","description":"Payout amount in dollars."},"date":{"type":"string","format":"date","description":"Payout arrival date (YYYY-MM-DD)."},"payout_id":{"type":"string","description":"Stripe payout identifier."}},"required":["amount","date","payout_id"],"title":"PayoutReconciliationData"},"PayoutReconciliationListResponse":{"type":"object","properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationBody"},{"type":"null"}],"description":"A pagination object with information about the current page, page size, total count, and last page."},"payouts":{"type":"array","items":{"$ref":"#/components/schemas/PayoutReconciliationData"},"description":"List of payout data for the requested period."}},"required":["payouts"],"title":"PayoutReconciliationListResponse"},"ListPayoutReconciliationBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"ListPayoutReconciliationBadRequestResponseError"},"ListPayoutReconciliationBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ListPayoutReconciliationBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"ListPayoutReconciliationBadRequestResponse"},"ReconciliationDataFee":{"oneOf":[{"type":"number","format":"double"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"description":"Truemed fee in dollars. Negative indicates an amount owed by the merchant.","title":"ReconciliationDataFee"},"ReconciliationDataOrderTotal":{"oneOf":[{"type":"number","format":"double"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"description":"Order total amount in dollars.","title":"ReconciliationDataOrderTotal"},"ReconciliationDataType":{"type":"string","enum":["Charge","Full Refund","Partial Refund","Dispute","Fee","Fee Refund"],"title":"ReconciliationDataType"},"ReconciliationData":{"type":"object","properties":{"charge_date":{"type":"string","format":"date","description":"Date the charge was created (YYYY-MM-DD)."},"customer_id":{"type":["string","null"],"format":"uuid","description":"Anonymized customer identifier (replaces name and email when PII is hidden)."},"email":{"type":["string","null"],"description":"Customer email address."},"fee":{"$ref":"#/components/schemas/ReconciliationDataFee","description":"Truemed fee in dollars. Negative indicates an amount owed by the merchant."},"metadata":{"type":["string","null"],"description":"Merchant-supplied metadata attached to the origin record, or null if absent."},"name":{"type":["string","null"],"description":"Customer full name."},"order_id":{"type":"string","description":"Unique identifier for the order."},"order_items":{"type":"string","description":"Comma-separated list of order item names."},"order_total":{"$ref":"#/components/schemas/ReconciliationDataOrderTotal","description":"Order total amount in dollars."},"payment_id":{"type":["string","null"],"description":"External payment integration identifier."},"payout_date":{"type":["string","null"],"format":"date","description":"Date of the payout (YYYY-MM-DD), or null if not yet paid out."},"payout_id":{"type":["string","null"],"description":"Payout identifier, or null if not yet paid out."},"refund_needs_invoicing":{"type":["string","null"],"description":"Whether the refund requires invoicing. Present only for fee rows; null otherwise."},"type":{"$ref":"#/components/schemas/ReconciliationDataType","description":"Type of transaction data."}},"required":["charge_date","fee","order_id","order_items","order_total","payment_id","payout_date","payout_id","type"],"title":"ReconciliationData"},"TransactionReconciliationListResponse":{"type":"object","properties":{"pagination":{"oneOf":[{"$ref":"#/components/schemas/PaginationBody"},{"type":"null"}],"description":"A pagination object with information about the current page, page size, total count, and last page."},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationData"},"description":"Paginated list of transaction data."}},"required":["transactions"],"title":"TransactionReconciliationListResponse"},"ListTransactionReconciliationBadRequestResponseError":{"type":"string","enum":["TotalAmountInvalid","ValidationError"],"title":"ListTransactionReconciliationBadRequestResponseError"},"ListTransactionReconciliationBadRequestResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ListTransactionReconciliationBadRequestResponseError"},"message":{"type":"string"}},"required":["error","message"],"title":"ListTransactionReconciliationBadRequestResponse"},"CaptureFailedResource":{"type":"object","properties":{"amount_collected":{"type":["integer","null"],"description":"The amount of funds already collected on the failed capture. Set when part of a split payment succeeded before the capture failed; null otherwise."},"failed_at":{"type":"string","format":"date-time","description":"When the capture was determined to have permanently failed."},"failure_details":{"type":["string","null"],"description":"A generic message indicating the capture could not be completed."},"payment_session_id":{"type":"string","description":"The payment session whose capture permanently failed."}},"required":["failed_at","payment_session_id"],"title":"CaptureFailedResource"},"CaptureWebhookPayload":{"type":"object","properties":{"amount_details":{"oneOf":[{"$ref":"#/components/schemas/PaymentSessionAmountDetails"},{"type":"null"}],"description":"The order-level charges and discounts this capture declared, as sent: empty when only its items declared, absent when nothing was declared."},"capture_amount":{"type":"integer","description":"The amount captured in cents"},"captured_at":{"type":"string","description":"ISO-8601 timestamp of when the capture occurred"},"id":{"type":"string","description":"The stable id of this capture, used to target a refund against it via `capture_id`."},"item_details":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CapturedItemDetails"},"description":"The per-item breakdown of this capture (empty for amount-only captures). Multi-capture sessions only."},"order_level_captured":{"type":["integer","null"],"description":"The order-level money this capture collected beyond its items' totals, in cents: order-level charges minus order-level discounts. `item_details[].total` plus this is `capture_amount`. Multi-capture sessions only."}},"required":["capture_amount","captured_at","id"],"title":"CaptureWebhookPayload"},"StatusUpdateWebhookPayload":{"type":"object","properties":{"authorize_amount":{"type":"integer","description":"The amount the user's card will be authorized for. In the case of `kind=one_time_payment`, this will always be the same as `capture_amount`"},"capture_amount":{"type":["integer","null"],"description":"The amount of funds actually captured. For payment sessions of `kind=one_time_payment` this field will always be present and will be the same as `authorize_amount`. For payment sessions of `kind=authorization` this field will not be present until the funds have been captured"},"captures":{"type":"array","items":{"$ref":"#/components/schemas/CaptureWebhookPayload"},"description":"List of capture details for the payment session, in the order the captures were made."},"created_at":{"type":"string","description":"ISO-8601 timestamp of when the payment session was created"},"metadata":{"type":["string","null"],"description":"Optional field echoed back if present in the call to create_payment_session"},"multicapture_available":{"type":["boolean","null"],"description":"Whether this session can be captured more than once. Truemed requests multi-capture for sessions created with `request_multicapture: true`, and the card network confirms it for each transaction; this is `true` only when every card the customer paid with supports it. When it's `false`, a `final: false` capture is rejected. Present once authorized, for sessions created with `request_multicapture: true`."},"order_items":{"type":"array","items":{"$ref":"#/components/schemas/PaymentSessionOrderItemDetails"},"description":"A list of order items with fields: item_id, name, price, quantity, sku, total_refundable (optional), quantity_refundable (optional), total_capturable (optional), quantity_capturable (optional)"},"order_level_charges_remaining":{"type":["integer","null"],"description":"Order-level shipping, tax and fees that no capture has collected yet, in cents. 0 once the session closes; refunds don't add back to it. Multi-capture sessions only, once authorized."},"order_level_discounts_remaining":{"type":["integer","null"],"description":"Order-level discounts that no capture has applied yet, in cents. 0 once the session closes; refunds don't add back to it. Multi-capture sessions only, once authorized."},"payment_id":{"type":"string","description":"The id returned to the partner by Truemed in response to a `create_payment_session` request"},"payment_token":{"type":["string","null"],"description":"Optional string indicating the payment_token used for the payment session. This field will be set only if the partner provided tokenize=True or a payment_token in the create_payment_session request"},"status":{"$ref":"#/components/schemas/PaymentSessionStatus","description":"The status of the payment from Truemed's perspective. Can be: captured, canceled, pending, processing, rejected, authorized, authorization_voided, authorization_expired"}},"required":["authorize_amount","captures","created_at","order_items","payment_id","status"],"title":"StatusUpdateWebhookPayload"},"PaymentTokenUpdatedWebhookPayload":{"type":"object","properties":{"eligibility_status":{"oneOf":[{"$ref":"#/components/schemas/EligibilityStatus"},{"type":"null"}],"description":"Where this customer's clinical eligibility stands at the moment this webhook is sent. Named apart from `status` on a payment session, which is that payment's status rather than the customer's. For which items that covers, and until when, use the eligibility read.\n\nOne of:\n- `approved` — A verified, unexpired letter stands for this customer.\n- `pending` — A survey is with a clinician; the outcome is not decided yet.\n- `expired` — The letter that covered this customer has lapsed and not been renewed.\n- `rejected` — A clinician reviewed this customer's most recent survey and declined it.\n- `never_requested` — No letter has ever been requested for this customer here."},"failed_payment_session_id":{"type":["string","null"],"description":"Optional payment session ID that failed, triggering token update"},"lmn_expires_at":{"type":["string","null"],"format":"date","description":"Optional ISO 8601 formatted date when the LMN expires (inclusive, UTC)."},"metadata":{"type":["string","null"],"description":"Optional metadata associated with the payment token"},"payment_methods":{"type":["array","null"],"items":{"$ref":"#/components/schemas/PaymentMethodResponse"},"description":"Optional list of available payment methods for the token"},"payment_session_id":{"type":["string","null"],"description":"Optional payment session ID associated with the token update"},"payment_token":{"type":"string","description":"The payment token identifier"},"provision_token_request_id":{"type":["string","null"],"description":"Optional provision token request ID"}},"required":["payment_token"],"title":"PaymentTokenUpdatedWebhookPayload"},"DisputeWebhookPayload":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DisputeDetailResource","description":"The full canonical dispute — the same shape returned by `GET /api/v1/disputes/{dispute_id}`."},"event_type":{"type":"string","description":"The event type: `dispute.created`, `dispute.updated`, or `dispute.closed`."},"webhook_delivery_id":{"type":"string","description":"Deterministic idempotency key for this delivery (`dlv_…`); stable across retries."}},"required":["data","event_type","webhook_delivery_id"],"title":"DisputeWebhookPayload"},"QualificationSessionStatusUpdatedWebhookPayload":{"type":"object","properties":{"email":{"type":["string","null"],"description":"The email address of the consumer who completed the qualification session."},"expires_at":{"type":["string","null"],"description":"An optional datetime at which the Letter-of-Medical-Necessity expires (inclusive, UTC)."},"qualification_session_id":{"type":"string","description":"The `qualification_session_id` returned by Truemed when the qualification session was created via `create_qualification_session`."},"source":{"type":["string","null"],"description":"An optional source, if provided in the redirect."},"status":{"type":"string","description":"The status of the qualification_session."},"user_id":{"type":["string","null"],"description":"An optional user_id, if provided in the redirect."}},"required":["qualification_session_id","status"],"title":"QualificationSessionStatusUpdatedWebhookPayload"},"ProductCatalogItemEligibilityUpdatedWebhookData":{"type":"object","properties":{"object":{"$ref":"#/components/schemas/CatalogItemDetail","description":"The catalog item with updated eligibility information."}},"required":["object"],"title":"ProductCatalogItemEligibilityUpdatedWebhookData"},"ProductCatalogItemEligibilityUpdatedEventEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProductCatalogItemEligibilityUpdatedWebhookData","description":"The webhook payload data."},"event_type":{"type":"string","description":"The type of event that triggered this webhook (e.g., 'product_catalog.item.eligibility_updated')."},"timestamp":{"type":"string","description":"ISO-8601 timestamp of when the event occurred."}},"required":["data","event_type","timestamp"],"title":"ProductCatalogItemEligibilityUpdatedEventEnvelope"},"ProductCatalogItemEligibilityUpdatedWebhookPayload":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProductCatalogItemEligibilityUpdatedEventEnvelope","description":"The event envelope, carrying `event_type` and `timestamp`. The catalog item itself is at `data.data.object`."},"event_type":{"type":"string","description":"The event type: `product_catalog.item.eligibility_updated`."},"webhook_delivery_id":{"type":"string","description":"Deterministic idempotency key for this delivery (`dlv_…`); stable across retries."}},"required":["data","event_type","webhook_delivery_id"],"title":"ProductCatalogItemEligibilityUpdatedWebhookPayload"}},"securitySchemes":{"truemed-api-key-rest":{"type":"apiKey","in":"header","name":"x-truemed-api-key","description":"Sales channel API key for merchant server-to-server authentication"}}}}