post
https://{store}/api/rest/sales2/creditmemo/apply
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
| Field | Type | Default | Description |
|---|---|---|---|
bill_id | int | — | Required. Invoice (bill) id |
amount | number | 0 | Amount to apply. 0 applies as much as possible, up to the invoice's remaining balance |
notify_customer | bool | true | Send the payment email |
Body, several invoices
| Field | Type | Default | Description |
|---|---|---|---|
bills | array | — | 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_customer | bool | true | Send the payment email |
When bills is present, bill_id and amount are ignored.
Response
| Field | Description |
|---|---|
credit_transaction | { id, increment_id, base_total, total } for the credit transaction created |
summary.total_credit_applied | Total applied, in base currency |
summary.bills_count | Invoices processed |
summary.bills_paid_count | Invoices that actually received credit. A batch can succeed while some invoice draws nothing |
summary.creditmemos_used_count | Credit memos drawn from |
bills[] | { bill_id, increment_id, amount_applied, fully_paid } |
creditmemos[] | { creditmemo_id, increment_id, amount_used, remaining_credit } |
notify_customer | Echo 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
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
