Best way to retrieve custom fields from an order via API?

I’m trying to create a report for canceled and paused subscriptions (v. 2.0) via the API.

I can see the user information related to the cancelations and pauses, but I cannot see custom fields related to the product (where we store the name of the person who ought to be notified of cancelations/renewals/resumes) - e.g. I need the value of “data-item-custom2”

Can you recommend a pathway by which to find this information?
I thought I’d try:

  • pull results for canceled
    ** search each for the invoice id
    *** pull the invoice to get an order “number”
    **** pull that order to fetch the “customFields” array

…but I’m getting NULL results for the Resources URL{id}/invoices which is stopping me rather dead in my tracks.

Appreciate your help!

Hi @rekkajay,

The most straightforward path here would be to take the initialOrderToken, which is available in the Subscription API’s response, and retrieve the product’s metadata by getting the order using our Orders API.

Let me know if that helps,