承载协议 | HTTPS PATCH |
|---|---|
接口方向 | 开发者服务器->华为帐号服务器 |
接口URL | {url}/hmspass/v1/loyalty/instance/{instanceId}/linkedoffers {url}变量需要开发者根据服务器所属区域自行选择,请参见钱包服务器地址。 |
数据格式 | 请求消息:Content-Type: application/json 响应消息:Content-Type: application/json |
Request Header:
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
Authorization | 是 | String | 鉴权码。获取方式详见基于OAuth 2.0开放鉴权,请使用“客户端模式”。“client_id”和“client_secret”即为开发者在华为AGC网站上创建应用后获取的“App ID”和“App key”。将获取到的“access_token”的值拼接在字符串“Bearer”之后,以空格符相隔,组成“Authorization”参数的值。 |
Content-Type | 是 | String | 固定值:“application/json;charset=utf-8”。 |
Accept | 是 | String | 固定值:“application/json;charset=utf-8”。 |
Request Body:
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
addOffers | 否 | Array<Offer> | 需要添加的关联优惠券信息。 |
deleteOffers | 否 | Array<Offer> | 需要删除的关联优惠券信息。 |
Offer:
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
passTypeIdentifier | 是 | String | 要添加或删除的优惠券的服务号。 |
instanceId | 是 | String | 优惠券个人化实例ID。 |
PATCH /hmspass/v1/loyalty/instance/40001/linkedoffers HTTP/1.1
Content-Type: application/json;charset=utf-8
Authorization: Bearer ***
Accept: application/json;charset=utf-8
Host: wallet-passentrust-drcn.cloud.huawei.com.cn
{
"addOffers": [
{
"passTypeIdentifier": "hwpass.com.huawei.wallet.offer.test",
"instanceId": "50001"
}
],
"deleteOffers": [
{
"passTypeIdentifier": "hwpass.com.huawei.wallet.offer.test",
"instanceId": "50002"
}
]
} HTTP/1.1 200 OK
Content-Type: application/json
{
"passTypeIdentifier": "hwpass.com.huawei.wallet.loyalty.test",
"passStyleIdentifier": "loyaltyModelTest",
"organizationPassId": "356688115",
"serialNumber": "40001",
"fields": {
"status": {
"state": "active",
"effectTime": "2019-11-13T00:00:00.111Z",
"expireTime": "2028-11-20T00:00:00.111Z"
},
"barCode": {
"text": "1118466050",
"type": "codabar",
"value": "1118466050",
"encoding": "UTF-8"
},
"commonFields": [
{
"key": "cardNumber",
"value": "12345678",
"label": "Card Number"
},
{
"key": "balance",
"value": "$666",
"label": "Balance"
},
{
"key": "memberName",
"value": "Joe Wiley",
"label": "Name"
}
],
"appendFields": [
{
"key": "points",
"value": "1500",
"label": "Points"
}
],
"messageList": [
{
"key": "message[10]",
"value": "Hello everyone!"
}
],
"relatedPassIds": [
{
"type": "hwpass.com.huawei.wallet.offer.test",
"id": "50001"
}
]
}
}