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_PAID
state. - 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
status
of the invoice toCANCELED
. Canceled invoices remain accessible in the seller account and are returned byGetInvoice
,ListInvoices
, andSearchInvoices
requests. - Updates the associated order based on the invoice status:
SCHEDULED
orUNPAID
invoices - Sets the orderstate
toCANCELED
and sets thestate
of any open fulfillments on the order toCANCELED
.PARTIALLY_PAID
invoices - Sets the orderstate
toCOMPLETED
and replaces existing line items with a newCUSTOM_AMOUNT
line 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_method
setting 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.updated
andinvoice.canceled
webhook events.order.updated
events 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
DRAFT
state. - The current version of the invoice. You can optionally provide this in the
version
query 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
, orSearchInvoices
requests. - Permanently deletes any attachments.
- Changes the
state
of the associated order toCANCELED
. - Invokes an
invoice.deleted
webhook event. Theorder.updated
event is also invoked after Square sets the associated order to theCANCELED
state.