Applies to: Invoices API
Learn how to use Invoices API endpoints to cancel a published invoice or delete a draft invoice.
To cancel a published invoice, call CancelInvoice and provide the following information:
- The ID of the invoice to cancel. The invoice must be in the 
SCHEDULED,UNPAID, orPARTIALLY_PAIDstate. - The current version of the invoice.
 
If you need to get the ID and version, call SearchInvoices or ListInvoices. If you have the ID but need the version, call GetInvoice.
The following is an example request:
Cancel invoice
After an invoice is canceled, Square does the following:
- Sets the 
statusof the invoice toCANCELED. Canceled invoices remain accessible in the seller account and are returned byGetInvoice,ListInvoices, andSearchInvoicesrequests. - Updates the associated order based on the invoice status:
SCHEDULEDorUNPAIDinvoices - Sets the orderstatetoCANCELEDand sets thestateof any open fulfillments on the order toCANCELED.PARTIALLY_PAIDinvoices - Sets the orderstatetoCOMPLETEDand replaces existing line items with a newCUSTOM_AMOUNTline item totaling the partially paid amount.Square doesn't automatically refund any payment amount.
 - Stops any automatic scheduled actions, such as sending reminders or charging a card on file. Sellers can no longer collect payments from a canceled invoice.
 - Notifies the seller, if the Canceled notification is enabled in the seller's notification settings.
 - Notifies the customer, as determined by the 
delivery_methodsetting for the invoice:- For 
EMAIL, Square sends an email notification. - For 
SMS, Square sends a text message. - For 
SHARE_MANUALLY, Square doesn't notify the customer. 
 - For 
 - Invokes 
invoice.updatedandinvoice.canceledwebhook events.order.updatedevents are also invoked after Square updates the associated order. 
You cannot cancel invoices in the DRAFT state or in the PAID, REFUNDED, CANCELED, or FAILED terminal state. Note that you can delete a DRAFT invoice.
Invoices aren't automatically updated or canceled if the customer profile assigned as the invoice recipient is deleted from the Customer Directory. If the invoice has remaining scheduled payments, Square continues to send the invoice to the primary_recipient.email address. Any remaining automatic payments fail, but the customer can still pay the invoice from the Square-hosted invoice payment page.
Consider canceling these invoices if there isn't a valid reason to keep them. You can subscribe to the customer.deleted webhook event to be notified when customers are deleted.
To delete an invoice, call DeleteInvoice and provide the following information:
- The ID of the invoice to delete. The invoice must be in the 
DRAFTstate. - The current version of the invoice. You can optionally provide this in the 
versionquery parameter to enable optimistic concurrency control. 
If you need to get the ID and version, call SearchInvoices or ListInvoices. If you have the ID but need the version, call GetInvoice.
The following is an example request:
Delete invoice
After an invoice is deleted, Square does the following:
- Removes the invoice from the seller account. Deleted invoices aren't returned by 
GetInvoice,ListInvoices, orSearchInvoicesrequests. - Permanently deletes any attachments.
 - Changes the 
stateof the associated order toCANCELED. - Invokes an 
invoice.deletedwebhook event. Theorder.updatedevent is also invoked after Square sets the associated order to theCANCELEDstate.