You are viewing an old version of the API
Cancel payment

Cancels (voids) a payment

If you set autocomplete to false when creating a payment, you can cancel the payment using this endpoint. For more information, see Delayed Payments.

Required permissions PAYMENTS_WRITE

Path Parameters

Name Description
payment_id
string

Required

payment_id identifying the payment to be canceled.

Response Fields

Name Description
errors
Error [ ]

Information on errors encountered during the request.

payment
Payment

The successfully canceled Payment object.

Examples

You are viewing an old version of the API
POST /v2/payments/{payment_id}/cancel
cURL
  • cURL
  • Ruby
  • Python
curl https://connect.squareup.com/v2/payments/{payment_id}/cancel \
  -X POST \
  -H 'Square-Version: 2019-11-20' \
  -H 'Authorization: Bearer ACCESS_TOKEN'
Response JSON
{
  "payment": {
    "id": "YNR82sYrdgYlEEvJHnkJ7jrRuaB",
    "created_at": "2018-10-17T20:38:46.743Z",
    "updated_at": "2018-10-17T20:38:57.693Z",
    "amount_money": {
      "amount": 200,
      "currency": "USD"
    },
    "app_fee_money": {
      "amount": 10,
      "currency": "USD"
    },
    "total_money": {
      "amount": 200,
      "currency": "USD"
    },
    "status": "CANCELED",
    "source_type": "CARD",
    "card_details": {
      "status": "VOIDED",
      "card": {
        "card_brand": "VISA",
        "last_4": "1234",
        "exp_month": 2,
        "exp_year": 2024,
        "fingerprint": "sq-1-9PP0tWfcM6vIsYmfsesdjfhduHSDFNdJFNDfDNFjdfjpseirDErsaP"
      },
      "entry_method": "KEYED",
      "cvv_status": "CVV_ACCEPTED",
      "avs_status": "AVS_ACCEPTED",
      "auth_result_code": "eWZBDh"
    },
    "reference_id": "12323232323"
  }
}

Share Feedback

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