Refund Payments
Use the Refunds API to refund a payment processed by Square. You usually need the payment.id
value and the amount to refund. In very limited cases, you can refund money to a buyer without referencing a payment ID. This is known as an unlinked refund. Regardless of whether the payment was taken with a Square product or with your application, you can refund a payment using the Refunds API.
The ability to process a refund has the following limitations:
The Refunds API can't refund payments whose original payment date is more than 1 year ago.
You can't refund more than what was originally collected.
You can only refund payments with the status of
COMPLETED
. For a card payment, you can't refund anAPPROVED
payment; however, you can cancel anAPPROVED
card payment.
In the following example RefundPayment
request:
payment_id
identifies the payment being refunded.amount
specifies 100 (100 cents or 1 dollar), which is the amount being refunded. Theamount
is the smallest denomination of the specified currency.currency
specifies USD, which is the currency of the refund.Authorization
is the header, which includes the account that took the original payment.
When Square receives the request, it begins the refund process. Square records the refund by creating a PaymentRefund
object and returns it in the response. The following is an example response:
Did you know?
When you refund a payment, Square also creates an Order
object that provides the refund details. For more information, see Order Returns and Exchanges.
In the response, note that order_id
refers to the Order
object created by the refund.
You can create partial payment refunds against a single Payment
object. Each partial refund reduces the payment.amount_money.amount
value by the refunded amount. The amount_money
and refunded_money
objects show the payment and refund amounts for a given payment in the following example:
Note
The refunded_money
field only appears on Payment
objects when any amount is refunded. Regardless of whether a payment is partially or fully refunded, the payment status remains COMPLETED
.
The RefundPayment
endpoint supports optimistic concurrency, which ensures that a payment is refunded only if it hasn't been modified after you retrieved it. Each Payment
object includes a version_token
field that identifies a specific version of the payment. You can choose to include the Payment
version token of the payment to be refunded by adding the payment_version_token
field in a RefundPayment
request. In this case, the refund request succeeds only if the payment hasn't been updated since that version_token
was generated.
After you request a payment refund using RefundPayment, the response might show the status as PENDING
because Square is still processing the refund. You can send a subsequent GetPaymentRefund request to get the current status.
Did you know?
If you've subscribed to refund webhooks, you get a refund.updated
notification with each refund status change.
The PaymentRefund
request includes the status
field. The status
field is the current state of the refund process and can be FAILED
, PENDING
, COMPLETED
, or REJECTED
.
FAILED
. The refund has failed. The cardholder doesn't receive a refund. The seller can refund the cardholder by other means (such as cash, gift card, or check). Reasons for refund failures can include:A lack of funds in the seller's account.
The card receiving the refund isn't valid.
Invalid request parameters.
PENDING
. Square is processing the refund. Square is getting funds from the seller's Square account or is in the process of moving funds back to the buyer's payment card. Most refunds are completed within a few hours. For card and bank transfer payments, the maximumPENDING
time is 14 days. A seller should contact Square Support if a refund isPENDING
beyond 14 days.COMPLETED
. Square approved the refund and funds have been sent to the buyer's payment card. The cardholder is guaranteed the refund amount. It might take 7–10 business days for refunds to appear, depending on the bank.REJECTED
. The refund failed due to a lack of funds in the seller's account and Square was unable to get the funds from the seller's linked bank account. The seller can refund the cardholder by other means (such as cash, gift card, or check).Note
In some cases, a refund can bypass the
PENDING
state and go directly to theCOMPLETED
orREJECTED
state. For example, in Japan, due to bank capabilities, refunds move immediately and bypass thePENDING
state.
The following shows an example refund request:
The following is a sample response. It shows the refund status as COMPLETED
.
The ability to process an unlinked refund has the following limitations:
Unlinked refunds are not supported in Japan.
American Express card payments cannot be refunded.
Square allows unlinked refunds only for seller accounts that have two-factor authentication (2FA) enabled for all employees.
Refunds cannot be processed by a Square account that has not been enabled for payment processing.
The unlinked refund feature is only available for sellers who have been authorized to use it. A seller using your application needs to contact their Square account manager for authorization. Once authorized, all of the seller's locations can take unlinked refunds.
The following example is the
400
response that your application receives if used by a seller who is not authorized to make unlinked refunds:
Before a seller can use the unlinked refund capability of your application, they need to be authorized by Square. Your application needs to determine the status of that capability before rendering any related UI. Use the Locations API (see Retrieve a specific location)
to get the list of capabilities for the seller location where your application is signed in. The capabilities
field in the returned Location
object includes a structure similar the following:
If the seller location is enabled for unlinked refunds, the capabilities array includes UNLINKED_REFUNDS
. If the capability is not present, unlinked refunds are not enabled. The seller needs to contact their Square account manager for authorization. Without authorization, a request to create an unlinked refund returns the following error:
Your application should subscribe to Locations API webhooks to catch the location.updated event so that if unlinked refunds are enabled for the seller while your application is running, it can refresh its UI to allow unlinked refunds.
Non-Square payments exist when a seller is transitioning their payment processing from another service to Square. During the transition period, the seller might want to issue a refund through Square for a payment taken before they started with Square. The refund request is unlinked because there is no Square Payment
object to represent the original payment.
This unlinked refund is processed in the same way a standard refund is processed. The seller's Square account is the source of the funds for the refund. If there are insufficient funds in the seller's Square account, the seller's linked bank account is the refund's source.
Use the RefundPayment
endpoint to process an unlinked refund. In the request, do not provide a payment ID. Instead, provide values for the following fields:
destination_id
. Identifies the refund destination by setting the value to a payment card (or Square gift card) token or card on file ID. Specify one of the following:A payment token.
A Square gift card or card on file ID.
location_id
. Where the refund occurred.customer_id
. Required for card-on-file destinations.unlinked
. Must betrue
.
A payment token is generated by your application using the Web Payments SDK. When testing, use a Sandbox testing
token such as cnon:card-nonce-ok
.
The following RefundPayment
request specifies a test payment card on file that Square provides for Sandbox testing.
You can test the same request with any of the card test values that Square provides, with the exception of the American Express card, which is not supported for unlinked refunds.
After receiving the request, Square processes the refund and returns money to the buyer. In response, Square returns a Refund
object, as shown in the following example:
The order_id
in this example is the unlinked return order ID. Square creates a refund order for you while processing the refund request and returns the new order ID in this response.
The destination_details
field contains the details of the refund destination. Currently, payment cards are the only supported refund destination. As additional destination types are supported, the destination_details
field will contain one child object for details of the destination type used in the refund.
The destination_details.card_details
field contains details of the destination payment card that you can use to confirm to the buyer that the funds were refunded to the intended card.
If you need more assistance, contact Developer Support or ask for help in the Developer Forums.