Retrieving custom order field data with REST V2

Working on converting an XMLRPC script to REST V2 . . .

The script uses a data query to get all orders for a given contact and specifically requests the data from a custom field, “_TrackingNumber”

Here’s the XMLRPC (PHP) code we’re using:

$returnFields = array(‘ContactId’,‘Id’, ‘JobTitle’,‘_TrackingNumber’); // sets fields that we’re going to return
$query = array(‘contactid’ => $contactID); // where statement
$orders = $infusionsoft->data()->query(“Job”,100,0,$query,$returnFields,‘Id’,false); //order by Id in descending order (ascending=false)

Is there a REST V2 endpoint that allows us to get this data?

I’ve done some searching here and in all the othe queries I’ve seen regarding custom order field values, the answer has been to use the legacy XMLRPC endpoints . . . but obviously that’s not an option since XMLRPC is going away.

Most of those other queries are years old though, so I’m hoping something has changed since then . . .

Hi @Magic_Agency, this is one of the gaps we identified in v2, and it is already listed in our known issues tracker. The issue is currently being addressed and should be released soon. I’ll notify you as soon as it becomes available. You can also track the status here: Known Issues Tracker

Hi @Magic_Agency

Updating, setting, and getting order custom field values is now supported in REST API v2. Here’s the relevant documentation for reference:

Thanks for your patience!

Omar