Skip to main content

Location

Requires read_locations access scope.

Subscribe to field-level changes on the Location GraphQL Admin API object. You can subscribe to create, delete, and update events, as well as changes to specific fields.

Each topic corresponds to a commerce resource (for example, a location) that can exist independently within its domain. Child entities that depend on a parent within the same domain don't have their own topic. Instead, changes to child entities trigger a delivery on the parent topic. Calculated fields, derived fields, auto-updated timestamps, and cross-domain fields aren't available as triggers.

shopify.app.toml

[events]
api_version = "unstable"

[[events.subscription]]
handle = "my_location_events"

topic = "Location"
actions = ["update"]
triggers = [
"location.address.city",
"location.isActive"
]

uri = "https://your-app.com/events"

query = """
query location_details($locationId: ID!) {
location(id: $locationId) {
id
name
isActive
address {
city
provinceCode
countryCode
}
}
shop {
id
}
}
"""

# Optional
query_filter = "location.isActive:true"

Field-level triggers for Location subscriptions.

All triggers require the read_locations access scope, and those triggers that require additional scopes are documented where relevant. Deprecated triggers are listed last.

Subscriptions can include multiple triggers. Use the shopify-webhook-id header for deduplication when handling duplicate deliveries.

Custom queries aren't limited to Location. They can query the full GraphQL Admin API.

Anchor to list-of-topics-location.*
location.*

Fires when events involve the Location object.

The "create" and "delete" actions are only relevant within the context of this parent topic. Use fields_changed to follow or replicate impacted data after a delete event. Define a custom query to retrieve specific fields from create events.

location.* is a parent trigger. Subscribing with the "update" action receives events for all supported triggers under location, including nested triggers. Use a more specific trigger to limit events to the fields you need.

Variables: locationId

Anchor to list-of-topics-location.address.*
location.address.*

Fires when the address field on the Location object changes.

location.address.* is a parent trigger. Subscribing with the "update" action receives events for all supported triggers under location.address, including nested triggers. Use a more specific trigger to limit events to the fields you need.

Include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The address field represents the address of this location.

Variables: locationId

Anchor to list-of-topics-location.address.address1
location.address.address1

Fires when the address1 field on the LocationAddress object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The address1 field represents the first line of the address for the location.

Variables: locationId

Anchor to list-of-topics-location.address.address2
location.address.address2

Fires when the address2 field on the LocationAddress object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The address2 field represents the second line of the address for the location.

Variables: locationId

Anchor to list-of-topics-location.address.city
location.address.city

Fires when the city field on the LocationAddress object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The city field represents the city of the location.

Variables: locationId

Anchor to list-of-topics-location.address.countryCode
location.address.countryCode

Fires when the countryCode field on the LocationAddress object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The countryCode field represents the country code of the location.

Variables: locationId

Anchor to list-of-topics-location.address.latitude
location.address.latitude

Fires when the latitude field on the LocationAddress object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The latitude field represents the approximate latitude coordinates of the location.

Variables: locationId

Anchor to list-of-topics-location.address.longitude
location.address.longitude

Fires when the longitude field on the LocationAddress object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The longitude field represents the approximate longitude coordinates of the location.

Variables: locationId

Anchor to list-of-topics-location.address.phone
location.address.phone

Fires when the phone field on the LocationAddress object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The phone field represents the phone number of the location.

Variables: locationId

Anchor to list-of-topics-location.address.provinceCode
location.address.provinceCode

Fires when the provinceCode field on the LocationAddress object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The provinceCode field represents the code for the province, state, or district of the address of the location.

Variables: locationId

Anchor to list-of-topics-location.address.zip
location.address.zip

Fires when the zip field on the LocationAddress object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The zip field represents the ZIP code of the location.

Variables: locationId

Anchor to list-of-topics-location.deactivatedAt
location.deactivatedAt

Fires when the deactivatedAt field on the Location object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The deactivatedAt field represents the date and time (ISO 8601 format) that the location was deactivated at.

Variables: locationId

Anchor to list-of-topics-location.fulfillsOnlineOrders
location.fulfillsOnlineOrders

Fires when the fulfillsOnlineOrders field on the Location object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The fulfillsOnlineOrders field indicates whether this location can fulfill online orders.

Variables: locationId

Anchor to list-of-topics-location.isActive
location.isActive

Fires when the isActive field on the Location object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The isActive field indicates whether the location is active.

Variables: locationId

Anchor to list-of-topics-location.metafield(namespace: String!, key: String!).*
location.metafield(namespace: String!, key: String!).*

Fires when the metafield field on the Location object changes.

location.metafield(namespace: String!, key: String!).* is a parent trigger. Subscribing with the "update" action receives events for all supported triggers under location.metafield(namespace: String!, key: String!), including nested triggers. Use a more specific trigger to limit events to the fields you need.

Include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The metafield field represents a custom field, including its namespace and key, that's associated with a Shopify resource for the purposes of adding and storing additional information.

Variables: locationId, metafieldKey, metafieldNamespace

Anchor to list-of-topics-location.metafield(namespace: String!).*
location.metafield(namespace: String!).*

Fires when the metafield field on the Location object changes.

location.metafield(namespace: String!).* is a parent trigger. Subscribing with the "update" action receives events for all supported triggers under location.metafield(namespace: String!), including nested triggers. Use a more specific trigger to limit events to the fields you need.

Include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

This subscription omits the optional argument metafield.key.

The metafield field represents a custom field, including its namespace and key, that's associated with a Shopify resource for the purposes of adding and storing additional information.

Variables: locationId, metafieldKey, metafieldNamespace

Anchor to list-of-topics-location.metafield(namespace: String!, key: String!).value
location.metafield(namespace: String!, key: String!).value

Fires when the value field on the Metafield object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

The value field represents the data stored in the metafield.

Variables: locationId, metafieldKey, metafieldNamespace

Anchor to list-of-topics-location.metafield(namespace: String!).value
location.metafield(namespace: String!).value

Fires when the value field on the Metafield object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

This subscription omits the optional argument metafield.key.

The value field represents the data stored in the metafield.

Variables: locationId, metafieldKey, metafieldNamespace

Anchor to list-of-topics-location.shipsInventory
location.shipsInventory

Fires when the shipsInventory field on the Location object changes.

Subscribe to this trigger with the "update" action and include the field in a custom query to retrieve updated data from the payload. You can trace the field in subsequent requests using fields_changed.

Legacy field indicating this location was designated for shipping.

Variables: locationId


Was this page helpful?