Applies to: Invoices API
Learn how to add, change, or clear fields in an invoice using the Invoices API.
Applications can call the UpdateInvoice endpoint in the Invoices API to update an invoice. For example, you can add or update the title, change the payment schedule, and change accepted payment methods. This endpoint supports sparse updates.
Only invoices in the
DRAFT,SCHEDULED,UNPAID, orPARTIALLY_PAIDstate can be updated. You cannot update invoices in thePAID,REFUNDED,PARTIALLY_REFUNDED,CANCELED, orFAILEDterminal state.For invoices in the
PAYMENT_PENDINGstate, you must wait for the payment to complete before you can update it (assuming it reaches thePARTIALLY_PAIDstate). In addition, the seller or customer cannot initiate another payment for an invoice in this state.The following restrictions apply to updating an invoice in a
DRAFTstate:- You cannot update the 
order_idorlocation_idfield. - Updating the 
primary_recipientcontact information requires two update requests. Use the first request to clear this field and the second request to add the field again. 
- You cannot update the 
 The following restrictions apply to updating a published invoice in the
SCHEDULED,UNPAID, orPARTIALLY_PAIDstate:- You cannot update the 
order_idorlocation_idfield. - You cannot update the 
primary_recipientfield. For more information, see Limitations with the Customers API integration. 
- You cannot update the 
 UpdateInvoicecannot be used to upload or delete an invoice attachment. To manage attachments, use theCreateInvoiceAttachmentorDeleteInvoiceAttachmentendpoint. For more information, see Create or Delete Invoice Attachments.
To update an invoice, call UpdateInvoice and provide the following information:
The ID of the invoice to update.
An
invoiceobject with:- The current 
versionof the invoice. - Any new fields to add and existing fields to change or clear (remove).
To change fields, provide the updated values.
To clear fields, specify a
nullvalue.Updating
payment_requestsorremindersuses a different syntax. To change a value, specify theuidand provide the updated value. To clear an element, specify theuidand include theremovefield set totrue.The Invoices API also supports using the
fields_to_clearfield to clear fields. However, usingnullvalues or theremovefield is the recommended field clearing method.
 
- The current 
 An optional
idempotency_keyto ensure idempotency.
Note
If you need to get the invoice ID and version, call SearchInvoices or ListInvoices. If you have the ID but need the version, call GetInvoice.
The following UpdateInvoice request adds (or updates) the invoice_number field and clears the description field.
In the Invoice object:
- Specify a value for  
invoice_number. - Set the 
descriptionvalue tonull. 
Update invoice
For this example, Square adds the invoice_number field if isn't already defined for the invoice; otherwise, Square updates its value.
After an invoice is updated, Square does the following:
Notifies the seller, if the Updated notification is enabled in the seller's notification settings.
Notifies the customer, as determined by the
delivery_methodsetting for the invoice:EMAIL- Square sends an email to the customer.SMS- Square sends a text message to the customer unless the customer has opted out of text message updates from Square invoices.SHARE_MANUALLY- Square doesn't notify the customer.
Opting out of sending
EMAILorSMSnotifications to customers isn't possible when updating an invoice with the Invoices API.Increments the invoice version.
Triggers an
invoice.updatedwebhook event.
The following example UpdateInvoice requests show various update scenarios:
- Update payment requests by removing the deposit request
 - Remove and add payment requests
 - Replace payment request percentages with exact amounts
 - Update custom fields