v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.1 MB
Payments

CancelPaymentByIdempotencyKey

Cancels (voids) a payment identified by the idempotency key that is specified in the request.

Use this method when the status of a CreatePayment request is unknown (for example, after you send a CreatePayment request, a network error occurs and you do not get a response). In this case, you can direct Square to cancel the payment using this endpoint. In the request, you provide the same idempotency key that you provided in your CreatePayment request that you want to cancel. After canceling the payment, you can submit your CreatePayment request again.

Note that if no payment with the specified idempotency key is found, no action is taken and the endpoint returns successfully.

post/v2/payments/cancel

Request body

idempotency_keystring required

The idempotency_key identifying the payment to be canceled.

Example request

{
  "idempotency_key": "a7e36d40-d24b-11e8-b568-0800200c9a66"
}

Response

Success

Example response

{}