Get corresponding subscription BillingCycle for a given Invoice

Hi all!

I’m using table schema: Table Schema Documentation - Keap Developer Portal

And trying to link a given invoice to a subscription to get its BillingCycle.

So I have a record from the “Invoice” table which has “JobId”

Then I query the table “Job” and the record from that table has “JobRecurringId”

And I’m confused here. I don’t see a table named “JobRecurreing” so I query “RecurringOrder” by the “JobRecurringId” which I guess is wrong.

Should I query " JobRecurringInstance" instead? And then use “RecurringId” to query “RecurringOrder”

Please advice. I know it’s not a logical and efficient way to start from the invoice, but I need my app to be able getting the Billing Cycle based on a single invoice.

There have been some significant changes to the schema that haven’t been released based on what I’ve seen recently vs what I’ve used in the past.

The XML-RPC API provides the order Id(s) for the invoice by using the method:

getOrderId($invoiceId)

… which should return an array of the specified IDs.

1 Like