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

# Activate or deactivate several products

> With `product_ids` each product is handled on its own and reported in `results`; a product
outside the tenant is reported as RESOURCE_NOT_FOUND and the rest get the requested `is_active`.

With `select_all` the selection is every product `GET /products` lists for the filters in
`filters`, minus `except_ids`. It always runs in the background: the response carries `queued`
and the number of products, and the caller gets an `inventory_bulk_operation` notification with
how many changed. Products created after the request are left out.



## OpenAPI

````yaml post /v1/products/bulk-status
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/products/bulk-status:
    post:
      tags:
        - Product
      summary: Activate or deactivate several products
      description: >-
        With `product_ids` each product is handled on its own and reported in
        `results`; a product

        outside the tenant is reported as RESOURCE_NOT_FOUND and the rest get
        the requested `is_active`.


        With `select_all` the selection is every product `GET /products` lists
        for the filters in

        `filters`, minus `except_ids`. It always runs in the background: the
        response carries `queued`

        and the number of products, and the caller gets an
        `inventory_bulk_operation` notification with

        how many changed. Products created after the request are left out.
      operationId: product.bulkStatus
      parameters:
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductBulkStatusRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    anyOf:
                      - type: object
                        properties:
                          success_count:
                            type: integer
                          failed_count:
                            type: integer
                          results:
                            type: array
                            items:
                              type: object
                              properties:
                                product_id:
                                  type: integer
                                success:
                                  type: boolean
                                error_code:
                                  type: string
                                message:
                                  type: string
                              required:
                                - product_id
                                - success
                        required:
                          - success_count
                          - failed_count
                          - results
                      - type: object
                        properties:
                          queued:
                            type: boolean
                          count:
                            type: integer
                        required:
                          - queued
                          - count
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    ProductBulkStatusRequest:
      type: object
      properties:
        product_ids:
          type: array
          description: >-
            The identifiers of the selected records. Send either these or
            `select_all`.
          items:
            type: integer
            minimum: 1
          minItems: 1
          maxItems: 100
        select_all:
          type: boolean
          description: >-
            Select every record the list shows with the filters in `filters`.
            The action then runs in the background and the response only carries
            the number of records.
        filters:
          type:
            - object
            - 'null'
          description: >-
            With `select_all`, the filters the list shows, as an object: the
            query parameters of `GET /api/v1/products` with the same names and
            values, array parameters without the `[]`. Paging and sorting
            parameters are ignored.
          properties:
            search:
              type:
                - string
                - 'null'
              description: The search query.
              maxLength: 255
            is_active:
              type:
                - boolean
                - 'null'
              description: Filter by active status.
            product_brand_id:
              type: array
              description: A brand ID to filter by.
              items:
                type: integer
            product_category_id:
              type: array
              description: A category ID to filter by.
              items:
                type: integer
            product_type_id:
              type: array
              description: A product type ID to filter by.
              items:
                type: integer
            base_unit_code_id:
              type: array
              description: A base unit code ID to filter by.
              items:
                type: integer
            catalog_product_id:
              type:
                - integer
                - 'null'
              description: >-
                Filter by the central catalog product the product was created
                from.
            tax_rate:
              type: array
              description: A tax rate percentage to filter by.
              enum:
                - '0'
                - '1'
                - '10'
                - '20'
              items:
                type: integer
                enum:
                  - '0'
                  - '1'
                  - '10'
                  - '20'
            created_at_from:
              type:
                - string
                - 'null'
              format: date-time
              description: >-
                Filter products created at or after this timestamp (tenant
                timezone).
            created_at_to:
              type:
                - string
                - 'null'
              format: date-time
              description: >-
                Filter products created at or before this timestamp (tenant
                timezone).
            target_currency_id:
              type:
                - integer
                - 'null'
              description: >-
                The currency of the sale or offer an item is being added to:
                each product then also carries its price converted into it
                (`converted_*`).
            target_exchange_rate:
              type:
                - number
                - 'null'
              description: >-
                The sale's or offer's own exchange rate against the clinic's
                base currency. Without it today's TCMB rate is used.
        except_ids:
          type:
            - array
            - 'null'
          description: >-
            With `select_all`, the identifiers of the records to leave out, at
            most 1000.
          items:
            type: integer
            description: A record identifier to leave out.
            minimum: 1
          maxItems: 1000
        is_active:
          type: boolean
          description: The active status to apply to every selected product.
      required:
        - is_active
      title: ProductBulkStatusRequest
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.flextell.ai/oauth/authorize
          tokenUrl: https://app.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.