shop113 ops

API de Shop

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

Consultas

CONSULTA

adminBlogCategories

#

Categories for the admin picker / filter chips.

Argumentos

  • tenantIdID
Devuelve[!]!
CONSULTA

adminGetShopOrder

#

Get a single shop order by ID (admin).

Argumentos

  • id!
Devuelve
CONSULTA

adminGetShopOrders

#

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

Argumentos

  • paging!

    Por defecto

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

    Por defecto

    []
Devuelve!
CONSULTA

adminInventoryAdjustments

#

Get inventory adjustment history for an inventory record.

Argumentos

  • inventoryId!
  • limitInt
Devuelve[!]!
CONSULTA

adminInventoryByProduct

#

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

Argumentos

  • productId!
  • variantId
Devuelve
CONSULTA

adminInventoryByShop

#

Get all inventory records for a shop.

Argumentos

  • shopId!
  • lowStockOnlyBoolean
  • outOfStockOnlyBoolean
Devuelve[!]!
CONSULTA

adminInventorySummary

#

Get inventory summary counts for a shop.

Argumentos

  • shopId!
Devuelve!
CONSULTA

adminListProductCategories

#

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

Argumentos

  • paging!

    Por defecto

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

    Por defecto

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

    Por defecto

    []
Devuelve!
CONSULTA

adminListProducts

#

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

Argumentos

  • paging!

    Por defecto

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

    Por defecto

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

    Por defecto

    []
Devuelve!
CONSULTA

adminListShopCategories

#

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

Argumentos

  • paging!

    Por defecto

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

    Por defecto

    []
Devuelve!
CONSULTA

adminListShops

#

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

Argumentos

  • paging!

    Por defecto

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

    Por defecto

    []
Devuelve!
CONSULTA

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.

Devuelve!
CONSULTA

cartItemCount

#

Get cart item count (for nav badge).

DevuelveInt!
CONSULTA

featuredProducts

#

Get featured products (discounted or high display priority). Optionally filtered by *product* category (menu section).

Argumentos

  • paging!

    Por defecto

    {
      "limit": 10,
      "page": 1,
      "after": null
    }
  • productCategoryId
Devuelve!
CONSULTA

myMerchantProfile

#

Get the current user's merchant profile.

Devuelve
CONSULTA

myShopInventory

#

List inventory rows for one of the current merchant's shops. Optional filters narrow the result to only low-stock or only out-of-stock items (out-of-stock takes precedence when both are set).

Argumentos

  • shopId!
  • lowStockOnlyBoolean
  • outOfStockOnlyBoolean
Devuelve[!]!
CONSULTA

myShopInventorySummary

#

Low-stock and out-of-stock counts for one of the current merchant's shops — powers the vendor home "needs restock" summary.

Argumentos

  • shopId!
Devuelve!
CONSULTA

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.

Argumentos

  • id!
Devuelve
CONSULTA

myShopOrders

#

Get all shop orders for the current customer.

Argumentos

  • pagination!
Devuelve!
CONSULTA

myShopProducts

#

List **all** products for one of the current merchant's shops — the management view — regardless of status or availability. Unlike the customer-facing products query (which only returns Active + available products), this also returns Draft, OutOfStock, and is_available = false products, so a merchant can see and re-enable a product they have marked sold out, or publish a freshly-created draft. Scoped to shop_id after verifying ownership. An optional product_category_id narrows the list to a single menu section; the category is verified to belong to the shop first, so a merchant can't read another shop's catalog by passing a foreign category id.

Argumentos

  • shopId!
  • productCategoryId
  • paging!

    Por defecto

    {
      "limit": 10,
      "page": 1,
      "after": null
    }
Devuelve!
CONSULTA

myShops

#

Get shops owned by the current merchant.

Argumentos

  • pagination!
Devuelve!
CONSULTA

myShopSalesChart

#

Weekly sales chart (revenue + order count per week) for one of the current merchant's shops. Scoped to shop_id after verifying ownership; currency is the merchant's own currency. Optional date range narrows the window.

Argumentos

  • shopId!
  • dateRangeStart
  • dateRangeEnd
Devuelve!
CONSULTA

product

#

Get a product by ID.

Argumentos

  • id!
Devuelve
CONSULTA

productAvailabilitySchedule

#

Get all availability schedule entries for a product.

Argumentos

  • productId!
