It seems the the location
endpoint doesn’t expose anything about which location is the default for a store.
Yet within a store admin under Settings > Location, there is a default location.
Is there a reason this isn’t exposed in the Admin API?
It seems the the location
endpoint doesn’t expose anything about which location is the default for a store.
Yet within a store admin under Settings > Location, there is a default location.
Is there a reason this isn’t exposed in the Admin API?
The docs seem to indicate that the concept is deprecated, I guess with order routing rules anywhere could be default.
Hey folks - @JordanFinners is on point, at the moment the
isPrimary
field is deprecated. Right now, the best method for tracking this would be through metafields. For example:
mutation LocationMetafieldsSet($locationId: ID!) {
metafieldsSet(metafields: [
{
ownerId: $locationId
namespace: "custom"
key: "isdefault"
type: "boolean"
value: "true"
}
]) {
metafields {
id
namespace
key
value
type
ownerType
}
userErrors {
field
message
}
}
}
It’s not the most ideal for sure, since you’d technically have to know this beforehand or build an interface for the merchant to mark a location as the default/primary shipping location, but thought this may help
My understanding is that this change is related to shared/multi-origin shipping. That said, if you’d like to share any use cases you folks were thinking about when it comes to primary shipping locations, feel free to ping me here and I’d be happy to take a look.
Yeah using a metafield isn’t ideal really for a public app to manage this.
My understanding is that this change is related to shared/multi-origin shipping.
Hmm its a bit confusing then because the admin settings UI still has a ‘default location’ area, so a store does still have one. It’s rather frustrating not having the API’s align with this the admin UI.