Cancel an unpaid invoice
cancel_invoiceCancels an unpaid invoice so the buyer can no longer pay it, for example when an order is called off.
Instructions
Cancels an unpaid invoice so the buyer can no longer pay it, for example when the order was called off. Pass the invoiceId from create_invoice, list_invoices or get_invoice. Without store every connected store is tried and only the one that owns the invoice cancels it. It works only while no payment has been seen; otherwise it returns invoice_not_cancellable and the invoice stays as it is. Money that still arrives later is marked paid_late, and cancelling twice returns the invoice unchanged. Use get_invoice first if you are not sure of its status. A failure comes back as an error with its code and what to do, for example rate_limited with the seconds to wait.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| store | No | Store id or exact store name from list_stores. Needed only when several stores are connected. | |
| invoiceId | Yes | The invoice id. |