Devuelve[!]!
CONSULTA

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 product_category_id is set → filter by product category 4. Else → all active products in the shop

Argumentos

  • input!
Devuelve!
CONSULTA

productVariants

#

Get product variants for a product.

Argumentos

  • productId!
Devuelve[!]!
CONSULTA

publicBlogCategories

#

All categories for the system tenant — drives the filter-chip row on /blog.

Devuelve[!]!
CONSULTA

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.

Argumentos

  • input!
Devuelve[!]!
CONSULTA

shop

#

Get a shop by ID. location is optional and, when supplied, makes deliveryFee address-aware (zone fee, or a live express quote for an express-only shop). Omitting it keeps the previous behaviour (null fee).

Argumentos

  • id!
  • location
Devuelve
CONSULTA

shopBySlug

#

Get a shop by slug. Accepts the same optional location as [shop] to make deliveryFee address-aware on the detail path.

Argumentos

  • slugString!
  • location
Devuelve
CONSULTA

shopCategories

#

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

Devuelve[!]!
CONSULTA

shopCategoriesWithSubcategories

#

Get all shop categories with their subcategories.

Devuelve[!]!
CONSULTA

shopCategory

#

Get a shop category by ID.

Argumentos

  • id!
Devuelve
CONSULTA

shopCategoryBySlug

#

Get a shop category by slug.

Argumentos

  • slugString!
Devuelve
CONSULTA

shopDeliveryZones

#

List delivery zones for a specific shop (admin).

Argumentos

  • shopId!
  • paging!

    Por defecto

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

    Por defecto

    []
Devuelve!
CONSULTA

shopOrder

#

Get a single order by ID for one of the current merchant's shops. Returns None when no order matches the id. Errors if the order exists but belongs to a shop the current merchant does not own, mirroring the ownership check in [MerchantQuery::shop_orders] — a merchant must never be able to read another merchant's order by guessing its id.

Argumentos

  • id!
Devuelve
CONSULTA

shopOrders

#

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

Argumentos

  • shopId!
  • paging!

    Por defecto

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

    Por defecto

    []
Devuelve!
CONSULTA

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.

Argumentos

  • currencyString!
  • dateRangeStart
  • dateRangeEnd
Devuelve!
CONSULTA

shopProductCategories

#

List a shop's enabled product categories (its menu sections), ordered for display. Each returned category resolves its own nested products, so the customer app can fetch a shop's entire catalog grouped by category in one request on shop open. These are *product* categories (per-shop menu sections), distinct from the shop's *business* categories exposed as Shop.categories / shopCategories.

Argumentos

  • shopId!
Devuelve[!]!
CONSULTA

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 shop_category_id is set → filter by shop (business) category 4. Else if shop_subcategory_id is set → filter by shop subcategory 5. Else → all enabled shops currently_open_only is always applied as a post-filter if set.

Argumentos

  • input!

    Por defecto

    {
      "query": null,
      "location": null,
      "shopCategoryId": null,
      "shopSubcategoryId": null,
      "currentlyOpenOnly": null,
      "minRating": null,
      "maxDeliveryFee": null,
      "hasDiscount": null,
      "limit": 10,
      "page": 1,
      "after": null,
      "sorting": []
    }
Devuelve!
CONSULTA

shopsByIds

#

Get several shops by ID, in the order requested. Serves the pinned storefront modes: shopStorefront hands the client a short list of shop ids, and this turns them into cards for the store switcher in one round-trip. Deliberately not a filter on [shops](Self::shops) — that query's job is discovery (pagination, sorting, proximity, category), none of which applies to a set the server already chose. Ids belonging to another tenant, or that no longer exist, are dropped rather than erroring: a pinned shop can be disabled between the config read and this call, and a half-rendered switcher beats a failed screen. location behaves as on [shop](Self::shop) — supplying it makes deliveryFee address-aware. Express quotes stay off: this renders a list, and each quote is an external routing call.

Argumentos

  • ids[!]!
  • location
Devuelve[!]!
CONSULTA

shopServiceHealth

#

Service health check query.

DevuelveString!
CONSULTA

shopStorefront

#

The storefront the calling tenant's shop app should render. Read by shop_customer at startup, before login — a bpk_ public client key is enough, since the answer is the same for every customer of the tenant and the app must know which listing to draw on its first frame. Returns platform defaults when the tenant has never configured it, so this never errors for a valid tenant.

