Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I hope that we can confirm the inventory of those places in the United States through the zip code. If the zip code is not within this range, the inventory of other warehouses will be displayed. If the zip code is not set, the inventory cannot be purchased.
Hello @kingsun
To confirm the inventory of a product at different warehouses in the United States based on the zip code, you can use the Shopify Inventory API. This API allows you to retrieve information about the availability of a product at a specific location.
To use the Inventory API, you will need to:
Enable the Inventory API in your Shopify store. To do this, go to Apps > Manage private apps and click on the "Create a new private app" button. Give your app a name and select the "Inventory" permission. Then click on the "Create app" button to generate your API credentials.
Retrieve the ID of the product that you want to check the inventory for. You can use the Shopify GraphQL API to do this by running a query like this:
{
product(id: "gid://shopify/Product/1234567890") {
id
}
}
Replace "1234567890" with the ID of the product that you want to check the inventory for.
Use the Inventory API to retrieve the inventory levels for the product at different locations. You can do this by making a GET request to the following URL:Use the Inventory API to retrieve the inventory levels for the product at different locations. You can do this by making a GET request to the following URL:
https://{your_store}.myshopify.com/admin/api/2022-10/products/{product_id}/inventory_levels.json
Replace {your_store} with the name of your Shopify store and {product_id} with the ID of the product that you retrieved in step 2.
In the response, you will receive a list of inventory levels for the product at different locations. You can filter this list based on the zip code to find the inventory levels for the locations that you are interested in.
You can find more information about the Inventory here https://help.shopify.com/en/manual/products/inventory/getting-started-with-inventory
I still need to develop a separate application to manage this, right? Thank you!
Yes, Let me know if I can help 🙂
How much will it cost if you help to implement this function
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025