Apply to invoice
o2c_apply_paymentApply some or all of a payment to an invoice. Bounded on both sides: never more than the payment has left, never more than the invoice still owes. Both refusals name the actual numbers, so the right next step is obvious.
Overpayment is real and stays as unapplied cash against the customer. Do not spread it across invoices the customer did not name. Effects: application recorded; invoice.status -> paid when fully settled.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | How much to apply. Omit to apply the smaller of what is left on each side. In cents (integer minor units) — 1250 means $12.50. | |
| invoice_id | Yes | The invoice it settles. An existing invoice id. | |
| payment_id | Yes | The payment. An existing payment id. |