Devuelve!
CONSULTA

shopSubcategories

#

Get subcategories for a category.

Argumentos

  • categoryId!
Devuelve[!]!

Mutaciones

MUTACIÓN

acceptShopOrder

#

Accept an incoming shop order.

Argumentos

  • input!
Devuelve!
MUTACIÓN

addToCart

#

Add an item to the cart.

Argumentos

  • input!
Devuelve!
MUTACIÓN

adjustProductStock

#

Adjust a product's on-hand stock by a signed delta, recording an audited adjustment. Positive adds stock, negative removes it.

Argumentos

  • input!
Devuelve!
MUTACIÓN

adminAddStock

#

Add stock to an inventory record.

Argumentos

  • input!
Devuelve!
MUTACIÓN

adminCreateInventory

#

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

Argumentos

  • input!
Devuelve!
MUTACIÓN

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.

Argumentos

  • input!
Devuelve!
MUTACIÓN

adminDeleteProduct

#

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

Argumentos

  • id!
DevuelveBoolean!
MUTACIÓN

adminRemoveStock

#

Remove stock from an inventory record.

Argumentos

  • input!
Devuelve!
MUTACIÓN

adminSetStockQuantity

#

Set the absolute stock quantity for an inventory record.

Argumentos

  • input!
Devuelve!
MUTACIÓN

adminUpdateProductDiscount

#

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

Argumentos

  • input!
Devuelve!
MUTACIÓN

adminUpdateShopStatus

#

Update a shop's status as an admin. # Authorization Requires TenantAdmin or PlatformAdmin role. # Validation Shop status is operational-only (approval lives on the merchant — a shop goes live when its merchant is approved via approveMerchant). The new status must be a permitted transition from the current status: - DisabledEnabled | Archived - EnabledDisabled | Blocked - BlockedEnabled | Archived Archived is terminal. Any other transition returns an error.

Argumentos

  • input!
Devuelve!
MUTACIÓN

applyPromoCode

#

Apply a promo code to the cart.

Argumentos

  • input!
Devuelve!
MUTACIÓN

approveMerchant

#

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

Argumentos

  • merchantId!
Devuelve!
MUTACIÓN

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.

Argumentos

  • input!
Devuelve!
MUTACIÓN

clearCart

#

Clear all items from the cart.

Devuelve!
MUTACIÓN

createDeliveryZone

#

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

Argumentos

  • input!
Devuelve!
MUTACIÓN

createProduct

#

Create a new product.

Argumentos

  • input!
Devuelve!
MUTACIÓN

createProductAvailability

#

Create a new product availability schedule entry.

Argumentos

  • input!
Devuelve!
MUTACIÓN

createProductCategory

#

Create a new product category. Admins may target any shop; merchants only their own shops.

Argumentos

  • input!
Devuelve!
MUTACIÓN

createProductOption

#

Create a new product option within a group.

Argumentos

  • input!
Devuelve!
MUTACIÓN

createShop

#

Create a new shop.

Argumentos

  • input!
Devuelve!
MUTACIÓN

createShopCategory

#

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

Argumentos

  • input!
Devuelve!
MUTACIÓN

createShopDeliveryZone

#

Create a new delivery zone for a shop.

Argumentos

  • input!
Devuelve!
MUTACIÓN

deleteDeliveryZone

#

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

Argumentos

  • id!
DevuelveBoolean!
MUTACIÓN

deleteProductAvailability

#

Delete a product availability schedule entry.

Argumentos

  • id!
DevuelveBoolean!
MUTACIÓN

deleteProductCategory

#

Delete a product category.

Argumentos

  • id!
DevuelveBoolean!
MUTACIÓN

deleteProductOption

#

Delete a product option.

Argumentos

  • id!
DevuelveBoolean!
MUTACIÓN

deleteShopCategory

#

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

Argumentos

  • id!
DevuelveBoolean!
MUTACIÓN

deleteShopDeliveryZone

#

Delete a delivery zone.

Argumentos

  • id!
DevuelveBoolean!
MUTACIÓN

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.

Argumentos

  • shopIdString
Devuelve!
MUTACIÓN

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.

Argumentos

  • productIdString!
Devuelve!
MUTACIÓN

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.

Argumentos

  • input!
Devuelve!
MUTACIÓN

markOrderDelivered

#

Mark an order as delivered.

Argumentos

  • input!
