Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solution

alipay.intl.acquiring.cashier.prepareForRedirect

The merchant can use this interface to make a cashier 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

AUTO_DEBIT

3

merchantTransId 

Unique merchant transaction ID

string

64

ME

51051001000000000002

4

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.value as 100 (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"
   }
}

5

expireTime

The expected expiration time of the order. This parameter is composed of integer number and time period unit. Supported time period units include:

  • y: years
  • m: months
  • d: days
  • h: hours
  • min: minutes
  • s: seconds

If not passed, the default value will be applied. Different product has its own default value.

string

16

O

3min

6

settleContractId

The settlement contract ID. A 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

7

paymentSite

The payment site

SiteEnum

64

M

ALIPAY_CN

8

terminalType

Terminal type

enum<TerminalTypeEnum

>

32

M

Indicates the source terminal type and how the redirect will happen.

WEB

9

merchantRedirectUrl

Merchant redirect URL.  It can be passed in each call, or configure once on the Alipay side.

Note: This field is required when merchantRedirectUrlisPassedInEachCall is true.

string

512

C

https://www.merchant.com/payResult.html

10

urlType

URL type. DEFAULT if blank.

UrlTypeEnum

/

O

DEFAULT

11

extendInfo

Reserved for extended info

string

2048

O

Key/Value
Note the type of extendInfo is a string. See the example in the request sample.

{}

12

riskInfo

Risk information. Highly recommend providing.

RiskInfo

/

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"
   },
   "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":"{}"
}

13

notifyUrl

The notify URL used for payment result notification.

string

256

O

https://xxx.xxx.xxx

Request sample

copy
{
    "request":{
        "head":{
            "version":"2.0.0",
            "function":"alipay.intl.acquiring.cashier.prepareForRedirect",
            "clientId":"211020000000000000044",
            "reqTime":"2001-07-04T12:08:56+05:30",
            "reqMsgId":"1234567asdfasdf1123fda",
            "reserve":"{}"
        },
        "body":{
            "merchantId":"218820000000000000023",
            "productCode":"AUTO_DEBIT",
            "merchantTransId":"51051001000000000002",
            "order":{
                "orderAmount":{
                    "currency":"USD",
                    "value":"239"
                },
                "orderTitle":"Women Summer Dress",
                "orderDetail":"New White Lace Sleeveless Cute Casual Summer Dresses Vestidos roupas femininas WQW10"
            },
            "expireTime":"3min",
            "settleContractId":"USD-1",
            "paymentSite":{
                "ALIPAY_CN":"null",
                "ALIPAY_HK":"null"
            },
            "terminalType":"WEB",
            "urlType":{
                "DEFAULT":"null",
                "SHORT":"null"
            },
            "extendInfo":"{}",
            "riskInfo":{
                "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"
                },
                "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://xxx.xxx.xxx"
        }
    },
    "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

Sample

1

resultInfo

Result information

ResultInfo

/

M


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

2

paymentSiteUrl

Payment site URL

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

string

1024

C

https://www.paymentsite.com/gateway.do?sign_type=RSA&sign=123456&merchant_id=218820000000000000023&product_code=AUTO_DEBIT&merchant_trans_id=51051001000000000002&order={"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"}}&merchant_redirect_url=https://www.merchant.com/payResult.html&oauth_apply_info={"authMerchantId":"218820000000000000023","scopes":["AUTH_AGREEMENTPAY"],"agreementPayAuthInfo":{"merchantAgreementId":"e8qdwl9casxor13","merchantUserId":"userId001","validPeriod":"2m"}}

3

validTime

The valid time for the generated URL. This parameter is composed of integer number and time period unit. Supported time period unit is:

  • s: seconds

If not passed, default is never expiring.

string

16

O

600s

Response sample

copy
{
    "response":{
        "head":{
            "version":"2.0.0",
            "function":"alipay.intl.acquiring.cashier.prepareForRedirect",
            "clientId":"211020000000000000044",
            "respTime":"2001-07-04T12:08:56+05:30",
            "reqMsgId":"1234567asdfasdf1123fda",
            "reserve":"{}"
        },
        "body":{
            "resultInfo":{
                "resultStatus":"S",
                "resultCodeId":"00000000",
                "resultCode":"SUCCESS",
                "resultMsg":"success"
            },
            "paymentSiteUrl":"https://www.paymentsite.com/gateway.do?sign_type=RSA&sign=123456&merchant_id=218820000000000000023&product_code=AUTO_DEBIT&merchant_trans_id=51051001000000000002&order={\"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\"}}&merchant_redirect_url=https://www.merchant.com/payResult.html&oauth_apply_info={\"authMerchantId\":\"218820000000000000023\",\"scopes\":[\"AUTH_AGREEMENTPAY\"],\"agreementPayAuthInfo\":{\"merchantAgreementId\":\"e8qdwl9casxor13\",\"merchantUserId\":\"userId001\",\"validPeriod\":\"2m\"}}",
            "validTime":"600s"
        }
    },
    "signature":"signature string"
}

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.