Anchor to shop
shop
query
Returns the Shop resource corresponding to the access token used in the request. The Shop resource contains business and store management settings for the shop.
Anchor to Possible returnsPossible returns
- Anchor to ShopShop•
Represents a collection of general settings and information about the shop.
Was this section helpful?
- Get a metafield attached to a shop
- Get metafields attached to a shop
- Receive a list of all FulfillmentServices
- Retrieve information about a shop
- Retrieves a list of fulfillment orders assigned to the shop locations that are owned by the app
- Retrieves a list of all users
- Retrieves a list of currencies enabled on a shop
- Retrieves a list of storefront access tokens that have been issued
- Retrieves a list of the shop's policies
- Retrieves the shop's configuration
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query ShopMetafield($namespace: String!, $key: String!) {
shop {
copyrightYear: metafield(namespace: $namespace, key: $key) {
value
}
}
}`,
{
variables: {
"namespace": "my_fields",
"key": "copyright_year"
},
},
);
const data = await response.json();
query ShopMetafield($namespace: String!, $key: String!) {
shop {
copyrightYear: metafield(namespace: $namespace, key: $key) {
value
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query ShopMetafield($namespace: String!, $key: String!) { shop { copyrightYear: metafield(namespace: $namespace, key: $key) { value } } }",
"variables": {
"namespace": "my_fields",
"key": "copyright_year"
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query ShopMetafield($namespace: String!, $key: String!) {
shop {
copyrightYear: metafield(namespace: $namespace, key: $key) {
value
}
}
}`,
{
variables: {
"namespace": "my_fields",
"key": "copyright_year"
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `query ShopMetafield($namespace: String!, $key: String!) {
shop {
copyrightYear: metafield(namespace: $namespace, key: $key) {
value
}
}
}`,
"variables": {
"namespace": "my_fields",
"key": "copyright_year"
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query ShopMetafield($namespace: String!, $key: String!) {
shop {
copyrightYear: metafield(namespace: $namespace, key: $key) {
value
}
}
}
QUERY
variables = {
"namespace": "my_fields",
"key": "copyright_year"
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"namespace": "my_fields",
"key": "copyright_year"
}
Response
JSON{
"shop": {
"copyrightYear": {
"value": "2022"
}
}
}