update_customer_subscription
Referência da tool update_customer_subscription do MCP Server do bitERP (Assinaturas).
Update Customer Subscription · Assinaturas
| Somente leitura | Destrutiva | Idempotente | Mundo aberto |
|---|---|---|---|
| Não | Sim | Não | Não |
Descrição
A descrição abaixo é a que o servidor publica, em inglês, e é o texto que o agente lê para decidir quando usar a tool.
Updates an existing customer subscription. Only provided fields will be updated.
Parâmetros
| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
tenant | string | Sim | Defines which tenant will have data read or changed. Use list_tenants first and prefer the returned tenant slug. Writes are permanent, so when the user has more than one tenant you must confirm the tenant before any write and never assume or reuse a previous choice without confirmation. UUID is accepted only when already known safely. |
id | string (UUID) | Sim | Customer subscription UUID |
financial_account_id | string (UUID) | Não | Financial account UUID |
financial_category_id | string (UUID) ou null | Não | Financial category UUID (null to clear) |
reference_code | string ou null | Não | Reference code (null to clear) |
billing_mode | string | Não | Billing mode Valores: internal, external. |
billing_interval | string | Não | Billing interval Valores: day, week, month, year. |
billing_interval_count | integer | Não | Billing interval count |
billing_cycle_anchor | string (date) ou null | Não | Billing cycle anchor date (YYYY-MM-DD) |
payment_terms_days | integer | Não | Payment terms in days |
description | string ou null | Não | Description |
notes | string ou null | Não | Internal notes |
items | array de objetos | Não | Subscription line items to reconcile |
items[].subscription_plan_id | string (UUID) | Não | Linked subscription plan UUID |
items[].product_id | string (UUID) | Não | Linked product UUID (required if subscription_plan_id is omitted) |
items[].item_description | string | Sim | Line item description |
items[].quantity | decimal (string ou number) | Não | Quantity as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted, must be > 0 (default "1") |
items[].unit_price | decimal (string ou number) | Sim | Unit price as decimal string (numeric(18,6), e.g. "1500.000000"); a JSON number with at most 6 decimals is also accepted, must be non-negative |
items[].discount_rate | decimal (string ou number) | Não | Discount rate as decimal string on the 0-100 percentage scale (e.g. "10" = 10%, "0.5" = half a percent); a JSON number on the same scale is also accepted; default "0" |
Resposta
O structuredContent da resposta traz os campos abaixo (até dois níveis; o schema completo está no outputSchema publicado no tools/list).
| Campo | Tipo | Descrição |
|---|---|---|
id | string (UUID) | — |
tenant_id | string (UUID) | — |
record_number | integer | — |
customer_id | string (UUID) | — |
financial_account_id | string (UUID) | — |
financial_category_id | string (UUID) ou null | — |
reference_code | string ou null | — |
status | string | Valores: trialing, active, past_due, paused, canceled. |
billing_mode | string | Valores: internal, external. |
billing_interval | string | Valores: day, week, month, year. |
billing_interval_count | integer | — |
currency | string | — |
billing_cycle_anchor | string (date) ou null | — |
current_period_start | string (date) ou null | — |
current_period_end | string (date) ou null | — |
next_billing_date | string (date) ou null | — |
trial_end | string (date) ou null | — |
start_date | string (date) | — |
payment_terms_days | integer | — |
cancel_at_period_end | boolean | — |
canceled_at | string (date-time) ou null | — |
paused_at | string (date-time) ou null | — |
ended_at | string (date-time) ou null | — |
description | string ou null | — |
notes | string ou null | — |
metadata | object | — |
created_at | string (date-time) | — |
updated_at | string (date-time) | — |
deleted_at | string (date-time) ou null | — |
items | array de objetos | — |
items[].id | string (UUID) | — |
items[].tenant_id | string (UUID) | — |
items[].subscription_id | string (UUID) | — |
items[].subscription_plan_id | string (UUID) ou null | — |
items[].product_id | string (UUID) ou null | — |
items[].item_description | string | — |
items[].quantity | string | — |
items[].unit_price | string | — |
items[].discount_rate | string | — |
items[].position | integer | — |
items[].created_at | string (date-time) | — |
items[].updated_at | string (date-time) | — |
items[].deleted_at | string (date-time) ou null | — |
latest_billing_cycle | object ou null | — |
latest_billing_cycle.id | string (UUID) | — |
latest_billing_cycle.tenant_id | string (UUID) | — |
latest_billing_cycle.subscription_id | string (UUID) | — |
latest_billing_cycle.sequence | integer | — |
latest_billing_cycle.period_start | string (date) | — |
latest_billing_cycle.period_end | string (date) | — |
latest_billing_cycle.status | string | — |
latest_billing_cycle.amount | string | — |
latest_billing_cycle.currency | string | — |
latest_billing_cycle.sales_order_id | string (UUID) ou null | — |
latest_billing_cycle.receivable_id | string (UUID) ou null | — |
latest_billing_cycle.external_invoice_id | string ou null | — |
latest_billing_cycle.external_idempotency_key | string ou null | — |
latest_billing_cycle.external_event_id | string ou null | — |
latest_billing_cycle.billed_at | string (date-time) ou null | — |
latest_billing_cycle.error_detail | string ou null | — |
latest_billing_cycle.metadata | object | — |
latest_billing_cycle.created_at | string (date-time) | — |
latest_billing_cycle.updated_at | string (date-time) | — |
dunning_suspend_after_days | integer | — |
dunning_billing_suspended | boolean | — |
managed_by_integration | boolean | — |
_tenant | object | — |
_tenant.id | string (UUID) | — |
_tenant.slug | string | — |
_tenant.company_name | string | — |
Exemplo de chamada
Requisição tools/call com os parâmetros obrigatórios. Os valores são ilustrativos: troque minha-empresa pelo tenant devolvido por list_tenants e cada <...> por um valor real.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "update_customer_subscription",
"arguments": {
"tenant": "minha-empresa",
"id": "<uuid>"
}
}
}
