• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
Cancel payment by idempotency key

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

Use this method when status of a CreatePayment request is unknown. For example, after you send a CreatePayment request a network error occurs and you don't 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 you want to cancel. After cancelling 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, the end point returns successfully.

Required permissions: PAYMENTS_WRITE

Request Body

Name Description


idempotency_key identifying the payment to be canceled.

Max Length 45 Min Length 1

Response Fields

Name Description
Error [ ]

Any errors that occurred during the request.


You are viewing an old version of the API
POST /v2/payments/cancel
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
curl https://connect.squareup.com/v2/payments/cancel \
  -X POST \
  -H 'Square-Version: 2020-06-25' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "idempotency_key": "a7e36d40-d24b-11e8-b568-0800200c9a66"
Response JSON

Share Feedback

Thanks for visiting the Square API documentation. What's on your mind?