Create locations using graphql or rest api

Create locations using graphql or rest api

tmeristem
Visitor
2 0 2

I want to create locations using GRAPHQL or REST API, unfortunately there is no hint in documentation about location CUD(create,update,delete) operations except from read operation.  Is there any alternative ?

Replies 5 (5)

_JB
Shopify Staff (Retired)
836 100 223

Hey @tmeristem,

It's currently only possible to create a new location through the merchant admin panel. The only exception is when you're using a fulfillmentService, but the created location can only be used by that fulfillmentService.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

hdamico
Visitor
2 0 1

Hi @_JB 
I know this is a pretty old thread but I am having the same concern as @tmeristem had. I need to create a new location using REST API or Graphql but I can't find how, I looked at fulfillmentService documentation as you suggested but I didn't find anything, could you provide me the document where it shows you how to create a location for a fulfillmentService?

guest4
Shopify Partner
90 6 24

Shopify automatically creates a Location for each Fulfillment Service. So if you need to create a Location, then create a Fulfillment Service. 

cspinelive
Shopify Partner
8 0 4

Use the locationAdd mutation of the GraphQL API.  It is listed under the "Store Properties" menu on the GraphQL API section of the docs website.  https://shopify.dev/docs/api/admin-graphql/2023-01/mutations/locationAdd

cspinelive
Shopify Partner
8 0 4

For those that come across this like I did, you can now add, edit, delete, activate and deactivate locations using the GraphQL API and it's mutations.  locationAdd, locationEdit, and so on.