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
  • C#
  • Java
curl https://connect.squareup.com/v2/payments/{payment_id}/cancel \
  -X POST \
  -H 'Square-Version: 2020-03-25' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json'
Response JSON
{
  "payment": {
    "id": "GQTFp1ZlXdpoW4o6eGiZhbjosiDFf",
    "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",
        "card_type": "DEBIT",
        "prepaid_type": "PREPAID",
        "bin": "411111"
      },
      "entry_method": "KEYED",
      "cvv_status": "CVV_ACCEPTED",
      "avs_status": "AVS_ACCEPTED",
      "auth_result_code": "eWZBDh",
      "statement_description": "SQ *MY MERCHANT"
    },
    "location_id": "XTI0H92143A39",
    "order_id": "m2Hr8Hk8A3CTyQQ1k4ynExg92tO3",
    "reference_id": "123456",
    "note": "Brief description",
    "customer_id": "RDX9Z4XTIZR7MRZJUXNY9HUK6I"
  }
}

Share Feedback

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