获取合同包列表
接口描述
GET /v1/resourcepackages/contracts
获取合同包列表
请求头(Request Header)
请求参数(Request Parameters)
名称 | 位置 | 类型 | 必须 | 描述 |
---|---|---|---|---|
sku_id | query | string | false | 规格ID |
effective_state | query | string | false | 生效状态 待生效 FUTURE 、有效 VALID、失效 EXPIRED |
filter | query | string | false | 筛选条件 支持 合同包ID/编号/名称 例如: start_date>='2024-01-08T16:00:00Z' AND end_date<='2024-01-18T15:59:59Z' AND display_name="1" |
order_by | query | string | false | 排序 |
page_size | query | integer(int32) | false | 分页大小 |
page_token | query | string | false | 分页页码 |
请求体(Request Body)
无
请求示例(Request Example)
curl --request GET \
--url https://finance.sensecoreapi.dev/boss/account/v1/resourcepackages/contracts \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}'
响应参数(Response Parameters)
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | ListResourcePackagesContractsResponse |
响应示例(Response Example)
200 Response
{
"contracts": [
{
"id": "string",
"display_name": "string",
"type": "string",
"original_id": "string",
"contract_no": "string",
"contract_name": "string",
"original_amount": 0,
"amount": 0,
"sku_amount_money": {
"currency_code": "string",
"units": 0,
"nanos": 0
},
"user_amount_money": {
"currency_code": "string",
"units": 0,
"nanos": 0
},
"state": "PENDING",
"start_date_time": "2019-08-24T14:15:22Z",
"end_date_time": "2019-08-24T14:15:22Z",
"tenant_id": "string",
"tenant_name": "string",
"tenant_code": "string",
"customer_type": "string",
"details": [
{
"id": "string",
"contract_id": "string",
"sku_id": "string",
"sku_name": "string",
"sku": {
"spu_id": "string",
"id": "string",
"display_name": "string",
"regions": [
"string"
],
"available_zones": [
"string"
],
"business_billing_cycle": "BBC_UNSPECIFIED",
"billing_cycle": "BC_UNSPECIFIED",
"billing_cycle_number": 0,
"payment_model": "PM_UNSPECIFIED",
"billing_model": "BM_UNSPECIFIED",
"price_model": "PIM_UNSPECIFIED",
"price": [
{
"tier": 0,
"name": "string",
"max_value": 0,
"money": [
{
"currency_code": "string",
"units": 0,
"nanos": 0
}
]
}
],
"price_unit": "string",
"price_scale": 0,
"stock": 0,
"stock_unit": "string",
"discount": 0,
"max_quantity": 0,
"min_quantity": 0,
"have_trial": true,
"trial_count": 0,
"trial_unit": "string",
"effective_time": "2019-08-24T14:15:22Z",
"ineffective_time": "2019-08-24T14:15:22Z",
"one_time": true,
"cancel_policy": "SP_UNSPECIFIED",
"actions": [
"string"
],
"tags": [
"string"
],
"excess_sku_id": "string",
"attributes": [
{
"attribute_id": "string",
"display_name": "string",
"property_name": "string",
"value": "string",
"value_unit": "string",
"value_scale": 0,
"attribute_value_id": "string",
"attribute_type": "ATT_KEY"
}
],
"status": "ST_UNSPECIFIED",
"spu_name": "string",
"sku_billing_items": [
{
"id": "string",
"sku_id": "string",
"attribute_id": "string",
"display_name": "string",
"property_name": "string",
"value_unit": "string",
"price_model": "PIM_UNSPECIFIED",
"price": [
{
"tier": 0,
"name": "string",
"max_value": 0,
"money": []
}
],
"price_unit": "string",
"price_scale": 0,
"stock": 0,
"stock_unit": "string",
"max_quantity": 0,
"min_quantity": 0,
"value_scales": [
{
"value_unit": "string",
"value_scale": 0,
"attribute_value_id": "string"
}
],
"status": "ST_UNSPECIFIED",
"discount": 0,
"creator": "string",
"updater": "string",
"create_time": "2019-08-24T14:15:22Z",
"update_time": "2019-08-24T14:15:22Z",
"meter_unit": "string"
}
],
"creator": "string",
"updater": "string",
"create_time": "2019-08-24T14:15:22Z",
"update_time": "2019-08-24T14:15:22Z",
"meter_unit": "string",
"usage_scope_type": "UST_UST_UNSPECIFIED",
"usage_scope_tenant_ids": [
"string"
],
"usage_scope_editable": true
},
"spu_id": "string",
"spu_name": "string",
"resource_type": "string",
"region": "string",
"zone": "string",
"number": 0,
"available_number": 0,
"billing_items": [
{
"id": "string",
"contract_detail_id": "string",
"billing_item_id": "string",
"billing_item_key": "string",
"billing_item_name": "string",
"value": 0,
"available_value": 0,
"value_unit": "string",
"sku_id": "string",
"sku_billing_item": {
"id": "string",
"sku_id": "string",
"attribute_id": "string",
"display_name": "string",
"property_name": "string",
"value_unit": "string",
"price_model": "PIM_UNSPECIFIED",
"price": [
{
"tier": 0,
"name": "string",
"max_value": 0,
"money": []
}
],
"price_unit": "string",
"price_scale": 0,
"stock": 0,
"stock_unit": "string",
"max_quantity": 0,
"min_quantity": 0,
"value_scales": [
{
"value_unit": "string",
"value_scale": 0,
"attribute_value_id": "string"
}
],
"status": "ST_UNSPECIFIED",
"discount": 0,
"creator": "string",
"updater": "string",
"create_time": "2019-08-24T14:15:22Z",
"update_time": "2019-08-24T14:15:22Z",
"meter_unit": "string"
},
"amount": 0,
"user_amount": 0,
"creator": "string",
"updater": "string",
"create_time": "2019-08-24T14:15:22Z",
"update_time": "2019-08-24T14:15:22Z",
"creator_name": "string",
"updater_name": "string"
}
],
"amount": 0,
"user_amount": 0,
"length": 0,
"creator": "string",
"updater": "string",
"create_time": "2019-08-24T14:15:22Z",
"update_time": "2019-08-24T14:15:22Z",
"creator_name": "string",
"updater_name": "string",
"start_time": "2019-08-24T14:15:22Z",
"end_time": "2019-08-24T14:15:22Z"
}
],
"contract_proof": "string",
"contract_proof_count": 0,
"additional_count": 0,
"effective_state": "FUTURE",
"creator": "string",
"updater": "string",
"create_time": "2019-08-24T14:15:22Z",
"update_time": "2019-08-24T14:15:22Z",
"creator_name": "string",
"updater_name": "string",
"contract_version": "V1"
}
],
"next_page_token": "string",
"total_size": 0,
"page_number": 0,
"page_size": 0
}
数据结构(Schemas)
Contract
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
id | string | false | read-only | ID |
display_name | string | true | none | 合同包名称 |
type | string | false | none | 合同包类型,CT_ORIGINAL 原始、CT_ADDITIONAL 补充 |
original_id | string | false | none | 补充合同包的原始合同包ID,默认为空 |
contract_no | string | true | none | 线下合同编号 |
contract_name | string | true | none | 线下合同名称 |
original_amount | integer(int64) | false | none | 原价(目录价) |
amount | integer(int64) | true | none | 金额,合同价(成交价) |
sku_amount_money | Money | false | none | 价格 |
user_amount_money | Money | false | none | 价格 |
state | string(enum) | false | none | 状态 |
start_date_time | string(date-time) | true | none | 有效期-开始日期 |
end_date_time | string(date-time) | true | none | 有效期-结束日期 |
tenant_id | string | true | none | 租户 UUID |
tenant_name | string | false | read-only | 租户 名称 |
tenant_code | string | false | read-only | 租户 标识 |
customer_type | string | false | read-only | 客户类型 |
details | [ContractDetail] | true | none | 商品明细信息 |
contract_proof | string | false | none | 合同凭证 |
contract_proof_count | integer(int32) | false | read-only | 合同凭证数量 |
additional_count | integer(int32) | false | read-only | 主合同包关联的补充合同包数量 |
effective_state | string(enum) | false | read-only | 状态,有三种:待生效 FUTURE 、有效 VALID、失效 EXPIRED |
creator | string | false | read-only | 创建者 ID |
updater | string | false | read-only | 更新者 ID output only |
create_time | string(date-time) | false | read-only | 创建时间 output only |
update_time | string(date-time) | false | read-only | 更新时间 output only |
creator_name | string | false | read-only | 创建人 |
updater_name | string | false | read-only | 更新人 |
contract_version | string(enum) | false | read-only | 合同版本 |
state Enumerated Values
枚举值 |
---|
PENDING |
COMMITTED |
DELIVERED |
CONSIGN |
TERMINATE |
FUTURE |
VALID |
EXPIRED |
V1 |
V2 |
ContractDetail
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
id | string | false | read-only | none |
contract_id | string | false | read-only | 合同包ID |
sku_id | string | true | none | none |
sku_name | string | false | read-only | none |
sku | Sku | false | none | 最小库存单元 |
spu_id | string | true | none | none |
spu_name | string | false | read-only | none |
resource_type | string | false | read-only | none |
region | string | true | none | none |
zone | string | true | none | none |
number | integer(int32) | true | none | none |
available_number | integer(int32) | false | read-only | none |
billing_items | [ContractDetailBillingItem] | false | none | [合同包计费项目] |
amount | integer(int64) | false | read-only | 目录价 |
user_amount | integer(int64) | true | none | 成交价 |
length | integer(int32) | true | none | 购买时长,仅用于计算合同包参考价格 |
creator | string | false | read-only | none |
updater | string | false | read-only | output only |
create_time | string(date-time) | false | read-only | output only |
update_time | string(date-time) | false | read-only | output only |
creator_name | string | false | read-only | none |
updater_name | string | false | read-only | none |
start_time | string(date-time) | false | read-only | output only |
end_time | string(date-time) | false | read-only | output only |
ContractDetailBillingItem
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
id | string | false | read-only | none |
contract_detail_id | string | false | read-only | 合同包详情ID |
billing_item_id | string | true | none | none |
billing_item_key | string | true | none | none |
billing_item_name | string | false | read-only | none |
value | integer(int64) | true | none | none |
available_value | integer(int64) | false | read-only | none |
value_unit | string | true | none | none |
sku_id | string | false | read-only | 规格ID |
sku_billing_item | SkuBillingItem | false | none | 计费项 |
amount | integer(int64) | false | read-only | 目录价 |
user_amount | integer(int64) | true | none | 成交价 |
creator | string | false | read-only | none |
updater | string | false | read-only | output only |
create_time | string(date-time) | false | read-only | output only |
update_time | string(date-time) | false | read-only | output only |
creator_name | string | false | read-only | none |
updater_name | string | false | read-only | none |
ListResourcePackagesContractsResponse
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
contracts | [Contract] | false | none | 合同包列表 |
next_page_token | string | false | none | 下一页页码 |
total_size | integer(int32) | false | none | 总记录数 |
page_number | integer(int32) | false | none | 当前页码 |
page_size | integer(int32) | false | none | 分页大小 |
Money
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
currency_code | string | false | none | 货币代码, 参考ISO 4217 |
units | integer(int64) | false | none | 价格整数部分 |
nanos | integer(int32) | false | none | 价格小数部分 |
Price
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
tier | integer(int32) | false | none | 层次 |
name | string | false | none | 层次名称 |
max_value | integer(int64) | false | none | 每层最大值 |
money | [Money] | false | none | 价格 |
Sku
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
spu_id | string | true | none | 隶属标准化产品单元id |
id | string | false | read-only | 最小库存单元id |
display_name | string | true | none | 最小库存单元名称 |
regions | [string] | true | none | 可售卖区域 |
available_zones | [string] | true | none | 可售卖可用区 |
business_billing_cycle | string(enum) | true | none | 计费周期, 默认每小时; |
billing_cycle | string(enum) | true | none | 账单周期, 默认按月出账; |
billing_cycle_number | integer(int32) | true | none | 账单周期数 |
payment_model | string(enum) | true | none | 付费模式 |
billing_model | string(enum) | true | none | 计费模式 |
price_model | string(enum) | true | none | 计费模型 |
price | [Price] | true | none | 价格 |
price_unit | string | true | none | 价格单位 |
price_scale | integer(int64) | true | none | 价格上报尺度 |
stock | integer(int64) | true | none | 库存数量 |
stock_unit | string | true | none | 库存单位 |
discount | integer(int32) | true | none | 折扣, 从0-100, 100表示不打折 |
max_quantity | integer(int64) | false | none | 最多可售卖数量 |
min_quantity | integer(int64) | false | none | 最少可售卖数量 |
have_trial | boolean | false | none | 是否含有试用期 |
trial_count | integer(int64) | false | none | 试用数量 |
trial_unit | string | false | none | 试用单位 |
effective_time | string(date-time) | true | none | 生效时间(已弃用) |
ineffective_time | string(date-time) | true | none | 失效时间(已弃用) |
one_time | boolean | false | none | 是否只能购买一次 |
cancel_policy | string(enum) | false | none | 退订规则 |
actions | [string] | false | none | 此字段已弃用 |
tags | [string] | false | none | 此字段已弃用 |
excess_sku_id | string | false | none | 此字段已弃用 |
attributes | [SkuAttribute] | false | none | 关联的规格和描述属性 |
status | string(enum) | false | read-only | 上下架状态 |
spu_name | string | false | read-only | 关联的标准化产品单元名称 |
sku_billing_items | [SkuBillingItem] | true | none | 关联的计费项 |
creator | string | false | read-only | 创建者id |
updater | string | false | read-only | 更新者id |
create_time | string(date-time) | false | read-only | 创建时间 |
update_time | string(date-time) | false | read-only | 更新时间 |
meter_unit | string | true | none | 计量上报单位 |
usage_scope_type | string(enum) | false | none | 适用类型 |
usage_scope_tenant_ids | [string] | false | none | 适用租户IDs |
usage_scope_editable | boolean | false | none | 适用是否可编辑 |
business_billing_cycle Enumerated Values
枚举值 |
---|
BBC_UNSPECIFIED |
BBC_HOURLY |
BBC_DAILY |
BBC_WEEKLY |
BBC_MONTHLY |
BBC_QUARTERLY |
BBC_YEARLY |
BC_UNSPECIFIED |
BC_HOURLY |
BC_DAILY |
BC_WEEKLY |
BC_MONTHLY |
BC_QUARTERLY |
BC_YEARLY |
PM_UNSPECIFIED |
PM_PREPAID |
PM_POSTPAID |
BM_UNSPECIFIED |
BM_USAGE |
BM_MONTHLY |
BM_YEARLY |
PIM_UNSPECIFIED |
PIM_FLATFEE |
PIM_PERUNIT |
PIM_TIERED |
PIM_VOLUME |
PIM_STAIRSTEP |
SP_UNSPECIFIED |
SP_IMMEDIATELY |
SP_ENDOFTERM |
SP_UNCONDITIONALLY_REFUND |
SP_NONREFUNDABLE |
ST_UNSPECIFIED |
ST_RELEASE |
ST_UNRELEASED |
UST_UST_UNSPECIFIED |
UST_PUBLIC |
UST_SPECIFIED |
SkuAttribute
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
attribute_id | string | false | none | 属性id |
display_name | string | false | none | 属性名称 |
property_name | string | false | none | 属性后端名称 |
value | string | false | none | 属性值 |
value_unit | string | false | none | 属性单位 |
value_scale | integer(int64) | false | none | value scale |
attribute_value_id | string | false | none | 属性值id |
attribute_type | string(enum) | false | none | 属性类型 |
attribute_type Enumerated Values
枚举值 |
---|
ATT_KEY |
ATT_SPEC |
ATT_DESCRIPTION |
ATT_BILLING_ITEM |
SkuBillingItem
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
id | string | true | none | 计费项id |
sku_id | string | true | none | 最小库存单元id |
attribute_id | string | true | none | 关联计费属性id |
display_name | string | false | read-only | 计费项名称 |
property_name | string | false | read-only | 属性后端名称 |
value_unit | string | true | none | 属性单位 |
price_model | string(enum) | true | none | 价格模型 |
price | [Price] | true | none | 价格 |
price_unit | string | true | none | 价格单位 |
price_scale | integer(int64) | true | none | 价格尺度 |
stock | integer(int64) | true | none | 库存 |
stock_unit | string | true | none | 库存单位 |
max_quantity | integer(int64) | true | none | 计费项数量上限 |
min_quantity | integer(int64) | true | none | 计费项数量下限 |
value_scales | [ValueScale] | false | read-only | 单位换算关系 |
status | string(enum) | true | none | 状态 |
discount | integer(int32) | true | none | 折扣 |
creator | string | false | read-only | 创建者 |
updater | string | false | read-only | 更新者 |
create_time | string(date-time) | false | read-only | 创建时间 |
update_time | string(date-time) | false | read-only | 更新时间 |
meter_unit | string | true | none | 计量上报单位 |
price_model Enumerated Values
枚举值 |
---|
PIM_UNSPECIFIED |
PIM_FLATFEE |
PIM_PERUNIT |
PIM_TIERED |
PIM_VOLUME |
PIM_STAIRSTEP |
ST_UNSPECIFIED |
ST_RELEASE |
ST_UNRELEASED |
ValueScale
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
value_unit | string | false | none | 属性单位 |
value_scale | integer(int64) | false | none | 换算倍数 |
attribute_value_id | string | false | none | 属性值id |