shop96 ops

Shop API

Catalog, products, vendors, categories, merchant operations, and inventory.

Queries

QUERY

adminGetShopOrder

#

Get a single shop order by ID (admin).

Arguments

  • id!
Returns
QUERY

adminGetShopOrders

#

List shop orders with filters, sorting, and pagination (admin).

Arguments

  • paging!

    Default

    {
      "limit": 10,
      "page": 1,
      "after": null
    }
  • filter
  • sorting[!]!

    Default

    []
Returns!
QUERY

adminInventoryAdjustments

#

Get inventory adjustment history for an inventory record.

Arguments

  • inventoryId!
  • limitInt
Returns[!]!
QUERY

adminInventoryByProduct

#

Get inventory for a specific product (and optionally a variant).

Arguments

  • productId!
  • variantId
Returns
QUERY

adminInventoryByShop

#

Get all inventory records for a shop.

Arguments

  • shopId!
  • lowStockOnlyBoolean
  • outOfStockOnlyBoolean
Returns[!]!
QUERY

adminInventorySummary

#

Get inventory summary counts for a shop.

Arguments

  • shopId!
Returns!
QUERY

adminListProductCategories

#

List product categories for admin with filtering, sorting, and pagination.

Arguments

  • paging!

    Default

    {
      "limit": 10,
      "page": 1,
      "after": null
    }
  • filter!

    Default

    {
      "shopId": null,
      "isEnabled": null,
      "search": null
    }
  • sorting[!]!

    Default

    []
Returns!
QUERY

adminListProducts

#

List products for admin with filtering, sorting, and pagination.

Arguments

  • paging!

    Default

    {
      "limit": 10,
      "page": 1,
      "after": null
    }
  • filter!

    Default

    {
      "shopId": null,
      "categoryIds": [],
      "status": null,
      "search": null
    }
  • sorting[!]!

    Default

    []
Returns!
QUERY

adminListShopCategories

#

List shop categories with admin filters, sorting, and pagination. # Authorization Requires TenantAdmin or PlatformAdmin role.

Arguments

  • paging!

    Default

    {
      "limit": 10,
      "page": 1,
      "after": null
    }
  • filter
  • sorting[!]!

    Default

    []
Returns!
QUERY

adminListShops

#

List shops with admin filters, sorting, and pagination. # Authorization Requires TenantAdmin or PlatformAdmin role.

Arguments

  • paging!

    Default

    {
      "limit": 10,
      "page": 1,
      "after": null
    }
  • filter
  • sorting[!]!

    Default

    []
Returns!
QUERY

cart

#

Get the current user's cart. Creates a new cart if one doesn't exist. Includes delivery fee preview and per-method delivery options when a delivery address with coordinates is set.

Returns!
QUERY

cartItemCount

#

Get cart item count (for nav badge).

ReturnsInt!
QUERY

featuredProducts

#

Get featured products (discounted or high display priority). Optionally filtered by category.

Arguments

  • paging!

    Default

    {
      "limit": 10,
      "page": 1,
      "after": null
    }
  • categoryId
Returns!
QUERY

myMerchantProfile

#

Get the current user's merchant profile.

Returns
QUERY

myShopOrder

#

Get a single shop order by ID for the authenticated customer. Returns None if the order doesn't exist or doesn't belong to the customer.

Arguments

  • id!
Returns
QUERY

myShopOrders

#

Get all shop orders for the current customer.

Arguments

  • pagination!
Returns!
QUERY

myShops

#

Get shops owned by the current merchant.

Arguments

  • pagination!
Returns!
QUERY

product

#

Get a product by ID.

Arguments

  • id!
Returns
QUERY

productAvailabilitySchedule

#

Get all availability schedule entries for a product.

Arguments

  • productId!
Returns[!]!
QUERY

products

#

Discover products within a shop with optional search, category, and tag filters. Replaces browseProducts, searchProducts, and productsByTags with a single query. **Filter priority:** 1. If query is set → full-text search on name/description/tags 2. Else if tags is set → filter products matching any tag 3. Else if category_id is set → filter by product category 4. Else → all active products in the shop

Arguments

  • input!
Returns!
QUERY

productVariants

#

Get product variants for a product.

Arguments

  • productId!
Returns[!]!
QUERY

searchProducts

#

