Apply to an invoice

Applies available credit to one or more open invoices. The credit is drawn from the invoice owner's available credit memos (customer and/or company), so you don't name a specific memo.

All invoices in one request share one credit transaction and one email decision.

Body, single invoice

FieldTypeDefaultDescription
bill_idint—Required. Invoice (bill) id
amountnumber0Amount to apply. 0 applies as much as possible, up to the invoice's remaining balance
notify_customerbooltrueSend the payment email

Body, several invoices

FieldTypeDefaultDescription
billsarray—Required. [{ "bill_id": 5530, "amount": 25.00 }, …]. A missing or 0 amount applies that invoice's full remaining balance. Each invoice may appear only once
notify_customerbooltrueSend the payment email

When bills is present, bill_id and amount are ignored.

Response

FieldDescription
credit_transaction{ id, increment_id, base_total, total } for the credit transaction created
summary.total_credit_appliedTotal applied, in base currency
summary.bills_countInvoices processed
summary.bills_paid_countInvoices that actually received credit. A batch can succeed while some invoice draws nothing
summary.creditmemos_used_countCredit memos drawn from
bills[]{ bill_id, increment_id, amount_applied, fully_paid }
creditmemos[]{ creditmemo_id, increment_id, amount_used, remaining_credit }
notify_customerEcho of the email decision

The credit transaction records the actor in an internal comment ("Credit applied manually by …").

Variant: Apply to several invoices

Batch form of Apply to an invoice: one credit transaction and one email decision cover every invoice in bills. A missing or 0 amount applies that invoice's full remaining balance.

See Apply to an invoice for the full field and response reference.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
integer
integer
boolean
Responses

Language
Credentials
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json