Void

This endpoint voids the remaining `openToCapture` amount of the payment auth, and refunds the consumer. <Note title="Note"> This operation is [idempotent](/idempotent-requests) based on the `requestId` guaranteeing the payment operation is only performed once. </Note> ## Successful Response (201) If successful, returns an updated copy of the [Payment object](/payment-object). - A new [Payment Event object](/payment-event-object) will be appended to the `events` array, with a `type` of "VOIDED". - A new [Refund object](/refund-object) will be prepended to the `refunds` array. - If the `openToCapture` amount is reduced to zero as a result of this Void request, the `paymentState` will be updated as follows: - from "AUTH_APPROVED" to "VOIDED", or - from "PARTIALLY_CAPTURED" to "CAPTURED". ## Connection Timeouts | Timeout | Time (Seconds) | | :------ | :------------- | | Open | 10 | | Read | 70 | ## Errors In addition to the [PUT/POST Errors](/put-post-errors) applicable to all POST endpoints, the following errors are specific to Void: | HTTP Status Code | errorCode | Description | | :-- | :-- | :-- | | **404** <br />Not Found | `not_found` | The `orderId` string provided was empty or did not match a valid order. | | **410** <br />Gone | `payment_captured` | Payment has already been fully captured for this order. |

Authentication

AuthorizationBasic

Basic authentication of the form Basic <username:password>.

Path parameters

orderIdstringRequired

The unique ID of the Clearpay Order, returned as the id property of the Auth response.

Headers

User-AgentstringRequired
AcceptstringOptionalDefaults to application/json

Request

This endpoint expects an object.
amountobjectOptional
The amount to be voided
requestIdstringOptional
A unique request ID, required for safe retries. It is recommended that the merchant generate a UUID for each unique void.
reasonstringOptional

Can be passed in void requests to conditionally modify wording of the corresponding consumer refund email. This can be set to 1 of 3 values, cancelledItems, amountAdjustment or null