<- Invoices API

Invoices API

Publish invoice

POST

 /v2/invoices/{invoice_id}/publish

Publishes the specified draft invoice.

After an invoice is published, Square follows up based on the invoice configuration. For example, Square sends the invoice to the customer's email address, charges the customer's card on file, or does nothing. Square also makes the invoice available on a Square-hosted invoice page.

The invoice status also changes from DRAFT to a status based on the invoice configuration. For example, the status changes to UNPAID if Square emails the invoice or PARTIALLY_PAID if Square charges a card on file for a portion of the invoice amount.

In addition to the required ORDERS_WRITE and INVOICES_WRITE permissions, CUSTOMERS_READ and PAYMENTS_WRITE are required when publishing invoices configured for card-on-file payments.

Permissions:ORDERS_WRITE, INVOICES_WRITE
Try in API Explorer
Link to section

Path parameters

Example code

Link to section

invoice_id

string

Required

The ID of the invoice to publish.

Link to section

Request body

Link to section

version

integer(32-bit)

Required

The version of the invoice to publish. This must match the current version of the invoice; otherwise, the request is rejected.

Link to section

idempotency_key

string

A unique string that identifies the PublishInvoice request. If you do not provide idempotency_key (or provide an empty string as the value), the endpoint treats each request as independent.

For more information, see Idempotency.

Link to section

Response fields

Link to section

invoice

The published invoice.

Link to section

errors

Information about errors encountered during the request.

Error descriptions