产品与营销策略查询
按外部产品编号查询产品及可用营销策略,供签约前校验。
接口说明
请求方式:【POST】/v1/subscription/product/query
请求域名:【主域名】https://api.baofu.com
请求参数
Header 参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | true | 请参考【开发指引-整体说明】生成认证信息 |
| Accept | string | true | 请设置为 application/json |
| Content-Type | string | true | 请设置为 application/json |
Body 参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| external_product_code | string(64) | false | 外部产品编号 |
请求示例
{
"external_product_code": "MONTHLY_VIP"
}
应答参数
200 OK
成功时业务体为数组;每项含 product 与 strategies。
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| product | object | true | 【产品信息】产品信息 |
| product.product_code | string | true | 产品编码 |
| product.external_product_code | string | true | 外部产品编号 |
| product.product_name | string | true | 产品名称 |
| product.period_type | string | true | 周期类型,取值:DAY / WEEK / MONTH / QUARTER / HALF_YEAR / YEAR / MONTH_FIXED_DAY |
| product.period_value | integer | true | 周期值 |
| product.fixed_day | integer | false | 固定扣款日(可空) |
| product.period_amount | integer | true | 每期扣款金额(分) |
| product.total_period | integer | false | 总期数(可空) |
| product.currency | string | true | 币种 |
| product.product_status | string | true | 产品状态,取值:ENABLED / DISABLED |
| product.description | string | false | 描述(可空) |
| strategies | array[object] | true | 【营销策略列表】可用营销策略 |
| strategies.strategy_code | string | true | 策略编码 |
| strategies.product_code | string | true | 产品编码 |
| strategies.pricing_type | string | true | 定价类型,取值:FREE_TRIAL / FIRST_PERIOD_DISCOUNT / TIERED_DISCOUNT / FIXED_DISCOUNT / NO_DISCOUNT / MERCHANT_SPECIFIED |
| strategies.priority | integer | true | 优先级(降序) |
| strategies.strategy_params | string | true | 策略参数 JSON |
| strategies.effective_start | string | true | 生效开始时间,ISO 8601 |
| strategies.effective_end | string | true | 生效结束时间,ISO 8601 |
| strategies.strategy_status | string | true | 策略状态,取值:ENABLED / DISABLED |
应答示例
200 OK
[
{
"product": {
"product_code": "PC202603260001",
"external_product_code": "MONTHLY_VIP",
"product_name": "月度会员",
"period_type": "MONTH",
"period_value": 1,
"fixed_day": null,
"period_amount": 1990,
"total_period": 12,
"currency": "CNY",
"product_status": "ENABLED",
"description": "月度VIP会员订阅"
},
"strategies": [
{
"strategy_code": "STR202603260001",
"product_code": "PC202603260001",
"pricing_type": "FIRST_PERIOD_DISCOUNT",
"priority": 100,
"strategy_params": "{\"discount_rate\":0.8}",
"effective_start": "2026-01-01T00:00:00+08:00",
"effective_end": "2026-12-31T23:59:59+08:00",
"strategy_status": "ENABLED"
}
]
}
]
错误码
公共错误码
| 状态码 | 错误码 | 描述 | 解决方案 |
|---|---|---|---|
| 400 | PARAM_ERROR | 参数校验失败 | 必填参数缺失或格式不合法 |
| 401 | SIGN_ERROR | 验证不通过 | 请参阅【开发指引-整体说明】排查签名 |
| 500 | SYSTEM_ERROR | 系统异常 | 内部系统错误 |
业务错误码
| 状态码 | 错误码 | 描述 | 解决方案 |
|---|---|---|---|
| 404 | NOT_FOUND | 产品未命中 | 产品查询未命中 |
应答示例
失败
{
"code": "NOT_FOUND",
"message": "产品未命中"
}