How to utilize the API to pull Extraneous data from the Order API Endpoint.
If you've worked with Orders in the Infoplus API, you've probably seen how many fields are available in this record type. However, despite all of these fields, sometimes there's even more data about an order that you may want to know, which doesn't fit into the core fields of Infoplus.
Infoplus accommodates this by exposing Extraneous data on the Order table. Orders which Infoplus receives through a Shopping Cart Connection automatically get all fields that Infoplus receives from the Shopping Cart added to their Extraneous data lists.
These data exist at two different levels: the Order level, and the Line Item level. Here's a screenshot of what these data look like when viewing an Order in Infoplus, in a tab at the bottom of the screen:
These extraneous data are also available in the Infoplus API, when GET'ing a single Order, or in an Order search result. Here's a formatted snippet of output from the Infoplus API, showing the same data as shown in the screenshot above:
In this JSON snippet, in the objects under the extraOrderData array, you'll primarily be interested in the code and value fields. The code is the identifier for the extraneous data. Specifically, for orders from a Shopping Cart Connection, these codes have a prefix to help you identify values that are from the shopping cart (i.e., "MAG-" for Magento or "CA-" ChannelAdvisor). The value field is simply the value of the data (which is always a String).
Similarly, in the extraLineItemData array, code and value have the same meaning as they do in extraOrderData. There is also a field SKU that specifies which line item on the order the data pertains to.