GraphQL
Read the store, products, collections, sellers, reviews, payment methods and articles in one request to POST /graphql.
With GraphQL you fetch the store, a product and its related products in one request, and you get back only the fields you select. The schema is read-only: carts, checkout, customers and every write go through REST.
Quick start
Send the query with POST and put the store's slug or domain in x-Store-Domain:
curl --request POST "https://storefront.ecomiq.pe/graphql" \
--header "Content-Type: application/json" \
--header "x-Store-Domain: my-store" \
--data-binary '{
"query": "query Store { store { id name currency language } }"
}'{
"data": {
"store": {
"id": "7204558912004325301",
"name": "My store",
"currency": "PEN",
"language": "es"
}
}
}The endpoint takes one operation per request, always over POST. IDs are opaque strings: store them and send them back unchanged.
Queries
store
Store name, logo, type, currency and language.
products
Paginated search with filters, facets and sorting.
product
One product's details by slug.
relatedProducts
Related products from a product ID.
collections
Collections with search, sorting and their first products.
collection
One collection by slug.
sellers
Marketplace sellers and their rating.
seller
A seller's profile, links and policies.
productReviews
A product's reviews with cursor, search and sorting.
storeReviews
Recent reviews across the store for testimonials.
paymentMethods
Payment methods offered at checkout.
articles
Published articles with search, folder and tag.
GraphQL or REST
| To | Use |
|---|---|
| Combine store, seller and products in one response | GraphQL |
| Request only some fields of a resource | GraphQL |
| Search products with filters and facets | GraphQL or REST |
| Create or update a cart, checkout or customer | REST |
| Read geography, tracking or analytics | REST |
| Work with OpenAPI or a Postman collection | REST |
Next steps
Last updated: