Skip to Content

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

ArgumentTypeDescriptionRequiredDefault
NoneThis query does not accept any arguments.NoN/A

Return Type

StorePolicies

An object containing the store’s policies. Each policy field is optional and returns a Policy object with the following fields:

FieldTypeDescription
termsAndConditionsPolicyTerms and conditions of the store.
privacyPolicyPolicyPrivacy policy of the store.
shippingPolicyPolicyShipping policy of the store.
refundPolicyPolicyRefund policy of the store.

Policy

FieldTypeDescription
titleStringTitle of the policy document.
bodyStringFull text content of the policy.
urlStringURL to the policy page on the store.

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

Error CodeDescriptionHandling Recommendation
400 Bad RequestThe query is malformed or contains invalid fields.Check query syntax and field names.
500 Internal Server ErrorUnexpected server error occurred.Retry after some time; contact support if persists.
200 OK with errors fieldGraphQL-level errors such as invalid queries or unavailable fields.Inspect errors array in response and adjust query accordingly.

Performance Considerations

  • The policies query 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.

TypeDescription
StorePoliciesContainer for all store policy documents.
PolicyRepresents an individual policy document with title, body, and URL.

Notes

  • All policy fields (termsAndConditions, privacyPolicy, shippingPolicy, refundPolicy) are optional and may be null if 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.
Last updated on