> ## Documentation Index
> Fetch the complete documentation index at: https://docs.depict.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# A product's available stock per variant and market group

> Available quantity of each variant in each of the merchant's market groups. Read-only. A single-market store, or a failed stock read, answers the empty payload (no groups).



## OpenAPI

````yaml /api-reference/openapi/lite.json get /products/{product_id}/variant-stock
openapi: 3.1.0
info:
  title: Search & Merchandising API
  version: 1.0.0
  description: >-
    REST API behind Depict: Search & Merchandising, the native Shopify app:
    onboarding, collections, boost & bury, dashboards, A/B testing and
    multi-store management. Endpoints are served under the /api/lite prefix and
    are authenticated with the Shopify session token that App Bridge issues to
    the embedded app.
servers:
  - url: /api/lite
security:
  - ShopifySessionToken: []
paths:
  /products/{product_id}/variant-stock:
    get:
      summary: A product's available stock per variant and market group
      description: >-
        Available quantity of each variant in each of the merchant's market
        groups. Read-only. A single-market store, or a failed stock read,
        answers the empty payload (no groups).
      operationId: productVariantStock
      parameters:
        - schema:
            type: string
            description: Shopify product id (numeric string).
          required: true
          description: Shopify product id (numeric string).
          name: product_id
          in: path
        - schema:
            type: string
            description: Lite merchant id, e.g. `shopify-<shop id>`.
          required: true
          description: Lite merchant id, e.g. `shopify-<shop id>`.
          name: merchant_id
          in: query
      responses:
        '200':
          description: Stock by market group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductVariantMarketStock'
        '400':
          description: The query failed its schema; `detail` carries zod's messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '401':
          description: Not authenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '403':
          description: Authenticated, but this identity may not call the API.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '404':
          description: Merchant not found for this caller.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
components:
  schemas:
    ProductVariantMarketStock:
      type: object
      properties:
        market_groups:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
            required:
              - name
          description: The merchant's market groups; empty for a single-market store.
        variant_quantities_by_group:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: integer
          description: Market group name → variant id → available quantity.
      required:
        - market_groups
        - variant_quantities_by_group
    Detail:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
      description: 'Every 4xx/5xx body: `{detail}`.'
  securitySchemes:
    ShopifySessionToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Shopify App Bridge session token of the embedded Depict: Search &
        Merchandising app. The shop in the token determines the merchant;
        merchant_id parameters must belong to that shop.

````