alipay.intl.acquiring.offline.pay

The merchant uses this interface to initiate an offline payment.

Request

Request parameters

Header

No

Name

Description

Type

Length

Required

Remarks

Sample

1

version

API version

string

8

ME

As per the respective API reference.

2.0.0

2

function

API interface

string

128

ME

According to specifications defined by each business domain.

alipay.intl.function

3

clientId

Client ID

string

32

ME

Provided by Alipay, used to identify partner and application system.

211020000000000000044

4

reqTime

Request time

datetime

/

M

DateTime with timezone, which follows the ISO-8601 standard.
Refer to: RFC 3339 Section 5.6

2001-07-04T12:08:56+05:30

5

reqMsgId

Request message ID

string

64

ME

Each request will be assigned with a unique ID (uuid).
The reqMsgId identifies a unique system request, it is not used to identify a unique business request.

1234567asdfasdf1123fda

6

reserve

Reserved for future implementation

string

256

O

Key/Value

{}

Body

No

Name

Description

Type

Length

Required

Remarks

Sample

1

merchantId

Merchant ID, which identifies the settlement target that Alipay would settle to.

stringĀ 

64

M

218820000000000000023

2

productCode

The product code

enum<ProductCodeEnum

>

64

M

OFFLINE_PAY

3

merchantTransIdĀ 

Unique merchant transaction ID

string

64

ME

51051001000000000002

4

codeType

The code type

enum<OfflineCodeTypeEnum

>

32

M

BARCODE

5

identityCode

Identity code

string

65535

M

28763443825664394

6

order

The order information

Order

/

M

The orderAmount should be provided in the smallest common currency unit. For example, to create a charge for $1.00, you would set orderAmount.valueas100 (100 cents).

{
Ā Ā Ā "orderAmount":{
Ā Ā Ā Ā Ā Ā Ā "currency":"THB",
Ā Ā Ā Ā Ā Ā Ā "value":"239"
Ā Ā Ā },
Ā Ā Ā "orderTitle":"Women Summer Dress",
Ā Ā Ā "orderDetail":"New White Lace Sleeveless Cute Casual Summer Dresses Vestidos roupas femininas WQW10",
Ā Ā Ā "seller":{
Ā Ā Ā Ā Ā Ā Ā "sellerId":"2188205006167080",
Ā Ā Ā Ā Ā Ā Ā "mcc":"5691",
Ā Ā Ā Ā Ā Ā Ā "sellerName":"Zara",
Ā  Ā  Ā  Ā  "storeId":"S94908",
Ā  Ā  Ā  Ā "storeName":"Zara-Store #30",
Ā  Ā  Ā  Ā "terminalId": "Z98745DE89745"
Ā Ā Ā }
}

7

settleContractId

Settlement contract ID.
The merchant might want to be settled in different ways for different situations, each of which could be defined by a settlement contract. For example, a merchant could have a settlement contract for USD settlement while has another settlement contract for CAD settlement.Ā 
If not provided, the default settlement contract will be used.

string

64

O

USD-1

8

envInfo

Device environment information of the user's current request.

EnvInfo

/

O

Ā 

{
Ā  Ā  Ā  Ā  Ā  Ā  "deviceInfo":{
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  "sessionId":"26daf780047938bf8d5b7ea8906003e9",
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  "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":"863360020885012",
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  "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"
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  },
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  "extendInfo":"{}"
Ā  Ā  Ā  Ā  Ā  Ā  }

9

extendInfo

Reserved for extended information

string

2048

O

Key/Value
Note the type of extendInfo is a string. See the example in the request sample. huabeiInstallment is used for huabei credit payment, installmentPlan represents the number of installment customer will pay, installmentFeeSellerContribution represents the percentage of fee/interest merchant willing to contribute.

