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 leitura | Destrutiva | Idempotente | Mundo aberto |
|---|---|---|---|
| Não | Sim | Sim | 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 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â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. |
transaction_id | string (UUID) | Sim | The debit line of the card that becomes the purchase (lines[].id of get_credit_card_statement_reconciliation) |
supplier_id | string (UUID) | Sim | Supplier of the purchase. Find it with list_suppliers. |
financial_category_id | string (UUID) | Não | Expense category of the purchase. Find it with list_financial_categories. |
description | string | Não | Description of the purchase |
notes | string | Não | Internal notes |
reference_code | string | Não | Reference code of the purchase |
payment_method_id | string (UUID) | Não | Payment method. Defaults to the tenant country's credit card payment method. |
installment_count | integer | Não | Number 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_number | integer | Não | Which 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).
| Campo | Tipo | Descrição |
|---|---|---|
payable | object | The purchase (installment 1 of an installment purchase) |
payable.id | string (UUID) | — |
payable.tenant_id | string (UUID) | — |
payable.record_number | integer | — |
payable.supplier_id | string (UUID) ou null | — |
payable.supplier | object ou null | — |
payable.financial_account_id | string (UUID) | — |
payable.financial_account | object ou null | — |
payable.payment_method_id | string (UUID) ou null | — |
payable.payment_method | object ou null | — |
payable.financial_category_id | string (UUID) ou null | — |
payable.financial_category | object ou null | — |
payable.account_scope_mask | object | — |
payable.purchase_invoice_id | string (UUID) ou null | — |
payable.purchase_invoice | object ou null | — |
payable.parent_payable_id | string (UUID) ou null | — |
payable.parent | any ou null | — |
payable.statement_payable_id | string (UUID) ou null | — |
payable.type | string | Valores: standard, interest, fine, bank_fee, refund, chargeback, card_statement. |
payable.reference_code | string ou null | — |
payable.status | string | Valores: pending, partial, paid, overdue, cancelled. |
payable.amount | string | — |
payable.discount_amount | string | — |
payable.surcharge_amount | string | — |
payable.issue_date | string (date) | — |
payable.due_date | string (date) | — |
payable.paid_at | string (date-time) ou null | — |
payable.installment_group_id | string (UUID) ou null | — |
payable.installment_number | integer ou null | — |
payable.installment_count | integer ou null | — |
payable.description | string ou null | — |
payable.notes | string ou null | — |
payable.metadata | object | — |
payable.created_by_user_id | string (UUID) ou null | — |
payable.updated_by_user_id | string (UUID) ou null | — |
payable.deleted_by_user_id | string (UUID) ou null | — |
payable.created_at | string (date-time) | — |
payable.updated_at | string (date-time) | — |
payable.deleted_at | string (date-time) ou null | — |
transaction_id | string (UUID) | The card line, now linked to the purchase |
statement_id | string (UUID) | The statement the purchase went to |
routing_notice | object ou null | Set when the line date falls in a closed statement and the purchase went to the open one |
routing_notice.code | string | — |
routing_notice.posted_on | string (date) | — |
routing_notice.closed_statement_id | string (UUID) | — |
routing_notice.closed_statement_period_end | string (date) | — |
routing_notice.closed_statement_in_correction | boolean | — |
routing_notice.destination_statement_id | string (UUID) | — |
routing_notice.destination_due_date | string (date) | — |
installments | array de objetos | Every installment of the purchase, in order; one item for a single payment |
installments[].id | string (UUID) | — |
installments[].tenant_id | string (UUID) | — |
installments[].record_number | integer | — |
installments[].supplier_id | string (UUID) ou null | — |
installments[].supplier | object ou null | — |
installments[].financial_account_id | string (UUID) | — |
installments[].financial_account | object ou null | — |
installments[].payment_method_id | string (UUID) ou null | — |
installments[].payment_method | object ou null | — |
installments[].financial_category_id | string (UUID) ou null | — |
installments[].financial_category | object ou null | — |
installments[].account_scope_mask | object | — |
installments[].purchase_invoice_id | string (UUID) ou null | — |
installments[].purchase_invoice | object ou null | — |
installments[].parent_payable_id | string (UUID) ou null | — |
installments[].parent | any ou null | — |
installments[].statement_payable_id | string (UUID) ou null | — |
installments[].type | string | Valores: standard, interest, fine, bank_fee, refund, chargeback, card_statement. |
installments[].reference_code | string ou null | — |
installments[].status | string | Valores: pending, partial, paid, overdue, cancelled. |
installments[].amount | string | — |
installments[].discount_amount | string | — |
installments[].surcharge_amount | string | — |
installments[].issue_date | string (date) | — |
installments[].due_date | string (date) | — |
installments[].paid_at | string (date-time) ou null | — |
installments[].installment_group_id | string (UUID) ou null | — |
installments[].installment_number | integer ou null | — |
installments[].installment_count | integer ou null | — |
installments[].description | string ou null | — |
installments[].notes | string ou null | — |
installments[].metadata | object | — |
installments[].created_by_user_id | string (UUID) ou null | — |
installments[].updated_by_user_id | string (UUID) ou null | — |
installments[].deleted_by_user_id | string (UUID) ou null | — |
installments[].created_at | string (date-time) | — |
installments[].updated_at | string (date-time) | — |
installments[].deleted_at | string (date-time) ou null | — |
statement_ids | array de string (UUID) | The statement of each installment, in the order of installments |
_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_credit_card_purchase_from_line",
"arguments": {
"tenant": "minha-empresa",
"transaction_id": "<uuid>",
"supplier_id": "<uuid>"
}
}
}
