Skip to Content

store

Get basic store information including domain, logo, favicon, and policies.

Query Structure

query { store { domain logo favicon name customerAccountsEnabled customerAccountsOptional customerAccountsRequireApproval catalogBrowsingRequiresAccount canSellOverStock isPasswordProtected defaultConsentOptions } }

Arguments

This query does not accept any arguments.

ArgumentTypeDescriptionRequiredDefault Value

Return Type

Type: StoreInfo

Basic information about the store including domain, logo, policies, and account settings.

FieldTypeDescriptionRequired
domainStringThe domain of the store.Yes
logoStringThe store’s logo if it is set.No
faviconStringThe store’s favicon if it is set.No
nameStringThe name of the store.Yes
customerAccountsEnabledBooleanReturns true if customer accounts are enabled in the store.Yes
customerAccountsOptionalBooleanReturns true if customer accounts are optional.Yes
customerAccountsRequireApprovalBooleanReturns true if customer accounts need to be approved.Yes
catalogBrowsingRequiresAccountBooleanReturns true if a customer account is required to browse the catalog.Yes
canSellOverStockBooleanReturns true if the store can sell over stock.Yes
isPasswordProtectedBooleanReturns true if the store has password protection enabled.Yes
defaultConsentOptions[String]Returns the default consent options for the store that a user can accept.Yes

Examples

Basic Query

query { store { domain name customerAccountsEnabled } }

Advanced Query

query { store { domain logo favicon name customerAccountsEnabled customerAccountsOptional customerAccountsRequireApproval catalogBrowsingRequiresAccount canSellOverStock isPasswordProtected defaultConsentOptions } }

Field Selection

query { store { name domain isPasswordProtected defaultConsentOptions } }

cURL Example

curl -X POST https://www.mystoreurl.com/graphql/0.8.0/ \ -H "Content-Type: application/json" \ -d '{"query":"query { store { domain name customerAccountsEnabled } }"}'

JavaScript Example

async function fetchStoreInfo() { const endpoint = "https://www.mystoreurl.com/graphql/0.8.0/"; const query = ` query { store { domain name customerAccountsEnabled } } `; try { const response = await fetch(endpoint, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ query }) }); if (!response.ok) { throw new Error(`Network error: ${response.status} ${response.statusText}`); } const { data, errors } = await response.json(); if (errors) { console.error("GraphQL errors:", errors); return; } console.log("Store Info:", data.store); } catch (error) { console.error("Fetch error:", error); } } fetchStoreInfo();

Response Format

{ "data": { "store": { "domain": "example.com", "logo": "https://example.com/logo.png", "favicon": "https://example.com/favicon.ico", "name": "Example Store", "customerAccountsEnabled": true, "customerAccountsOptional": false, "customerAccountsRequireApproval": false, "catalogBrowsingRequiresAccount": false, "canSellOverStock": true, "isPasswordProtected": false, "defaultConsentOptions": ["email_marketing", "sms_notifications"] } } }

Error Handling

Error CodeDescriptionResolution
400 Bad RequestThe query is malformed or invalid.Check the GraphQL query syntax and structure.
500 Internal Server ErrorServer encountered an unexpected condition.Retry the request after some time or contact support.
GraphQL ErrorsErrors returned in the errors field of the response.Inspect the error messages for details and adjust the query accordingly.

Performance Considerations

  • The store query returns a small, fixed set of fields and is optimized for quick retrieval.
  • Avoid requesting unnecessary optional fields (logo, favicon) if not needed to reduce payload size.
  • This query does not support pagination or filtering as it returns a single store object.
  • Rate limiting may apply to the API; implement exponential backoff or retries on HTTP 429 responses.
  • Cache the response where appropriate, as store information changes infrequently.

Authentication

This API currently does not require authentication. However, authentication requirements may be introduced in future versions. Monitor API updates for any changes to authentication requirements.

StoreInfo

FieldTypeDescription
domainStringThe domain of the store.
logoStringThe store’s logo if it is set.
faviconStringThe store’s favicon if it is set.
nameStringThe name of the store.
customerAccountsEnabledBooleanReturns true if customer accounts are enabled in the store.
customerAccountsOptionalBooleanReturns true if customer accounts are optional.
customerAccountsRequireApprovalBooleanReturns true if customer accounts need to be approved.
catalogBrowsingRequiresAccountBooleanReturns true if a customer account is required to browse the catalog.
canSellOverStockBooleanReturns true if the store can sell over stock.
isPasswordProtectedBooleanReturns true if the store has password protection enabled.
defaultConsentOptions[String]Returns the default consent options for the store that a user can accept.

Notes

  • The store query provides essential information useful for storefront display, customer account management, and policy enforcement.
  • The defaultConsentOptions field lists consent types (e.g., marketing preferences) that the store supports by default.
  • Optional fields such as logo and favicon may be null if not configured.
  • The boolean fields related to customer accounts and catalog browsing help tailor user experience and access control.
  • Always check for the presence of optional fields before usage to avoid runtime errors.
Last updated on