Reverse Payment By Token

This endpoint performs a reversal of the checkout that is used to initiate the Clearpay payment process. This will cancel the order asynchronously as soon as it is created without the need of an additional call to the void or refund endpoint. In order for a payment to be eligible, the order must be in an Auth-Approved or Captured state and must be issued within 10 minutes of the order being created.

If this is called after a timeout is received from v2/payments/auth and v2/payments/auth eventually completes successfully, the order will get voided shortly after it’s created.

If this is called after a timeout is received from v2/payments/capture and v2/payments/capture eventually completes successfully, the order will end up in a REVERSED state. This is similar to a call to the v2/payments/refund endpoint except that merchant fees are not paid to Clearpay and the capture and refund will not show up in the settlement file.

Successful Response (204)

Returns no content in the response.

Connection Timeouts

TimeoutTime (Seconds)
Open10
Read70

Errors

In addition to the PUT/POST Errors applicable to all POST endpoints, the following errors are specific to Reverse Payment By Token:

HTTP Status CodeerrorCodeDescription
402 <br />Payment Requiredinvalid_tokenInvalid token
412 <br />Precondition Failedprecondition_failedPayment reversal previously processed
412 <br />Precondition Failedprecondition_failedPayment not eligible for a reversal
412 <br />Precondition Failedprecondition_failedOrder outside reversal window
412 <br />Precondition Failedprecondition_failedOrder in pending reversal, no captures/auth accepted
post/v2/payments/token:{token}/reversal

Request

  • Base URL: https://global-api-sandbox.afterpay.com
  • URL: https://global-api-sandbox.afterpay.com/v2/payments/token:{token}/reversal
  • Auth: HTTP basic

Path parameters

tokenstring required

The token of the checkout to be reversed (voided).

Headers

User-Agentstring required
Acceptstring

Response

Successful response

Changes

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