Create a transfer
Once the Partner completes the prerequisite steps, the Partner is able to initiate a transfer request on behalf of the Customer.
Workflow
The following figure illustrates the overall process of a transfer:
Figure 1. Transfer process
Procedure
Step 1. Create a transfer
The transfer process consists of the following steps:
- Before creating a transfer request, the Partner needs to make sure that the prefunding balance is sufficient. The Partner can query WorldFirst(Alipay) with the inquiryBalance API. WorldFirst(Alipay) responds to the Partner about the prefunding balance, currency, and other relevant information.
Note: This step is required before making a request with the transfer API. It is the best practice to make sure of sufficient funds before creating a transfer request.
- For cross-currency trades, a Customer can also make inquiries about the exchange rate. The Partner inquires WorldFirst(Alipay) about the currency exchange rate with the inquiryQuote API. WorldFirst(Alipay) responds to the Partner with an exchange rate. Partners forward the exchange rate to the customer for confirmation.
Note: The exchange rate is a fixed rate for a certain duration which is determined by the contract between WorldFirst(Alipay) and b
- The Partner submits a transfer request with the transfer API. WorldFirst(Alipay) might use the transfer order information to validate the transfer due to regulatory requirements. Once the internal validation process is completed, WorldFirst(Alipay) processes the transfer request with the submitted exchange rate and notifies the Partner that the transfer is accepted by WorldFirst(Alipay).
Note: The transfer process is asynchronous. WorldFirst(Alipay) responds to the Partner about the acceptance of the request, rather than the final result of the transfer. To query the final transfer result, refer to Step 2.
Step 2. Inquire about the payment result
To obtain the transfer status, you can monitor the asynchronous notification or actively call the inquiryTransfer API to get the transfer status. Although a retransmission mechanism exists for the asynchronous notification, the notification might not be received due to network issues when the user successfully completes the transfer. Therefore, it is necessary to actively inquire about the transfer result by using the inquiryTransfer API.
Usually, when you encounter one of the following cases, call the inquiryTransfer API:
- The Partner can inquire about the transfer result 5 seconds after initializing a transfer.
- In cases where no clear transfer result can be obtained. For example, when the transfer result notification is not received within 30 minutes after receiving the response from the transfer API.
Step 3. Receive payment notification
WorldFirst(Alipay) sends the Partner the result of the transfer order after processing. The transfer result notification is carried out with the notifyTransfer API. After receiving the transfer result notification, you must take the corresponding action to process the notification.
After receiving the transfer result notification, you need to take the following actions:
- Verify the signature: to check whether the transfer result notification is sent by WorldFirst(Alipay).
The transfer result notification from WorldFirst(Alipay) is signed by WorldFirst(Alipay). It is recommended to verify the signature and check whether the notification is sent by WorldFirst(Alipay). For more details, refer to the Sign a request and validate the signature chapter.
- Return a receipt acknowledgment message: to let WorldFirst(Alipay) know that you have already received the notification.
After receiving the notification from WorldFirst(Alipay), the Partner needs to send WorldFirst(Alipay) a response message to acknowledge the receipt of the notification.
The Partner needs to properly sign the message before making the response. For details, refer to the Sign a request and validate the signature chapter.
The response header observes the following structure:
Header field | Required | Code sample |
Signature | Yes | Signature: algorithm=RSA256, keyVersion=2, signature=**** |
Content-Type | Yes | Content-Type: application/json; charset=UTF-8 |
Client-Id | Yes | Client-Id: **** |
Response-Time | Yes | Response-Time: 2019-04-04T12:08:56+08:00 |
Sample response header:
{
"headers": {
"Content-Type": "application/json",
"client-id": "5J5Y2Z1GSG5ET508239",
"response-time": "2022-03-07T07:49:27Z",
"signature": "algorithm=RSA256,keyVersion=1,signature=VelVji6jp8UJVrBUvZrwij8uPmjc//hfmVJqCCW0x+Yh/HEs5pz9wiMyYLRjykTOii+f5EznxcFIUxPae5KITe3fChufJzFhJ4iku5U/w6exmBWVR5vrvQZSYO0vG5aJKwUQW/jjgaUWg1d+ySmaJ0VZ0pniQRtwYRGCvzdey+gI0+jMFbChIQDemZ0uLCExRQ0SBKAjEH/Vq14KlY88Wr2bR829tqsxaECSq2M5eeDC7j6FGPMazfX1W+EGqa2go2Hif6BnodwXzNsEAfQlUrbwCi9Ey/uNO4ScTX6FVG1nb+q8/k09wTkCz/nHnwTQolDrLRndZqZfz79a344/FQ=="
}
}
For more details about the response message, refer to the API overview chapter.
The response body has the following fixed value:
{
"result":{
"resultStatus":"S",
"resultCode":"SUCCESS",
"resultMessage":"success"
}
}
If the Partner does not respond to WorldFirst(Alipay) that the notification has been received successfully, WorldFirst(Alipay) will resend the result.
The following policy represents how WorldFirst(Alipay) makes retry attempts:
- WorldFirst(Alipay) retries notifications 7 times.
- Intervals between notifications: 2m, 10m, 10m, 1h, 2h, 6h, and 15h.