You are viewing an old version of the API
Refund payment

Refunds a payment.

You can refund the entire payment amount or a portion of it. For more information, see Payments and Refunds Overview.

Required permissions PAYMENTS_WRITE

Request Body

Name Description
idempotency_key
string

Required

A unique string that identifies this RefundPayment request. Key can be any valid string but must be unique for every RefundPayment request. For more information, see Idempotency keys.

Min Length 1
amount_money
Money

Required

The amount of money to refund.

Cannot be more than the total_money value of the payment minus the total amount of all previously completed refunds for this payment.

Must be specified in the smallest denomination of the applicable currency. For example, US dollar amounts are specified in cents. See Working with monetary amounts for details.

The currency code must match the currency associated with the business that is charging the card.

app_fee_money
Money

Beta

Amount of money the developer will contribute to help cover the refunded amount. Specified in the smallest denomination of the applicable currency. For example, US dollar amounts are specified in cents.

Value cannot be more than the amount_money.

You can specify this parameter in a refund request only if the same parameter was also included when taking the payment. This is part of the application fee scenario the API supports. For more information, see Collect Fees

payment_id
string

Required

Unique ID of the payment being refunded.

Min Length 1
reason
string

A description of the reason for the refund.

Max Length 192

Response Fields

Name Description
errors
Error [ ]

Information on errors encountered during the request.

refund
PaymentRefund

The successfully created PaymentRefund.

Error Descriptions

Error
AMOUNT_TOO_HIGH

The requested payment amount is too high for the provided payment source.

RESERVATION_DECLINED

402 Request failed - The card issuer declined the refund.

Examples

You are viewing an old version of the API
POST /v2/refunds
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
curl https://connect.squareup.com/v2/refunds \
  -X POST \
  -H 'Square-Version: 2020-03-25' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "idempotency_key": "a7e36d40-d24b-11e8-b568-0800200c9a66",
    "payment_id": "UNOE3kv2BZwqHlJ830RCt5YCuaB",
    "amount_money": {
      "amount": 100,
      "currency": "USD"
    }
  }'
Response JSON
{
  "refund": {
    "id": "UNOE3kv2BZwqHlJ830RCt5YCuaB_xVteEWVFkXDvKN1ddidfJWipt8p9whmElKT5mZtJ7wZ",
    "status": "PENDING",
    "amount_money": {
      "amount": 100,
      "currency": "USD"
    },
    "payment_id": "UNOE3kv2BZwqHlJ830RCt5YCuaB",
    "created_at": "2018-10-17T20:41:55.520Z",
    "updated_at": "2018-10-17T20:41:55.520Z"
  }
}

Share Feedback

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