Cancel an Invoice

Facades: merchant

Overview

Cancel an invoice by ID, with the option to force cancelation when no contact information is present.

📘

Note

Cancellation will require either an SMS or E-mail to have already been set if the invoice has proceeded to the point where it may have been paid.

Parameters

ParameterDescription
invoiceIdThe ID of the invoice to delete.
forceCancelIf true it will cancel the invoice even if no contact information is present.

When omitted, this will be false.

Example

// Option 1 - Without forceCancel
Invoice cancelInvoice = bitpay.cancelInvoice("QrPWSMkq594kQfJex28S7X");

// Option 2 - Without forceCancel
Invoice cancelInvoice = bitpay.cancelInvoice("QrPWSMkq594kQfJex28S7X", false);