6. Update a Ticket

1. API Path

/api/open/alipay/v1/ipass/pass/manage/updatePass

Production domain: https://open.alipay.hk

Endpoint:https://open.alipay.hk/api/open/alipay/v1/ipass/pass/manage/updatePass

Scenario: Merchant can use this interface to update ticket content, close and remove it after user using/deleting this ticket.

2. API Request

2.1 Request

2.1.1 Header

Name

Type

Required

Description

Sample

client-id

String

M

Client ID

2110200000000044

signature

String

M

Message signature information

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

encrypt

String

O

Message encryption information

algorithm=rsa, keyVersion=2

Content-type

String

M

Http content type

application/json; charset=UTF-8

2.1.2 Body

Name

Type

Length

Required

Description

Sample

merchantId

string

32

Y

Merchant Id

2312314123123123

userId

string

32

C

AlipayHK userId

2188200000000000

openId

string

32

C

AlipayHK openId

fj398457jd8iue98d8w7w93j

templateCode

string

32

O

Template Id

passId

String

32

Y

passId

Returned  from Create a Ticket API

status

String

32

Y

Ticket status update:

USED - The ticket is used

CLOSED - Remove the ticket

UPDATE - To update the ticket content

USED

updateDetailType

String

32

C

When ticket status type is UPDATE, the available types are

UPDATE_AIR_TICKET

UPDATE_TRAIN_TICKET

UPDATE_BUS_TICKET

UPDATE_SHIP_TICKET

UPDATE_MOVIE

UPDATE_PASS

UPDATE_AIR_TICKET

bizDate

Date

/

O

Timestamp of updating ticket.

When updateDetailType is set to below value, this field is mandatory

  • UPDATE_AIR_TICKET
  • UPDATE_TRAIN_TICKET
  • UPDATE_BUS_TICKET
  • UPDATE_SHIP_TICKET
  • UPDATE_MOVIE
  • UPDATE_PASS

1713766195

endDate

String

128

O

Ticket expiration time

Has to be the same logic as endDate from Create ticket API

1640970061000

dataInfo

String

O

Dynamic data that needs to be updated, json data type, with language identifier

2.2 Response

Name

Type

Length

Description

Sample

ResultInfo

Object

/

Result

2.2.1 ResultInfo

Name

Type

Description

Sample

resultCode

String

Result Code

resultStatus

String

Result Status

F - Fail S- Success

resultMessage

String

Result message

SUCCESS

2.2.2 Result Code

Index

Result Code

Result Status

Description

HTTP Status Code

1

PARAM_ILLEGAL

F

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

200OK

2

SUCCESS

S

success.

200OK

3

UNKNOWN_EXCEPTION

U

API failed due to unknown reason.

200OK

4

USER_NOT_EXIST

F

The user nor exist.

200OK

5

PASS_UPDATE_FAIL

F

update pass info failed

200OK

6

PASS_HAS_NOT_EXIST

F

pass has not exist

200OK

7

PASS_USED_OCCUPIED

F

pass used occupied

200OK

8

PASS_HAS_NOT_USED

F

pass has not used

200OK

9

BIZ_NOT_SUPPORT

F

Business does not support

200OK

10

PASS_STATUS_ILLEGAL

F

pass status is illegal

200OK

3. Request Sample

3.1 The journey has finished - Request

copy
{     
  "merchantId":"6228480402564890018",
  "userId":"2160400000000135",
  "templateId":"5228480402564890018",     
  "passId":"2995228480402564890018",     
  "status":"USED"
}

3.2 Response

copy
{
  "resultInfo":{
    "resultCode": "SUCCESS",
    "resultMessage":"success",         
    "resultStatus": "S"     
  } 
}

3.3 Update ticket content - Request

copy
{
    "merchantId":"2160400000000135",
    "userId":"20881919187171",
    "templateId":"5228480402564890018",
    "passId":"2995228480402564890018",
    "status":"UPDATE",
    "bizDate": 1640970061000,
    "endDate": 1640980061000,
    "updateDetailType": "UPDATE_AIR_TICKET"
    "dataInfo": {
        "$airlineName_zh_HK$": "国泰航空",
        "$airlineName_en_US$": "国泰航空EN",
        "$airlineLogo_zh_HK$": "https://www.logo.com",
        "$airlineLogo_en_US$": "https://www.logo.com",
        "$airlineCode_zh_HK$": "A1234",
        "$airlineCode_en_US$": "A1234",
        "$from_zh_HK$": "香港",
        "$from_en_US$": "HK",
        "$to_zh_HK$": "首尔",
        "$to_en_US$": "Seoul",
        "$startTime_zh_HK$": 1640970061000,
        "$startTime_en_US$": 1640970061000,
        "$endTime_zh_HK$": 1640970061000,
        "$endTime_en_US$": 1640970061000,
        "$shiftNumber_zh_HK$": "CX1245",
        "$shiftNumber_en_US$": "CX1245",
        "$fromAddress_zh_HK$": "香港国际机场某个上车点",
        "$fromAddress_en_US$": "HK Wharf stream",
        "$toAddress_zh_HK$": "首尔仁川机场某一个地方上车点",
        "$passengerInfoList_zh_HK$": [{"passengerName":"乘客名称","idNumber":"H*******1134","ticketType":"成人票","ticketLevel":"经济舱"}],
        "$passengerInfoList_en_US$": [{"passengerName":"乘客名称","idNumber":"H*******1134","ticketType":"成人票","ticketLevel":"经济舱"}],
        "$platformName_zh_HK$": "同程旅行",
        "$platformName_en_US$": "TongCheng",
        "$platformLogo_zh_HK$": "https://www.logo.com",
        "$platformLogo_en_US$": "https://www.logo.com"
    }
}

3.4 Response

copy
{
  "resultInfo":{
    "resultCode": "SUCCESS",
    "resultMessage":"success",         
    "resultStatus": "S"     
  } 
}

3.5 Remove ticket - Request

copy
{
    "merchantId":"6228480402564890018",
    "openId":"aklak12312khabmnb12hbj4b1jm1j1h1bqosm4",
    "templateId":"5228480402564890018",
    "passId":"2995228480402564890018",
    "status":"CLOSED"
}

3.6 Response

copy
{
    "resultInfo":{
        "resultCode": "SUCCESS"
        "resultMessage":"success",
        "resultStatus": "S"
    }
}