Shopify
Overview
The Shopify Core API exposes Shopify's Admin GraphQL API through a REST-shaped surface — orders, products, customers, discounts, inventory, content, themes, webhooks and raw ShopifyQL. Each route maps to exactly one Admin GraphQL query or mutation, named in the table below.
| Base path | /api/core/shopify |
| Admin API version | 2026-04 |
| Auth | the calling organization's own stored Shopify access token and shop domain, resolved from its shopify integration. You never pass a Shopify token yourself |
| Every request | requires ?organizationId=<uuid> |
IDs: pass the numeric tail, not the full GID. Shopify identifies objects as gid://shopify/Order/1234567890; these routes take 1234567890 in the path and build the GID for you. A full URL-encoded GID also passes through untouched, so both forms work.
Money is Shopify's unit here, not piasters. Unlike Analify's Analytics API (which returns integer piasters everywhere), Core API returns Shopify's raw values — and shopifyql in particular returns EGP major units. Convert on your side; do not assume ×100.
API Endpoints
Orders
| Endpoint | Admin GraphQL | Description |
|---|---|---|
GET /shopify/orders | orders | List orders (first, after, query, sortKey, reverse) |
GET /shopify/orders/count | ordersCount(query:) | Count orders matching a query |
GET /shopify/orders/{orderId} | order(id:) | Get one order |
POST /shopify/orders/{orderId}/cancel | orderCancel | Cancel an order |
PATCH /shopify/orders/{orderId}/note | orderUpdate (note) | Set an order's note |
POST /shopify/orders/{orderId}/tags | tagsAdd | Add tags to an order |
DELETE /shopify/orders/{orderId}/tags | tagsRemove | Remove tags from an order |
POST /shopify/orders/metafields | metafieldsSet | Set order metafields |
Products and inventory
| Endpoint | Admin GraphQL | Description |
|---|---|---|
GET /shopify/products | products | List products |
POST /shopify/products | productCreate | Create a product |
GET /shopify/products/{productId} | product(id:) | Get one product |
PATCH /shopify/products/{productId} | productUpdate | Update a product |
GET /shopify/products/variants | productVariants | List variants (first, after, query) |
PATCH /shopify/products/variant-cost | inventoryItemUpdate | Set a variant's unit cost (COGS) |
POST /shopify/products/metafields | metafieldsSet | Set product metafields |
GET /shopify/inventory/levels | location(id:).inventoryLevels | Inventory levels at a location |
GET /shopify/inventory/items/{inventoryItemId} | inventoryItem(id:) | Get one inventory item |
POST /shopify/inventory/adjust | inventoryAdjustQuantities | Adjust stock quantities |
GET /shopify/locations | locations | List locations |
Customers and segments
| Endpoint | Admin GraphQL | Description |
|---|---|---|
GET /shopify/customers | customers | List / search customers |
GET /shopify/customers/{customerId} | customer(id:) | Get one customer |
PATCH /shopify/customers/{customerId} | customerUpdate | Update a customer |
GET /shopify/customers/{customerId}/orders | customer(id:).orders | A customer's orders |
POST /shopify/customers/{customerId}/tags | tagsAdd | Add customer tags |
DELETE /shopify/customers/{customerId}/tags | tagsRemove | Remove customer tags |
GET /shopify/segments | segments | List customer segments |
POST /shopify/segments | segmentCreate | Create a segment (name, query) |
GET /shopify/segments/{segmentId}/members | customerSegmentMembers | Members of a segment |
Discounts and gift cards
| Endpoint | Admin GraphQL | Description |
|---|---|---|
GET /shopify/discounts/codes | codeDiscountNodes | List code discounts |
POST /shopify/discounts/codes | discountCodeBasicCreate | Create a basic code discount |
POST /shopify/discounts/bxgy | discountCodeBxgyCreate | Create a buy-X-get-Y discount |
POST /shopify/discounts/free-shipping | discountCodeFreeShippingCreate | Create a free-shipping discount |
GET /shopify/discounts/automatic | automaticDiscountNodes | List automatic discounts |
DELETE /shopify/discounts/{discountId} | discountCodeDelete | Delete a code discount |
GET /shopify/gift-cards | giftCards | List gift cards |
POST /shopify/gift-cards | giftCardCreate | Create a gift card |
POST /shopify/gift-cards/{giftCardId}/deactivate | giftCardDeactivate | Deactivate a gift card |
Draft orders
| Endpoint | Admin GraphQL | Description |
|---|---|---|
GET /shopify/draft-orders | draftOrders | List draft orders |
POST /shopify/draft-orders | draftOrderCreate | Create a draft order |
GET /shopify/draft-orders/{draftOrderId} | draftOrder(id:) | Get one draft order |
POST /shopify/draft-orders/{draftOrderId}/complete | draftOrderComplete | Complete a draft order |
Content and storefront
| Endpoint | Admin GraphQL | Description |
|---|---|---|
GET /shopify/pages | pages | List pages |
POST /shopify/pages | pageCreate | Create a page |
GET /shopify/pages/{pageId} | page(id:) | Get one page |
PATCH /shopify/pages/{pageId} | pageUpdate | Update a page |
DELETE /shopify/pages/{pageId} | pageDelete | Delete a page |
GET /shopify/blogs | blogs | List blogs |
GET /shopify/articles | articles | List articles |
POST /shopify/articles | articleCreate | Create an article |
PATCH /shopify/articles/{articleId} | articleUpdate | Update an article |
DELETE /shopify/articles/{articleId} | articleDelete | Delete an article |
GET /shopify/redirects | urlRedirects | List URL redirects |
POST /shopify/redirects | urlRedirectCreate | Create a URL redirect |
GET /shopify/menus | menus | List navigation menus |
PATCH /shopify/menus/{menuId} | menuUpdate | Update a menu |
Themes, webhooks, shop and analytics
| Endpoint | Admin GraphQL | Description |
|---|---|---|
GET /shopify/themes | themes | List themes |
GET /shopify/themes/{themeId}/files | theme(id:).files | Read theme files (?filenames=a,b) |
PUT /shopify/themes/{themeId}/files | themeFilesUpsert | Create / overwrite theme files |
DELETE /shopify/themes/{themeId}/files | themeFilesDelete | Delete theme files |
POST /shopify/themes/{themeId}/publish | themePublish | Publish a theme |
GET /shopify/webhooks | webhookSubscriptions | List webhook subscriptions |
POST /shopify/webhooks | webhookSubscriptionCreate | Create a webhook subscription |
DELETE /shopify/webhooks/{webhookId} | webhookSubscriptionDelete | Delete a webhook subscription |
GET /shopify/shop | shop | Shop info (name, domain, currency, timezone) |
POST /shopify/analytics/shopifyql | shopifyqlQuery | Run a raw ShopifyQL query |
Reading orders
GET /api/core/shopify/orders forwards Shopify's own connection args — first, after (cursor), query (Shopify's search syntax), sortKey, reverse.
curl -G "https://analify.scalyax.ai/api/core/shopify/orders" \
-H "Authorization: Bearer {anlfy_token}" \
--data-urlencode "organizationId={organizationId}" \
--data-urlencode "first=10" \
--data-urlencode "query=created_at:>=2026-08-01 financial_status:paid"Pagination is Shopify's cursor model, not page numbers: read pageInfo.hasNextPage / endCursor from the response and pass the cursor back as after.
ShopifyQL
POST /api/core/shopify/analytics/shopifyql
POST /api/core/shopify/analytics/shopifyqlRuns a raw ShopifyQL query — Shopify's own analytics language — and returns its unmodified table.
curl -X POST "https://analify.scalyax.ai/api/core/shopify/analytics/shopifyql?organizationId={organizationId}" \
-H "Authorization: Bearer {anlfy_token}" -H "Content-Type: application/json" \
-d '{
"query": "FROM sales SHOW total_sales, orders GROUP BY day SINCE -30d UNTIL today"
}'FROM sales returns EGP major units. Analify's own ingest layer multiplies by 100 before storing; Core API does not. If you are comparing a ShopifyQL figure against an Analytics API figure, scale one of them first.
Setting product costs (COGS)
PATCH /api/core/shopify/products/variant-cost writes the unit cost onto Shopify's inventory item. If you would rather keep costs in Analify without touching Shopify, use the Analify-native COGS endpoints instead — those are piaster-based and never write to the store.
Destructive routes
These change a live storefront or live order data, take effect immediately, and have no dry-run. All of them require an API token with the write scope.
PUT/DELETE /shopify/themes/{themeId}/filesandPOST /shopify/themes/{themeId}/publish— edit and publish the theme customers seePOST /shopify/orders/{orderId}/cancel— cancels a real orderPOST /shopify/inventory/adjust— moves real stockDELETE /shopify/pages/{pageId},DELETE /shopify/articles/{articleId},DELETE /shopify/discounts/{discountId},DELETE /shopify/webhooks/{webhookId}
Error Shape
Shopify failures are classified into a fixed set, each with its own HTTP status, and carry a reconnectRequired hint:
| Code | Status | Meaning |
|---|---|---|
SHOPIFY_AUTH_EXPIRED | 401 | Access token no longer valid — reconnect the store |
SHOPIFY_SCOPE_MISSING | 403 | The app's granted scopes do not cover this call |
SHOPIFY_RATE_LIMITED | 429 | Shopify throttled the request |
SHOPIFY_PLATFORM_DOWN | 502 | Shopify returned a server-side failure |
SHOPIFY_TIMEOUT | 504 | The call exceeded its time budget |
SHOPIFY_UNKNOWN | 500 | Unclassified failure |
And before any Shopify call is attempted:
| Code | Status | Meaning |
|---|---|---|
SHOPIFY_NOT_CONNECTED | 400 | The organization has no connected Shopify store |
SHOPIFY_RECONNECT_REQUIRED | 401 | Stored credential is dead — the user must reconnect |
| SHOPIFY_CREDENTIALS_ERROR | 400 | Credential resolution failed for another reason |
Updated about 2 months ago
