REST v2 access to Invoices table

Hey @OmarAlmonte

I’m looking for an endpoint to retrieve the list of invoices for an order, corresponding to the InvoiceService endpoint under XMLRPC.

Our cusotmers use this for their customer service portals.

I checked known issues, and didn’t see it there.

I looked through various sections of the REST v1 and REST v2 API, but nothing is leaping out at me. I DO see invoice_id in the Order and Subscription objects, but not the data itself.

Did I miss something, or is this not being ported forward, or being considered, or?

Hi @David_Bullock. In essence, orders and invoices are now treated as the same concept in the API. Historically they were separate, but going forward they are one-to-one (interchangeable), which is why some endpoints now consistently use Order IDs to access invoice-related data.

This means you can retrieve invoice data through the order endpoints. Future API versions may unify terminology further and standardize.

@OmarAlmonte - Are you aware of the Order and Invoice ID misalignment issue that affect a small number of customers?

There are Keap applications out there that will generate a different Invoice ID to the Order ID. If developers have built integrations to look up by Invoice ID, then they will not be able to in REST V2.

It would a good idea to get your development team to realign the ID number on those applications, and keep them aligned. Or provide a query parameter to look up by the Invoice ID.

1 Like

@Pav I will bring this up internally and give you an update.

OK so question:.

I have the subscriptions endpoint.

I have the orders endpoint.

How do I get from a particular order (Invoice) to the subscription it belongs to, or from a subscription to see which orders(invoices) belong to it?

@OmarAlmonte - This is what David is referring to.

https://developer.infusionsoft.com/docs/table-schema/#RecurringOrder

1 Like

@Pav thanks for bringing that up, we will look into this.

@David_Bullock and @Pav, you can find the subscription that generated a particular order by looking at order_items.[].subscription_id, which links each item in the order back to its subscription. That said, there’s currently a bug causing this field to return 0. I’ll add it to the tracker and update you once it’s resolved.

1 Like

Hey @OmarAlmonte

I’m not clear if this is a function of the bug you mentioned.

I checked two endpoints and the known issues list.

Neither endpoint had a property of “subscription_id” anywhere in it, or in their order_items collection.. Normally from what I’ve seen, even if the property is zero, the property is still present, just with no value. (example the “subscriptions” “active” property.

The known issues DOES mention missing fields for Orders, but it doesn’t mention which Orders endpoints, or which fields (custom_fields, etc). so I can’t tell if this is a known issue or not.

https://api.infusionsoft.com/crm/rest/v2/orders/{order_id}

https://api.infusionsoft.com/crm/rest/v2/orders

Hey @David_Bullock, thanks for the detailed feedback. Really appreciate you taking the time to review everything.

The subscription_id property is returned when the item_type is SUBSCRIPTION, so it won’t appear for other item types.

In the Known Issues Tracker, where applicable, I’ll update the Notes section to specify the affected endpoints.

@Pav @David_Bullock Both the bug and the filter orders by invoice_id items have been added to the tracker.

@David_Bullock @Pav The bug related to the subscription_id property has now been resolved. Thanks again for your patience and for helping us identify it!

Thanks, I’ll take a look.

How about subscription custom fields? At least read? Any ETA? It still just says “In Review”. Not being able to read fields is a showstopper.

Hi David, I don’t have an ETA for that one yet, but I’ll make sure to let you know as soon as it’s released.