biterp

create_credit_card_purchase_from_line

Referência da tool create_credit_card_purchase_from_line do MCP Server do bitERP (Conciliação da fatura de cartão).

Create Credit Card Purchase from Line · Conciliação da fatura de cartão

Somente leituraDestrutivaIdempotenteMundo aberto
NãoSimSimNã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 card purchase from a debit line already on the credit card (bank connection, OFX, PDF import or a manual debit) and links the line to it, which reconciles the line. Amount and date come from the line; the purchase goes to the oldest open statement and copies its due date. Use it for a pending line whose card_match state is none (Sem compra). Never create it on your own: propose supplier, category and description, and wait for the user to approve. Only lines of the open statement can change: a closed statement neither receives nor loses anything, and the tool refuses its lines.

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.
transaction_idstring (UUID)SimThe debit line of the card that becomes the purchase (lines[].id of get_credit_card_statement_reconciliation)
supplier_idstring (UUID)SimSupplier of the purchase. Find it with list_suppliers.
financial_category_idstring (UUID)NãoExpense category of the purchase. Find it with list_financial_categories.
descriptionstringNãoDescription of the purchase
notesstringNãoInternal notes
reference_codestringNãoReference code of the purchase
payment_method_idstring (UUID)NãoPayment method. Defaults to the tenant country's credit card payment method.
installment_countintegerNãoNumber of installments of the purchase. With 2 or more, the line is installment installment_number, and each later installment (same amount as the line) goes to the statement of the following cycle.
installment_numberintegerNãoWhich installment the line is (1 when omitted). Requires installment_count of at least 2.

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
payableobjectThe purchase (installment 1 of an installment purchase)
payable.idstring (UUID)—
payable.tenant_idstring (UUID)—
payable.record_numberinteger—
payable.supplier_idstring (UUID) ou null—
payable.supplierobject ou null—
payable.financial_account_idstring (UUID)—
payable.financial_accountobject ou null—
payable.payment_method_idstring (UUID) ou null—
payable.payment_methodobject ou null—
payable.financial_category_idstring (UUID) ou null—
payable.financial_categoryobject ou null—
payable.account_scope_maskobject—
payable.purchase_invoice_idstring (UUID) ou null—
payable.purchase_invoiceobject ou null—
payable.parent_payable_idstring (UUID) ou null—
payable.parentany ou null—
payable.statement_payable_idstring (UUID) ou null—
payable.typestringValores: standard, interest, fine, bank_fee, refund, chargeback, card_statement.
payable.reference_codestring ou null—
payable.statusstringValores: pending, partial, paid, overdue, cancelled.
payable.amountstring—
payable.discount_amountstring—
payable.surcharge_amountstring—
payable.issue_datestring (date)—
payable.due_datestring (date)—
payable.paid_atstring (date-time) ou null—
payable.installment_group_idstring (UUID) ou null—
payable.installment_numberinteger ou null—
payable.installment_countinteger ou null—
payable.descriptionstring ou null—
payable.notesstring ou null—
payable.metadataobject—
payable.created_by_user_idstring (UUID) ou null—
payable.updated_by_user_idstring (UUID) ou null—
payable.deleted_by_user_idstring (UUID) ou null—
payable.created_atstring (date-time)—
payable.updated_atstring (date-time)—
payable.deleted_atstring (date-time) ou null—
transaction_idstring (UUID)The card line, now linked to the purchase
statement_idstring (UUID)The statement the purchase went to
routing_noticeobject ou nullSet when the line date falls in a closed statement and the purchase went to the open one
routing_notice.codestring—
routing_notice.posted_onstring (date)—
routing_notice.closed_statement_idstring (UUID)—
routing_notice.closed_statement_period_endstring (date)—
routing_notice.closed_statement_in_correctionboolean—
routing_notice.destination_statement_idstring (UUID)—
routing_notice.destination_due_datestring (date)—
installmentsarray de objetosEvery installment of the purchase, in order; one item for a single payment
installments[].idstring (UUID)—
installments[].tenant_idstring (UUID)—
installments[].record_numberinteger—
installments[].supplier_idstring (UUID) ou null—
installments[].supplierobject ou null—
installments[].financial_account_idstring (UUID)—
installments[].financial_accountobject ou null—
installments[].payment_method_idstring (UUID) ou null—
installments[].payment_methodobject ou null—
installments[].financial_category_idstring (UUID) ou null—
installments[].financial_categoryobject ou null—
installments[].account_scope_maskobject—
installments[].purchase_invoice_idstring (UUID) ou null—
installments[].purchase_invoiceobject ou null—
installments[].parent_payable_idstring (UUID) ou null—
installments[].parentany ou null—
installments[].statement_payable_idstring (UUID) ou null—
installments[].typestringValores: standard, interest, fine, bank_fee, refund, chargeback, card_statement.
installments[].reference_codestring ou null—
installments[].statusstringValores: pending, partial, paid, overdue, cancelled.
installments[].amountstring—
installments[].discount_amountstring—
installments[].surcharge_amountstring—
installments[].issue_datestring (date)—
installments[].due_datestring (date)—
installments[].paid_atstring (date-time) ou null—
installments[].installment_group_idstring (UUID) ou null—
installments[].installment_numberinteger ou null—
installments[].installment_countinteger ou null—
installments[].descriptionstring ou null—
installments[].notesstring ou null—
installments[].metadataobject—
installments[].created_by_user_idstring (UUID) ou null—
installments[].updated_by_user_idstring (UUID) ou null—
installments[].deleted_by_user_idstring (UUID) ou null—
installments[].created_atstring (date-time)—
installments[].updated_atstring (date-time)—
installments[].deleted_atstring (date-time) ou null—
statement_idsarray de string (UUID)The statement of each installment, in the order of installments
_tenantobject—
_tenant.idstring (UUID)—
_tenant.slugstring—
_tenant.company_namestring—

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_credit_card_purchase_from_line",
        "arguments": {
            "tenant": "minha-empresa",
            "transaction_id": "<uuid>",
            "supplier_id": "<uuid>"
        }
    }
}

Nesta página