alipay.intl.acquiring.offline.preCreate (for third-party QR code payment)
Call this interface to pre-create the order without the buyer's identity for a third-party merchant QR payment. Alipay returns a payment URL in the response. Buyers can access the payment URL using Alipay wallet to confirm the order and make the payment.
Request
Service address
Environment | URL |
Production | https://open-sea.alipay.com/api/alipay/intl/acquiring/offline/precreate.htm |
Request head
Parameter | Description |
version String(8) | The API version
|
function String(128) | The API name
|
clientId String(32) | The unique ID assigned by Alipay to identify a client that makes API calls
|
reqTime Date time | Request time. Date time with timezone, see RFC 3339 Section 5.6 for details
|
reqMsgId String(64) | Request message ID. The unique ID assigned by the client to identify a request message. Note: The reqMsgId identifies a unique system request, but it is not used to identify a unique business request
|
reserve String(256) | Reserved parameter. Key-Value formatted parameter for future use. This parameter is required when you are an ISV. If you are an ISV, you need to provide the isvAccesstoken value
|
signType String(64) | Sign type. If this field is not specified, RSA2 is used as the sign type.
|
Request body
Parameter | Description |
merchantId String(64) | The acquirer ID, assigned by Alipay. You can get this parameter value with your Alipay account.
|
productCode String(64) | The payment product code. The value is OFFLINE_PAY for the third-party merchant QR code payment solution.
|
merchantTransId String(64) | Merchant transaction ID. The unique ID assigned by the merchant to identify a transaction.
|
order Order | The order information. Note: The
|
settleContractId String(64) | The settlement contract ID. The value is defined in the settlement contract. For example, a merchant can have one contract for USD settlement and another one for CAD settlement. If not provided, the default value specified in the settlement contract is used
|
riskInfo RiskInfo | Information about the risk. Although this parameter is optional, it is highly recommond to provide this parameter. See RiskInfo for details
|
notifyUrl String(256) | Merchant notify URL, which is used for receiving asynchronous notifications after the payment is done
|
userAgent String(1024) | The user agent of the electronic wallet used for payment
|
merchantRedirectUrl String(512) | Merchant redirect URL when the payment succeeds.
|
sceneType String(32) | The scene type. The value is THIRDPARTYQRCODE for the third-party merchant QR code payment solution
|
extendInfo String(6000) | Extended information, a key-value formatted parameter for future use.When information about the trade industry need to be provided, specify the tradeInformation sub fields in this field. See tradeInformation for details.
|
Synchronous Response
Response head
Parameter | Description |
version String(8) | The API version
|
function String(128) | The API name
|
clientId String(32) | The unique ID assigned by Alipay to identify a client that makes API calls
|
respTime Date time | Response time. Date time with timezone, see RFC 3339 Section 5.6 for details
|
reqMsgId String(64) | Request message ID. The unique ID assigned by client to identify a request message
|
reserve String(256) | Reserved parameter. Key-Value formatted parameter for future use
|
Response body
Parameter | Description |
resultInfo ResultInfo | Result info. See resultInfo for details
|
merchantTransId String(64) | Merchant transaction ID. The unique ID assigned by the merchant to identify a transaction. Only when the transaction succeeds, this field is returned.
|
orderQrCode String(1024) | The QR code of the precreated order. Only when
|
extendInfo String(2048) | Extended information. Key-Value formatted parameter for future use
|
bigPicUrl String(2048) | URL for the big picture of the QR code
|
smallPicUrl String(2048) | URL for the small picture of the QR code
|
picUrl String(2048) | URL for the QR code picture with a normal size
|
acquirementId String(64) | Alipay transaction ID, the unique transaction ID assigned by Alipay only when the transaction succeeds
|
createTime Date time | The time when the transaction is created. Date time with timezone, see RFC 3339 Section 5.6 for details.This parameter is returned only when
|
orderAmount Money | This value must be the same as that of
|
payScheme String(256) | A scheme URL for wallet to complete the payment.
|
Sub-parameters
order
Parameter | Description |
orderAmount Money | The order amount. See Money for details
|
orderTitle String(256) | The order title
|
orderDetail String(400) | The detailed description of the order
|
seller Seller | The seller information.See seller for details.
|
RiskInfo
Parameter | Description |
deviceInfo DeviceInfo | Device information. See DeviceInfo for details
|
userInfo UserInfo | Information about the user. See UserInfo for details
|
orderInfos list<OrderInfo> | Transaction information. See OrderInfo for details
|
riskExtendInfo String(2048) | Risk extend information. Key-Value formatted parameter for future use
|
DeviceInfo
Parameter | Description |
sessionId String(64) | The session ID that identifies the device, can be obtained from the integrated Alipay device fingerprint SDK
|
serialNo String(64) | Serial number of the device. Note: It is recommended to provide this parameter, although it is optional
|
clientIp String(32) | Client IP address.Note: It is recommended to provide this parameter, although it is optional
|
latitudeLongitude String(128) | Latitude and longitude of the user's request to the merchant.Note: It is recommended to provide this parameter, although it is optional
|
idfa String(128) | Advertising identifier.Note: It is recommended to provide this parameter, although it is optional
|
terminalType enum<TerminalType> | Terminal type. See TerminalType for details
|
deviceName String(256) | Device name
|
deviceBrand String(256) | Device brand
|
deviceModel String(64) | Device model
|
imei String(64) | International mobile equipment identity
|
osName String(64) | Operating system name
|
osVersion String(32) | Operating system version
|
wirelessNetwork String(128) | Wireless network
|
wirelessCarrier String(128) | Wireless carrier name
|
flightMode String(32) | Specifies whether the flight mode is enabled or not
|
fingerPrintEnabled String(32) | Specifies whether the finger print is enabled or not
|
deviceBootTime Date time | The boot time of the device
|
lastUnlockTime Date time | The last unlock time of the device
|
screenResolution String(32) | The resolution of the device screen
|
isJailbreaked Boolean(32) | Specifies whether the device is jailbreaked or not
|
macAddress String(64) | Mac address
|
systemLanguage String(64) | Device system language
|
timeZone String(32) | Time zone in device settings
|
UserInfo
Parameter | Description |
signupTime Date time | The user signup time, in a format of date time with timezone that follows the ISO-8601 standard. See RFC 3339 Section 5.6 for details.
|
lastLoginTime Date time | Merchant user last login time, in a format of date time with timezone that follows the ISO-8601 standard. See RFC 3339 Section 5.6 for details.
|
merchantUserId String(64) | The user ID in the merchant system
|
OrderInfo
Parameter | Description |
productName String(64) | The product name
|
productCategory String(64) | The category that the product belongs to
|
productSubCategory String(64) | The subcategory that the product belongs to
|
itemPrice Money | Item price. See Money for details.
|
TerminalType
Name | Type | Description |
APP | String | Mobile application |
WEB | String | Browser web |
WAP | String | Mobile wap |
SYSTEM | String | System call |
APP_LINK | String | Direct jump to mobile app through universal link |
seller
Parameter | Description |
sellerId String(32) | The merchant ID, assigned by acquirer to the merchant
|
sellerMCC String(32) | The merchant industry. See Merchant category code for details.
|
sellerName String(128) | The seller name
|
sellerEngName String(256) | The English name of the seller
|
storeId String(32) | The store ID
|
storeMCC String(32) | The merchant category code of the store. See Merchant category code for details
|
storeName String(128) | The name of the store
|
storeEngName String(256) | English name of the store
|
terminalId String(64) | The POS terminal ID
|
operatorId String(64) | The operator ID
|
Money
Parameter | Description |
currency String(3) | The 3-letter currency code. See supported currencies for details
|
value Number(16) | The amount. This value must be provided in the smallest common currency unit. For example, to create a charge for $1.00, you can set orderAmount: value=100 (100 cents)
|
resultInfo
Parameter | Description |
resultStatus String(2) | The request status can be:
|
resultCodeId String(8) | An 8-digit code that is used to identify a result. When
|
resultCode String(64) | The result code
|
resultMsg String(256) | Result message. When
|
ExchangeRate
Parameter | Description |
baseCurrency String(3) | The base currency
|
exchangeCurrency String(3) | The exchange currency
|
rate String(16) | The exchange rate of
|
SiteEnum
tradeInformation
Parameter | Description |
businessType String | Business type. 5 types are supported.1: Hotel2: AIR3: Overseas study consulting4: Sales of goods5: 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 (|).
|
hotelName 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).
|
checkInTime Date | Check-in time. Format: yyyy-MM-dd. Timezone: GMT +8. Specify this field only when business_type is 1 (Hotel).
|
checkOutTime Date | Check-out time. Format: yyyy-MM-dd. Timezone: GMT +8. Specify this field only when business_type is 1 (Hotel).
|
flightNumber String | Flight number. If flight transfer exists, separate flight numbers with vertical bar (|). Specify this field only when business_type is 2 (AIR).
|
departureTime 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).
|
admissionNoticeUrl String | If business_type is 3 (Overseas study consulting), the URL of admission notice (image) must be specified.
|
goodsInfo 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).
|
totalQuantity Number | Total quantities of all goods in one order. Specify this field only when business_type is 4 (Sales of goods).
|
otherBusinessType String | If business_type is 5 (Others), specify the business type in details.
|
Result code
Functional logic result code
resultCodeId | resultCode | resultStatus | Remarks |
00000025 | REPEAT_REQ_INCONSISTENT | F | Repeated or inconsistent requests |
00000011 | RISK_REJECT | F | The payment is declined because of risk control |
12005001 | CURRENCY_NOT_SUPPORT | F | The transaction currency is not supported. See supported currencies for details |
12005104 | AMOUNT_EXCEED_LIMIT | F | The amount exceeds the limit |
12005128 | COUNT_EXCEED_LIMIT | F | The count exceeds the limit |
12005100 | ORDER_IS_CLOSED | F | The transaction status is closed |
12005003 | ORDER_STATUS_INVALID | F | The transaction status is invalid |
12006007 | MERCHANT_MONTHLY_AMOUNT_LIMIT_EXCEED | F | The monthly amount limit of merchant has been reached, cannot receive payment |
12005136 | MERCHANT_NOT_SUPPORT_ACQUIRE | F | The merchant is not supported to acquire. |
12005137 | USER_AGENT_NOT_SUPPORT | F | The user agent is not supported. |
Basic result code
resultCodeId | resultCode | resultStatus | Remarks |
00000000 | SUCCESS | S | Success |
00000019 | PROCESS_FAIL | F | General business failure |
00000901 | UNKNOWN_EXCEPTION | U | API failed because of unknown reasons |
00000004 | PARAM_ILLEGAL | F | The parameter is incorrect. |
00000007 | INVALID_SIGNATURE | F | The signature is invalid. |
00000008 | KEY_NO_FOUND | F | The key is not found. |
00000013 | NO_INTERFACE_DEF | F | The API is undefined. |
00000014 | API_IS_INVALID | F | The API is invalid or nonactivated. |
00000016 | OAUTH_FAILED | F | The oAuth authentication failed |
00000021 | ACCESS_DENIED | F | Access denied |
12014152 | CLIENT_FORBIDDEN_ACCESS_API | F | The Client is not authorized to use this API. |
12014155 | UNKNOWN_CLIENT | F | Unknown client |
12014156 | INVALID_CLIENT_STATUS | F | Invalid client status |
00000024 | REQUEST_TRAFFIC_EXCEED_LIMIT | F | The request traffic exceeds the limit. |
00000030 | SIGN_TYPE_INVALID | F | The sign type is invalid. |
Sample
Request sample
{
"request": {
"head": {
"version": "2.0.4",
"function": "alipay.intl.acquiring.offline.preCreate",
"clientId": "211xxxxxxxxxxxxxx0044",
"reqTime": "2001-07-04T12:08:56+05:30",
"reqMsgId": "123xxxxxxxxxxxxxxx3fda",
"signType": "RSA2"
},
"body": {
"merchantId": "211xxxxxxxxxxxxxx2999",
"productCode": "OFFLINE_PAY",
"merchantTransId": "510xxxxxxxxxxxxx0002",
"order": {
"orderAmount": {
"currency": "USD",
"value": "239"
},
"seller":{
"sellerId": "211xxxxxxxxxxxxxx0415",
"sellerName": "Zara",
"storeName": "Zara-Store #30",
"sellerMCC": "5691",
"terminalId": "Z98xxxxxx9745",
"storeId": "211xxxxxxxxxxxxxx0415"
},
"orderTitle": "Women Summer Dress",
"orderDetail": "New White Lace Sleeveless Cute Casual Summer Dresses Vestidos roupas femininas WQW10",
},
"settleContractId": "USD-1",
"riskInfo": {
"deviceInfo": {
"sessionId": "26dxxxxxxxxxxxxxxxxxxxxxxxxx03e9",
"serialNo": "f0c0ec9a",
"clientIp": "121.0.29.220",
"latitudeLongitude": "39.9151190000,116.4039630000",
"idfa": "5D08BADB6-B7D1-46DE-BDAB-B66468A1EFCC",
"terminalType": "APP",
"deviceName": "Mike's iPhone",
"deviceBrand": "APPLE",
"deviceModel": "iPhone 7 Plus",
"imei": "863xxxxxxxx5012",
"osName": "ios",
"osVersion": "9.1.1",
"wirelessNetwork": "china unicom",
"wirelessCarrier": "china unicom",
"flightMode": "enabled",
"fingerPrintEnabled": "enabled",
"deviceBootTime": "2001-07-04T12:08:56+05:30",
"lastUnlockTime": "2001-07-04T12:08:56+05:30",
"screenResolution": "1024*768",
"isJailbreaked": true,
"macAddress": "8c:be:be:71:1f:34",
"systemLanguage": "EN",
"timeZone": "UTC+11"
},
"userInfo": {
"signupTime": "2001-07-04T12:08:56+05:30",
"lastLoginTime": "2001-07-04T12:08:56+05:30",
"merchantUserId": "user0001"
},
"orderInfos": [
{
"productName": "iPhone 7",
"productCategory": "Phone",
"productSubCategory": "smart phone",
"itemPrice": {
"currency": "USD",
"value": "239"
}
}
],
"riskExtendInfo": "{}"
},
"extendInfo": "{\"chinaExtraTransInfo\":{\"businessType\":\"5\"}}",
"notifyUrl": "http://notify.com",
"userAgent": "ALIPAY_HK",
"merchantRedirectUrl": "http://success.com",
"sceneType": "THIRDPARTYQRCODE"
}
},
"signature": "signature string"
}
Synchronous response sample
Request succeeds:
{
"response":{
"head":{
"version":"2.0.4",
"function":"alipay.intl.acquiring.offline.preCreate",
"clientId":"211xxxxxxxxxxxxxx0044",
"respTime":"2001-07-04T12:08:56+05:30",
"reqMsgId":"123xxxxxxxxxxxxxxx3fda",
"reserve":"{}"
},
"body":{
"resultInfo":{
"resultStatus":"S",
"resultCodeId":"00000000",
"resultCode":"SUCCESS",
"resultMsg":"success"
},
"merchantTransId":"510xxxxxxxxxxxxx0002",
"orderQrCode":"https://global.alipay.com/281002042tmCd8ZkTS2sxBuzSNu431cII",
"extendInfo":"{\"isEnterpriseUser\":\"true\"}",
"bigPicUrl":"http://mobilecodec.alipay.com/show.htm?code=bax06253ak3kj15fkjf700a4&picSize=L",
"smallPicUrl":"http://mobilecodec.alipay.com/show.htm?code=bax00636140jfx40pmiz518a&picSize=S",
"picUrl":"http://mobilecodec.alipay.com/show.htm?code=bax00636140jfx40pmiz518a&picSize=M",
"acquirementId":"201xxxxxxxxxxxxxxxxxxxxx2747",
"createTime":"2001-07-04T12:08:56+05:30",
"orderAmount":{
"currency":"USD",
"value":"239"
},
"payScheme":"alipays://platformapi/startApp?appId=10000007&actionType=route&qrcode=https://global.alipay.com/281002042tmCd8ZkTS2sxBuzSNu431cII"
}
},
"signature":"signature string"
}
Request fails:
{
"response":{
"head":{
"version":"2.0.4",
"function":"alipay.intl.acquiring.offline.preCreate",
"clientId":"211xxxxxxxxxxxxxx0044",
"respTime":"2001-07-04T12:08:56+05:30",
"reqMsgId":"123xxxxxxxxxxxxxxx3fda",
"reserve":"{}"
},
"body":{
"resultInfo":{
"resultStatus":"F",
"resultCodeId":"00000019",
"resultCode":"PROCESS_FAIL",
"resultMsg":"General business failure"
},
"merchantTransId":"510xxxxxxxxxxxxx0002",
"orderQrCode":"https://global.alipay.com/281002042tmCd8ZkTS2sxBuzSNu431cII",
"extendInfo":"{\"isEnterpriseUser\":\"true\"}",
"bigPicUrl":"http://mobilecodec.alipay.com/show.htm?code=bax06253ak3kj15fkjf700a4&picSize=L",
"smallPicUrl":"http://mobilecodec.alipay.com/show.htm?code=bax00636140jfx40pmiz518a&picSize=S",
"picUrl":"http://mobilecodec.alipay.com/show.htm?code=bax00636140jfx40pmiz518a&picSize=M",
"acquirementId":"201xxxxxxxxxxxxxxxxxxxxx2747",
"createTime":"2001-07-04T12:08:56+05:30",
"orderAmount":{
"currency":"USD",
"value":"239"
},
"payScheme":"alipays://platformapi/startApp?appId=10000007&actionType=route&qrcode=https://global.alipay.com/281002042tmCd8ZkTS2sxBuzSNu431cII"
}
},
"signature":"signature string"
}