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

# Check store availability for a product

> Returns nearby store availability for a known product. Provide the user's location and search radius to find stores carrying this product, sorted by distance (closest first).



## OpenAPI

````yaml /openapi/openapi-agent.json get /agent/api/v1/products/{gtin}/availability
openapi: 3.1.0
info:
  title: Agentic Commerce API
  version: 1.0.0
  description: >
    Structured API for AI shopping assistants (ChatGPT, Gemini, Perplexity) to
    resolve product availability at nearby stores via tool use. Accepts
    natural-language product queries with geographic context and returns ranked
    results with real-time store availability.


    ## Authentication


    All endpoints require an API key passed via the `X-API-Key` HTTP header,
    unless otherwise noted.


    ```

    X-API-Key: csb_<body>_<checksum>

    ```


    Generate API keys in **Settings > API Keys** in your dashboard, or via the
    Account API.

    Session-based (cookie) authentication is also accepted for browser-based
    access.


    ## Rate Limits


    | Tier        | Requests / minute | Requests / day |

    |-------------|-------------------|----------------|

    | Default     | 300               | 10,000         |

    | Custom      | Contact us        | Contact us     |


    Rate-limit headers are included on every response so callers can
    self-throttle without

    hitting our 429s ("informed governor"):


    - `RateLimit-Policy` — every active window, e.g. `300;w=60, 10000;w=86400`

    - `RateLimit-Limit` — quota for the **most-restrictive** currently-active
    window

    - `RateLimit-Remaining` — requests left in that window

    - `RateLimit-Reset` — seconds until that window resets (relative; clock-skew
    safe)


    Legacy `X-RateLimit-*` aliases are also emitted for back-compat.
    `X-RateLimit-Reset`

    keeps the absolute Unix-timestamp shape to avoid breaking existing
    consumers.


    When rate-limited, you receive `429 Too Many Requests` with a
    `retry_after_seconds` field

    in the error envelope and a `Retry-After` header.


    ## Pagination


    List endpoints return paginated results in this envelope:


    ```json

    {
      "data": [...],
      "pagination": {
        "page": 1,
        "page_size": 25,
        "total_count": 342,
        "total_pages": 14,
        "has_next": true,
        "has_previous": false
      }
    }

    ```


    Use `?page=2&page_size=50` query parameters. Maximum page size is 100.


    ## Error Responses


    All errors conform to [RFC 9457 Problem
    Details](https://www.rfc-editor.org/rfc/rfc9457)

    with `Content-Type: application/problem+json`:


    ```json

    {
      "type": "https://closient.com/docs/errors/not_found",
      "title": "Not Found",
      "status": 404,
      "detail": "The requested resource was not found.",
      "error_code": "not_found",
      "retryable": false,
      "timestamp": "2026-03-31T12:00:00+00:00"
    }

    ```


    Common error codes: `unauthorized` (401), `forbidden` (403), `not_found`
    (404),

    `validation_error` (422), `rate_limited` (429), `internal_error` (500).
  termsOfService: https://www.closient.com/terms/
servers:
  - url: https://www.closient.com
security: []
tags:
  - name: Resolve
    description: Resolve product queries to nearby store availability.
  - name: Products
    description: Retrieve detailed product information by GTIN.
  - name: Availability
    description: Check store availability for a known product.
externalDocs:
  description: Closient Documentation
  url: https://docs.closient.com
paths:
  /agent/api/v1/products/{gtin}/availability:
    get:
      tags:
        - Availability
      summary: Check store availability for a product
      description: >-
        Returns nearby store availability for a known product. Provide the
        user's location and search radius to find stores carrying this product,
        sorted by distance (closest first).
      operationId: apps_agent_api_availability_availability
      parameters:
        - in: path
          name: gtin
          schema:
            description: >-
              GTIN of the product to look up. Accepts GTIN-8, GTIN-12 (UPC-A),
              GTIN-13 (EAN-13), or GTIN-14; the service pads shorter forms to
              GTIN-14 internally before lookup.
            maxLength: 14
            minLength: 8
            pattern: ^\d{8}$|^\d{12,14}$
            title: Gtin
            type: string
          required: true
          description: >-
            GTIN of the product to look up. Accepts GTIN-8, GTIN-12 (UPC-A),
            GTIN-13 (EAN-13), or GTIN-14; the service pads shorter forms to
            GTIN-14 internally before lookup.
        - in: query
          name: latitude
          schema:
            description: >-
              Latitude in decimal degrees (WGS84). Positive north / negative
              south. Required — the endpoint is location-anchored and has no
              default.
            maximum: 90
            minimum: -90
            title: Latitude
            type: number
          required: true
          description: >-
            Latitude in decimal degrees (WGS84). Positive north / negative
            south. Required — the endpoint is location-anchored and has no
            default.
        - in: query
          name: longitude
          schema:
            description: >-
              Longitude in decimal degrees (WGS84). Positive east / negative
              west. Required — the endpoint is location-anchored and has no
              default.
            maximum: 180
            minimum: -180
            title: Longitude
            type: number
          required: true
          description: >-
            Longitude in decimal degrees (WGS84). Positive east / negative west.
            Required — the endpoint is location-anchored and has no default.
        - in: query
          name: radius_km
          schema:
            default: 10
            description: >-
              Search radius in kilometers from the latitude/longitude pair.
              Stores beyond this distance are excluded. Capped at 100 km.
            exclusiveMinimum: 0
            maximum: 100
            title: Radius Km
            type: number
          required: false
          description: >-
            Search radius in kilometers from the latitude/longitude pair. Stores
            beyond this distance are excluded. Capped at 100 km.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/StoreAvailabilityOut'
                title: Response
                type: array
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorOut'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorOut'
        '405':
          description: Method Not Allowed
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorOut'
        '422':
          description: Unprocessable Content
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorOut'
        '429':
          description: Too Many Requests
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorOut'
      security:
        - APIKeyHeaderAuth: []
        - OAuthTokenAuth: []
        - CookieGatedSessionAuth: []
        - {}
components:
  schemas:
    StoreAvailabilityOut:
      description: |-
        Store-level availability information for a product.

        Returned both as ``ResolveResultOut.availability`` items (resolve flow)
        and as the top-level list from ``GET /products/{gtin}/availability``.
        Stores are sorted by distance ascending (closest first).
      examples:
        - address: 270 Greenwich St, New York, NY, 10007
          distance_km: 1.23
          last_verified: '2026-04-30T14:22:00Z'
          price: $4.99
          stock_confidence: active
          stock_status: In Stock
          store: Whole Foods Tribeca
      properties:
        store:
          description: >-
            Store / branch name as the shopper would recognize it (e.g. 'Whole
            Foods Tribeca'). Sourced from ``Place.name``.
          title: Store
          type: string
        address:
          description: >-
            Comma-joined street address ('line 1, city, region, postal_code').
            Components missing on the underlying ``Place`` are omitted from the
            joined string.
          title: Address
          type: string
        distance_km:
          description: >-
            Great-circle distance from the user's location to this store, in
            kilometers, rounded to 2 decimals. Zero when the distance could not
            be computed.
          minimum: 0
          title: Distance Km
          type: number
        stock_status:
          $ref: '#/components/schemas/StockStatusDisplayEnum'
          description: >-
            Customer-facing stock label derived from the underlying offer
            status. Use this when surfacing availability to a shopper. See
            ``stock_confidence`` for the machine-readable wire value.
        stock_confidence:
          $ref: '#/components/schemas/OfferStatusEnum'
          description: >-
            Wire value of the underlying ``InStoreOffer.status``
            (``apps.retailers.models.OfferStatus``). Use this for programmatic
            decisions; see ``stock_status`` for the display label.
        price:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Pre-formatted price string with currency symbol (e.g. '$4.99'). Null
            when no price is on file for this store.
          title: Price
        last_verified:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            ISO 8601 timestamp of the last inventory verification on the
            underlying ``InStoreOffer.quantity_updated_at``. Null when the offer
            has never had a quantity update.
          title: Last Verified
      required:
        - store
        - address
        - distance_km
        - stock_status
        - stock_confidence
      title: StoreAvailabilityOut
      type: object
    ErrorOut:
      title: ErrorOut
      type: object
      description: RFC 9457 Problem Details error body.
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        error_code:
          type: string
        retryable:
          type: boolean
        timestamp:
          type: string
          format: date-time
      required:
        - type
        - title
        - status
        - detail
      examples:
        - type: https://closient.com/docs/errors/not_found
          title: Not Found
          status: 404
          detail: The requested resource was not found.
          error_code: not_found
          retryable: false
          timestamp: '2026-03-31T12:00:00+00:00'
    StockStatusDisplayEnum:
      description: |-
        Customer-facing stock label rendered alongside ``stock_confidence``.

        Derived from :class:`apps.retailers.models.OfferStatus` via a fixed
        presentation map in :mod:`apps.agent.services.resolve`. Distinct from
        the raw ``OfferStatusEnum`` (the wire/machine value) — the display
        string is what an AI assistant should surface to a shopper, while
        ``stock_confidence`` is what it should reason about programmatically.
      enum:
        - In Stock
        - Discontinued
        - Seasonal
        - Out of Stock
        - Unknown
      title: StockStatusDisplayEnum
      type: string
    OfferStatusEnum:
      enum:
        - active
        - discontinued
        - seasonal
        - out_of_stock
      title: OfferStatusEnum
      type: string
  securitySchemes:
    APIKeyHeaderAuth:
      type: apiKey
      in: header
      name: X-API-Key
    OAuthTokenAuth:
      type: http
      scheme: bearer
    CookieGatedSessionAuth:
      type: apiKey
      in: cookie
      name: sessionid

````