{"huabeiInstallment":{"installmentPlan":"3",Ā 

Request sample

copy
{
    "request":{
        "head":{
            "version":"2.0.0",
            "function":"alipay.intl.acquiring.offline.pay",
            "clientId":"211020000000000000044",
            "reqTime":"2001-07-04T12:08:56+05:30",
            "reqMsgId":"1234567asdfasdf1123fda",
            "reserve":"{}"
        },
        "body":{
            "merchantId":"218820000000000000023",
            "productCode":"OFFLINE_PAY",
            "merchantTransId":"51051001000000000002",
            "codeType":"BARCODE",
            "identityCode":"28763443825664394",
            "order":{
                "orderAmount":{
                    "currency":"USD",
                    "value":"239"
                },
                "orderTitle":"Women Summer Dress",
                "orderDetail":"New White Lace Sleeveless Cute Casual Summer Dresses Vestidos roupas femininas WQW10"
            },
            "settleContractId":"USD-1",
            "envInfo":{
                "deviceInfo":{
                    "sessionId":"26daf780047938bf8d5b7ea8906003e9",
                    "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":"863360020885012",
                    "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"
                },
                "extendInfo":"{}"
            },
            "extendInfo":"{\"huabeiInstallment\":{\"installmentPlan\":\"3\", \"installmentFeeSellerContribution\":\"100\"}}"
        }
    },
    "signature":"signature string"
}

Response

Response parameters

Header

No

Name

Description

Type

Length

Required

Remarks

Sample

1

version

API version

string

8

ME

As per the respective API reference.

2.0.0

2

function

API interface

string

128

ME

According to specifications defined by each business domain.

alipay.intl.function

3

clientId

Client ID

string

32

ME

Provided by Alipay, used to identify partner and application system.

211020000000000000044

4

respTime

Response time

datetime

/

M

DateTime with timezone, which follows the ISO-8601 standard.Ā 
Refer to: RFC 3339 Section 5.6

2001-07-04T12:08:56+05:30

5

reqMsgId

Request message ID

string

64

ME

Each request will be assigned with a unique ID (uuid).

1234567asdfasdf1123fda

6

reserve

Reserved for future implementation

string

256

O

Key/Value

{}

Body

No

Name

Description

Type

Length

Required

Remarks

Sample

1

resultInfo

Result information

ResultInfo

/

M

{
Ā  Ā  "resultStatus": "S",
Ā  Ā  "resultCodeId": "00000000",
Ā  Ā  "resultCode":"SUCCESS",
Ā  Ā  "resultMsg": "result message"
}

2

acquirementId

Unique Alipay transaction ID.

Note: This field is required when resultInfo.resultCode is SUCCESS.

string

64

C

2015032412007101547201351234

3

merchantTransIdĀ 

Unique merchant transaction ID.

Note: This field is required when resultInfo.resultCode is SUCCESS.

string

64

CE

51051001000000001234

4

orderAmount

Order amount.

Note: This field is required when resultInfo.resultCode is SUCCESS.

Money

/

C

Should be exactly same as orderAmountĀ passed in the request

{"currency":"USD", "value":"239"}

5

payAmount

User actual paid amount.

Note: This field is required when resultInfo.resultCode is SUCCESS and payCurrencyDifferentWithOrderCurrency is true.

Money

/

C

May have different currency with orderAmount.

{"currency":"CNY", "value":"1481"}

6

conversionRate

The conversion rate.

Note: This field is required when resultInfo.resultCode is SUCCESS and payCurrencyDifferentWithOrderCurrency is true.

ExchangeRate

/

C

The exchage rate between orderAmount and payAmount.

{
"baseCurrency":"USD",
"exchangeCurrency":"CNY",
"rate":"6.9123"
}

7

createTime

The creation time of the transaction.

Note: This field is required when resultInfo.resultCode is SUCCESS.

datetime

/

C

DateTime with timezone, which follows the ISO-8601 standard.Ā 
Refer to: RFC 3339 Section 5.6

2001-07-04T12:08:56+05:30

8

userSite

The payment user site.

Note: This field is required when resultInfo.resultCode is SUCCESS.

enum<SiteEnum

>

64

M

ALIPAY_CN

9

userId

The user ID in the payment site

string

64

O

Not provided by default

2088123456789012

10

userLoginId

The login ID of the payment site.

string

64

O

Not provided by default. The login ID is provided in a masked format to protect customer privacy.

c***@gmail.com

11

extendInfo

Reserved for extended information

string

2048

O

{"isEnterpriseUser":"true", "enterpriseUserName":"seller"}

Response sample

copy
{
    "response":{
        "head":{
            "version":"2.0.0",
            "function":"alipay.intl.acquiring.offline.pay",
            "clientId":"211020000000000000044",
            "respTime":"2001-07-04T12:08:56+05:30",
            "reqMsgId":"1234567asdfasdf1123fda",
            "reserve":"{}"
        },
        "body":{
            "resultInfo":{
                "resultStatus":"S",
                "resultCodeId":"00000000",
                "resultCode":"SUCCESS",
                "resultMsg":"success"
            },
            "acquirementId":"2015032412007101547201351234",
            "merchantTransId":"51051001000000000002",
            "orderAmount":{
                "currency":"USD",
                "value":"239"
            },
            "createTime":"2001-07-04T12:08:56+05:30",
            "userSite":"ALIPAY_CN",
            "userId":"2088123456789012",
            "userLoginId":"c***@gmail.com",
            "extendInfo":"{\"isEnterpriseUser\":\"true\", \"enterpriseUserName\":\"seller\"}"
        }
    },
    "signature":"signature string"
}

Result codes

Functional logic result codes

No

ResultCodeId

ResultCode

ResultStatus

Remarks

1

00000025

REPEAT_REQ_INCONSISTENT

F

Repeated submit, and requests are inconsistent.

2

00000011

RISK_REJECT

F

Payment is declined by risk control.

3

QUERY_CONTRACT_VALUE_NULL

F

The query contract value is null.

4

CONTRACT_STATUS_INVALID

F

The status of the contract is invalid.

5

12002005

USER_NOT_EXIST

F

User does not exist

6

12002006

USER_STATUS_ABNORMAL

F

User status is not normal.

7

12005001

CURRENCY_NOT_SUPPORT

F

Transaction currency is invalid.

8

12005104

AMOUNT_EXCEED_LIMIT

F

The amount exceeds the limit.

9

12005128

COUNT_EXCEED_LIMIT

F

Count exceeds the limit.

10

12006004

USER_BALANCE_NOT_ENOUGH

F

User balance is not enough.

11

12005131

IDENTITY_CODE_INVALID

F

The identity code is invalid.

12

12005132

IDENTITY_CODE_NOT_SUPPORT

F

The format of identity code is NOT supported, e.g. the identity code is from an unsupported wallet.Ā 

13

12005124

PAYMENT_IN_PROCESS

U

The payment is still under process.

14

12005100

ORDER_IS_CLOSED

F

The order status is closed.Ā 

15

12005003

ORDER_STATUS_INVALID

F

The order status is invalid.Ā 

16

12002046

USER_AMOUNT_EXCEED_LIMIT

F

User amount exceeds the limit.

17

12002004

USER_REALNAME_STATUS_INVALID

F

This user needs to complete real name validation.

18

12002010

USER_NO_PAYMENT_INSTRUMENT

F

This user has no payment instrument.

19

12002003

USER_BALANCE_PAY_OFF

F

This user turns the basic payment capability off.

Basic result codes

The following global result codes might be returned for all APIs.

No

ResultCodeId

ResultCode

ResultStatus

Remarks

1

00000000

SUCCESS

S

Success

2

00000019

PROCESS_FAIL

F

General business failure. No retry.

3

00000901

UNKNOWN_EXCEPTION

U

API failed due to unknown reasons.

4

00000004

PARAM_ILLEGAL

F

Illegal parameters. For example, non-numeric input, invalid date.

5

00000007

INVALID_SIGNATURE

F

The signature is invalid.

6

00000008

KEY_NO_FOUND

F

The key is not found.

7

00000013

NO_INTERFACE_DEF

F

API is not defined,

8

00000014

API_IS_INVALID

F

API is invalid or not active,

9

00000016

OAUTH_FAILED

F

oAuth authentication failed.

10

00000021

ACCESS_DENIED

F

Access denied

11

12014152

CLIENT_FORBIDDEN_ACCESS_API

F

The client is not authorized to use this API.

12

12014155

UNKNOWN_CLIENT

F

Unknown client

13

12014156

INVALID_CLIENT_STATUS

F

Invalid client status

14

00000024

REQUEST_TRAFFIC_EXCEED_LIMIT

F

Request traffic exceeds the limit.