Cancel an Invoice by GUID

Facades: merchant

Overview

Cancel an invoice by GUID, 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 GUID 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.cancelInvoiceByGuid("5262067c-d1d6-4620-b67c-e4dd1168d3ae");

// Option 2 - With forceCancel
Invoice cancelInvoice = bitpay.cancelInvoiceByGuid("5262067c-d1d6-4620-b67c-e4dd1168d3ae", true);