Preview recording a payment on a sales invoice

Takes the same body as invoice.allocatePayment and shows what it would post, writing nothing: what the invoice has open, what the payment settles (payment.settles, in the invoice's currency), the shortfall a shortfall_reason closes (shortfall: reason, amount, account), what stays open (left_open), settles_in_full, and the journal (journal.lines, signed amounts in the base currency, debit positive; journal.available is false with a reason for a line in another currency). It runs the commit's own checks, so a refusal is named here first: write_off_not_permitted, withholding_tax_account_required, withholding_tax_account_unavailable, withholding_tax_currency_mismatch, withholding_tax_nothing_withheld, withholding_tax_exceeds_limit, payment_exceeds_open, shortfall_nothing_to_close, shortfall_account_unavailable, shortfall_note_required, shortfall_reason_unavailable, shortfall_currency_mismatch, period_locked. Amounts are decimal strings. The ETag header (and meta.invoice_version) is the invoice version it read: send it as If-Match on the commit, which then refuses with 412 if the invoice changed in between. Requires the invoices:action OAuth scope with update_invoices and update_bank_accounts.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
Body Params

Proposed values used to preview recording a payment on a sales invoice without persisting changes.

The same body as invoice.allocatePayment: the preview describes exactly
what that commit would post.

string | null
string
number
number

Not accepted.

date
string | null

Required for other (what the rest was); for withholding_tax, the tax withheld.

string | null
enum

A short payment: leave_open (default) keeps the rest open;
withholding_tax posts it to shortfall_account_id; fee,
bad_debt and other write it off. These need
write_off_receivables, settle in full and carry no VAT.
discount is refused.

Allowed:
integer | null

Chart-of-accounts id the rest posts to; required for withholding_tax and other.

string

Not accepted: the payment-date rate applies.

Responses

Language
Credentials
OAuth2
Missing 1 required scope
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
*/*