编辑计费账户
接口描述
PATCH /v1/billingaccounts/{billing_account_id}
编辑计费账户
请求参数(Request Parameters)
名称 | 位置 | 类型 | 必须 | 描述 |
---|---|---|---|---|
billing_account_id | path | string | true | 账号ID |
请求体(Request Body)
名称 | 位置 | 类型 | 必须 | 描述 |
---|---|---|---|---|
body | body | UpdateBillingAccount | true | none |
请求示例(Request Example)
curl --request PATCH \
--url https://finance.sensecoreapi.dev/boss/account/v1/billingaccounts/string \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {access-token}' \
--header 'Content-Type: application/json' \
--data '{"id":"string","display_name":"string","credit_line":{"currency_code":"string","units":0,"nanos":0},"threshold_balance":{"currency_code":"string","units":0,"nanos":0},"disable_threshold":true,"threshold_balance2":{"currency_code":"string","units":0,"nanos":0},"threshold_balance3":{"currency_code":"string","units":0,"nanos":0}}'
响应参数(Response Parameters)
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | BillingAccount |
响应示例(Response Example)
200 Response
{
"id": "string",
"name": "string",
"display_name": "string",
"type": "string",
"parent_id": "string",
"state": "BA_UNSPECIFIED",
"auto_pay": true,
"auto_voucher": true,
"allow_arrears": true,
"allow_managed": true,
"credit_line": {
"currency_code": "string",
"units": 0,
"nanos": 0
},
"threshold_balance": {
"currency_code": "string",
"units": 0,
"nanos": 0
},
"owner_id": "string",
"tenant_id": "string",
"escrow_account_id": "string",
"password_pay": "string",
"available_balance": {
"currency_code": "string",
"units": 0,
"nanos": 0
},
"available_credit_limit": {
"currency_code": "string",
"units": 0,
"nanos": 0
},
"available_voucher_number": 0,
"available_coupon_number": 0,
"creator": "string",
"updater": "string",
"create_time": "2019-08-24T14:15:22Z",
"update_time": "2019-08-24T14:15:22Z",
"frozen": {
"currency_code": "string",
"units": 0,
"nanos": 0
},
"currency_code": "string",
"balance": {
"currency_code": "string",
"units": 0,
"nanos": 0
},
"available_contract_number": 0,
"linked_subscription_number": 0,
"disable_threshold": true,
"threshold_balance2": {
"currency_code": "string",
"units": 0,
"nanos": 0
},
"threshold_balance3": {
"currency_code": "string",
"units": 0,
"nanos": 0
},
"arrears": {
"currency_code": "string",
"units": 0,
"nanos": 0
}
}
数据结构(Schemas)
BillingAccount
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
id | string | true | none | 计费账户ID create: not REQUIRED, if not assign id, give "" update: REQUIRED |
name | string | true | none | 计费账户标识 |
display_name | string | true | none | 计费账户名 |
type | string | false | none | 类型,默认、自定义 两种 |
parent_id | string | false | none | 父帐号 ID create: REQUIRED, if no parent, value is "" update: REQUIRED, can be updated |
state | string(enum) | true | none | 账户状态 create: REQUIRED, default value is BA_ACTIVE update: REQUIRED, can be updated |
auto_pay | boolean | true | none | 是否自动支付 |
auto_voucher | boolean | true | none | 是否自动使用代金券 |
allow_arrears | boolean | true | none | 是否允许欠费 |
allow_managed | boolean | true | none | 是否允许被其它帐号管理,查看账单等 |
credit_line | Money | true | none | 价格 |
threshold_balance | Money | true | none | 价格 |
owner_id | string | true | none | 归属人ID |
tenant_id | string | true | none | 租户 ID |
escrow_account_id | string | false | none | 托管账户 账单将由托管账号支付,托管账户拥有管理权 |
password_pay | string | true | none | 支付密码 |
available_balance | Money | false | none | 价格 |
available_credit_limit | Money | false | none | 价格 |
available_voucher_number | integer(int32) | false | read-only | 可用代金券数 |
available_coupon_number | integer(int32) | false | read-only | 可用优惠券数 |
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 | 变更时间 |
frozen | Money | false | none | 价格 |
currency_code | string | true | none | 货币代码 |
balance | Money | false | none | 价格 |
available_contract_number | integer(int32) | false | read-only | 可用合同包数 |
linked_subscription_number | integer(int32) | false | read-only | 关联订阅数 |
disable_threshold | boolean | false | none | 是否关闭余额报警 |
threshold_balance2 | Money | false | none | 价格 |
threshold_balance3 | Money | false | none | 价格 |
arrears | Money | false | none | 价格 |
state Enumerated Values
枚举值 |
---|
BA_UNSPECIFIED |
BA_ACTIVE |
BA_DISABLED |
BA_FROZEN |
Money
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
currency_code | string | false | none | 货币代码, 参考ISO 4217 |
units | integer(int64) | false | none | 价格整数部分 |
nanos | integer(int32) | false | none | 价格小数部分 |
UpdateBillingAccount
名称 | 类型 | 必须 | 限制 | 描述 |
---|---|---|---|---|
id | string | true | none | 计费账户ID create: not REQUIRED, if not assign id, give "" update: REQUIRED |
display_name | string | true | none | 计费账户名 |
credit_line | Money | true | none | 价格 |
threshold_balance | Money | true | none | 价格 |
disable_threshold | boolean | false | none | 是否关闭余额报警 |
threshold_balance2 | Money | false | none | 价格 |
threshold_balance3 | Money | false | none | 价格 |