API ReferenceTruemed Sessions

Cancel Shop Pay Truemed Session

Cancel a pending Truemed session. Use this when the shopper never finished the flow or you withdrew the offer. The endpoint takes no request body and is idempotent: canceling an already-canceled session is a no-op that returns the same `canceled` state. You can cancel a session any time before a capture is reported: from creation, through the survey, an authorization hold, and clinical review. A canceled session reads `qualification_info.qualification_status` = `canceled` and stops accepting survey completions and holds. Its `order_items` keep the merchant-visible eligibility split: `eligible_amount_cents` is omitted until the shopper completes the survey; after that, each line reports the HSA/FSA-eligible amount (`> 0` for an eligible line, `0` for a line that was ineligible or clinically rejected). Once a capture has been reported you can no longer cancel, and the call returns a `400`; to return money to the shopper after capture, issue a [refund](/v2/api-reference/truemed-sessions/create-shop-pay-truemed-session-refund) instead.

Authentication

x-truemed-api-keystring

Platform API key for platform server-to-server authentication

Path parameters

truemed_session_idstringRequired
The Shop Pay Truemed session ID from the URL path.

Response

Successful response
truemed_session_idstring
The session that was canceled.

Errors

400
Bad Request Error
404
Not Found Error
405
Method Not Allowed Error
500
Internal Server Error
501
Not Implemented Error