Record Invoice Payment
record_invoice_paymentRecord a payment received outside Spark (cash, check, bank transfer, card taken elsewhere) on an issued invoice — the invoice list's Mark as paid. Nothing is charged: this never runs a card or bank payment. The amount defaults to what is still owed; a smaller amount records a partial payment, and more than is owed is refused. The invoice is marked paid once its payments cover it, and the payment posts to connected accounting applied to the invoice. The method defaults to the invoice's payment method. Two-step: preview=true, then commit with the previewReceipt.
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": {
"invoiceId": "<invoiceId>"
},
"name": "record_invoice_payment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | Amount received. Defaults to what is still owed on the invoice. | |
| method | No | How it was paid: cash, check, bank_transfer, credit_card (taken elsewhere), cash_on_delivery, advance_payment or other. Defaults to the invoice's payment method. | |
| preview | No | Step 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing is written until the commit call. | |
| clientId | No | Optional client id (GUID) for operator (unpinned) credentials on 3PL tenants. | |
| invoiceId | Yes | Invoice id (GUID) or number from list_invoices. | |
| idempotencyKey | No | Caller-generated idempotency key; required with previewReceipt to commit. | |
| previewReceipt | No | Step 2: the receipt returned by the preview call. Supply with a fresh idempotencyKey to commit. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| number | No | ||
| paidAt | No | ||
| status | No | ||
| preview | No | ||
| warnings | No | ||
| expiresAt | No | ||
| invoiceId | No | ||
| paymentId | No | ||
| totalAmount | No | ||
| actionItemId | No | ||
| confirmation | No | ||
| documentKind | No | ||
| correlationId | No | ||
| approvalResult | No | ||
| idempotencyKey | No | ||
| previewReceipt | No | ||
| approvalRequired | No | ||
| approvalRuleName | No | ||
| idempotentReplay | No |