create_forex_trade_wap
Call this interface to initiate a wap payment request.
Request
Service address
Environment | HTTPS request URL |
Production environment | https://intlmapi.alipay.com/gateway.do |
Test environment | https://mapi.alipaydev.com/gateway.do |
Request parameters
trade_information
Parameter | Description |
business_typeString | 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, use the vertical bar to seperate type values.
|
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_timeDate | 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_numberString | 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_quantityNumber | 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.
|
Note:
Do not use the halfwidth quotation mark (") in parameter values.
Response
Synchronous response
Parameter | Description |
Basic parameter | |
sign_type String | Sign type. RSA, RSA2 and MD5 are supported. Use uppercase.
|
sign String | Signature value Example:e5815a4556db338ed237f7d3fd222184 |
Business parameter | |
trade_status String(32) | Alipay transaction status. For each transaction, partner must ensure that the status is TRADE_FINISHED. See Trade status for details. Example:TRADE_FINISHED |
trade_no String(64) | Alipay transaction ID, with a length in the range 16 - 64 bits.
|
out_trade_no String(64) | The unique transaction ID that is assigned by the partner. This parameter is transmitted by the corresponding request and needs to be returned with the original value.
|
currency String(3) | The settlement currency
|
total_fee Number(9,2) | The payment amount
|
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, the value can be TRADE_FINISHED or TRADE_CLOSED. See Trade status for details.
|
trade_no String(64) | Alipay transaction ID, with a length in the range 16 - 64 bits.
|
out_trade_no String(64) | The unique transaction ID that is assigned by the partner. This parameter is transmitted by the corresponding request and needs to be returned with the original value.
|
currency String(3) | The settlement currency
|
total_fee Number(9,2) | The payment amount, which is a floating number in the range 0.01 - 1000000.00.
|
Nofitication trigger condition
Trigger condition name | Description | Note |
TRADE_FINISHED | Trade successfully | true (trigger nofitication) |
WAIT_BUYER_PAY | Trade creation | false (does not trigger nofitication) |
TRADE_CLOSED | Trade closed | true (trigger nofitication) |
For more information about the asynchronous response, see Asynchronous 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 out_trade_no parameter is duplicated. |
ILLEGAL_CURRENCY | The currency parameter is incorrect. |
ILLEGAL_TIMEOUT_RULE | The timeout_rule parameter is incorrect. |
SYSTEM_EXCEPTION | Alipay system error |
ILLEGAL_ARGUMENT | Incorrect parameter |
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 | The service is not activated for this account. |
ILLEGAL_DYN_MD5_KEY | The dynamic key information is incorrect. |
ILLEGAL_ENCRYPT | Encryption is incorrect. |
ILLEGAL_USER | User ID is incorrect. |
ILLEGAL_EXTERFACE | Interface configuration is incorrect. |
ILLEGAL_AGENT | The 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=208xxxxxxxxx5500&_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=HKD&product_code=NEW_WAP_OVERSEAS_SELLER&payment_inst=ALIPAYHK&subject=Mika's coffee shop&out_trade_no=out_trade_no_20190910_140243&total_fee=0.01&refer_url=http%3A%2F%2Fwww.mikascoffee.com&trade_information={"business_type"%3A"4"%2C"goods_info"%3A"Mika's capsule coffee^1"%2C"total_quantity"%3A"1"}&sign=c74a6ab82817bd9a325cacaac2d67322
Request sample for acquirers and system integrators with secondary merchants
https://intlmapi.alipay.com/gateway.do?service=create_forex_trade_wap&partner=208xxxxxxxxx5500&_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=HKD&product_code=NEW_WAP_OVERSEAS_SELLER&payment_inst=ALIPAYHK&subject=Mika's coffee shop&out_trade_no=out_trade_no_20190910_140243&total_fee=0.01&secondary_merchant_id=1314520&secondary_merchant_name=Mika's coffee shop&secondary_merchant_industry=5499&sign=82386d719493e90f17ac6e22f2e8de22
Response
Synchronous response
http://www.mikascoffee.com/return?currency=HKD&out_trade_no=out_trade_no_20190910_140255&total_fee=0.01&trade_no=201xxxxxxxxxxxxxxxxxxxx7004&trade_status=TRADE_FINISHED&sign=d9ab0ebb4d2cd4a3a4a83ccdc4c6e6da&sign_type=MD5
http://www.mikascoffee.com/return
currency=HKD
out_trade_no=out_trade_no_20190910_140255
total_fee=0.01
trade_no=201xxxxxxxxxxxxxxxxxxxx7004
trade_status=TRADE_FINISHED
sign=d9ab0ebb4d2cd4a3a4a83ccdc4c6e6da
sign_type=MD5
Asynchronous response
http://www.mikascoffee.com/notify
notify_id=201xxxxxxxxxxxxxxxxxxxxxxxxxxx2953
notify_type=trade_status_sync
sign=$$$
trade_no=201xxxxxxxxxxxxxxxxxxxxx7003
total_fee=0.01
out_trade_no=out_trade_no_20190910_140243
notify_time=2019-09-10 14:11:45
currency=HKD
trade_status=TRADE_FINISHED
sign_type=MD5