Record payment
create_paymentRecord a customer payment and optionally apply it to a specific invoice to reduce the balance.
Instructions
Record a payment received from a customer, optionally applied against a specific invoice. Use it once the money has actually arrived, after confirming the invoice Id with get_invoice or search_invoices. Write operation with real accounting effect: it posts cash against the customer and reduces the linked invoice balance. Not idempotent, so a repeated call records a second payment. Supplying invoice_id links the whole total_amount to that invoice; omitting it leaves an unapplied credit on the customer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| payment | Yes | Payment to record: the customer Id, the total received, and optionally the invoice it settles. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | ||
| payment | No |