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",
            "$fromTimeZone_en_US$": "GMT+8",
            "$fromTimeZone_zh_HK$": "GMT+8",
            "$toTimeZone_en_US$": "GMT+6",
            "$toTimeZone_zh_HK$": "GMT+6"
    }
}

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"
    }
}

3.7 Update partial bus ticket of a same order - Request

copy
{
 "status": "UPDATE",
 "passId": "20240425190271021604578876544",
 "merchantId":"2160120036095023",
 "userId":"21601203942344",
 "updateDetailType": "UPDATE_BUS_TICKET",
 "bizDate": 665588743235567,
 "dataInfo": {
    "$from_zh_HK$": "广州北汽车客运站",  // 起点站中文名称,必填,24个字
    "$from_en_US$": "GuangZhou", // 起点站英文名称,必填,48个字
    "$fromAddress_zh_HK$": "广州天河客运站一楼",  // 起点站中文名称,必填,64个字
    "$fromAddress_en_US$": "GuangZhou TianHe", // 起点站英文名称,必填,128个字
    "$to_zh_HK$": "深圳南山客运站",  // 终点站中文名称,必填,24个字
    "$to_en_US$": "ShenZhen NanShan", // 终点站英文名称,必填,48个字
    "$toAddress_zh_HK$": "深圳南山客运站一楼",  // 终点站中文名称,必填,64个字
    "$toAddress_en_US$": "ShenZhen NanShan Street", // 终点站英文名称,必填,128个字
    "$availableTimes_zh_HK$": 1,  // 可用次数,非必填,取值范围[0,100]
    "$availableTimes_en_US$": 1,  // 可用次数,非必填,取值范围[0,100]
    "$price_zh_HK$": {"cent": 996, "currency": "HKD"},// 票价,非必填,最小金额单位(分)
    "$price_en_US$": {"cent": 996, "currency": "HKD"},// 票价,非必填,最小金额单位(分)
    "$startTime_zh_HK$": 1722396535310,   // 发车时间点,毫秒时间戳,必填
    "$startTime_en_US$": 1722396535310,   // 发车时间点,毫秒时间戳,必填
    "$endTime_zh_HK$": 1724988535310,  // 到站时间点,毫秒时间戳,必填
    "$endTime_en_US$": 1724988535310,  // 到站时间点,毫秒时间戳,必填
    "$ticketType_zh_HK$":"成人票",  // 票类型,非必填,12个字
    "$ticketType_en_US$":"ADULT", // 票类型,非必填,24个字
    "$busSeat_zh_HK$": "21", // 座位号,非必填,12个字
    "$busSeat_en_US$": "21", // 座位号,非必填,12个字
    "$platformName_zh_HK$": "好赏买",  // 购票平台,非必填,32个字
    "$platformName_en_US$": "COD",  // 购票平台,非必填,64个字
    "$platformLogo_zh_HK$": "https://mdn.alipayobjects.com/huamei_vwzgao/afts/img/A*JA3_R55-PXQAAAAAAAAAAAAADgmNAQ/original", //logo图,非必填,256个字
    "$platformLogo_en_US$": "https://mdn.alipayobjects.com/huamei_vwzgao/afts/img/A*JA3_R55-PXQAAAAAAAAAAAAADgmNAQ/original",  //logo图,非必填,256个字
    "$serviceProviderName_zh_HK$": "广州城际巴士集团", // 服务提供商名称,非必填,32个字
    "$serviceProviderName_en_US$": "GuangZhou City Bus Group"  // 服务提供商名称,非必填,64个字
    "$passengerInfoList_en_US$": [{"id":"11111111","busSeat":"21","ticketType":"ADULT","status":"USED","codeInfo":{"codeMsg":"ticket code","codeValue":"AABB345OODD","codeType":"qrcode","codeStandard":"QRCODE"}},{"id":"222222","busSeat":"22","ticketType":"ADULT","status":"AVAILABLE","codeInfo":{"codeMsg":"ticket code","codeValue":"AABB345OOEE","codeType":"qrcode","codeStandard":"QRCODE"}}],
    "$customerServiceInfoForHK_zh_HK$": "+852 12343456",
    "$customerServiceInfoForHK_en_US$": "+852 12343456",
    "$customerServiceInfoForCN_zh_HK$": "+86 13424453224",
    "$customerServiceInfoForCN_en_US$": "+86 13424453224"
  },
 "extInfo":{
  "fromAddressDetailUrl": "alipayhk://platformapi/startapp?appId=2102020185475244&page=pages/alipay/orderDetail/index?orderCode=20240421389609183133&query=",
  "toAddressDetailUrl": "alipayhk://platformapi/startapp?appId=2102020185475244&page=pages/alipay/orderDetail/index?orderCode=20240421389609183133&query=",
  "billId":"2020091119027102160530200000039",
  "merchantBillDetail": "alipayhk://platformapi/startapp?appId=21020201854751234&page=pages/alipay/orderDetail/index?",
  "merchantBillId": "1223410142129",
  "copyOrderUrl": "alipayhk://platformapi/startapp?appId=2102020185475244&page=pages/alipay/orderDetail/index?orderCode=20240421389609183133&query=",
 }
 }

3.8 Response

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