paymentSessions

Void an authorized payment session before capture

The void_payment_session endpoint should be called after create_payment_session has been called with kind of authorization as outlined in Create Payment Session (Manual Capture).

On a multi-capture session that is partially_captured, a void keeps the amount already captured and releases the uncaptured remainder. The session then reports captured, and you can refund its captures.

A void is rejected while a capture on the session is still processing. Retry after that capture completes.

The failure or success status is communicated to the partner via a payment_session_complete 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 received a final capture via a call to /payment_session/{payment_session_id}/capture 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
    • ValidationError - A capture on the session is still processing. Retry the void after that capture completes.
  • message:
    • Indication of one of the following:
      • Which field was missing
      • Details on how the total amount was invalid
      • Details on captured sessions.
post/payments/v1/payment_session/{business_id}/void

Request

  • Base URL: https://dev-api.truemed.com
  • URL: https://dev-api.truemed.com/payments/v1/payment_session/{business_id}/void
  • Auth: API key in header x-truemed-api-key

Path parameters

business_idstring required

The UUID of the payment session returned by create_payment_session.

Request body

idempotency_keystring required

Allows the endpoint to be called multiple times. It must be unique to the void session call.

Response

Successful response

idstring required

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.

Changes

No recorded changes to this operation across all 1 revision of this API.