Portals included:
- PC-pay: create_forex_trade
- WAP-pay: create_forex_trade_wap
- APP-pay: mobile.securitypay.pay
- Auto-debit: alipay.acquire.createandpay
The adjustments:
- Add parameter: refer_url (excluding Auto-debit)
- Add parameter: trade_information
- Remove parameter: body (replaced with trade_information due to max-length limit)
Parameter explanation:
- 1- refer_url:
- Description: Your website's homepage (Or the app download address, if no homepage exists)
- Format: URL(200)
- Example: refer_url=http://testmerchant.com
-
- 2- trade_information:
- Description: Used to pass the product information
- Format: JSON(6000)
Sub-parameters:
Name | Description | Conditionality |
business_type | Business type of product1: Hotel2: Aviation3: Overseas Education Affairs4: Retailing5: Other | |
Examples:
Business_type | Example |
1 (Hotel) | trade_information={"business_type":"1", "hotel_name":"Harbour Plaza 8 Degrees", "check_in_time":"2019-03-05|2019-03-08", "check_out_time":"2019-03-08|2019-03-11"} |
2 (Aviation) | trade_information={"business_type":"2", "flight_number":"DL 1009", "departure_time":"2019-03-04 12:45"} |
3 (Overseas Education Affairs) | trade_information={"business_type":"3", "admission_notice_url":"http://liuxue.liuxuesituation.com/rootimages/2015/06/06/2025060694237.jpg"} |
4 (Retailing) | trade_information={"business_type":"4", "goods_info":"APPLE iPhone 8 Plus 3GB 64GB^1|APPLE Macbook Pro 13 inch i5 8G 256G with TouchBar^1", "total_quantity":"2"} |
5 (Other) | trade_information={"business_type":"5", "other_business_type":"Airport Transfer to Ali Future Hotel, Driver: Li"} |
Notes:
- The format of goods_info is "goods_name^goods_quantity", total_quantity msut be the sum of the values of goods_info.
- goods_info must contain clear information about the goods, including brand name, production category, product specifications, and corresponding quantities.
- If more than 1 items exist, join them with "|".
Possible modification steps:
Step1 Remove parameter body
Step2 Add parameter: refer_url=http://testmerchant.com
Step3 Add parameter: trade_information={"business_type":"4", "goods_info":"APPLE iPhone 8 Plus 3GB 64GB^1", "total_quantity":"1"}
Full request example:
https://intlmapi.alipay.com/gateway.do?_input_charset=UTF-8¤cy=USD¬ify_url=https%3A%2F%2Fwww.aliexpress.com%2Fnotify&out_trade_no=T2019030407262312&partner=2088021017666931&product_code=NEW_OVERSEAS_SELLER&refer_url=https%3A%2F%2Fwww.aliexpress.com&return_url=https%3A%2F%2Fwww.aliexpress.com&secondary_merchant_id=K781125&secondary_merchant_industry=5965&secondary_merchant_name=Global%20Top%20Brands%20Store&service=create_forex_trade&subject=APPLE%20iPhone%208%20Plus...%20and%20APPLE%20Macbook%20Pro...&total_fee=2098&trade_information=%7B%22business_type%22%3A%224%22%2C%22goods_info%22%3A%22APPLE%20iPhone%208%20Plus%203GB%2064GB%5E1%7CAPPLE%20Macbook%20Pro%2013%20inch%20i5%208G%20256G%20with%20TouchBar%5E1%22%2C%22total_quantity%22%3A%222%22%7D&sign=188dc677967a4fac37938372bfd441ef&sign_type=MD5
Others:
- Other parameters and the signature rules are not changed.
- For more details, visit the API documents:
- PC-pay: create_forex_trade
- WAP-pay: create_forex_trade_wap
- APP-pay: mobile_securitypay_pay
- Auto-debit: createandpay
涉及的接口:
- PC支付接口:create_forex_trade
- WAP支付接口:create_forex_trade_wap
- APP支付接口:mobile.securitypay.pay
- 代扣接口:alipay.acquire.createandpay
调整如下:
- 添加字段refer_url(除了代扣接口)
- 添加字段trade_information
- 删除字段body(出于参数最大长度原因,现用trade_information代替)
参数解释:
1- refer_url:贵司网站首页(如果没有,则是app下载地址)
- 解释:贵司的官网地址(如贵司业务不需要官网,则为贵司app下载地址)
- 格式:URL(200)
- 例子:refer_url=http://testmerchant.com
-
- 2-trade_information:用于传递商品信息
- 解释:用于传递商品信息
- 格式:JSON(6000)
子参数:
参数名 | 解释 | 何时需要该参数? |
business_type | 商品类型1: 酒店行业2: 民航运输业3: 留学产业4: 商品零售业5: 其他 | |
hotel_name | 酒店的名称 | 当business_type=1 |
check_in_time | 入住时间 | 当business_type=1 |
check_out_time | 离店时间 | 当business_type=1 |
flight_number | 航班号 | 当business_type=2 |
departure_time | 起飞时间 | 当business_type=2 |
admission_notice_url | 录取通知书的图片链接 | 当business_type=3 |
goods_info | 零售商品信息,包含商品名称和数量 | 当business_type=4 |
total_quantity | 零售商品信息中的商品总数量 | 当business_type=4 |
other_business_type | 表示其他种类的商品类型名称 | 当business_type=5 |
例子:
business_type | example |
1 (酒店行业) | trade_information={"business_type":"1", "hotel_name":"阿里未来酒店", "check_in_time":"2019-03-05|2019-03-08", "check_out_time":"2019-03-08|2019-03-11"} |
2 (民航运输业) | trade_information={"business_type":"2", "flight_number":"DL 1009", "departure_time":"2019-03-04 12:45"} |
3 (留学产业) | trade_information={"business_type":"3", "admission_notice_url":"http://liuxue.liuxuesituation.com/rootimages/2015/06/06/2025060694237.jpg"} |
4 (商品零售业) | trade_information={"business_type":"4", "goods_info":"Apple/苹果 iPhone XS Max 64GB^1|APPLE/苹果 Macbook Pro 13 inch i5 8G 256G with TouchBar^1", "total_quantity":"2"} |
5 (其他) | trade_information={"business_type":"5", "other_business_type":"至阿里未来酒店的机场接送服务,李师傅"} |
- goods_info的格式为"商品名^商品数量",total_quantity应为goods_info中的数量之和。
- goods_info中应当包含明确的商品信息,包括品牌名、产品类别,产品规格以及数量。
- 当包含多个项目时,用|分割。
示例改动步骤:
第1步 删除参数 "body"
第2步 添加参数: refer_url=http://testmerchant.com
第3步 添加参数: trade_information={"business_type":"4", "goods_info":"APPLE iPhone 8 Plus 3GB 64GB^1", "total_quantity":"1"}
完整请求示例:
https://intlmapi.alipay.com/gateway.do?_input_charset=UTF-8¤cy=USD¬ify_url=https%3A%2F%2Fwww.aliexpress.com%2Fnotify&out_trade_no=T2019030407262312&partner=2088021017666931&product_code=NEW_OVERSEAS_SELLER&refer_url=https%3A%2F%2Fwww.aliexpress.com&return_url=https%3A%2F%2Fwww.aliexpress.com&secondary_merchant_id=K781125&secondary_merchant_industry=5965&secondary_merchant_name=Global%20Top%20Brands%20Store&service=create_forex_trade&subject=APPLE%20iPhone%208%20Plus...%20and%20APPLE%20Macbook%20Pro...&total_fee=2098&trade_information=%7B%22business_type%22%3A%224%22%2C%22goods_info%22%3A%22APPLE%20iPhone%208%20Plus%203GB%2064GB%5E1%7CAPPLE%20Macbook%20Pro%2013%20inch%20i5%208G%20256G%20with%20TouchBar%5E1%22%2C%22total_quantity%22%3A%222%22%7D&sign=188dc677967a4fac37938372bfd441ef&sign_type=MD5
其他:
- 其他参数以及加签规则未做任何改动。
- 更多细节请参考对应的API文档:
- PC支付接口:https://global.alipay.com/doc/global/create_forex_trade
- WAP支付接口:https://global.alipay.com/doc/global/create_forex_trade_wap
- APP支付接口:https://global.alipay.com/doc/global/mobile_securitypay_pay
- 代扣接口:https://global.alipay.com/doc/global/createandpay