markwine avatar image
markwine asked markwine commented

Getting Product SKU through API

Is it possible to get the item SKU through the Orders API, and if not, is this planned for future development?

Currently, it seems as if you can get some product information, including product code, through a Orders request for line item information (GetOrderLineItems), but in order to get other information, including the SKU, a further inventory API request is needed.

Based on prior questions and documentations, it seems that a) the Order Line Item request has become more verbose by default, previously requiring a parameter ( expand=lineItems.item) to get information that is now given by default, and b) the product SKU was recently added to the exported Line Items document through the merchant dashboard.

I want to know if the suggested workflow, if I wish to access the SKUs for the line items in an order, is to initially make an order query, and then based on this result, use the inventory API to get the corresponding SKU based on the Clover ID? It seems as if this might ultimately use extra server resources, so if a more direct approach with fewer API calls is possible, that would seem preferable.

It also seems that the Clover team is moving toward associating more product information with Order Line Items, and I think it would be great if the SKU was part of the Order Line Item response.
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

zgreathouse avatar image
zgreathouse Deactivated answered markwine commented
Below is an example API call to get the item SKU using the Order API.{ {mId}}/orders/{ {orderId}}?expand=lineItems.item

The general idea is the lineItem field is meant to hold the minimum amount of information on the item which is necessary to construct an order. If more information about the item needs to be accessed, you may expand the item field within the lineItem to do so.
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

markwine avatar image markwine commented ·

Ok, so if we want more info about the items, we can just do an expanded orders request and not worry about the line items API.


0 Likes 0 ·

Welcome to the
Clover Developer Community