Refunds API

Refund Payments

You use the Refunds API to refund payments. This topic explores the API and provides examples. For an overview, see Payments and Refunds APIs Overview.

Refund a payment
Permalink Get a link to this section

Consider the following Refunds API RefundPayment request. In the request:

  • amount_money specifies one dollar to refund. It specifies the currency and the amount to charge. The amount is the smallest denomination of the specified currency (USD), which means the US dollar amount specified in the request is in cents (100 cents).

  • payment_id identifies the payment being refunded.

  • Authorization header includes the account that took the original payment.

    curl -X POST \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer {{ACCESS_TOKEN}}' \
    -H 'Cache-Control: no-cache' \
    -H 'Content-Type: application/json' \
    -d '{
      "idempotency_key": "{{UNIQUE-KEY}}",
      "payment_id": "sXps2bKrr05VXDaOV0dgexample",
      "amount_money": {
        "amount": 100,
        "currency": "USD"
      }
    }' \
    'https://connect.squareup.com/v2/refunds'
    

    After receiving the request, Square begins the refund process. The following is a sample response:

    {
       "refund":{
          "id":"6aVfI...",
          "status":"PENDING",
          "amount_money":{
             "amount":100,
             "currency":"USD"
          },
          "payment_id":"sXps2bKrr05VXDaOV0dgexample",
          "order_id":"NF446edlDGTq7fzlEzYKSvHJ6xbZY",
          "created_at":"2019-07-15T00:25:08.275Z",
          "updated_at":"2019-07-15T00:25:08.978Z",
          "location_id":"X9XWRESTK1CZ1"
       }
    }
    

Retrieve refund information
Permalink Get a link to this section

After you refund a payment, the RefundPayment response might show the status as PENDING. You can send a GetPaymentRefund request to get refund information.

curl -X GET \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {{ACCESS_TOKEN}}' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
'https://connect.squareup.com/v2/refunds/{{REFUND-ID}}'

The following is a sample response. It shows the refund status as COMPLETED. For different status values, see the PaymentRefund API.

{
   "refund":{
      "id":"K2bfzontSp4yOJ...",
      "status":"COMPLETED",
      "amount_money":{
         "amount":100,
         "currency":"USD"
      },
      "payment_id":"K2bfzontSp4yOJSwsIABexample",
      "created_at":"2019-02-18T01:00:41.574Z",
      "updated_at":"2019-02-18T01:07:21.529Z"
   }
}