Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solution

Refund in-store payments

This document describes how the refund for Alipay In-store Payment works.

Scope

The information in this document applies to Alipay In-store Payment products and AlipayHK in-store payment products, which includes the following ones:

  • Barcode Payment
  • Merchant QR Code Payment
  • Transaction QR Code Payment
  • Third-party Merchant QR Code Payment
  • AlipayHK - Barcode
  • AlipayHK - Merchant QR Code
  • AlipayHK - Transaction QR Code

Overview

The following table describes the key information of in-store payment refunds.

Refund type

Asynchronous refund

Asynchronous refund

Synchronous refund

Refund method

Global Merchant Portal

API (is_sync is N or null)

API (is_sync is Y)

How is refund result returned

Displayed in the Global Merchant Portal transaction list

Returned by the API sync response or asynchronous notification. See Asynchronous refund for details.

Returned by the API synchronous response

Synchronous 

response exists

No

Yes. If the request succeeds, sync response returns the request acceptance result. However, if the request fails, the refund fails, and sync response returns the failure result.

Yes. Synchronous response returns the both the request acceptance result and the refund result.

Asynchronous 

notification exists

No

Yes, but only if the refund succeeds. 

No

Alipay retries the refund

Yes. If the refund is requested within the T day, the refund is processed after the request. If the refund is requested after the T day, the refund is processed during the request day 23:00 to next day 5:00 (GTM+8). If merchant funds are insufficient, Alipay retries the refund during 23:00 to next day 5:00 (GTM+8) for 180 days. If the funds are still insufficient after 180 days, the refund fails.

No. To retry a refund, merchant must send a new request.

Table 1. Key information for in-store payment refund

How to issue a refund

You can issue a refund by using the refund API for in-store payment (alipay.acquire.overseas.spot.refund)or by using Global Merchant Portal. Only transactions that are successfully paid can be refunded and the refund must be requested within the valid refund period. 

  • API can be used to request either a synchronous refund or an asynchronous refund. 
  • Global Merchant Portal can only issue asynchronous refund.

Synchronous refund

Use the refund interface alipay.acquire.overseas.spot.refund to issue a synchronous refund. In the request, the value of is_sync  must be Y For more information about the API, see spot_refund.

After receiving the request, Alipay processes the refund and then returns the refund result to the merchant by using a synchronous response.

  • If errors exist in the request, the refund fails.
  • If the request is successfully accepted, Alipay process the refund, and
    • If the merchant funds are sufficient for the refund, the refund succeeds.
    • If the merchant funds are insufficient for the refund, the refund fails. Merchant can retry the refund by sending a new request.

Sample request

copy
https://intlmapi.alipay.com/gateway.do?service=alipay.acquire.overseas.spot.refund&partner=2088021966388155&_input_charset=UTF-8&sign_type=MD5&notify_url=https%3A%2F%2Fwww.test.com&currency=USD&partner_trans_id=Refund_Test_002&partner_refund_id=Refund_Test_002-1&refund_amount=0.01&refund_reason=%E4%B9%B0%E5%AE%B6%E4%B8%BB%E5%8A%A8%E8%A6%81%E6%B1%82%E9%80%80%E6%AC%BE&is_sync=Y&sign=6f6855584cc15426615468c01ed15638

Sample response

The refund succeeds:

copy
<alipay>
<is_success>T</is_success>
<request>
<param name="_input_charset">UTF-8</param>
<param name="sign">6f6855584cc15426615468c01ed15638</param>
<param name="notify_url">https://www.test.com</param>
<param name="is_sync">Y</param>
<param name="partner_trans_id">Refund_Test_002</param>
<param name="partner">2088021966388155</param>
<param name="service">alipay.acquire.overseas.spot.refund</param>
<param name="refund_amount">0.01</param>
<param name="currency">USD</param>
<param name="refund_reason">Buyer's demand</param>
<param name="sign_type">MD5</param>
<param name="partner_refund_id">Refund_Test_002-1</param>
</request>
<response>
<alipay>
<alipay_trans_id>2020021222001461121418728041</alipay_trans_id>
<currency>USD</currency>
<exchange_rate>6.97251950</exchange_rate>
<partner_refund_id>Refund_Test_002-1</partner_refund_id>
<partner_trans_id>Refund_Test_002</partner_trans_id>
<refund_amount>0.01</refund_amount>
<refund_amount_cny>0.07</refund_amount_cny>
<result_code>SUCCESS</result_code>
</alipay>
</response>
<sign>f9f6daefcd7fbf56fb930c7f75d8bb22</sign>
<sign_type>MD5</sign_type>
</alipay>

The refund fails:

copy
<alipay>
<is_success>T</is_success>
<request>
<param name="_input_charset">UTF-8</param>
<param name="sign">7a1f0f739abd76ba0215693be0c608c2</param>
<param name="notify_url">https://www.test.com</param>
<param name="is_sync">Y</param>
<param name="partner_trans_id">Refund_Test_002</param>
<param name="partner">2088021966388155</param>
<param name="service">alipay.acquire.overseas.spot.refund</param>
<param name="refund_amount">0.01</param>
<param name="currency">USD</param>
<param name="refund_reason">Buyer's demand</param>
<param name="sign_type">MD5</param>
<param name="partner_refund_id">Refund_Test_002-5</param>
</request>
<response>
<alipay>
<error>REQUEST_AMOUNT_EXCEED</error>
<result_code>FAILED</result_code>
</alipay>
</response>
<sign>4fbff80e997dfee35ce7204e9d189fe1</sign>
<sign_type>MD5</sign_type>
</alipay>

