API reference
Sellub exposes two GraphQL APIs from the Vendure server.
Shop API
Public, used by storefronts. Customer-facing operations: browsing products, cart, checkout, account.
- Endpoint:
https://api.sellub.com/shop-api - Auth:
vendure-token: <channelToken>header to scope to a shop (the token is the shop’s slug — leave it out for the marketplace); session cookie or thevendure-auth-tokenheader for the customer. - Schema: introspection is disabled in production. Use a local server (
http://localhost:3000/shop-api, with GraphiQL) or@duabalabs/sellub-client’s typed helpers.
Common operations
query GetActiveOrder {
activeOrder {
id
code
state
totalWithTax
lines { productVariant { name } quantity linePriceWithTax }
}
}
mutation AddItemToOrder($variantId: ID!, $quantity: Int!) {
addItemToOrder(productVariantId: $variantId, quantity: $quantity) {
... on Order { id totalQuantity }
... on ErrorResult { errorCode message }
}
}Admin API
Internal, used by the dashboard and trusted integrations.
- Endpoint:
https://api.sellub.com/admin-api - Auth: an administrator’s session (cookie or
vendure-auth-token) or a Vendure API key asAuthorization: Bearer <api-key>. Storefront customer sessions are refused. - Scope: a seller’s account sees only its own shops.
- Schema: as for the Shop API — local only (
http://localhost:3000/admin-api).
Common operations
query Orders($options: OrderListOptions) {
orders(options: $options) {
items { id code state totalWithTax customer { emailAddress } }
totalItems
}
}
mutation TransitionOrderToState($id: ID!, $state: String!) {
transitionOrderToState(id: $id, state: $state) {
... on Order { id state }
... on OrderStateTransitionError { errorCode transitionError }
}
}Custom Sellub APIs
Beyond stock Vendure, Sellub’s plugins add operations. The ones an integrator is most likely to use:
| API | Purpose |
|---|---|
shops, shop, shopByDomain (Shop API) | Shop directory and a shop’s public profile |
deliveryEstimates (Shop API) | Delivery options and prices for a destination |
browseServices, bookService (Shop API) | Bookable services |
sellubShopBundles, sellubAddBundleToCart (Shop API) | Product bundles |
sellubCreateApiKey, sellubChannelSecurity (Admin API) | Your shop’s API keys and origin allow-lists |
sellubCreateWebhookEndpoint, sellubWebhookDeliveries (Admin API) | Webhook endpoints and their delivery log |
| External payments (REST) | One-off payments, invoices, subscriptions — see Commerce API |
Rate limits
The external-payments REST API is limited to 10 requests a minute per IP and 100 per account. The GraphQL APIs limit query complexity rather than request rate.
Last updated on