Updated Deadline: Aug 1st -- [Deprecation] Important changes to ProductVariant, Refund and Fulfillment APIs

Shopify Staff
Shopify Staff
469 36 92

No problem Jonathan!  We fully realize that this is tough, it is easily the largest change Shopify has ever made to our APIs so we are right here with you to help the transition!

Developer Experience @ Shopify
0 Likes
Shopify Partner
36 0 26

Ryan

inventory_quantity on Variant API docs shows as deprecated. See attached screenshot

1. Can you confirm that "reading" inventory_quantity via Variant API is NOT deprecated?

2. Please clarify whether there are any plans to deprecate "reading" inventory_quantity via Variant API and the deprecation timeline in that case. 

If the API documentation can be updated to make this clear it would clear the confusion.

Thanks!

 

 

1 Like
Shopify Partner
660 0 104

Will read_inventory and read_locations be backfilled for existing installations that already have the read_product scope?

0 Likes
Shopify Staff
Shopify Staff
469 36 92

1. Can you confirm that "reading" inventory_quantity via Variant API is NOTdeprecated?

2. Please clarify whether there are any plans to deprecate "reading" inventory_quantity via Variant API and the deprecation timeline in that case. 

On the variant, inventory_quantity is being moved to read-only and there is no plan to remove that functionality.  This should only be used if you want an aggregate count of inventory at all locations, as it will not provide location specific details.

Will read_inventory and read_locations be backfilled for existing installations that already have the read_product scope?

We are handling these requests at deprecations@shopify.com.  If you would like us to backfill any permissions required for multi-location support to your existing installs, email us with the app details, and the permissions you want applied.  We'll confirm the details and respond before the backfill goes out so you know the date.

 

Ryan

 

Developer Experience @ Shopify
0 Likes
Shopify Partner
660 0 104

Ok, thanks Ryan.

0 Likes
Shopify Partner
9 0 2

Ryan, can you provide an example of using the GraphQL to retreive all of the available inventory for a given product?  I'm trying to get the available quantity for all of the variants associated with a given product, and can't find the correct syntax to query this.  The query below works for just the Product, but I need to get all of the variant inventories below that level. 

query {
  product(id: "gid://shopify/Product/94810538000") {
   variants {
    inventoryItems {
     inventoryLevels (first:10) {
        edges {
          node {
            location {
              name
                     }
           available
               }
              }
                                }
                   }
                   }
  }
  }

 

0 Likes
Shopify Staff
Shopify Staff
469 36 92

Hi Loren, you're looking for something like this, +/- the info you need or don't need 

{
  product(id: "gid://shopify/Product/94810538000") {
    id
    variants (first:10) {
      edges {
        node {
          id
          inventoryItem {
            id
            inventoryLevels (first:6) {
              edges {
                node {
                  id
                  available
                  location {
                    id
                    name
                    address {
                      address1
                      address2
                      city
                      country
                      zip
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

 

Developer Experience @ Shopify
1 Like
Shopify Partner
9 0 2

Thanks - that works perfectly.  But how'd you generate that so fast?

 

0 Likes
Shopify Staff
Shopify Staff
469 36 92

Practice!

Developer Experience @ Shopify
1 Like
Shopify Partner
4 0 0

Hi Ryan,

For the fulfillment service API, how will i know which location_id i need to use for each line item? 

Right now my company uses a private app to do all our fulfillments and we have about 600 different fufillment service. 

Some of our order's come with a origin_location attached with the line item but some order's do not have it. how will i be able to fufill the line item if it does not come with an origin_location?

thanks.

0 Likes