Asynchronous refund

You can issue an asynchronous refund by using either the refund API or by using Global Merchant Portal.

API

Use the refund interface alipay.acquire.overseas.spot.refund to issue an asynchronous refund. In the request, is_sync can be empty, or the value of is_sync must be NFor more information about the API, see spot_refund.

After the request is sent, Alipay processes the refund and then notifies the merchant of the refund result according to following scenarios:

  • If the errors exist in the request, the refund fails. Alipay returns the result by using a synchronous response.
  • If the request is successfully accepted, Alipay first returns the request result to the merchant by using a synchronous response, and notifies the refund result by using an asynchronous notification according to the following scenarios:
    • If the refund is requested within the T day and merchant funds are sufficient for the refund, the refund will be completed in a short period of time.
    • If the merchant funds are sufficient for the refund, but the refund is requested after T day, Alipay processes the refund during the request day 23:00 to next day 5:00 (GTM+8).
    • If the merchant funds are insufficient for the refund, Alipay retries the refund during 23:00 to next day 5:00 (GTM+8) for 180 days.
      • If the funds become sufficient, Alipay processes the refund and sends the refund result to the merchant by using an asynchronous notification.
      • If the merchant funds are still insufficient after the 180 days, the refund fails. No notification is sent in this case.

Sample request

copy
https://intlmapi.alipay.com/gateway.do?service=alipay.acquire.overseas.spot.refund&partner=2088021966388155&_input_charset=UTF-8&sign_type=MD5&notify_url=https%3A%2F%2Fwww.test.com&currency=USD&partner_trans_id=Refund_Test_002&partner_refund_id=Refund_Test_002-3&refund_amount=0.01&refund_reason=%E4%B9%B0%E5%AE%B6%E4%B8%BB%E5%8A%A8%E8%A6%81%E6%B1%82%E9%80%80%E6%AC%BE&sign=ce038bbcf351bdd5c9594d4f677856c4

Sample response

The refund request is accepted by Alipay and a synchronous response is returned:

copy
<alipay>
<is_success>T</is_success>
<request>
<param name="partner_trans_id">Refund_Test_002</param>
<param name="partner">2088021966388155</param>
<param name="service">alipay.acquire.overseas.spot.refund</param>
<param name="_input_charset">UTF-8</param>
<param name="sign">ce038bbcf351bdd5c9594d4f677856c4</param>
<param name="refund_amount">0.01</param>
<param name="currency">USD</param>
<param name="refund_reason">Buyer's demand</param>
<param name="notify_url">https://www.test.com</param>
<param name="sign_type">MD5</param>
<param name="partner_refund_id">Refund_Test_002-3</param>
</request>
<response>
<alipay>
<alipay_trans_id>2020021222001461121418728041</alipay_trans_id>
<currency>USD</currency>
<exchange_rate>6.97251950</exchange_rate>
<partner_refund_id>Refund_Test_002-3</partner_refund_id>
<partner_trans_id>Refund_Test_002</partner_trans_id>
<refund_amount>0.01</refund_amount>
<refund_amount_cny>0.07</refund_amount_cny>
<result_code>SUCCESS</result_code>
</alipay>
</response>
<sign>2cf81e241f141802dd137636f3b7e1d3</sign>
<sign_type>MD5</sign_type>
</alipay>

The refund fails, and a synchronous response is returned:

copy
<alipay>
<is_success>T</is_success>
<request>
<param name="partner_trans_id">Refund_Test_002</param>
<param name="partner">2088021966388155</param>
<param name="service">alipay.acquire.overseas.spot.refund</param>
<param name="_input_charset">UTF-8</param>
<param name="sign">05457b79c8749f8ea3f0ac5a1c169e0f</param>
<param name="refund_amount">0.02</param>
<param name="currency">USD</param>
<param name="refund_reason">Buyer's demand</param>
<param name="notify_url">https://www.test.com</param>
<param name="sign_type">MD5</param>
<param name="partner_refund_id">Refund_Test_002-4</param>
</request>
<response>
<alipay>
<error>REQUEST_AMOUNT_EXCEED</error>
<result_code>FAILED</result_code>
</alipay>
</response>
<sign>4fbff80e997dfee35ce7204e9d189fe1</sign>
<sign_type>MD5</sign_type>
</alipay>

The refund succeeds, and an asynchronous notification is sent:

copy
https://www.mikascoffee.com/notify
trans_refund_fee=0.01
notify_type=refund_status_sync
return_amount=0.01
notify_time=2019-09-11 19:24:30
out_trade_no=out_trade_no_20190904_163949
refund_status=REFUND_SUCCESS
sign=$$$
out_return_no=partner_refund_id_20190904_160211
currency=USD
sign_type=MD5
notify_id=201xxxxxxxxxxxxxxxxxxxxxxxxxxx3785

Global Merchant Portal

You can issue an asynchronous refund by using Alipay Global Merchant Portal. See the following steps for details:

  1. Log into Alipay Global Site with your merchant account.

image.png

  1. Go to Business Center -- My Transaction.

image.png

  1. Find the specific transaction and click Refund. You can search the transaction with the transaction ID, or filter transactions by using the transaction time.

image.png

  1. Enter the refund information and your payment password to issue the refund.

image.png

  1. Click 确定 (Confirm) to confirm the refund.

捕获.PNG

You can then wait for the refund to be processed by Alipay. To obtain the refund result, you must find the specific transaction in Global Merchant Portal, or use the reconciliation service.