Devuelve!
MUTACIÓN

markOrderPickedUp

#

Mark an order as picked up.

Argumentos

  • input!
Devuelve!
MUTACIÓN

markOrderReady

#

Mark an order as ready for pickup/delivery.

Argumentos

  • input!
Devuelve!
MUTACIÓN

registerMerchant

#

Register as a merchant.

Argumentos

  • input!
Devuelve!
MUTACIÓN

rejectShopOrder

#

Reject an incoming shop order.

Argumentos

  • input!
Devuelve!
MUTACIÓN

removeFromCart

#

Remove an item from the cart.

Argumentos

  • input!
Devuelve!
MUTACIÓN

removePromoCode

#

Remove a promo code from the cart.

Argumentos

  • promoCodeString!
Devuelve!
MUTACIÓN

reorderProductOptions

#

Reorder options within a group.

Argumentos

  • input!
DevuelveBoolean!
MUTACIÓN

saveBlogCategory

#

Argumentos

  • input!
Devuelve!
MUTACIÓN

setCartDeliveryAddress

#

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

Argumentos

  • input!
Devuelve!
MUTACIÓN

setCartDeliveryMode

#

Set the delivery mode for the cart.

Argumentos

  • input!
Devuelve!
MUTACIÓN

setProductAvailability

#

Atomically replace a product's full availability schedule. Passing an empty windows list clears the schedule (the product becomes available whenever the shop is open).

Argumentos

  • input!
Devuelve[!]!
MUTACIÓN

setProductStock

#

Set a product's on-hand stock for one of the current merchant's shops. Creates the inventory row if absent and turns on inventory tracking for the product so fulfillment reserves against it.

Argumentos

  • input!
Devuelve!
MUTACIÓN

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.

Argumentos

  • input!
Devuelve[!]!
MUTACIÓN

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.

Argumentos

  • input!
Devuelve[!]!
MUTACIÓN

setShopOperatingHours

#

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

Argumentos

  • input!
Devuelve[!]!
MUTACIÓN

setShopStorefront

#

Set the tenant's storefront mode, pinned shops and cart scope. Requires TenantOwner, TenantAdmin or PlatformAdmin. Returns the freshly-resolved storefront rather than the raw stored config, so the settings UI can show the effect of the change — most importantly what AUTO worked out to — without a second round-trip.

Argumentos

  • input!
Devuelve!
MUTACIÓN

shopServicePing

#

Service health check mutation.

DevuelveString!
MUTACIÓN

startOrderPreparation

#

Start preparing an order.

Argumentos

  • input!
Devuelve!
MUTACIÓN

submitMerchantForReview

#

Submit the caller's merchant profile for admin review. Transitions the merchant Pending → PendingReview (or re-submits from Rejected). This is the single approval signal: the merchant enters the admin approval queue here, and approve_merchant — which also enables the merchant's onboarding shop — is the counterpart. Shop status is operational-only and carries no approval state.

Devuelve!
MUTACIÓN

toggleProductAvailability

#

Toggle product availability.

Argumentos

  • input!
Devuelve!
MUTACIÓN

toggleProductOptionEnabled

#

Toggle a product option's enabled state.

Argumentos

  • id!
  • isEnabledBoolean!
DevuelveBoolean!
MUTACIÓN

toggleShopOpen

#

Toggle shop open/closed state.

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateCartItem

#

Update item quantity in cart.

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateDeliveryZone

#

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

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateMerchant

#

Update merchant profile.

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateProduct

#

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateProductAvailability

#

Update an existing product availability schedule entry.

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateProductCategory

#

Update an existing product category.

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateProductDiscount

#

Update an existing product. Set, change, or clear a product's discount on one of the caller's shops. Null fields clear the corresponding value (no discount / unlimited quantity / no expiry) — mirrors adminUpdateProductDiscount but scoped to the merchant's own products.

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateProductOption

#

Update an existing product option.

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateProductStatus

#

Update product status (draft, active, discontinued).

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateShop

#

Update an existing shop.

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateShopCategory

#

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

Argumentos

  • input!
Devuelve!
MUTACIÓN

updateShopDeliveryZone

#

Update an existing delivery zone.

Argumentos

  • input!
Devuelve!

Suscripciones

SUSCRIPCIÓN

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

Devuelve!
SUSCRIPCIÓN

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

Devuelve!