商品管理
获取商品一级分组
版本: v1
接口信息
- 请求方式:
GET - 请求地址:
/console/v1/product/group/first
返回参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| list | array | 否 | - | 商品一级分组 |
| list[].id | int | 否 | - | 商品一级分组ID |
| list[].name | int | 否 | - | 商品一级分组名称 |
| list[].type | int | 否 | - | 分组类型:type=domain表示域名 |
| count | int | 否 | - | 商品一级分组总数 |
获取商品二级分组
版本: v1
接口信息
- 请求方式:
GET - 请求地址:
/console/v1/product/group/second
请求参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | int | 否 | - | 一级分组ID |
返回参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| list | array | 否 | - | 商品二级分组 |
| list[].id | int | 否 | - | 商品二级分组ID |
| list[].name | int | 否 | - | 商品二级分组名称 |
| list[].parent_id | int | 否 | - | 商品一级分组ID |
| list[].type | int | 否 | - | 分组类型:type=domain表示域名 |
| list[].description | string | 否 | - | 描述 |
| count | int | 否 | - | 商品二级分组总数 |
商品列表
版本: v1
接口信息
- 请求方式:
GET - 请求地址:
/console/v1/product
请求参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| keywords | string | 否 | - | 关键字,搜索范围:商品ID,商品名,描述 |
| id | int | 否 | - | 二级分组ID |
| page | int | 否 | - | 页数 |
| limit | int | 否 | - | 每页条数 |
| exclusive | bool | 否 | - | 是否只返回专属商品 |
| product_ids | array | 否 | - | 筛选哪些商品 |
返回参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| list | array | 否 | - | 商品列表 |
| list[].id | int | 否 | - | ID |
| list[].name | string | 否 | - | 商品名 |
| list[].description | string | 否 | - | 描述 |
| list[].pay_type | string | 否 | - | 付款类型免费free,一次onetime,周期先付recurring_prepayment,周期后付recurring_postpaid,按需计费on_demand,周期先付+按需计费recurring_prepayment_on_demand |
| list[].price | string | 否 | - | 商品最低价格 |
| list[].cycle | string | 否 | - | 商品最低周期 |
| list[].mode | string | 否 | - | 代理模式:only_api仅调用接口,sync同步商品 |
| list[].client_level_name | string | 否 | - | 用户等级名称,这个字段在没有用户等级插件时不存在,所以需要注意判断 |
| list[].stock_control | int | 否 | - | 是否开启库存 |
| list[].qty | int | 否 | - | 库存数量,当开启库存,该字段才有意义 |
| list[].pay_ontrial | object | 否 | - | 试用配置,status:是否开启,cycle_type:时长单位(hour/day/month),cycle_num:时长,client_limit:用户限制(no不限制/new新用户/host用户必须存在激活中的产品),account_limit:账户限制(email绑定邮件/phone绑定手机/certification),old_client_exclusive:老用户专享(商品ID多选,逗号分隔),max:单用户最大试用数量 |
| count | int | 否 | - | 商品总数 |
商品详情
版本: v1
接口信息
- 请求方式:
GET - 请求地址:
/console/v1/product/:id
请求参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | int | 是 | - | 商品ID |
返回参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| product | object | 否 | - | 商品 |
| product.id | int | 否 | - | ID |
| product.name | string | 否 | - | 商品名称 |
| product.product_group_id | int | 否 | - | 所属商品组ID |
| product.description | string | 否 | - | 商品描述 |
| product.hidden | int | 否 | - | 0显示默认,1隐藏 |
| product.stock_control | int | 否 | - | 库存控制(1:启用)默认0 |
| product.qty | int | 否 | - | 库存数量(与stock_control有关) |
| product.pay_type | int | 否 | - | 付款类型(免费free,一次onetime,周期先付recurring_prepayment,周期后付recurring_postpaid,按需计费on_demand,周期先付+按需计费recurring_prepayment_on_demand) |
| product.auto_setup | int | 否 | - | 是否自动开通:1是默认,0否 |
| product.type | int | 否 | - | 关联类型:server,server_group |
| product.rel_id | int | 否 | - | 关联ID |
| upgrade | array | 否 | - | 可升降级商品ID,数组 |
| product_id | int | 否 | - | 父商品ID |
| plugin_custom_fields | array | 否 | - | 自定义字段{is_link:是否已有子商品,是,置灰} |
| show | int | 否 | - | 是否将商品展示在会员中心对应模块的列表中:0否1是 |
| on_demand.min_credit | string | 否 | - | 购买时用户最低余额 |
| on_demand.min_usage_time | int | 否 | - | 最低使用时长 |
| on_demand.min_usage_time_unit | string | 否 | - | 最低使用时长单位(second=秒,minute=分,hour=小时) |
| on_demand.credit_limit_pay | int | 否 | - | 允许信用额支付(0=否,1=是) |
结算商品
版本: v1
接口信息
- 请求方式:
POST - 请求地址:
/console/v1/product/settle
请求参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| product_id | int | 是 | - | 商品ID |
| config_options | object | 是 | - | 自定义配置 |
| customfield | object | 否 | - | 自定义参数,比如优惠码参数传:{"promo_code":["pr8nRQOGbmv5"]} |
| qty | int | 是 | - | 数量 |
| self_defined_field | object | 否 | - | 自定义字段({"5":"123"},5是自定义字段ID,123是填写的内容) |
返回参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| order_id | int | 否 | - | 订单ID |
商品配置页面
版本: v1
接口信息
- 请求方式:
GET - 请求地址:
/console/v1/product/:id/config_option
请求参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | int | 是 | - | 商品ID |
| flag | bool | 否 | false | 是否获取隐藏隐藏商品的模块内容(true=是,false=否) |
返回参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| product_name | string | 否 | - | 商品名称 |
| content | string | 否 | - | 模块输出内容 |
修改配置计算价格
版本: v1
接口信息
- 请求方式:
POST - 请求地址:
/console/v1/product/:id/config_option
请求参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | int | 是 | - | 商品ID |
| qty | int | 是 | - | 数量 |
| config_options | array | 否 | - | 模块自定义配置参数,格式{"configoption":{1:1,2:[2]},"cycle":2,"promo_code":"Af13S1ACj","event_promotion":12,"qty":1} |
返回参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| price | string | 否 | - | 价格 |
| renew_price | string | 否 | - | 续费价格 |
| billing_cycle | string | 否 | - | 周期名称d |
| duration | int | 否 | - | 周期时长(秒) |
| description | string | 否 | - | 订单子项描述 |
| base_price | string | 否 | - | 基础价格 |
| price_total | float | 否 | - | 折扣后金额(各种优惠折扣处理后的金额,没有就是price价格) |
| price_promo_code_discount | float | 否 | - | 优惠码折扣金额(当使用优惠码,且有效时,才返回此字段) |
| price_client_level_discount | float | 否 | - | 客户等级折扣金额(当客户等级有效时,才返回此字段) |
| price_event_promotion_discount | float | 否 | - | 活动促销折扣金额(当活动促销有效时,才返回此字段) |
获取商品库存
版本: v1
接口信息
- 请求方式:
GET - 请求地址:
/console/v1/product/:id/stock
请求参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | int | 否 | - | 商品ID |
返回参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| product | object | 否 | - | 商品 |
| product.id | int | 否 | - | ID |
| product.stock_control | int | 否 | - | 库存控制0:关闭1:启用 |
| product.qty | int | 否 | - | 库存数量 |
商品订单页自定义字段
版本: v1
接口信息
- 请求方式:
GET - 请求地址:
/console/v1/product/:id/self_defined_field/order_page
请求参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | int | 是 | - | 商品ID |
返回参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| data[].id | int | 否 | - | 自定义字段ID |
| data[].field_name | string | 否 | - | 字段名称 |
| data[].field_type | string | 否 | - | 字段类型(text=文本框,link=链接,password=密码,dropdown=下拉,checkbox=勾选框,textarea=文本区,explain=说明) |
| data[].description | string | 否 | - | 字段描述 |
| data[].regexpr | string | 否 | - | 验证规则 |
| data[].field_option | string | 否 | - | 下拉选项 |
| data[].is_required | int | 否 | - | 是否必填(0=否,1=是) |
| data[].show_client_host_list | int | 否 | - | 会员中心列表显示(0=否,1=是) |
| data[].explain_content | string | 否 | - | 说明内容 |