Semantic product search. Embeds the free-text query, then ranks products by cosine similarity against their stored description_embedding. Requires the tenant to have semantic_search_enabled turned on under Settings → AI Features and at least one configured embedding-capable AI provider with remaining monthly budget.

Arguments

  • input!
Returns[!]!
QUERY

shop

#

Get a shop by ID.

Arguments

  • id!
Returns
QUERY

shopBySlug

#

Get a shop by slug.

Arguments

  • slugString!
Returns
QUERY

shopCategories

#

Get all shop categories. Returns enabled categories sorted by display order.

Returns[!]!
QUERY

shopCategoriesWithSubcategories

#

Get all shop categories with their subcategories.

Returns[!]!
QUERY

shopCategory

#

Get a shop category by ID.

Arguments

  • id!
Returns
QUERY

shopCategoryBySlug

#

Get a shop category by slug.

Arguments

  • slugString!
Returns
QUERY

shopDeliveryZones

#

List delivery zones for a specific shop (admin).

Arguments

  • shopId!
  • paging!

    Default

    {
      "limit": 10,
      "page": 1,
      "after": null
    }
  • sorting[!]!

    Default

    []
Returns!
QUERY

shopOrders

#

Get orders for a specific shop owned by the current merchant. Supports filters, sorting, and pagination.

Arguments

  • shopId!
  • paging!

    Default

    {
      "limit": 10,
      "page": 1,
      "after": null
    }
  • filter
  • sorting[!]!

    Default

    []
Returns!
QUERY

shopOrderStatistics

#

Get aggregate statistics for shop orders. Filters by currency (required) and an optional date range. Statistics are computed across all shops for the current tenant.

Arguments

  • currencyString!
  • dateRangeStart
  • dateRangeEnd
Returns!
QUERY

shops

#

Discover shops with optional search, location, category, and open-status filters. Replaces browseShops, nearbyShops, and searchShops with a single unified query. **Filter priority:** 1. If query is set → full-text search on name/description 2. Else if location is set → proximity search sorted by distance 3. Else if category_id is set → filter by category 4. Else if subcategory_id is set → filter by subcategory 5. Else → all enabled shops currently_open_only is always applied as a post-filter if set.

Arguments

  • input!

    Default

    {
      "query": null,
      "location": null,
      "categoryId": null,
      "subcategoryId": null,
      "currentlyOpenOnly": null,
      "limit": 10,
      "page": 1,
      "after": null,
      "sorting": []
    }
Returns!
QUERY

shopServiceHealth

#

Service health check query.

ReturnsString!
QUERY

shopSubcategories

#

Get subcategories for a category.

Arguments

  • categoryId!
Returns[!]!

Mutations

MUTATION

acceptShopOrder

#

Accept an incoming shop order.

Arguments

  • input!
Returns!
MUTATION

addToCart

#

Add an item to the cart.

Arguments

  • input!
Returns!
MUTATION

adminAddStock

#

Add stock to an inventory record.

Arguments

  • input!
Returns!
MUTATION

adminCreateInventory

#

Create an inventory record for a product (or product variant).

Arguments

  • input!
Returns!
MUTATION

adminCreateShopOrder

#

Create a shop order on behalf of a customer (call-center dispatcher path). # Authorization Requires TenantAdmin or PlatformAdmin role. # Behaviour - Validates the shop is enabled and belongs to the calling tenant. - Loads each product to lock in its current price (no cart/quote round-trip). - Computes pricing: subtotal = sum of unit_price × quantity, delivery_fee = shop.delivery_fee_minor when delivering (else 0), total = subtotal + delivery_fee. Tax and service fees are zero in the dispatcher path; they remain a server-driven concern for customer-placed orders that go through the cart flow. - Generates a fresh parent order_id UUID — shop orders persist independently of the order-domain Order row, matching the existing schema (no FK enforcement). - Persists with status: New, prep_status: Pending so it appears on the merchant's incoming-orders queue exactly like a normal order.

Arguments

  • input!
Returns!
MUTATION

adminDeleteProduct

#

Soft-delete a product by setting its status to discontinued.

Arguments

  • id!
ReturnsBoolean!
MUTATION

adminRemoveStock

#

Remove stock from an inventory record.

Arguments

  • input!
Returns!
MUTATION

adminSetStockQuantity

#

Set the absolute stock quantity for an inventory record.

Arguments

  • input!
Returns!
MUTATION

adminUpdateProductDiscount

#

Update discount settings for a product. Set discount_percentage to null to remove the discount entirely.

Arguments

  • input!
Returns!
MUTATION

adminUpdateShopStatus

#

Update a shop's status as an admin. # Authorization Requires TenantAdmin or PlatformAdmin role. # Validation The new status must be a permitted transition from the current status. Allowed transitions: - PendingApprovalEnabled (alias: approve via approveMerchant) - PendingApprovalBlocked - EnabledDisabled | Blocked - DisabledEnabled | Archived - BlockedEnabled | Archived Archived is terminal. Any other transition returns an error.

Arguments

  • input!
Returns!
MUTATION

applyPromoCode

#

Apply a promo code to the cart.

Arguments

  • input!
Returns!
MUTATION

approveMerchant

#

Approve a merchant (admin only). Sets merchant status to Approved and marks as verified.

Arguments

  • merchantId!
Returns!
MUTATION

checkoutCart

#

Checkout the current cart: validates shops, locks prices, and returns a quote ID. The returned quoteId should be passed to createOrder(quoteId, kind: SHOP, ...). The quote expires after 5 minutes — call again if expired.

Arguments

  • input!
Returns!
MUTATION

clearCart

#

Clear all items from the cart.

Returns!
MUTATION

createDeliveryZone

#

Create a delivery zone on a shop owned by the calling merchant.

Arguments

  • input!
Returns!
MUTATION

createProduct

#

Create a new product.

Arguments

  • input!
Returns!
MUTATION

createProductAvailability

#

Create a new product availability schedule entry.

Arguments

  • input!
Returns!
MUTATION

createProductCategory

#

Create a new product category.

Arguments

  • input!
Returns!
MUTATION

createProductOption

#

Create a new product option within a group.

Arguments

  • input!
Returns!
MUTATION

createShop

#

Create a new shop.

Arguments

  • input!
Returns!
MUTATION

createShopCategory

#

Create a new shop category. # Authorization Requires TenantAdmin or PlatformAdmin role.

Arguments

  • input!
Returns!
MUTATION

createShopDeliveryZone

#

Create a new delivery zone for a shop.

Arguments

  • input!
Returns!
MUTATION

deleteDeliveryZone

#

Delete a delivery zone — caller must own the shop it belongs to.

Arguments

  • id!
ReturnsBoolean!
MUTATION

deleteProductAvailability

#

Delete a product availability schedule entry.

Arguments

  • id!
ReturnsBoolean!
MUTATION

deleteProductCategory

#

Delete a product category.

Arguments

  • id!
ReturnsBoolean!
MUTATION

deleteProductOption

#

Delete a product option.

Arguments

  • id!
ReturnsBoolean!
MUTATION

deleteShopCategory

#

Delete a shop category by ID. # Authorization Requires TenantAdmin or PlatformAdmin role.

Arguments

  • id!
ReturnsBoolean!
MUTATION

deleteShopDeliveryZone

#

Delete a delivery zone.

Arguments

  • id!
ReturnsBoolean!
MUTATION

embedAllProducts

#

Compute embeddings for every still-NULL product under this tenant (or one shop, when shop_id is provided). Tenant-admin only. Bounded internally; the admin re-runs until moreRemaining is false. Plan gate (Pro+) is enforced inside the EmbeddingPort dispatcher.

Arguments

  • shopIdString
Returns!
MUTATION

embedProduct

#

Compute and store the embedding for one product. Tenant-admin only. Requires the tenant to have semantic_search_enabled turned on under Settings → AI Features and at least one configured embedding-capable AI provider with remaining monthly budget. Plan gate (Pro+) is enforced inside the EmbeddingPort dispatcher.

Arguments

  • productIdString!
Returns!
MUTATION

generateProductSuggestionFromPhoto

#

Generate a draft product suggestion from a single product photo. Tenant-admin only. Requires the tenant to have product_description_gen_enabled turned on under Settings → AI Features and at least one configured AI provider with remaining monthly budget.

Arguments

  • input!
Returns!
MUTATION

markOrderDelivered

#

Mark an order as delivered.

Arguments

  • input!
Returns!
MUTATION

markOrderPickedUp

#

Mark an order as picked up.

Arguments

  • input!
Returns!
MUTATION

markOrderReady

#

Mark an order as ready for pickup/delivery.

Arguments

  • input!
Returns!
MUTATION

registerMerchant

#

Register as a merchant.

Arguments

  • input!
Returns!
MUTATION

rejectShopOrder

#

Reject an incoming shop order.

Arguments

  • input!
Returns!
MUTATION

removeFromCart

#

Remove an item from the cart.

Arguments

  • input!
Returns!
MUTATION

removePromoCode

#

Remove a promo code from the cart.

Arguments

  • promoCodeString!
Returns!
MUTATION

reorderProductOptions

#

Reorder options within a group.

Arguments

  • input!
ReturnsBoolean!
MUTATION

setCartDeliveryAddress

#

Set the delivery address for the cart. Only requires the saved location ID — coordinates are resolved server-side from the identity service.

Arguments

  • input!
Returns!
MUTATION

setCartDeliveryMode

#

Set the delivery mode for the cart.

Arguments

  • input!
Returns!
MUTATION

setShopCategories

#

Replace the set of categories associated with a merchant's shop. Validates that all category IDs belong to the same tenant and are enabled before making any changes. Diffs current vs requested and issues only the needed add/remove calls.

Arguments

  • input!
Returns[!]!
MUTATION

setShopDeliveryZones

#

Atomically replace the full set of delivery zones on a shop. Used by the onboarding form which collects all zones together — one transactional call avoids the partial-failure / duplicate- zone states the per-zone create_delivery_zone path produced on retry.

Arguments

  • input!
Returns[!]!
MUTATION

setShopOperatingHours

#

Set operating hours for a shop (bulk replace all days).

Arguments

  • input!
Returns[!]!
MUTATION

shopServicePing

#

Service health check mutation.

ReturnsString!
MUTATION

startOrderPreparation

#

Start preparing an order.

Arguments

  • input!
Returns!
MUTATION

toggleProductAvailability

#

Toggle product availability.

Arguments

  • input!
Returns!
MUTATION

toggleProductOptionEnabled

#

Toggle a product option's enabled state.

Arguments

  • id!
  • isEnabledBoolean!
ReturnsBoolean!
MUTATION

toggleShopOpen

#

Toggle shop open/closed state.

Arguments

  • input!
Returns!
MUTATION

updateCartItem

#

Update item quantity in cart.

Arguments

  • input!
Returns!
MUTATION

updateDeliveryZone

#

Update a delivery zone — caller must own the shop the zone lives on.

Arguments

  • input!
Returns!
MUTATION

updateMerchant

#

Update merchant profile.

Arguments

  • input!
Returns!
MUTATION

updateProduct

#

Update an existing product.

Arguments

  • input!
Returns!
MUTATION

updateProductAvailability

#

Update an existing product availability schedule entry.

Arguments

  • input!
Returns!
MUTATION

updateProductCategory

#

Update an existing product category.

Arguments

  • input!
Returns!
MUTATION

updateProductOption

#

Update an existing product option.

Arguments

  • input!
Returns!
MUTATION

updateProductStatus

#

Update product status (draft, active, discontinued).

Arguments

  • input!
Returns!
MUTATION

updateShop

#

Update an existing shop.

Arguments

  • input!
Returns!
MUTATION

updateShopCategory

#

Update an existing shop category. # Authorization Requires TenantAdmin or PlatformAdmin role.

Arguments

  • input!
Returns!
MUTATION

updateShopDeliveryZone

#

Update an existing delivery zone.

Arguments

  • input!
Returns!

Subscriptions

SUBSCRIPTION

shopCustomerEvents

#

Subscribe to shop customer events (Shop service) Receive real-time events relevant to shop customers: - Order confirmations - Shipment tracking updates - Delivery notifications - Notifications **Requirements:** - Must be authenticated - Must have Customer role - Must be using Shop app

Returns!
SUBSCRIPTION

vendorEvents

#

Subscribe to vendor events (Shop service) Receive real-time events relevant to shop vendors: - New order notifications - Inventory alerts - Payment received notifications - Notifications **Requirements:** - Must be authenticated - Must have Vendor role - Must be using Shop app

Returns!

Build the foundation once. Expand without limits.

BetterSuite is built for teams who see on-demand as a business — not a feature.