Refund payment
Refunds a payment.
You can refund the entire payment amount or a portion of it.
Name | Description |
---|---|
idempotency_
Required
|
A unique string that identifies this For more information, see Idempotency. |
amount_
Required
|
The amount of money to refund. This amount cannot be more than the This amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see Working with Monetary Amounts. The currency code must match the currency associated with the business that is charging the card. |
app_
Beta
|
The amount of money the developer contributes to help cover the refunded amount. This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). The value cannot be more than the 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 Take Payments and Collect Fees. |
payment_
Required
|
The unique ID of the payment being refunded. |
reason
|
A description of the reason for the refund. |
Response Fields
Name | Description |
---|---|
errors
|
Information about errors encountered during the request. |
refund
|
The successfully created |
Examples
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/refunds \
-X POST \
-H 'Square-Version: 2020-12-16' \
-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"
}
}'
{
"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"
}
}
Error Descriptions
400 Bad request |
AMOUNT_ The requested payment amount is too high for the provided payment source. |
> |
400 Bad request |
REFUND_ Request failed - The card issuer declined the refund. |
> |
{
"errors": [
{
"code": "AMOUNT_TOO_HIGH",
"category": "INVALID_REQUEST_ERROR"
}
]
}