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

You are viewing an old version of the API
Void transaction

Deprecated
Effective August 15th, 2019

Cancels a transaction that was created with the Charge endpoint with a delay_capture value of true.

See Delayed capture transactions for more information.

Permissions
PAYMENTS_WRITE

Deprecation date
2019-08-15
Retirement date
2021-09-01
Replaced by
CancelPayment
Migration guide
Name Description
location_id
string

Required
transaction_id
string

Required

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

Examples

You are viewing an old version of the API
POST /v2/locations/{location_id}/transactions/{transaction_id}/void
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
curl https://connect.squareup.com/v2/locations/location_id0/transactions/transaction_id1/void \
  -X POST \
  -H 'Square-Version: 2020-08-12' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json'
Response JSON
{}

Error Descriptions

400 Bad request DELAYED_TRANSACTION_CAPTURED

The application tried to capture a delayed-capture payment that was already captured.

>
400 Bad request DELAYED_TRANSACTION_EXPIRED

The application tried to update a delayed-capture payment that has expired.

>
400 Bad request
{
  "errors": [
    {
      "code": "DELAYED_TRANSACTION_CAPTURED",
      "category": "INVALID_REQUEST_ERROR"
    }
  ]
}

Share Feedback

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