How do I get SKU in line_items from FulfillmentOrders?

thegamecrafter
Shopify Partner
5 0 8

I'm trying to build a fulfillment workflow using the APIs as described here: https://shopify.dev/apps/fulfillment/fulfillment-service-apps/manage-fulfillments

However, the REST API appears to be missing a critical piece of data. The line items don't contain SKUs. Yet everything works off of the SKUs, including the inventory APIs described on the same page here: https://shopify.dev/apps/fulfillment/fulfillment-service-apps/manage-fulfillments#step-9-share-inven...

Am I missing something? How do I get the REST API to give me the SKUs in line items? I am aware I can get them via GraphQL, but if I have to use GraphQL, then why even have REST APIs?

Replies 8 (8)

Snodgers
Shopify Partner
16 0 12

What call are you using, exactly?

 

SKUs will show up in the data. If you use this, it definitely works:

 

/admin/api/[api version]/orders/[order number].json

 

 

thegamecrafter
Shopify Partner
5 0 8

I'm using the new fulfillment system as it is linked in the original post. The REST endpoint is:

 

GET https://{shop}.myshopify.com/admin/api/{api_version}/assigned_fulfillment_orders.json?assignment_sta...

 

 

Snodgers
Shopify Partner
16 0 12

Okay, I don't see it in that particular call but you can get it from the other call they describe:

 

https://{shop}.myshopify.com/admin/api/{api_version}/fulfillments.json
thegamecrafter
Shopify Partner
5 0 8

Yeah, but with the new system you have to accept a FulfillmentOrder before you can create a Fulfillment. This is why it's a problem. It's going to be a problem for everyone using fulfillments in a while because they're ditching the old Fulfillment system according to the attached note on this page: https://shopify.dev/apps/fulfillment/fulfillment-service-apps

 

Caution

If your app is using the Order (REST or GraphQL) and Fulfillment (REST or GraphQL) API resources to fulfill orders, then you're using a legacy workflow. As of API version 2022-07, the legacy workflow will no longer be supported.

By API version 2023-04, all apps should be using the FulfillmentOrder object to manage fulfillments. For more information on fulfillment-related resources that were removed in API version 2022-07, refer to the 2022-07 release notes.

Snodgers
Shopify Partner
16 0 12

Okay but even so, you are getting item IDs and inventory IDs. You can look up the SKU from the inventory ID, if not the item ID.

thegamecrafter
Shopify Partner
5 0 8

Yes there are absolutely work arounds, including using the GraphQL version of this same object instead of REST (which is what I did). My point is that every other part of the new FulfillmentOrders API uses SKUs, not product IDs. Thus the REST endpoint for assigned_fulfillment_orders should include SKUs, not product IDs.

Snodgers
Shopify Partner
16 0 12

Understood. I was just trying to explore options but I absolutely agree.

 

There's no good reason to omit the SKU from the line item data. Shopify needs to address this problem.

jgmullor
Shopify Partner
1 0 0

September 2023 and no updates on this 😞