create_forex_trade_wap
Call this interface to initiate a wap payment request.
#Request
#Service address
Environment | HTTPS request URL |
Production environment | |
Test environment |
#Request parameters
#trade_information
| Parameter | Description |
business_type String | Business type. 5 types are supported: 1: Hotel 2: AIR 3: Overseas study consulting 4: Sales of goods 5: Others, including all the other business types that do not fall into the above 4 categories. For example, mobile data service recharge, airport pick up service, etc. If more than one type is involved, separate type values with vertical bar (|).
|
hotel_name String | Hotel name that consists of numbers, letters, spaces, and special characters including ,.<>()[]/\-,. If more than one hotel name exists, separate values with vertical bar (|). Specify this field only when business_type is 1 (Hotel).
|
check_in_time Date | Check-in time. Format: yyyy-MM-dd. Timezone: GMT +8. Specify this field only when business_type is 1 (Hotel).
|
check_out_time Date | Check-out time. Format: yyyy-MM-dd. Timezone: GMT +8. Specify this field only when business_type is 1 (Hotel).
|
flight_number String | Flight number. If flight transfer exists, separate flight numbers with vertical bar (|). Specify this field only when business_type is 2 (AIR).
|
departure_time Date | Departure time.Format: yyyy-MM-dd HH:mmTimezone: GMT +8. If flight transfer exists, separate time values with vertical bar (|). Specify this field only when business_type is 2 (AIR).
|
admission_notice_url String | If business_type is 3 (Overseas study consulting), the URL of admission notice (image) must be specified.
|
goods_info String | Goods information that includes SKU names and corresponding quantities, in the format of SKU_name^quantity. If more than one goods exists, separate values with vertical bar (|). Specify this field only when business_type is 4 (Sales of goods).
|
total_quantity Number | Total quantities of all goods in one order. Specify this field only when business_type is 4 (Sales of goods).
|
other_business_type String | If business_type is 5 (Others), specify the business type in details.Example:Airport pick up service |
Note:
The decimal place accuracy of amounts, such as the values of total_fee, depends on the value of currency. If the value of currency isJPY, then the amount must be an integer. For example, 100 JPY. For other currencies, the amount is of two decimal place accuracy. For example, 100.00 USD. Amounts in other formats will cause error, for example, 100.999 USD. The value of rmb_fee is also of two decimal places because the currency is CNY.
#Response
#Synchronous response
| Parameter | Description |
| Basic parameter | |
sign_type String | Sign type. RSA, RSA2 and MD5 are supported. Use uppercase.
|
sign String | Sign value
|
| Business parameter | |
trade_status String(32) | Alipay transaction status. For each transaction, you must ensure that the status is TRADE_FINISHED. See Trade status for details.
|
trade_no String(64) | The serial number assigned by Alipay to identify a trade in the Alipay system, with a length in the range 16 - 64 bits.
|
out_trade_no String(64) | The unique transaction ID that is assigned by the merchant. This parameter is transmitted by the corresponding request and needs to be returned with the original value.
|
currency String(3) | Settlement currency code
|
total_fee Number(9,2) | The transaction amount. This parameter is transmitted by the corresponding request and needs to be returned with its original value.
|
rmb_fee Number(9,2) | The transaction amount in RMB. Note: This parameter is returned only when merchants used this parameter in the request.
|
#Asynchronous response
| Parameter | Description |
| Basic parameter | |
sign_type String | Sign type. RSA, RSA2 and MD5 are supported. Use uppercase.
|
sign String | Sign value
|
| Business parameter | |
notify_type String | Notification type, with a value of trade_status_sync.
|
notify_id String(34) | Notification ID, used by the partner system to verify the notification
|
notify_time Timestamp | The time in GMT+8 when the notification is sent. The time format is yyyy-MM-dd HH:mm:ss.
|
trade_status String(32) | Trade status, with a value of TRADE_FINISHED or TRADE_CLOSED. See Trade status for details.
|
trade_no String(64) | The serial number assigned by Alipay to identify a trade in the Alipay system, with a length in the range 16 - 64 bits.
|
out_trade_no String(64) | The unique transaction ID that is assigned by the merchant. If the ID is duplicated with the out_trade_no of a previous transaction, the payment fails and an error message is returned to indicate that the payment is duplicated.
|
currency String(3) | Settlement currency code
|
total_fee Number(9,2) | The transaction amount
|
#Notification trigger condition
Trigger condition name | Description | Note |
TRADE_FINISHED | Trade is completed successfully | true (trigger notification) |
WAIT_BUYER_PAY | Trade creation | false (does not trigger notification) |
TRADE_CLOSED | Trade closed | true (trigger notification) |
#Error codes
#Business errors
Returned Result | Description |
FOREX_MERCHANT_NOT_SUPPORT_THIS_CURRENCY | This currency is not supported. |
ILLEGAL_SECURITY_PROFILE | This kind of encryption is not supported. |
REPEAT_OUT_TRADE_NO | The value of the out_trade_no parameter is duplicated. |
ILLEGAL_CURRENCY | The value of the currency parameter is incorrect. |
ILLEGAL_TIMEOUT_RULE | The value of the timeout_rule parameter is incorrect. |
SYSTEM_EXCEPTION | Alipay system error |
ILLEGAL_ARGUMENT | Incorrect parameter |
SECONDARY_MERCHANT_ID_BLANK | The secondary merchant ID is not provided to Alipay. |
SECONDARY_MERCHANT_ID_INVALID | The secondary merchant is not registered with Alipay. |
SECONDARY_MERCHANT_STATUS_ERROR | The status of secondary merchant is abnormal in the Alipay system. |
#Access errors
Returned result | Description |
ILLEGAL_SIGN | Illegal signature |
ILLEGAL_SERVICE | Service Parameter is incorrect. |
ILLEGAL_PARTNER | Incorrect Partner ID |
ILLEGAL_SIGN_TYPE | Signature is of wrong type. |
ILLEGAL_PARTNER_EXTERFACE | Service is not activated for this account. |
ILLEGAL_DYN_MD5_KEY | Dynamic key information is incorrect. |
ILLEGAL_ENCRYPT | Encryption is incorrect. |
ILLEGAL_USER | User ID is incorrect. |
ILLEGAL_EXTERFACE | Interface configuration is incorrect. |
ILLEGAL_AGENT | Agency ID is incorrect. |
HAS_NO_PRIVILEGE | No right to visit |
INVALID_CHARACTER_SET | The character set is invalid. |
#System errors
Returned result | Description |
SYSTEM_ERROR | Alipay system error |
SESSION_TIMEOUT | Session timeout |
ILLEGAL_TARGET_SERVICE | Wrong target service |
ILLEGAL_ACCESS_SWITCH_SYSTEM | Merchant is not allowed to visit system of this type. |
EXTERFACE_IS_CLOSED | The interface has been closed. |
#Samples
#Request
Request sample for merchants directly integrated with Alipay
https://intlmapi.alipay.com/gateway.do?service=create_forex_trade_wap&partner=208xxxxxxxxx6931&_input_charset=UTF-8&sign_type=MD5¬ify_url=http%3A%2F%2Fwww.mikascoffee.com%2Fnotify&return_url=http%3A%2F%2Fwww.mikascoffee.com%2Freturn¤cy=USD&product_code=NEW_WAP_OVERSEAS_SELLER&subject=Mika's%20capsule%20coffee&out_trade_no=out_trade_no_20190826_204554&total_fee=12&refer_url=http%3A%2F%2Fwww.mikascoffee.com&trade_information=%7B%22business_type%22%3A%224%22%2C%22goods_info%22%3A%22Mika's%20capsule%20coffee%5E1%22%2C%22total_quantity%22%3A%221%22%7D&sign=7af72fa01f18138abe6f3911d9097089
Request sample for acquirers and system integrators with secondary merchantshttps://intlmapi.alipay.com/gateway.do?service=create_forex_trade_wap&partner=2088021017666931&_input_charset=UTF-8&sign_type=MD5¬ify_url=http%3A%2F%2Fwww.mikascoffee.com%2Fnotify&return_url=http%3A%2F%2Fwww.mikascoffee.com%2Freturn¤cy=USD&product_code=NEW_WAP_OVERSEAS_SELLER&subject=Mika's%20capsule%20coffee&out_trade_no=out_trade_no_20190826_204550&total_fee=12&secondary_merchant_id=1314520&secondary_merchant_name=China%20Substation&secondary_merchant_industry=5499&sign=11d87b484c623c771220001aa31705b5
#Response
Synchronous response sample
http://www.mikascoffee.com/return?currency=USD&out_trade_no=out_trade_no_20190826_204556&total_fee=0.01&trade_no=2019082622001336531050687821&trade_status=TRADE_FINISHED&sign=c2d0ad527e5937fdc8dd0f7dcc7f7ac2&sign_type=MD5
http://www.mikascoffee.com/return
currency=USD
out_trade_no=out_trade_no_20190826_204556
total_fee=0.01
trade_no=2019082622001336531050687821
trade_status=TRADE_FINISHED
sign=c2d0ad527e5937fdc8dd0f7dcc7f7ac2
sign_type=MD5

Asynchronous response sample
http://www.mikascoffee.com/notify?notify_id=2019082600222214311036531048309837¬ify_type=trade_status_sync&sign=69b24fbfdc570463897a15f75b321215&trade_no=2019082622001336531050687821&buyer_id=2088602333336535&total_fee=0.01&forex_rate=7.20211000&out_trade_no=out_trade_no_20190826_204556&rmb_fee=0.07&seller_id=2088021017666931¤cy=USD¬ify_time=2019-08-26 21%3A43%3A12&trade_status=TRADE_FINISHED&sign_type=MD5
http://www.mikascoffee.com/notify
notify_id=2019082600222214311036531048309837
notify_type=trade_status_sync
sign=69b24fbfdc570463897a15f75b321215
trade_no=2019082622001336531050687821
buyer_id=2088602333336535
total_fee=0.01
forex_rate=7.20211000
out_trade_no=out_trade_no_20190826_204556
rmb_fee=0.07
seller_id=2088021017666931
currency=USD
notify_time=2019-08-26 21:43:12
trade_status=TRADE_FINISHED
sign_type=MD5