优惠应用
- Endpoint:
POST /aggregate-pay/api/gateway/applyPromoEvent - Tags: 营销
Description
接口名称:applyPromoEvent
Parameters
| Field | In | Type | Required | Constraints | Description |
|---|---|---|---|---|---|
Content-Type | header | string | Yes | ||
sign | header | string | Yes | 签名信息请参考技术文档 |
Parameter Examples
Content-Type:"application/json"sign:"FPFVT3o227JrFRbqu19boZCpVVTF9KznxyRawUmxpfXilHV/0yK46haPhAjNu1hPUMy7Vw/ILXhfzffNm4Fj0apWknlTY9OJxnSoQxS9BTFtc61tn5yV1q69x/kkBl82/qwg+XTJ4fOzy7Mar3VaC1E2PlDA6RkkKBUyNE6RYgsdB+Su7an4+4HVTNAnoe74WyvBgxTLMNg28igBTdqxaO3w/UBY6ObVp7vkqkQGdL1Y+HgmMYaAVwrM3+ALWGId0sJ+YqTY4WJ+0xCRGhaSnybiIjZsQEYyID68WNUfuavDLDsEhaMm/HfQvf5p0R1Ltovp3wwJnEbQcjY458iX5A=="
Request Body
Content-Type: application/json
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
version | string | Yes | maxLength: 8 | 接口版本 当前值为:1.1 | |
keyVersion | string | Yes | maxLength: 8 | 密钥版本 当前值为:1 | |
requestTime | string | Yes | maxLength: 32 | 请求时间,符合rfc3339规范,格式:yyyy-MM-dd'T'HH:mm:ss.SSSXXX 时间需要在当前时间两分钟内 | |
appId | string | Yes | maxLength: 64 | 商户应用Id,PayerMax分配给商户应用的唯一标识 | |
merchantNo | string | No | maxLength: 32 | 商户号,商户与PayerMax业务签约时生成的唯一标识 | |
data | object | Yes | 请求数据体 | ||
data.requestId | string | Yes | maxLength: 64 | 本次业务操作幂等 ID,长度 16–64 | |
data.checkId | string | Yes | calcPromoEvent优惠试算返回的试算id,优惠应用时传递可以进行二次校验 | ||
data.userId | string | Yes | maxLength: 32 | 商户侧用户号 | ONETIME |
data.subscriptionNo | string | No | maxLength: 10 | 订阅号 | |
data.promotionEventIdList | string | Yes | maxLength: 2 | 促销活动编号列表;可为 null,与promotionCode二选一。 | |
data.promotionCode | string | Yes | maxLength: 3 | 推广码;可为 null,与promotionCode二选一。 |
Example
json
{
"version": "1.1",
"keyVersion": "1",
"requestTime": "2022-01-22T10:00:00.500+08:00",
"appId": "6666c8b036a24579974497c2f9a33333",
"merchantNo": "010213834784554",
"data": {
"requestId": "openreq202610220001xx",
"userId": "testdev001",
"subscriptionNo": "SUB261015061106740441000005A04",
"promotionEventIdList": [
"PE20260001"
]
}
}Responses
200
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
code | string | Yes | 返回码,’APPLY_SUCCESS’代表成功 | ||
msg | string | Yes | 返回描述,’Success.’ | ||
data | object | Yes | 本次业务操作响应数据 | ||
data.requestId | string | Yes | maxLength: 64 | 本次业务操作幂等 ID;同一次重试保持不变,新操作须换新 ID;响应原样回传 | |
data.checkId | string | Yes | maxLength: 64 | 试算方案 ID,发券时作为 checkId 传入 | |
data.totalDiscountAmount | object | Yes | 明细优惠金额合计 | ||
data.totalDiscountAmount.amount | number | Yes | 金额 | ||
data.totalDiscountAmount.currency | string | Yes | 币种 | ||
data.discountDetailList | object | Yes | 可用促销活动明细列表 | ||
data.discountDetailList.promotionEventId | string | Yes | 促销活动编号 | ||
data.discountDetailList.promotionEventName | string | Yes | 促销活动名称 | ||
data.discountDetailList.promotionCode | string | Yes | 推广码编号 | ||
data.discountDetailList.discountSource | string | Yes | 优惠成本承担方;merchant商户承担 | ||
data.discountDetailList.discountAmount | object | Yes | 优惠金额 | ||
data.discountDetailList.discountAmount.amount | string | Yes | 金额 | ||
data.discountDetailList.discountAmount.currency | string | Yes | 币种 | ||
data.discountDetailList.priceDiscountList | object | Yes | 订阅计划 priceId维度优惠明细列表 | ||
data.discountDetailList.priceDiscountList.productId | string | Yes | 商品编号 | ||
data.discountDetailList.priceDiscountList.priceId | string | Yes | 价格编号 | ||
data.discountDetailList.priceDiscountList.productName | string | Yes | 商品名称 | ||
data.discountDetailList.priceDiscountList.discountAmount | object | Yes | 商品优惠金额 | ||
data.discountDetailList.priceDiscountList.discountAmount.amount | string | Yes | 金额 | ||
data.discountDetailList.priceDiscountList.discountAmount.currency | string | Yes | 币种 | ||
data.discountDetailList.applicablePeriodCount | string | Yes | 剩余适用订阅期数,订阅产品时展示 |
Response Example
json
{
"code": "SUCCESS",
"msg": "success",
"data": {
"requestId": "open-req-20261104-0001xxxxxxxxxx",
"checkId": "pdis_0023179204466656867450005627",
"totalDiscountAmount": {
"amount": 10,
"currency": "USD"
},
"discountDetailList": [
{
"promotionEventId": "PE20260001",
"promotionEventName": "订阅首单优惠",
"promotionCode": "PROMO2026A",
"discountSource": "merchant",
"discountAmount": {
"amount": 10,
"currency": "USD"
},
"applicablePeriodCount": 1,
"priceDiscountList": [
{
"productId": "PRODUCT2026101002294303420000001",
"priceId": "PRICE2026101002294305020000002",
"productName": "产品A",
"quantity": 10,
"discountAmount": {
"amount": 10,
"currency": "USD"
}
}
]
}
]
}
}Enum Reference
data.userId
ONETIME
