Void Session

The `void_payment_session` endpoint should be called after [`create_payment_session`](/api-reference/payment-sessions/create-payment-session) has been called with `kind` of `authorization` as outlined in [Create Payment Session (Manual Capture)](/guides/payment-sessions/manual-delayed-capture). The failure or success status is communicated to the partner via a [`payment_session_complete`](/api-reference/payment-sessions/payment-session-completed-webhook) webhook as before. ## Response Notes ### Success Case HTTP Status: `200` - `id` - 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 ### Failure Case: HTTP Status: `400` If a field is missing or the request is otherwise can't be processed, we'll return a `400` with the following fields: - `error` - can be one of: - `MissingField`: one of the required fields is not present in the request - `PaymentSessionDoesNotExist` - the `payment_session_id` does not exist. - `ServerError`: There was an internal server error. - Requests can be retried as long as the `idempotency-key` is the same. - `SessionCaptured` - The session has already been captured via a call to [`/payment_session/{payment_session_id}/capture`](/api-reference/payment-sessions/capture-payment-session) and can no longer be voided. - In this case, to return funds to the customer, you'll need to issue a refund. - `SessionPending` - The survey hasn't been completed by the customer, and no auth hold has been placed, so there is no auth hold to void yet. - `ImmediateCapture` - The caller is attempting to void a payment_session that wasn't created with `kind=authorization` - `message`: - Indication of one of the following: - Which field was missing - Details on how the total amount was invalid - Details on captured sessions.

Authentication

x-truemed-api-keystring

Sales channel API key for merchant server-to-server authentication

Path parameters

business_idstringRequired

The UUID of the payment session returned by create_payment_session.

Request

Request body for PaymentSessionVoidRequest
idempotency_keystringRequired
Allows the endpoint to be called multiple times. It must be unique to the void session call.

Response

Successful response
idstring

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.

Errors