alipay.intl.acquiring.offline.pay
The merchant can use this interface to initiate a barcode payment request.
Request
Service address
Environment | URL |
Production | https://open-sea.alipay.com/api/alipay/intl/acquiring/offline/pay.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
|
Request body
Parameter | Description |
merchantId String(64) | The merchant ID. This parameter identifies the settlement target that Alipay settles to.
|
productCode enum<ProductCode>(64) | The payment product code. See ProductCode for details.
|
merchantTransId String(64) | Merchant transaction ID. The unique ID assigned by the merchant to identify a transaction.
|
codeType enum<OfflineCodeType>(32) | The code type. See OfflineCodeType for details.
|
identityCode String(64) | The barcode code value
|
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.
|
riskInto RiskInfo(/) | Information about the risk. Although this parameter is optional, it is highly recommond to provide this parameter. See RiskInfo for details.
|
notifyUrl String(1024) | Merchant notify URL, which is used for receiving asynchronous notifications after the payment is done.
|
extendInfo String(2048) | Extended information. Key-Value formatted parameter for future use. See extendInfo for details.
|
trade_information String(6000) | Information about the trade industry. See trade_informationfor details.
|
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.
|
signType String(8) | Sign type
|
Response body
Parameter | Description |
resultInfo ResultInfo(/) | Result info. See resultInfo for details.
|
acquirementId String(64) | Alipay transaction ID. The unique transaction ID assigned by Alipay when the transaction succeeds.
|
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.
|
orderAmount Money(/) | This value must be the same as that of
|
payAmount Money(/) | The actual amount the buyer paid. Note: This parameter is required when
|
conversionRate ExchangeRate(/) | The exchage rate between
|
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 required when
|
paymentTime Date time(/) | The payment time of the transaction. This parameter is required when
|
userSite enum<Site>(64) | The payment user site. This parameter is required when
|
userId String(64) | The user ID that identifies a user in the user site.
|
userLoginId String(64) | The ID that the user uses to login to the payment site. The ID is masked to protect the customer privacy.
|
extendInfo String(2048) | Extended information. Key-Value formatted parameter for future use.
|
Sub-parameters
ProductCode
Name | Type | Description |
OFFLINE_PAY | String | Offline payment |
OfflineCodeType
Name | Type | Description |
BARCODE | String | Barcode scene |
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>(32) | 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 seller ID
|
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)
|
extendInfo
storeTerminalRequestTime String | The time when the transaction is created on terminal. Format: yyyy-MM-ddTHH:mm:ss.SSS ± timezone
|
last_payment_info String | Information about the previous one payment. The information includes alipay_trans_id and the time when the merchant receives the response from Alipay, which are separated by a vertical bar (|).
|
trade_information
Parameter | Description |
business_type 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 (|).
|
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.
|
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
|
Site
Name | Type | Description |
ALIPAY_CN | String | Alipay site for Chinese mainland |
ALIPAY_HK | String | Alipay site for Hong Kong, China |
KAKAOPAY | String | Kakao Pay |
TNG | String | Touch'n Go eWallet |
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 |
12002005 | USER_NOT_EXIST | F | The user does not exist |
12002006 | USER_STATUS_ABNORMAL | F | Abnormal user status |
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 |
12006004 | USER_BALANCE_NOT_ENOUGH | F | Insufficient user balance |
12005131 | IDENTITY_CODE_INVALID | F | The |
12005132 | IDENTITY_CODE_NOT_SUPPORT | F | The format of the identity code is NOT supported. For example, the identity code is from an unsupported wallet |
12005124 | PAYMENT_IN_PROCESS | U | The payment is still in process |
12005100 | ORDER_IS_CLOSED | F | The transaction status is closed |
12005003 | ORDER_STATUS_INVALID | F | The transaction status is invalid |
12002046 | USER_AMOUNT_EXCEED_LIMIT | F | The user amount exceeds the limit |
12002004 | USER_REALNAME_STATUS_INVALID | F | The user needs to complete the real name authentication |
12002010 | USER_NO_PAYMENT_INSTRUMENT | F | No payment instrument is applicable |
12005134 | SIGN_TYPE_INVALID | F | The signature type is invalid |
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 |
00000021 | ACCESS_DENIED | F | Access denied |
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 |
12003001 | MERCHANT_NOT_EXIST | F | The merchant doesn't exist |
Sample
Sample request
{
"request":{
"head":{
"version":"2.0.4",
"function":"alipay.intl.acquiring.offline.pay",
"clientId":"385xxxxxxxxx0001",
"reqTime":"2001-07-04T12:08:56+05:30",
"reqMsgId":"123xxxxxxxxxxxxxxx3fda",
"signType":"RSA2"
},
"body":{
"merchantId":"211xxxxxxxxxxxxxx2999",
"productCode":"OFFLINE_PAY",
"merchantTransId":"510xxxxxxxxxxxxx0002",
"codeType":"BARCODE",
"identityCode":"287xxxxxxxxxx4394",
"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":"26dxxxxxxxxxxxxxxxxx7xxxxxxx03e9",
"serialNo":"f0cxec9a",
"clientIp":"121.0.29.220",
"latitudeLongitude":"39.9151190000,116.4039630000",
"idfa":"5D0xxxxB6-B7D1-46DE-BDAB-B66xxxxxxFCC",
"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":"{}"
},
"notifyUrl":"https://xxxx.xxx.com/jjjj",
"extendInfo":"{}"
}
},
"signature":"signature string"
}
Sample response
{
"response":{
"head":{
"version":"2.0.4",
"function":"alipay.intl.function",
"clientId":"385xxxxxxxxx0001",
"respTime":"2001-07-04T12:08:56+05:30",
"reqMsgId":"123xxxxxxxxxxxxxxx3fda",
"reserve":"{}",
"signType":"RSA2"
},
"body":{
"resultInfo":{
"resultStatus":"S",
"resultCodeId":"00000000",
"resultCode":"SUCCESS",
"resultMsg":"success"
},
"acquirementId":"201xxxxxxxxxxxxxxxxxxxxx2747",
"merchantTransId":"510xxxxxxxxxxxxx1234",
"orderAmount":{
"currency":"USD",
"value":"239"
},
"createTime":"2001-07-04T12:08:56+05:30",
"userSite":"ALIPAY_CN",
"userId":"208xxxxxxxxx9012",
"userLoginId":"c***@gmail.com",
"extendInfo":"{\"isEnterpriseUser\":\"true\"}"
}
},
"signature":"signature string"
}