Invoices that are unpaid have no order_id

According to the api docs, the ’ Get invoice’ method should return an ‘invoice’ object with the ‘order_id’ that links it back to the order containing the line items etc.

However I’ve found that when an invoice has the status ‘UNPAID’ the order_id is missing. If you look in the square dashboard, it does show the line items etc for that invoice. Is there any plan to make every invoice link back to an order_id so we can get the line_items for every invoice?

It would be super helpful for analysis purposes to expose this data through the API: i.e. how many items did i invoice for but have not been paid yet.

1 Like

:wave: Currently Invoices created using the Seller Dashboard, POS application, or Square Invoices application do not include the order_id field unless a payment has been made on the invoice. Invoices created using the Invoices API require the order ID and therefore always include the order ID. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slightly_smiling_face:

That is awesome - thank you! Yeah from the Seller Dashboard you can see the data is there (items, quantities etc for the line items) but it’s just not exposed in the API currently. I’m guessing this is due to how square handles creating invoices/orders internally, but it would be great if it could be fixed and also more consistent.
Thanks again!

1 Like

Hello @Bryan-Square, we just noticed this terrible issue. We are syncing invoices with other accounting system and because of this we are having errors and we are missing invoices that never get paid. Is the order_id now included in invoices created other way than with the API? and when will it be included in all of them? Is this known issue documented anywhere? or just explained currently when will we get the order_id?

1 Like

At this time for invoices that are created via the seller Dashboard the order_id isn’t available till the invoice is paid for. This is a popular feature request and we hope to have more for you soon. It is documented in the Limitations section of our documentation. :slightly_smiling_face:

Hi @Bryan-Square ,

We require further information on the remaining number of customer sessions in order to handle our situation effectively. Even if sometimes an invoice is overdue, we still consider this within the framework of a package purchase.

Without the assignment of the order_id to the invoice, we are unable to access the items, resulting in the inability to accurately tally client debts.

We would appreciate your assistance in resolving this matter.

Kind regards.

At this time the ability to get the orders for invoices created on the Dashboard isn’t currently available. As a workaround if you allow ACH bank transfers as a payment method for the invoice the order will be returned by the Orders API before the invoice is paid for. :slightly_smiling_face:

Dear @Bryan-Square,

We need help in working with the invoice JSON response from the API. Our challenge is not with the order_id itself, but rather with the information contained in the related invoice.

Our current API response includes a range of fields, including a public invoice URL:

"public_url": "https://squareup.com/pay-invoice/inv:0-XXXXXXXXXXXXXXXXXXXXX",

We need to extract details from this URL, namely the list of items, their quantity, and cost:

Our preference would be to receive this itemized list directly with the invoice details. As your website already fetches and displays this data, we imagine it is stored in the database.

If possible, accessing this data automatically, rather than manually via the URL, would significantly improve our workflow and reduce the risk of errors. This manual process is increasingly challenging given the influx of new invoices and transactions we deal with.

Thank you for your assistance.

Okay, if you want the itemized information for the invoice you’ll need to call the Orders API to get the catalog_object_ids for the line items. Once you have those IDs you’ll then call the Catalog API to get the item details. :slightly_smiling_face: