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 version2026-04
Auththe calling organization's own stored Shopify access token and shop domain, resolved from its shopify integration. You never pass a Shopify token yourself
Every requestrequires ?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

EndpointAdmin GraphQLDescription
GET /shopify/ordersordersList orders (first, after, query, sortKey, reverse)
GET /shopify/orders/countordersCount(query:)Count orders matching a query
GET /shopify/orders/{orderId}order(id:)Get one order
POST /shopify/orders/{orderId}/cancelorderCancelCancel an order
PATCH /shopify/orders/{orderId}/noteorderUpdate (note)Set an order's note
POST /shopify/orders/{orderId}/tagstagsAddAdd tags to an order
DELETE /shopify/orders/{orderId}/tagstagsRemoveRemove tags from an order
POST /shopify/orders/metafieldsmetafieldsSetSet order metafields

Products and inventory

EndpointAdmin GraphQLDescription
GET /shopify/productsproductsList products
POST /shopify/productsproductCreateCreate a product
GET /shopify/products/{productId}product(id:)Get one product
PATCH /shopify/products/{productId}productUpdateUpdate a product
GET /shopify/products/variantsproductVariantsList variants (first, after, query)
PATCH /shopify/products/variant-costinventoryItemUpdateSet a variant's unit cost (COGS)
POST /shopify/products/metafieldsmetafieldsSetSet product metafields
GET /shopify/inventory/levelslocation(id:).inventoryLevelsInventory levels at a location
GET /shopify/inventory/items/{inventoryItemId}inventoryItem(id:)Get one inventory item
POST /shopify/inventory/adjustinventoryAdjustQuantitiesAdjust stock quantities
GET /shopify/locationslocationsList locations

Customers and segments

EndpointAdmin GraphQLDescription
GET /shopify/customerscustomersList / search customers
GET /shopify/customers/{customerId}customer(id:)Get one customer
PATCH /shopify/customers/{customerId}customerUpdateUpdate a customer
GET /shopify/customers/{customerId}/orderscustomer(id:).ordersA customer's orders
POST /shopify/customers/{customerId}/tagstagsAddAdd customer tags
DELETE /shopify/customers/{customerId}/tagstagsRemoveRemove customer tags
GET /shopify/segmentssegmentsList customer segments
POST /shopify/segmentssegmentCreateCreate a segment (name, query)
GET /shopify/segments/{segmentId}/memberscustomerSegmentMembersMembers of a segment

Discounts and gift cards

EndpointAdmin GraphQLDescription
GET /shopify/discounts/codescodeDiscountNodesList code discounts
POST /shopify/discounts/codesdiscountCodeBasicCreateCreate a basic code discount
POST /shopify/discounts/bxgydiscountCodeBxgyCreateCreate a buy-X-get-Y discount
POST /shopify/discounts/free-shippingdiscountCodeFreeShippingCreateCreate a free-shipping discount
GET /shopify/discounts/automaticautomaticDiscountNodesList automatic discounts
DELETE /shopify/discounts/{discountId}discountCodeDeleteDelete a code discount
GET /shopify/gift-cardsgiftCardsList gift cards
POST /shopify/gift-cardsgiftCardCreateCreate a gift card
POST /shopify/gift-cards/{giftCardId}/deactivategiftCardDeactivateDeactivate a gift card

Draft orders

EndpointAdmin GraphQLDescription
GET /shopify/draft-ordersdraftOrdersList draft orders
POST /shopify/draft-ordersdraftOrderCreateCreate a draft order
GET /shopify/draft-orders/{draftOrderId}draftOrder(id:)Get one draft order
POST /shopify/draft-orders/{draftOrderId}/completedraftOrderCompleteComplete a draft order

Content and storefront

EndpointAdmin GraphQLDescription
GET /shopify/pagespagesList pages
POST /shopify/pagespageCreateCreate a page
GET /shopify/pages/{pageId}page(id:)Get one page
PATCH /shopify/pages/{pageId}pageUpdateUpdate a page
DELETE /shopify/pages/{pageId}pageDeleteDelete a page
GET /shopify/blogsblogsList blogs
GET /shopify/articlesarticlesList articles
POST /shopify/articlesarticleCreateCreate an article
PATCH /shopify/articles/{articleId}articleUpdateUpdate an article
DELETE /shopify/articles/{articleId}articleDeleteDelete an article
GET /shopify/redirectsurlRedirectsList URL redirects
POST /shopify/redirectsurlRedirectCreateCreate a URL redirect
GET /shopify/menusmenusList navigation menus
PATCH /shopify/menus/{menuId}menuUpdateUpdate a menu

Themes, webhooks, shop and analytics

EndpointAdmin GraphQLDescription
GET /shopify/themesthemesList themes
GET /shopify/themes/{themeId}/filestheme(id:).filesRead theme files (?filenames=a,b)
PUT /shopify/themes/{themeId}/filesthemeFilesUpsertCreate / overwrite theme files
DELETE /shopify/themes/{themeId}/filesthemeFilesDeleteDelete theme files
POST /shopify/themes/{themeId}/publishthemePublishPublish a theme
GET /shopify/webhookswebhookSubscriptionsList webhook subscriptions
POST /shopify/webhookswebhookSubscriptionCreateCreate a webhook subscription
DELETE /shopify/webhooks/{webhookId}webhookSubscriptionDeleteDelete a webhook subscription
GET /shopify/shopshopShop info (name, domain, currency, timezone)
POST /shopify/analytics/shopifyqlshopifyqlQueryRun 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

Runs 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}/files and POST /shopify/themes/{themeId}/publish — edit and publish the theme customers see
  • POST /shopify/orders/{orderId}/cancel — cancels a real order
  • POST /shopify/inventory/adjust — moves real stock
  • DELETE /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:

CodeStatusMeaning
SHOPIFY_AUTH_EXPIRED401Access token no longer valid — reconnect the store
SHOPIFY_SCOPE_MISSING403The app's granted scopes do not cover this call
SHOPIFY_RATE_LIMITED429Shopify throttled the request
SHOPIFY_PLATFORM_DOWN502Shopify returned a server-side failure
SHOPIFY_TIMEOUT504The call exceeded its time budget
SHOPIFY_UNKNOWN500Unclassified failure

And before any Shopify call is attempted:

CodeStatusMeaning
SHOPIFY_NOT_CONNECTED400The organization has no connected Shopify store
SHOPIFY_RECONNECT_REQUIRED401Stored credential is dead — the user must reconnect

| SHOPIFY_CREDENTIALS_ERROR | 400 | Credential resolution failed for another reason |


Did this page help you?