pay_document
Register a payment for a Holded document (invoice, purchase, etc.) and optionally link it to a bank account; note that this may auto-approve the document.
Instructions
Register a payment for a document (Holded API v2). Supported docTypes: invoice, salesreceipt, creditnote, receiptnote, purchase — others throw an unsupported error. IMPORTANT: this may AUTO-APPROVE the document as a side effect (status 0→1). paymentmethod is the payment-method catalog id (from list_payment_methods), NOT a bank/treasury id. To link the payment to a bank account, pass bankId: the /payments endpoint can't set it, so the tool performs a second step (PUT /payments/{id}) and reports the outcome in _warnings.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"docType": "<docType>",
"documentId": "<documentId>",
"amount": "<amount>"
},
"name": "pay_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Payment date as Unix timestamp | |
| amount | Yes | Payment amount | |
| bankId | No | Bank account id to link the payment to. Triggers a second step (PUT /payments/{id}) to set the bank link on the payment. | |
| docType | Yes | Type of document | |
| documentId | Yes | Document ID | |
| treasuryId | No | Treasury account ID | |
| paymentmethod | No | Payment-method catalog id (from list_payment_methods), NOT a bank/treasury id. |