alipay.intl.acquiring.agreement.pay

This interface is used by merchant to make an automatic deduction from the binded account, by using the correct accessToken.

Request parameters

No

Name

Description

Type

Length

Required

Remarks

Sample

1

version

API version

string

8

Y

As per the respective API reference

2.0.0

2

function

API interface

string

128

Y

According to specifications defined by each business domain

alipay.intl.function

3

clientId

Client ID

string

32

Y

Provided by AlipayHK, used to identify partner and application system

4Q5XPV504B0A5302

4

reqTime

Request time

datetime

/

Y

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

Y

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

1234567asdfasdf1123fda

6

accessToken

Access token

string

64

Y

M9WkKnmRGFflrgEp2ORH5sMIkH9L59AXK6SFkdzAi5000969

7

reserve

Reserved for future implementation

string

256

N

Key/Value

{}

Body

No

Name

Description

Type

Length

Required

Remarks

Sample

1

merchantId

The merchant id, which identifies the settlement target that AlipayHK would settle to.

string 

64

Y

2160400000002012

2

productCode

The product code.

enum<productcode>

64

Y

AUTO_DEBIT

3

merchantTransId 

Unique merchant transaction id.

string

64

Y

YIDAO_20181212_0000002

4

order

The order information.

Order

/

Y

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=100 (100 cents).

"order": {
                "orderAmount": {
                    "currency": "HKD",
                    "value": "10000"
                }

5

settleContractId

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

N

USD-1

7

extendInfo

Reserved for extended info

string

2048

N

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

 "extendInfo": "{}"

8

notify_url

Notify url for a completed payment

string

512

N

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

Request sample

{
    "request":{
        "head":{
            "version":"2.0.0",
            "function":"alipay.intl.acquiring.agreement.pay",
            "clientId":"4Q5XPV504B0A5302",
            "reqTime":"2001-07-04T12:08:56+05:30",
            "reqMsgId":"YIDAO_GW_20181212_000002",
            "accessToken":"M9WkKnmRGFflrgEp2ORH5sMIkH9L59AXK6SFkdzAi5000969",
            "reserve":"{}"
        },
        "body": {
            "settleContractId": "USD-1",
            "productCode": "AGREEMENT_OR_CASHIER_PAY",
            "merchantId": "2160400000002012",
            "merchantTransId": "YIDAO_20181212_0000002",
            "extendInfo": "{}",
            "notify_url": "https://7yfnppybv0.execute-api.ap-northeast-1.amazonaws.com/sandbox/notify/2160400000002012",
            "order": {
                "orderAmount": {
                    "currency": "HKD",
                    "value": "10000"
                },
                "orderDetail": "phone  bill",
                "orderTitle": "merchant xxx"
            }
        }
    },
    "signature":"testing_signature"
}

Response Parameters

Header

No

Name

Description

Type

Length

Required

Remarks

Sample

1

version

API version

string

8

Y

As per the respective API reference

2.0.0

2

function

API interface

string

128

Y

According to specifications defined by each business domain

alipay.intl.function

3

clientId

Client ID

string

32

Y

Provided by Alipay, used to identify partner and application system

4Q5XPV504B0A5302

4

respTime

Response time

datetime

/

Y

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

Y

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

1234567asdfasdf1123fda

6

accessToken

Access token

string

64

Y

M9WkKnmRGFflrgEp2ORH5sMIkH9L59AXK6SFkdzAi5000969

7

reserve

Reserved for future implementation

string

256

N

Key/Value

{}

Body 

No

Name

Description

Type

Length

Required

Remarks

Sample

1

resultInfo

Result info

ResultInfo

/

Y


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

2

acquirementId

Unique AlipayHK transaction id.

Note:

This parameter is required when resultInfo.resultCode = SUCCESS

string

64

N

20181211194010800100160960000444183

3

merchantTransId 

Unique merchant transaction id.

Note:

This parameter is required when resultInfo.resultCode = SUCCESS

string

64

N

YIDAO_20181212_0000002

4

orderAmount

Order amount

Note:

This parameter is required when resultInfo.resultCode = SUCCESS

Money

/

N

Should be exactly same as 'orderAmount'   
passed in the request

{

"currency": "HKD",
 "value": "10000"

}

5

createTime

The creation time of the transaction

Note:

This parameter is required when resultInfo.resultCode = SUCCESS

datetime

/

N

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

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

6

extendInfo

Reserved for extended info

string

2048

N

{}

Response sample 

{
    "response": {
        "body": {
            "acquirementId": "20181211194010800100160960000444183",
            "createTime": "2018-12-11T20:15:31-08:00",
            "merchantTransId": "YIDAO_20181212_0000002",
            "orderAmount": {
                "currency": "HKD",
                "value": "10000"
            },
            "resultInfo": {
                "resultCode": "SUCCESS",
                "resultCodeId": "00000000",
                "resultMsg": "Success",
                "resultStatus": "S"
            }
        },
        "head": {
            "clientId": "4Q5XPV504B0A5302",
            "function": "alipay.intl.acquiring.agreement.pay",
            "reqMsgId": "YIDAO_GW_20181212_000002",
            "respTime": "2018-12-11T20:15:33-08:00",
            "version": "2.0.0"
        }
    }
}

 

Business Error code

Functional Logic Result Code

No

ResultCodeId

ResultCode

ResultStatus

Remarks

1

00000019

PROCESS_FAIL

F

General business failure

2

12005123

AUTH_NOT_SUCCESS

F

The authorization is not success

3

12007001RISK_AML_REJECT

F

Anti money laundering risk reject

4

12007615

PRODUCT_CODE_INVALID

F

Product code invalid

5

00000004

PARAM_ILLEGAL

F

Illegal parameters

6

12002006

USER_STATUS_ABNORMAL

F

User status is not normal

7

00000901

UNKNOWN_EXCEPTION

U

Unknown exception

8

00000011

RISK_REJECT

F

Risk reject

9

12002005

USER_NOT_EXIST

F

User does not exist

10

12002006

USER_STATUS_ABNORMAL

F

User status is not normal

11

12002027

OTP_VERIFY_TIMES_EXCEED_LIMIT

F

Verify code failed too many times, user must get a new code.

12

12002026

OTP_VERIFY_UNMATCHED

F

Verify code invalid

13

12014174

AUTH_CODE_INVALID

F

authCode is invalid

14

12014155

UNKNOWN_CLIENT

F

Unknown client

15

00000025

REPEAT_REQ_INCONSISTENT

F

Repeated submit, and requests are inconsistent.

16

12005012

USER_CONTRACT_STATUS_INVALID

F

Status of user contract is invalid

17

12005001

CURRENCY_NOT_SUPPORT

F

Transaction currency is invalid

18

12005004

ORDER_NOT_EXIST

F

Order does not exist

19

12005104

AMOUNT_EXCEED_LIMIT

FAmount exceeds limits

20

12005131

IDENTITY_CODE_INVALID

F

The identity code is invalid

21

12005132

IDENTITY_CODE_NOT_SUPPORT

FThe format of identity code is NOT supported, e.g. the identity code is from a unsupported wallet.

22

12005124

PAYMENT_IN_PROCESS

U

The payment is still under process

23

12005002

ORDER_IS_CLOSED

F

Order status is closed

24

12005003ORDER_STATUS_INVALIDF

Order status is invalid

25

12006004

BALANCE_NOT_ENOUGH

FBalance not enough

26

12002046

USER_AMOUNT_EXCEED_LIMIT

F

User amount exceeds limits

27

12002010

USER_NO_PAYMENT_INSTRUMENT

F

This user has no payment instrument