获取合同包列表 | 大装置帮助中心
跳到主要内容

获取合同包列表

接口描述

GET /v1/resourcepackages/contracts 获取合同包列表

请求头(Request Header)

参考认证(authentication)

请求参数(Request Parameters)

名称位置类型必须描述
sku_idquerystringfalse规格ID
effective_statequerystringfalse生效状态 待生效 FUTURE 、有效 VALID、失效 EXPIRED
filterquerystringfalse筛选条件 支持 合同包ID/编号/名称 例如: start_date>='2024-01-08T16:00:00Z' AND end_date<='2024-01-18T15:59:59Z' AND display_name="1"
order_byquerystringfalse排序
page_sizequeryinteger(int32)false分页大小
page_tokenquerystringfalse分页页码

请求体(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)

StatusMeaningDescriptionSchema
200OKOKListResourcePackagesContractsResponse

响应示例(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

名称类型必须限制描述
idstringfalseread-onlyID
display_namestringtruenone合同包名称
typestringfalsenone合同包类型,CT_ORIGINAL 原始、CT_ADDITIONAL 补充
original_idstringfalsenone补充合同包的原始合同包ID,默认为空
contract_nostringtruenone线下合同编号
contract_namestringtruenone线下合同名称
original_amountinteger(int64)falsenone原价(目录价)
amountinteger(int64)truenone金额,合同价(成交价)
sku_amount_moneyMoneyfalsenone价格
user_amount_moneyMoneyfalsenone价格
statestring(enum)falsenone状态
start_date_timestring(date-time)truenone有效期-开始日期
end_date_timestring(date-time)truenone有效期-结束日期
tenant_idstringtruenone租户 UUID
tenant_namestringfalseread-only租户 名称
tenant_codestringfalseread-only租户 标识
customer_typestringfalseread-only客户类型
details[ContractDetail]truenone商品明细信息
contract_proofstringfalsenone合同凭证
contract_proof_countinteger(int32)falseread-only合同凭证数量
additional_countinteger(int32)falseread-only主合同包关联的补充合同包数量
effective_statestring(enum)falseread-only状态,有三种:待生效 FUTURE 、有效 VALID、失效 EXPIRED
creatorstringfalseread-only创建者 ID
updaterstringfalseread-only更新者 ID output only
create_timestring(date-time)falseread-only创建时间 output only
update_timestring(date-time)falseread-only更新时间 output only
creator_namestringfalseread-only创建人
updater_namestringfalseread-only更新人
contract_versionstring(enum)falseread-only合同版本

state Enumerated Values

枚举值
PENDING
COMMITTED
DELIVERED
CONSIGN
TERMINATE
FUTURE
VALID
EXPIRED
V1
V2

ContractDetail

名称类型必须限制描述
idstringfalseread-onlynone
contract_idstringfalseread-only合同包ID
sku_idstringtruenonenone
sku_namestringfalseread-onlynone
skuSkufalsenone最小库存单元
spu_idstringtruenonenone
spu_namestringfalseread-onlynone
resource_typestringfalseread-onlynone
regionstringtruenonenone
zonestringtruenonenone
numberinteger(int32)truenonenone
available_numberinteger(int32)falseread-onlynone
billing_items[ContractDetailBillingItem]falsenone[合同包计费项目]
amountinteger(int64)falseread-only目录价
user_amountinteger(int64)truenone成交价
lengthinteger(int32)truenone购买时长,仅用于计算合同包参考价格
creatorstringfalseread-onlynone
updaterstringfalseread-onlyoutput only
create_timestring(date-time)falseread-onlyoutput only
update_timestring(date-time)falseread-onlyoutput only
creator_namestringfalseread-onlynone
updater_namestringfalseread-onlynone
start_timestring(date-time)falseread-onlyoutput only
end_timestring(date-time)falseread-onlyoutput only

ContractDetailBillingItem

名称类型必须限制描述
idstringfalseread-onlynone
contract_detail_idstringfalseread-only合同包详情ID
billing_item_idstringtruenonenone
billing_item_keystringtruenonenone
billing_item_namestringfalseread-onlynone
valueinteger(int64)truenonenone
available_valueinteger(int64)falseread-onlynone
value_unitstringtruenonenone
sku_idstringfalseread-only规格ID
sku_billing_itemSkuBillingItemfalsenone计费项
amountinteger(int64)falseread-only目录价
user_amountinteger(int64)truenone成交价
creatorstringfalseread-onlynone
updaterstringfalseread-onlyoutput only
create_timestring(date-time)falseread-onlyoutput only
update_timestring(date-time)falseread-onlyoutput only
creator_namestringfalseread-onlynone
updater_namestringfalseread-onlynone

ListResourcePackagesContractsResponse

名称类型必须限制描述
contracts[Contract]falsenone合同包列表
next_page_tokenstringfalsenone下一页页码
total_sizeinteger(int32)falsenone总记录数
page_numberinteger(int32)falsenone当前页码
page_sizeinteger(int32)falsenone分页大小

Money

名称类型必须限制描述
currency_codestringfalsenone货币代码, 参考ISO 4217
unitsinteger(int64)falsenone价格整数部分
nanosinteger(int32)falsenone价格小数部分

Price

名称类型必须限制描述
tierinteger(int32)falsenone层次
namestringfalsenone层次名称
max_valueinteger(int64)falsenone每层最大值
money[Money]falsenone价格

Sku

名称类型必须限制描述
spu_idstringtruenone隶属标准化产品单元id
idstringfalseread-only最小库存单元id
display_namestringtruenone最小库存单元名称
regions[string]truenone可售卖区域
available_zones[string]truenone可售卖可用区
business_billing_cyclestring(enum)truenone计费周期, 默认每小时;
billing_cyclestring(enum)truenone账单周期, 默认按月出账;
billing_cycle_numberinteger(int32)truenone账单周期数
payment_modelstring(enum)truenone付费模式
billing_modelstring(enum)truenone计费模式
price_modelstring(enum)truenone计费模型
price[Price]truenone价格
price_unitstringtruenone价格单位
price_scaleinteger(int64)truenone价格上报尺度
stockinteger(int64)truenone库存数量
stock_unitstringtruenone库存单位
discountinteger(int32)truenone折扣, 从0-100, 100表示不打折
max_quantityinteger(int64)falsenone最多可售卖数量
min_quantityinteger(int64)falsenone最少可售卖数量
have_trialbooleanfalsenone是否含有试用期
trial_countinteger(int64)falsenone试用数量
trial_unitstringfalsenone试用单位
effective_timestring(date-time)truenone生效时间(已弃用)
ineffective_timestring(date-time)truenone失效时间(已弃用)
one_timebooleanfalsenone是否只能购买一次
cancel_policystring(enum)falsenone退订规则
actions[string]falsenone此字段已弃用
tags[string]falsenone此字段已弃用
excess_sku_idstringfalsenone此字段已弃用
attributes[SkuAttribute]falsenone关联的规格和描述属性
statusstring(enum)falseread-only上下架状态
spu_namestringfalseread-only关联的标准化产品单元名称
sku_billing_items[SkuBillingItem]truenone关联的计费项
creatorstringfalseread-only创建者id
updaterstringfalseread-only更新者id
create_timestring(date-time)falseread-only创建时间
update_timestring(date-time)falseread-only更新时间
meter_unitstringtruenone计量上报单位
usage_scope_typestring(enum)falsenone适用类型
usage_scope_tenant_ids[string]falsenone适用租户IDs
usage_scope_editablebooleanfalsenone适用是否可编辑

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_idstringfalsenone属性id
display_namestringfalsenone属性名称
property_namestringfalsenone属性后端名称
valuestringfalsenone属性值
value_unitstringfalsenone属性单位
value_scaleinteger(int64)falsenonevalue scale
attribute_value_idstringfalsenone属性值id
attribute_typestring(enum)falsenone属性类型

attribute_type Enumerated Values

枚举值
ATT_KEY
ATT_SPEC
ATT_DESCRIPTION
ATT_BILLING_ITEM

SkuBillingItem

名称类型必须限制描述
idstringtruenone计费项id
sku_idstringtruenone最小库存单元id
attribute_idstringtruenone关联计费属性id
display_namestringfalseread-only计费项名称
property_namestringfalseread-only属性后端名称
value_unitstringtruenone属性单位
price_modelstring(enum)truenone价格模型
price[Price]truenone价格
price_unitstringtruenone价格单位
price_scaleinteger(int64)truenone价格尺度
stockinteger(int64)truenone库存
stock_unitstringtruenone库存单位
max_quantityinteger(int64)truenone计费项数量上限
min_quantityinteger(int64)truenone计费项数量下限
value_scales[ValueScale]falseread-only单位换算关系
statusstring(enum)truenone状态
discountinteger(int32)truenone折扣
creatorstringfalseread-only创建者
updaterstringfalseread-only更新者
create_timestring(date-time)falseread-only创建时间
update_timestring(date-time)falseread-only更新时间
meter_unitstringtruenone计量上报单位

price_model Enumerated Values

枚举值
PIM_UNSPECIFIED
PIM_FLATFEE
PIM_PERUNIT
PIM_TIERED
PIM_VOLUME
PIM_STAIRSTEP
ST_UNSPECIFIED
ST_RELEASE
ST_UNRELEASED

ValueScale

名称类型必须限制描述
value_unitstringfalsenone属性单位
value_scaleinteger(int64)falsenone换算倍数
attribute_value_idstringfalsenone属性值id