Retrieve, List, or Search Invoices

Applies to: Invoices API | Orders API | Customers API | Payments API | Refunds API | Subscriptions API

Learn how to use Invoices API endpoints to retrieve, list, and search for invoices.

Link to section

Overview

Use the GetInvoice, ListInvoices, and SearchInvoices endpoints in the Invoices API to retrieve a specific invoice, list invoices at a specific location, and search for invoices at a specific location.

ID fields that reference other objects can be used to get itemization details and other information related to the invoice. For more information, see Get related order, payment, and other information.

Link to section

Retrieve an invoice by ID

To retrieve an invoice by ID, call GetInvoice.

Get invoice

The following is an example response:

For information about key invoice fields, see Invoice object.

Link to section

List invoices

To list invoices, call ListInvoices and specify the required location ID. The following example uses the limit query parameter to specify a maximum page size of three results. The default page size is 100.

List invoices

The following is an excerpt of an example paged response:

If the response is paged, the response includes a cursor field. To retrieve the next page of results, include the cursor query parameter in the next ListInvoices call, as shown in the following example:

List invoices

Link to section

Search for invoices

To search for invoices at a specified location, call SearchInvoices and provide the location ID. You can optionally provide a customer ID to filter for invoices that belong to a specific customer at the specified location. If you need to get the customer ID, you can search customer profiles by phone number, email address, or other supported attribute.

The following example request filters by a customer and location. Although the location_ids and customer_ids fields are arrays, only a single customer ID and a single location ID can be specified in each filter.

Search invoices

The following is an excerpt of an example response:

The following example request filters by a specific customer and location and sorts the results in order from oldest to newest:

Search invoices

The INVOICE_SORT_DATE sort field works as follows:

  • If the invoice is a draft, the invoice created_at date is used for sorting.
  • If the invoice was published and has a scheduled_at date, the scheduled_at date is used for sorting.
  • If the invoice was published and doesn't have a scheduled_at date, the publish date is used for sorting.

Link to section

Get related order, payment, and other information

An invoice represents a payment schedule for an order and might not contain all the information needed for auditing and reporting. However, you can use invoice fields to retrieve the following related information:

  • Goods, services, or pricing associated with the invoice - Call RetrieveOrder using the order_id on the invoice and then check the line_items field.

  • The customer who received the invoice - Call RetrieveCustomer using the primary_recipient.customer_id on the invoice.

    The customer_id might be different on the invoice, underlying order, and any invoice payments. The customer who created the order can be different than the customer who received the invoice. For invoice payments, Square attempts to infer the customer based on the payment information.

  • The payment or refund processed for an invoice payment request - Use the payment ID from the corresponding tender on the underlying order to call GetPayment. To learn how, see Retrieve an invoice payment. Note that an invoice might have multiple payment requests.

    If an invoice payment is refunded, use the refund ID from the payment.refund_ids field to call GetPaymentRefund. A payment might have multiple partial refunds.

  • The subscription associated with the invoice - Call RetrieveSubscription using the subscription_id on the invoice. This field is present only on recurring subscription billing invoices.

Link to section

See also