Merchant Admin GraphQL
Complete guide and operation reference for POST /admin/graphql (31 Queries, 65 Mutations, RBAC & SSE)
Merchant Admin GraphQL (/admin/graphql)
Every xclade store exposes a dedicated Merchant Admin GraphQL surface at:
POST https://{shortId}.api.myxclade.com/admin/graphqlBuilt natively in Go (gqlgen), /admin/graphql powers the Store Admin Console (/app), back-office automations, ERP syncs, warehouse operations, and @xclade/sdk admin methods.
Key Capabilities
- 31 Queries & 65 Mutations spanning catalog, pricing, WMS bins & cycle counts, orders, draft orders, fulfillments, refunds, returns, B2B quotes/approvals, analytics, ERP connections, webhooks, RBAC, and batch imports.
- Fine-Grained RBAC: Every operation is protected by
AdminRBACGuardand the@requirePermissionschema directive. - Live SSE Transport: Supports Server-Sent Events (
transport.SSEwith 15-second keep-alive pings) alongsidePOSTandGET. - Higher Admin Limits: Allows up to 16 MiB payloads (for batch imports), depth 14, 30 aliases, and 75 directives.
- CSRF Guard: Always enabled on
GEToperations—sendX-Xclade-Request: trueorX-GraphQL-Request: true.
Authentication
Authenticate admin requests using any of three supported methods:
- Admin JWT Bearer Token — Obtained from
adminLogin(email, password)orredeemAdminSso(token):Authorization: Bearer eyJhbGciOi... - Merchant Secret API Key (
sk_...) — Ideal for server-to-server ERP/CI scripts:Authorization: Bearer sk_live_... - Admin Session Cookie — Automatically set for browser sessions inside
/app.
Sign In Example
mutation AdminLogin($email: String!, $password: String!) {
adminLogin(email: $email, password: $password)
}query AdminMe {
adminMe {
id
email
first_name
last_name
is_super_admin
policies
roles {
id
name
slug
is_system
}
}
}Admin Queries (31)
Identity, Store Configuration & RBAC
| Query | Description |
|---|---|
adminMe | Fetch the authenticated admin user, assigned roles, and effective RBAC policy keys. |
storeConfig | Fetch store name, default currency/region/sales channel/stock location, return window, and metadata. |
adminUsers | List store administrator accounts and their assigned roles. |
rbacRoles | List custom and system RBAC roles. |
rbacPolicies | List available RBAC permission policies. |
publishableKeys | List storefront Publishable API Keys (pk_...) and linked sales channels. |
salesChannels | List configured sales channels. |
taxRegions | List tax regions and default rates. |
shippingProfiles | List fulfillment shipping profiles. |
customerGroups | List customer groups (including B2B contract groups). |
vendors | List marketplace vendors. |
Catalog, Pricing & Effective-Price Debugger
| Query | Description |
|---|---|
adminProducts | Paginated SQL-joined catalog list with variant counts, inventory totals, and filters. |
adminPriceLists | List sale and override price lists. |
adminPriceListPage | Fetch a price list with paginated variant price rows. |
resolveEffectivePrices | Debug exact effective price resolution for variants given currency, region, customer group, or quantity. |
Inventory & Warehouse Management (WMS)
| Query | Description |
|---|---|
stockLocations | List warehouses and fulfillment locations. |
inventoryLevels | Inspect stocked, reserved, and available quantities per location. |
adminInventoryItems | Paginated inventory items with SKU and stock summaries. |
warehouseBins(location_id) | List warehouse storage bins (zone, aisle, rack, shelf, capacity). |
cycleCountSessions(location_id) | List warehouse physical inventory cycle count sessions. |
Orders, Customers, Analytics & Integrations
| Query | Description |
|---|---|
adminOrders | Paginated orders & draft orders with status, channel, region, customer, and B2B company filters. |
adminCustomers | Searchable customer directory with account filters. |
analyticsOverview(from, to, currency_code) | Revenue, order count, AOV, and conversion metrics. |
adminB2BOverview | B2B pipeline metrics across companies, pending quotes, and approvals. |
abandonedCartStats(days) | Aggregate abandoned cart recovery statistics. |
abandonedCarts(limit, offset, stage) | List active abandoned carts by recovery stage. |
providerConfigs | List payment, shipping, search, and verification (e.g. ID Rabbit) provider configs. |
erpConnections | List configured ERP integrations (Zoho, NetSuite, etc.). |
webhookEndpoints | List tenant outbound webhook subscriptions. |
adminQuery / adminFetchQuery | Generic domain query dispatchers used by internal console tooling. |
Admin Mutations (65)
Auth, Store Setup, RBAC & Uploads
adminLogin,adminLogout,redeemAdminSsocreatePresignedUpload(direct-to-S3 media upload URLs)updateStoreConfig,upsertRegion,upsertSalesChannel,upsertTaxRegion,upsertShippingOptioninviteAdminUser,upsertRbacRole,assignUserRolescreatePublishableKey,revokePublishableKey
Catalog, Pricing, Promotions & Search
upsertProduct,deleteProduct,upsertCategory,upsertCollection,upsertBrand,upsertVendormoderateReview,reindexSearch(triggers full Typesense catalog reindex)upsertCustomerGroup,upsertCampaignupsertPriceList,deletePriceList,upsertPromotion,deletePromotion
Inventory & Warehouse Management (WMS)
upsertStockLocation,adjustInventoryLevelupsertWarehouseBin,startCycleCountSession,completeCycleCountSession
Orders, Fulfillments, Payments, Returns & B2B Quotes
createDraftOrder,convertDraftOrdercreateOrderFulfillment,markFulfillmentShipped,markFulfillmentDeliveredcaptureOrderPayment,refundOrderPayment,cancelOrderstageOrderEdit,confirmOrderEdit,receiveReturnsendQuoteOffer,merchantRejectQuote
Storefront CMS, Providers, ERP & Webhooks
updateBrandSettings,upsertNavigationMenu,upsertHeroSlider,updateSeoSettings,upsertAdvertisement,upsertChangelogupsertProviderConfig,verifyProviderConfigupsertErpConnection,triggerErpSyncupsertWebhookEndpoint,deleteWebhookEndpoint
High-Throughput Batch Importers
importCategoriesBatch,importCollectionsBatch,importProductsBatch,importCustomersBatch,importOrdersBatchadminMutate,adminFetchMutate
Using @xclade/sdk for Admin Operations
import { createXcladeSDK } from '@xclade/sdk';
const admin = createXcladeSDK({
baseUrl: 'https://{shortId}.api.myxclade.com',
apiKey: process.env.XCLADE_SECRET_KEY, // sk_live_...
});
const { products, count } = await admin.graphql.listProducts({ limit: 25, offset: 0 });
const overview = await admin.graphql.analyticsOverview({ currency_code: 'usd' });See the @xclade/sdk guide for complete TypeScript SDK examples.