biterp

get_credit_card_open_statement

Referência da tool get_credit_card_open_statement do MCP Server do bitERP (Faturas de cartão).

Get Credit Card Open Statement · Faturas de cartão

Somente leituraDestrutivaIdempotenteMundo aberto
SimNãoSimNã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.

Returns the credit card statement still being formed for one card: period, expected due date, number of purchases and the forming total (what the card owes minus what is already billed in earlier unpaid statements). The total can change until the statement is closed; zero or negative means nothing to pay this cycle. Purchases of an open statement are not returned by list_payables; this is where they are. A statement takes the purchases from period_start to period_end; it closes on closes_on (period_end + 1 day), and a purchase made on the closing day already goes to the next statement. Never add a statement total to the card account balance: they are the same debt on two axes. Read only: closing, paying or reopening a statement is done in the bitERP web app. Find the card with list_financial_accounts type=credit_card.

Parâmetros

ParâmetroTipoObrigatórioDescrição
tenantstringSimDefines 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.
card_account_idstring (UUID)SimThe credit card account ID. Find it with list_financial_accounts (type credit_card).

Resposta

O structuredContent da resposta traz os campos abaixo (até dois níveis; o schema completo está no outputSchema publicado no tools/list).

CampoTipoDescrição
cardobject—
card.idstring (UUID)—
card.namestring—
card.last_four_digitsstring ou nullLast four digits of the card, when registered
statementobject ou null—
statement.statement_idstring (UUID)Id of the statement payable: pass it to list_credit_card_statement_purchases
statement.record_numberintegerTenant-scoped sequential number of the statement payable, shown in bitERP as CPG-<n> for Brazilian companies (prefix depends on the tenant country)
statement.period_startstring (date)—
statement.period_endstring (date)Last day whose purchases go to this statement: the eve of the closing day
statement.closes_onstring (date)Planned closing day (period_end + 1 day). A purchase made on this day already goes to the next statement
statement.due_datestring (date)Expected due date; can still change until the statement is closed
statement.forming_totalstringWhat the card owes up to as_of_date minus what earlier unpaid statements already bill. Can change until the statement is closed; zero or negative = nothing to pay this cycle
statement.previous_open_balancestringOpen balance of earlier closed statements, read at as_of_date: already subtracted from forming_total
statement.as_of_datestring (date)Cut-off date used for forming_total
statement.purchases_countinteger—
statement.awaiting_closebooleanThe planned closing day has arrived and the statement is waiting to be closed in the bitERP web app
statement.breakdownobjectComposition of forming_total (DEV-1087): debits + credits + advance_payments + carry_over
statement.advance_paymentsobjectAdvance payment legs of this statement in formation (active inbound transfers that do not pay another card statement)
reasonstringPresent when statement is null: no entry opened the statement of the current cycle yet

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": "get_credit_card_open_statement",
        "arguments": {
            "tenant": "minha-empresa",
            "card_account_id": "<uuid>"
        }
    }
}

Nesta página