alipay.intl.acquiring.offline.pay_2.0.2
The merchant can use this interface to initiate a barcode payment request.
Request
Service address
Environment | URL |
---|---|
Production | https://open-na.alipay.com/api/alipay/intl/acquiring/offline/pay.htm |
Request head
Parameter | Name | Type | Length | Required | Description | Sample |
---|---|---|---|---|---|---|
version | API version | String | 8 | Y | The API version | 2.0.2 |
function | API name | String | 128 | Y | The API name | alipay.intl.acquiring.offline.pay |
clientId | Client ID | String | 32 | Y | The unique ID assigned by Alipay to identify a client that makes API calls | 211xxxxxxxxxxxxxxx044 |
reqTime | Request time | Datet ime | / | Y | Date time with timezone, see RFC 3339 Section 5.6 for details. | 2001-07-04T12:08:56+05:30 |
reqMsgId | Request message ID | String | 64 | Y | The unique ID assigned by client to identify a request message | 1234567asdfasdf1123fda |
reserve | Reserved parameter | String | 256 | N | Key/Value formatted parameter for future use | {key/value} |
signType | Sign type | String | 64 | N | The signature type | RSA2 |
Request body
Parameter | Name | Type | Length | Required | Description | Sample | |||
---|---|---|---|---|---|---|---|---|---|
partnerId | Partner ID | String | 32 | Y | The unique partner ID assigned by Alipay. This parameter identifies the settlement target that Alipay settles to. | 211xxxxxxxxxxxxxxxx512 | |||
productCode | Product code | String | 64 | Y | The payment product code can be: | AUTO_DEBIT : Multi-use agreement for auto-debit product. The agreement stays valid until it is explicitly cancelled. | AUTH_CAPTURE : Multi-use agreement for auth-capture product. The agreement stays valid until it is explicitly cancelled. | OFFLINE_PAY : offline payment. | OFFLINE_PAY |
merchantTransId | Merchant transaction ID | String | 64 | Y | The unique ID assigned by the merchant to identify a transaction. | 510xxxxxxxxxxxxxx002 | |||
codeType | Code type | String | 32 | Y | The code type can be: | BARCODE | BARCODE | ||
identityCode | Identity code | String | 64 | Y | The barcode code value | 287xxxxxxxxxxx394 | |||
order | Order parameters | Order | / | Y | See order for details. | { "orderAmount":{ "currency":"THB", "value":"239" }, "orderTitle":"Women Summer Dress", "orderDetail":"New White Lace Sleeveless Cute Casual Summer Dresses Vestidos roupas femininas WQW10", "seller":{ "secondaryMerchantId":"2188205006167080", "secondaryMerchantIndustry":"5691", "secondaryMerchantName":"Zara", "storeId":"S94908", "storeName":"Zara-Store #30", "terminalId": "Z98745DE89745" } } | |||
settleContractId | The settlement contract ID. | String | 64 | N | 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. | USD-1 |
Response
Response head
Parameter | Name | Type | Length | Required | Description | Sample |
---|---|---|---|---|---|---|
version | API version | String | 8 | Y | The API version | 2.0.2 |
function | API name | String | 128 | Y | The API name | alipay.intl.acquiring.offline.pay |
clientId | Client ID | String | 32 | Y | The unique ID assigned by Alipay to identify a client that makes API calls | 211xxxxxxxxxxxxxxx044 |
respTime | Response time | Datet ime | / | Y | Date time with timezone, see RFC 3339 Section 5.6 for details. | 2001-07-04T12:08:56+05:30 |
reqMsgId | Request message ID | String | 64 | Y | The unique ID assigned by client to identify a request message | 1234567asdfasdf1123fda |
reserve | Reserved parameter | String | 256 | N | Key/Value formatted parameter for future use | {key/value} |
Response body
Parameter | Name | Type | Length | Required | Description | Sample | |
---|---|---|---|---|---|---|---|
resultInfo | Result info | ResultInfo | / | Y | See resultInfo for details. | { "resultStatus": "S", "resultCodeId": "00000000", "resultCode":"SUCCESS", "resultMsg": "result message" } | |
acquirementId | Alipay transaction ID | String | 64 | C | The unique Alipay transaction ID. This parameter is required when resultCode is SUCCESS . | 2015xxxxxxxxxxxxxxxxxxxxx747 | |
merchantTransId | Merchant transaction ID | String | 64 | C | The unique ID assigned by the merchant to identify a transaction. Note: This parameter is required when reultCode is SUCCESS . | 510xxxxxxxxxxxxxx002 | |
orderAmount | Order amount | Money | / | C | This value must be the same as that of orderAmount passed in the request.This parameter is required when reultCode is SUCCESS . See Money for details. | {"currency":"USD", "value":"239"} | |
payAmount | The actual amount the buyer paid. | Money | / | C | Note: This parameter is required when reultCode is SUCCESS , or refundActualCurrencyDifferentWithRefundCurrency is true . See Money for details. | {"currency":"CNY", "value":"1481"} | |
conversionRate | Conversion rate | conversionRate | / | C | The exchage rate between orderAmount and payAmount .This parameter is required when reultCode is SUCCESS , or refundActualCurrencyDifferentWithRefundCurrency is true . See conversionRate for details. | { "baseCurrency":"USD", "exchangeCurrency":"CNY", "rate":"6.9123" } | |
createTime | Create time | Date time | / | C | The time when the transaction is created. Date time with timezone, see RFC 3339 Section 5.6 for details. This parameter is required when reultCode is SUCCESS . | 2001-07-04T12:08:56+05:30 | |
userSite | User site | String | 64 | Y | The user site shows where the buyer's wallet app belongs: | ALIPAY_CN | |
userId | User ID | String | 64 | N | The user ID that identifies a user in the user site | 208xxxxxxxxxx012 | |
userLoginId | User login ID | String | 64 | N | The ID that the user uses to login to the wallet app. The ID is masked to protect the customer privacy. | c***@gmail.com |
Sub-parameters
order
Parameter | Name | Type | Length | Required | Description | Sample |
---|---|---|---|---|---|---|
orderAmount | Order amount | Money | / | Y | The order amount. See Money for details. | { "value" : "293", "currency" : "CNY" } |
orderTitle | Order title | String | 256 | Y | The order title | Women Summer Dress |
orderDetail | Order detail | String | 400 | Y | The detailed description of the order | New White Lace Sleeveless Cute Casual Summer Dresses Vestidos roupas femininas WQW10. |
seller | Seller | Seller | / | C | The seller information. This parameter is required when siteNeeds is true . See seller for details. | { "secondaryMerchantId":"2188205006167080", "secondaryMerchantIndustry":"5691", "secondaryMerchantName":"Zara" } |
buyerId | Buyer ID | String | 32 | N | The buyer ID. This parameter is required when function is alipay.intl.acquiring.offline.create | 208xxxxxxxxxx234 |
seller
Parameter | Name | Type | Length | Required | Description | Sample |
---|---|---|---|---|---|---|
secondaryMerchantId | Secondary merchant ID | String | 64 | Y | The unique secondary merchant ID distinguishes each specific sub merchants. | 123456123456123456 |
secondaryMerchantIndustry | MCC(Merchant Category Code) | String | 64 | Y | The secondary merchant industry. See Merchant category code for details. | 5691 |
secondaryMerchantName | Secondary merchant name | String | 512 | Y | The secondary merchant name | Zara |
storeId | Store ID | String | 64 | Y | The store ID | sid-123 |
storeName | Store name | String | 256 | Y | The store name | Zara Main Store |
terminalId | POS terminal ID | String | 64 | N | The POS terminal ID | tid-3489439085 |
operatorId | Operator ID. | String | 64 | N | The operator ID | Juliet-001 |
Money
Parameter | Name | Type | Length | Required | Description | Sample |
---|---|---|---|---|---|---|
currency | Currency | String | 3 | Y | The 3-letter currency code. See supported currencies for details. | USD |
value | value | Number | 16 | Y | 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). | 239 |
resultInfo
Parameter | Name | Type | Length | Required | Description | Sample | |||
---|---|---|---|---|---|---|---|---|---|
resultStatus | Result status | String | 2 | Y | The request status can be: | S : success | F : failure | U : unknown | S |
resultCodeId | Result ID | String | 8 | Y | An 8-digit code that is used to identify a result. When resultStatus is S , the value must be 00000000. When resultStatus is F or U , the value can be other result ID specified by the interface. | 00000000 | |||
resultCode | Result code | String | 64 | Y | The result code | SUCCESS | |||
resultMsg | Result message | String | 256 | N | When resultCode is S , this value can be empty. When resultCode is F or U , the error description is required. | success |
conversionRate
Parameter | Name | Type | Length | Required | Description | Sample |
---|---|---|---|---|---|---|
baseCurrency | Base currency | String | 3 | Y | The base currency | USD |
exchangeCurrency | Exchange currency | String | 3 | Y | The exchange currency | CNY |
rate | Rate | String | 16 | Y | The exchange rate of baseCurrency against exchangeCurrency | 6.9123 |
Result code
Functional logic result code
Basic result code
ResultID | 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. |
Sample
Sample request
copy
{
"request": {
"body": {
"codeType": "BARCODE",
"createTime": "2001-07-04T12:08:56+05:30",
"identityCode": "285045665857162726",
"merchantTransId": "gemxxxxxxxqge",
"order": {
"orderAmount": {
"currency": "JPY",
"value": "1"
},
"orderDetail": "New123",
"orderTitle": "men",
"seller": {
"operatorId": "test_operator_id",
"secondaryMerchantIndustry": "5812",
"secondaryMerchantName": "buzhimerchantname",
"sellerId": "211xxxxxxxxxxxxxxx413",
"storeId": "211xxxxxxxxxxxxxxx413",
"storeName": "buzhistorename",
"terminalId": "testterminalId"
}
},
"partnerId": "211xxxxxxxxxxxxxxx413",
"productCode": "OFFLINE_PAY",
"settleContractId": "JPY"
},
"head": {
"clientId": "385xxxxxxxxxx708",
"function": "alipay.intl.acquiring.offline.pay",
"reqMsgId": "1234567asdfasdf1123fda",
"reqTime": "2001-07-04T12:08:56+05:30",
"reserve": {},
"signType": "SHA256",
"version": "2.0.2"
}
},
"signature": "2c18e55211fd03aec046d4ac52c9c96de04fb277232c7adfd8a3018398a54d46"
}
Sample response
copy
{
"response":{
"head":{
"version":"2.0.2",
"function":"alipay.intl.acquiring.offline.pay",
"clientId":"211xxxxxxxxxxxxxxx044",
"respTime":"2001-07-04T12:08:56+05:30",
"reqMsgId":"1234567asdfasdf1123fda",
"reserve":"{}"
},
"body":{
"resultInfo":{
"resultStatus":"S",
"resultCodeId":"00000000",
"resultCode":"SUCCESS",
"resultMsg":"success"
},
"acquirementId":"2015032412007101547201351234",
"merchantTransId":"510xxxxxxxxxxxxxx002",
"orderAmount":{
"currency":"USD",
"value":"239"
},
"createTime":"2001-07-04T12:08:56+05:30",
"userSite":"ALIPAY_CN",
"userId":"208xxxxxxxxxx012",
"userLoginId":"c***@gmail.com"
}
},
"signature":"signature string"
}