Record invoice payment
invbg_record_invoice_paymentWRITE: record a payment received for a document and allocate it, which updates the document's balance_paid/balance_due and payment status. Two calls: POST /payments, then POST /payments/{id}/invoices. If the allocation fails the payment stays recorded: the error names its id (see invbg_get_payment).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Note stored on the payment. | |
| amount | Yes | Amount received and allocated to this document. | |
| paid_at | No | When it was paid (default now). | |
| currency | Yes | Currency of the payment (required by inv.bg), e.g. BGN or EUR. | |
| invoice_id | Yes | inv.bg document id the payment is for. | |
| contragent_id | No | The paying client's id. | |
| currency_rate | Yes | Exchange rate to BGN (required by inv.bg): 1 for BGN; otherwise the rate from invbg_get_exchange_rate. | |
| payment_processor | Yes | How the money was received. |