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).
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 been captured 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
message:
- Indication of one of the following:
- Which field was missing
- Details on how the total amount was invalid
- Details on captured sessions.