create_customer_subscription
Referência da tool create_customer_subscription do MCP Server do bitERP (Assinaturas).
Create Customer Subscription · Assinaturas
| Somente leitura | Destrutiva | Idempotente | Mundo aberto |
|---|---|---|---|
| Não | Não | 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.
Creates a customer subscription with one or more line items.
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. |
customer_id | string (UUID) | Sim | Customer UUID |
financial_account_id | string (UUID) | Sim | Financial account UUID |
financial_category_id | string (UUID) | Não | Optional financial category UUID |
reference_code | string | Não | Optional subscription reference code (must be unique per tenant) |
status | string | Não | Initial status Valores: trialing, active, past_due, paused, canceled. |
billing_mode | string | Não | Billing mode (default internal) Valores: internal, external. |
billing_interval | string | Sim | Billing interval Valores: day, week, month, year. |
billing_interval_count | integer | Não | Billing interval count (default 1) |
billing_cycle_anchor | string (date) | Não | Billing cycle anchor date (YYYY-MM-DD) |
start_date | string (date) | Sim | Subscription start date (YYYY-MM-DD) |
trial_period_days | integer | Não | Trial period in days |
payment_terms_days | integer | Não | Payment terms in days |
description | string | Não | Description |
notes | string | Não | Internal notes |
items | array de objetos | Sim | Subscription line items |
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": "create_customer_subscription",
"arguments": {
"tenant": "minha-empresa",
"customer_id": "<uuid>",
"financial_account_id": "<uuid>",
"billing_interval": "day",
"start_date": "2026-01-15",
"items": [
{
"item_description": "<item_description>",
"unit_price": "100.00"
}
]
}
}
}
