policies
Get store policies including terms and conditions, privacy policy, shipping policy, and refund policy.
Query Structure
query {
policies {
termsAndConditions {
title
body
url
}
privacyPolicy {
title
body
url
}
shippingPolicy {
title
body
url
}
refundPolicy {
title
body
url
}
}
}Arguments
Return Type
StorePolicies
An object containing the store’s policies. Each policy field is optional and returns a Policy object with the following fields:
Policy
Examples
Basic Query
query {
policies {
termsAndConditions {
title
body
}
}
}Advanced Query
query {
policies {
termsAndConditions {
title
body
url
}
privacyPolicy {
title
body
url
}
shippingPolicy {
title
body
url
}
refundPolicy {
title
body
url
}
}
}Field Selection
query {
policies {
privacyPolicy {
title
url
}
refundPolicy {
title
body
}
}
}cURL Example
curl -X POST https://www.mystoreurl.com/graphql/0.8.0 \
-H "Content-Type: application/json" \
-d '{"query":"query { policies { termsAndConditions { title body url } } }"}'JavaScript Example
async function fetchStorePolicies() {
const query = `
query {
policies {
termsAndConditions {
title
body
url
}
privacyPolicy {
title
body
url
}
shippingPolicy {
title
body
url
}
refundPolicy {
title
body
url
}
}
}
`;
try {
const response = await fetch('https://www.mystoreurl.com/graphql/0.8.0', {
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 Policies:', data.policies);
} catch (error) {
console.error('Fetch error:', error);
}
}
fetchStorePolicies();Response Format
{
"data": {
"policies": {
"termsAndConditions": {
"title": "Terms and Conditions",
"body": "These are the terms and conditions...",
"url": "https://www.mystoreurl.com/terms"
},
"privacyPolicy": {
"title": "Privacy Policy",
"body": "This is the privacy policy...",
"url": "https://www.mystoreurl.com/privacy"
},
"shippingPolicy": {
"title": "Shipping Policy",
"body": "Details about shipping...",
"url": "https://www.mystoreurl.com/shipping"
},
"refundPolicy": {
"title": "Refund Policy",
"body": "Information about refunds...",
"url": "https://www.mystoreurl.com/refund"
}
}
}
}Error Handling
Performance Considerations
- The
policiesquery returns static content that rarely changes, so it is safe to cache responses on the client or CDN to reduce load and improve response times. - Since no arguments are accepted, caching is straightforward and can be done globally.
- Rate limiting may apply on the API server; avoid excessive polling by caching results and refreshing only when necessary.
- The response size depends on the length of policy bodies; request only the fields needed to optimize payload size.
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.
Related Types
Notes
- All policy fields (
termsAndConditions,privacyPolicy,shippingPolicy,refundPolicy) are optional and may benullif not set by the store. - Use field selection to request only the policies relevant to your application to optimize performance.
- URLs provided in policy fields link to the store’s public-facing policy pages for user reference.