alipay.intl.user.pass.createPass

Overview

Endpoint: /api/open/alipay/v1/ipass/pass/manage/createPass

Use this interface to issue a gift card or a member card to the user's AlipayHK wallet after the user purchases or gets a gift card or a member card in the mini program. Then, the user can view the cards in the coupon package of AlipayHK.

Sample

Request

copy
{
 "merchantId": "2160120036095023",
 "userId": "2160220037090534",
 "templateCode": "temlate111001",
 "bizSerialId": "1111128828",
 "bizSerialType": "OUT_PLAT_FORM",
 "startDate": "2020-09-01 00:00:00",
 "endDate": "2020-09-28 00:00:00",
 "type": "COUPON",
 "dataInfo": {
 "en_US": {
 "$shopname$": "demo shop"
 },
 "zh_HK": {
 "$shopname$": ""
 }
 },
 "product": "GIFT_CARD",
 "codeInfo": {
 "$codemsg$": "9123912839123712893",
 "$codevalue$": "9123912839123712893"
 },
 "bizCreate": "2020-09-01 00:00:00"
}

Response

copy
{
 "result": {
 "resultCode": "SUCCESS",
 "resultMessage": "success",
 "resultStatus": "S"
 },
 "passId": "2020091119027102160530200000039"
}

Structure

Request parameters

Header

No

Name

Description

Type

Required

Sample

1

clientId

Client ID

String

ME

211020000000000000044

2

signature

Message signature information

String

M

algorithm=sha256withrsa,keyVersion=2, signature=xxxxxxxxxxxyyyyyyyyyyyyyyzzzzzzzzz==

3

encrypt

Message encryption information

String

O

algorithm=rsa, keyVersion=2

4

Contenttype

Http content type

String

M

application/json; charset=UTF-8

Body

No

Name

Description

Type

Length

Required

Remarks

1

merchantId

The merchant ID

String

32

M

2

userId

AlipayHK user ID

String

32

C

At least one of userId and openId needs to be passed.

3

openId

The unique openId for the merchant that is authorized by AlipayHK.

String

32

C

At least one of userId and openId needs to be passed.

4

templateCode

Card template ID

String

32

M

5

bizSerialId

Serial number of card business

String

128

M

6

bizSerialType

Serial number type of card business.

Possible values are:

OUT_PLAT_FORM

BizSerialType

32

M

7

startDate

The valid expire time of the card, with a format of yyyy-MM-dd HH:mm: ss.

M

8

endDate

The valid end time of the card, with a format of yyyy-MM-dd HH:mm: ss.

M

9

bizCreate

The creation time of the card, with a format of yyyy-MM-dd HH:mm: ss.

M

10

type

The card type.

Possible values are:

  • COUPON
  • CARD

PassType

32

O

11

product

The card product type.

Possible values are:

  • GIFT_CARD
  • MEMBER_CARD

PassProductType

32

O

12

codeInfo

The code value information of the card. JSON format.

String

512

M

13

dataInfo

Details of cards.

8192

O

Response

Header

No

Name

Description

Type

Required

Sample

1

clientId

Client ID

String

ME

211020000000000000044

2

signature

Message signature information

String

M

algorithm=sha256withrsa,keyVersion=2, signature=xxxxxxxxxxxyyyyyyyyyyyyyyzzzzzzzzz==

3

encrypt

Message encryption information

String

O

algorithm=rsa, keyVersion=2

4

Contenttype

Http content type

String

M

application/json; charset=UTF-8

5

tracerId

Each request will be assigned with a unique ID to identify a unique system request, which is not used to identify a unique business request.

String

M

645864f51556420636666454470556

Body

No

Name

Description

Type

Length

Required

1

result

Result information

ResultInfo

M

2

passId

The unique identifier that is generated by the system.

String

32

M

Result code

No.

resultCode

resultStatus

resultMessage

1

PARAM_ILLEGAL

F

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

2

SUCCESS

S

Success

3

UNKNOWN_EXCEPTION

U

API failed due to unknown reasons.

4

USER_NOT_EXIST

F

The user does not exist.

5

PASS_HAS_EXIST

F

Pass exists

6

PASS_TEMPLATE_HAS_NOT_EXIT

F

Pass template has not existed.

7

PASS_TYPE_NOT_MATCH

F

Pass type does not match.

8

PASS_PRODUCT_TYPE_NOT_MATCH

F

Pass product type does not match.

9

PASS_TEMPLATE_JSON_CONTENT_IS_NULL

F

Pass template content is null.

10

PASS_TEMPLATE_JSON_CONTENT_ILLEGAL

F

Pass template content is illegal.