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

# Search foods

> Full-text searches the store's foods by name, description and category, returning up to 30 matches with category populated.

Full-text searches the store's foods by name, description and category, returning up to 30 matches with category populated. The `query` parameter is required; omitting it returns 400. Requires the `READ_INVENTORY` scope.


## OpenAPI

````yaml GET /foods/search
openapi: 3.1.0
info:
  title: Salesive Apps API — Catalog
  description: >-
    Catalog data endpoints (products, foods and services) callable by an
    installed third-party app using its app access token. The target store is
    bound to the token server-side by the OAuth install flow.
  version: 1.0.0
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /foods/search:
    get:
      tags:
        - foods
      summary: Search foods
      description: >-
        Full-text searches the store's foods by name, description and category,
        returning up to 30 matches with category populated. The `query`
        parameter is required; omitting it returns 400. Requires the
        `READ_INVENTORY` scope.
      operationId: searchFoods
      parameters:
        - name: query
          in: query
          required: true
          schema:
            type: string
          description: >-
            Full-text search term matched against food name, description and
            category. Required.
      responses:
        '200':
          description: Search foods — success.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - success
                  - message
                  - data
                properties:
                  status:
                    type: integer
                    example: 200
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Search foods
                  data:
                    type: object
                    properties:
                      foods:
                        type: array
                        items:
                          $ref: '#/components/schemas/Food'
                    example:
                      foods:
                        - _id: 66a2a1c4e1b3a40012cd1001
                          name: Margherita Pizza
                          price: 12.5
                          images:
                            - https://cdn.salesive.com/f/margherita.jpg
                          category:
                            _id: 66a2a0aae1b3a40012cd0001
                            name: Pizzas
                            slug: pizzas
                          available: true
                          listed: true
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    Food:
      type: object
      description: A restaurant menu item.
      properties:
        _id:
          type: string
        name:
          type: string
        description:
          type: string
        price:
          type: number
        promoPrice:
          type: number
          nullable: true
        images:
          type: array
          items:
            type: string
        video:
          type: string
          nullable: true
        category:
          $ref: '#/components/schemas/CategoryRef'
        available:
          type: boolean
        listed:
          type: boolean
        addons:
          type: array
          items:
            $ref: '#/components/schemas/Addon'
        shop:
          $ref: '#/components/schemas/ShopRef'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    CategoryRef:
      description: >-
        Category. Populated as an object on reads, accepted/returned as an id
        string on writes.
      nullable: true
      oneOf:
        - type: string
          description: Category ObjectId.
        - type: object
          properties:
            _id:
              type: string
            name:
              type: string
              example: Apparel
            slug:
              type: string
    Addon:
      type: object
      description: An optional add-on for a food or service item.
      required:
        - name
        - price
      properties:
        _id:
          type: string
        name:
          type: string
        price:
          type: number
          minimum: 0
        maxQuantity:
          type: integer
          default: 10
        image:
          type: string
          nullable: true
        available:
          type: boolean
          default: true
        description:
          type: string
    ShopRef:
      description: >-
        The owning store. Bound server-side to the app token; populated as an
        object on reads, returned as an id string on writes.
      oneOf:
        - type: string
          description: Store ObjectId.
        - type: object
          properties:
            _id:
              type: string
            name:
              type: string
              example: Acme Store
            logo:
              type: string
              nullable: true
            currency:
              $ref: '#/components/schemas/Currency'
            isActive:
              type: boolean
    Currency:
      type: object
      description: The store's currency.
      properties:
        _id:
          type: string
        name:
          type: string
        symbol:
          type: string
          example: $
        code:
          type: string
          example: USD
  responses:
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 401
              success:
                type: boolean
                example: false
              message:
                type: string
                example: Unauthorized
              data:
                type: object
                nullable: true
    Forbidden:
      description: >-
        The app token is valid but lacks the OAuth scope required by this
        endpoint.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                example: 403
              success:
                type: boolean
                example: false
              message:
                type: string
                example: 'Forbidden: missing required scope'
              data:
                type: object
                nullable: true
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side — never send a shop
        id.

````