API ReferenceTruemed Sessions

Capture Shop Pay Truemed Session

Report a charge you captured on your own payment rail. Send a `capture_info` block describing the charge. Truemed records it against the session for substantiation and session history, and computes its fee. The captured amount is derived from the `item_details` line totals, not from a separate amount field. The call is idempotent on the shop and `idempotency_key` together. Replaying the same capture with identical contents returns the result recorded the first time rather than recording the charge twice; a replay whose contents differ is rejected with a `400` rather than merged. Item order doesn't matter, so the same lines in a different order count as the same capture.

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.

Request

Request body for ShopPayCaptureTruemedSessionRequest
capture_infoobjectRequired
Settlement details for the capture your platform processed on its own rail.
idempotency_keystringRequired1-200 characters
A unique key making the capture report safely retryable.
item_detailslist of objectsRequired

Itemized attribution for the captured amount: each entry captures part of a line item, up to its capturable quantity and total from the session detail. The captured amount is derived from these line totals, not a separate amount field.

Response

Successful response
capture_idstring or null

Truemed’s stable ID for the recorded capture (mrt_<capture_id>).

captured_amount_centsinteger
Cumulative captured amount on this session, in cents, including this capture.
truemed_session_idstring
The session the capture was executed against.

Errors

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