openapi: 3.0.0
info:
  title: Coolset Supply Chain API
  description: >-
    Manage orders, products, origins, and value chains for supply chain
    transparency and compliance.
  version: '1.0'
  contact:
    email: support@coolset.com
    url: https://coolset.com
  x-logo:
    url: https://www.coolset.com/images/coolset-logo.png
    altText: Coolset
    href: https://www.coolset.com/
servers:
  - url: https://developers-scranton.coolset.com/api
    description: Production server
paths:
  /orders:
    get:
      operationId: orders_list
      summary: List orders
      description: >-
        Returns a paginated list of supply chain orders for the authenticated
        company. Each order includes its type (buying/selling), buyer and seller
        IDs, value chain association, and nested order items with product
        details. Required filter: order_action (buying|selling) — determines
        whether to return orders where the authenticated company is the buyer or
        seller. Optional filters: type, buyer_company_status,
        seller_company_status, assessment_status, value_chain, date ranges
        (order_created_at, order_arrival_at), border_cross_country_code, tags,
        item product details (SKU, name, commodity, composition), item
        volume/unit, item external ID, or passing/failing percentage. Use search
        to match buyer_external_id, seller_external_id, or tag names.
      parameters:
        - name: type
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: type__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_created_at
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_created_at__gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_created_at__lte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_arrival_at
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_arrival_at__gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_arrival_at__lte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_company_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_company_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_company_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_company_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: value_chain
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: border_cross_country_code
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: border_cross_country_code__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__slug
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__slug__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__isnull
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__isnull
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__volume
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__volume__gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__volume__lte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__unit
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__external_id
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__external_id__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__external_id__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__external_id__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__external_id__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__sku
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__sku__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__sku__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__sku__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__commodity
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__commodity__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__composition
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__composition__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__sku
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__sku__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__sku__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__sku__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__commodity
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__commodity__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__composition
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__composition__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: passing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: failing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_action
          in: query
          description: ''
          required: true
          schema:
            type: string
        - name: ordering
          in: query
          description: Which field to use when ordering the results.
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: A search term.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                required:
                  - count
                  - results
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type: string
                    format: uri
                    nullable: true
                  previous:
                    type: string
                    format: uri
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Order'
      tags:
        - orders
    parameters: []
    servers: &ref_0
      - url: https://developers-scranton.coolset.com/api
        description: Production server
  /orders/{id}:
    get:
      operationId: orders_read
      summary: Retrieve an order
      description: >-
        Returns a single order by ID with full details including order items,
        value chain, and traceability counts.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
      tags:
        - orders
    delete:
      operationId: orders_delete
      summary: Delete an order
      description: Soft-deletes a single order by ID.
      responses:
        '204':
          description: ''
      tags:
        - orders
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /orders/batch:
    post:
      operationId: orders_batch_create
      summary: Create batch orders
      description: >-
        Create multiple orders in a single request. Each order can include
        nested order items with buyer/seller product references. Used for bulk
        data imports and integrations.
      requestBody:
        $ref: '#/components/requestBodies/BatchOrder'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchOrder'
      tags:
        - orders
    parameters: []
    servers: *ref_0
  /orders/batch/{id}:
    patch:
      operationId: orders_batch_partial_update
      summary: Update a batch order
      description: Update an existing batch order and its line items.
      requestBody:
        $ref: '#/components/requestBodies/BatchOrder'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchOrder'
      tags:
        - orders
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /orders/purchase:
    post:
      operationId: orders_purchase_create
      summary: Create a purchase order
      description: >-
        Create a new purchase order with nested order items. The authenticated
        company is set as the buyer.
      requestBody:
        $ref: '#/components/requestBodies/PurchaseOrder'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrder'
      tags:
        - orders
    parameters: []
    servers: *ref_0
  /orders/purchase/{id}:
    patch:
      operationId: orders_purchase_partial_update
      summary: Update a purchase order
      description: Partially update an existing purchase order and its items.
      requestBody:
        $ref: '#/components/requestBodies/PurchaseOrder'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrder'
      tags:
        - orders
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /orders/sale:
    post:
      operationId: orders_sale_create
      summary: Create a sale order
      description: >-
        Create a new sale order with nested order items. The authenticated
        company is set as the seller.
      requestBody:
        $ref: '#/components/requestBodies/SaleOrder'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleOrder'
      tags:
        - orders
    parameters: []
    servers: *ref_0
  /orders/sale/{id}:
    patch:
      operationId: orders_sale_partial_update
      summary: Update a sale order
      description: Partially update an existing sale order and its items.
      requestBody:
        $ref: '#/components/requestBodies/SaleOrder'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleOrder'
      tags:
        - orders
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /orders/statistics:
    get:
      operationId: orders_statistics_list
      summary: List order statistics
      description: >-
        Returns aggregated order statistics such as order counts grouped by
        date. Required filter: order_action (buying|selling). Use filters to
        narrow by type, buyer_company_status, seller_company_status,
        assessment_status, value_chain, date ranges (order_created_at,
        order_arrival_at), border_cross_country_code, tags, or item details.
        Results are not paginated.
      parameters:
        - name: type
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: type__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_created_at
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_created_at__gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_created_at__lte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_arrival_at
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_arrival_at__gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_arrival_at__lte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_company_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_company_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_company_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_company_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: value_chain
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: border_cross_country_code
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: border_cross_country_code__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__slug
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__slug__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__isnull
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__isnull
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__volume
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__volume__gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__volume__lte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__unit
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__external_id
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__external_id__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__external_id__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__external_id__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__external_id__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__sku
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__sku__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__sku__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__sku__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__commodity
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__commodity__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__composition
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__buyer_product__composition__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__sku
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__sku__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__sku__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__sku__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__commodity
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__commodity__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__composition
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: items__seller_product__composition__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: passing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: failing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order_action
          in: query
          description: ''
          required: true
          schema:
            type: string
        - name: group_by
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: delimit_by
          in: query
          description: ''
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrderStatistics'
      tags:
        - orders
    parameters: []
    servers: *ref_0
  /origins:
    get:
      operationId: origins_list
      summary: List origins
      description: >-
        Returns a paginated list of geographic origins for the authenticated
        company. Each origin includes its name, country code, coordinates, and
        description. Use search to filter by name or description, or order by
        name/country_code.
      parameters:
        - name: name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: country_code
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: passing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: failing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: ordering
          in: query
          description: Which field to use when ordering the results.
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: A search term.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                required:
                  - count
                  - results
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type: string
                    format: uri
                    nullable: true
                  previous:
                    type: string
                    format: uri
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Origin'
      tags:
        - origins
    post:
      operationId: origins_create
      summary: Create an origin
      description: >-
        Create a new geographic origin with a name, country code, and optional
        coordinates and description.
      requestBody:
        $ref: '#/components/requestBodies/Origin'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Origin'
      tags:
        - origins
    parameters: []
    servers: *ref_0
  /origins/{id}:
    get:
      operationId: origins_read
      summary: Retrieve an origin
      description: Returns a single origin by ID with full details.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Origin'
      tags:
        - origins
    patch:
      operationId: origins_partial_update
      summary: Update an origin
      description: Partially update an existing origin. Only provided fields are changed.
      requestBody:
        $ref: '#/components/requestBodies/Origin'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Origin'
      tags:
        - origins
    delete:
      operationId: origins_delete
      summary: Delete an origin
      description: Soft-deletes a single origin by ID.
      responses:
        '204':
          description: ''
      tags:
        - origins
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /products:
    get:
      operationId: products_list
      summary: List products
      description: >-
        Returns a paginated list of products for the authenticated company. Each
        product includes its name, SKU, commodity type, composition, and HS code
        classification. Search by SKU or name, and order by name, commodity,
        type, or composition.
      parameters:
        - name: sku
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: sku__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: sku__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: sku__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description__isnull
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: scientific_name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: scientific_name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: scientific_name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: scientific_name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: scientific_name__isnull
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: common_name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: common_name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: common_name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: common_name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: common_name__isnull
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: type__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: hs_code
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: hs_code__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: hs_code__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: hs_code__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: hs_code__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: commodity
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: commodity__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: composition
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: composition__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: is_packaging
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: volume
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: volume__gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: volume__lte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: volume__isnull
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: unit
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: unit__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status__isnull
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__slug
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__slug__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: passing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: failing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: ordering
          in: query
          description: Which field to use when ordering the results.
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: A search term.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                required:
                  - count
                  - results
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type: string
                    format: uri
                    nullable: true
                  previous:
                    type: string
                    format: uri
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProductList'
      tags:
        - products
    post:
      operationId: products_create
      summary: Create a product
      description: >-
        Create a new product with a name, SKU, commodity type, and optional HS
        code and composition details.
      requestBody:
        $ref: '#/components/requestBodies/Product'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
      tags:
        - products
    parameters: []
    servers: *ref_0
  /products/{id}:
    get:
      operationId: products_read
      summary: Retrieve a product
      description: Returns a single product by ID with full details.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
      tags:
        - products
    patch:
      operationId: products_partial_update
      summary: Update a product
      description: Partially update an existing product. Only provided fields are changed.
      requestBody:
        $ref: '#/components/requestBodies/Product'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
      tags:
        - products
    delete:
      operationId: products_delete
      summary: Delete a product
      description: Soft-deletes a single product by ID.
      responses:
        '204':
          description: ''
      tags:
        - products
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /value-chains:
    get:
      operationId: value-chains_list
      summary: List value chain partners
      description: >-
        Returns a paginated list of value chain partners (suppliers/customers).
        Each entry includes the partner company name, country, contact details,
        status, and assessment status. Search by company_name or contact_name.
      parameters:
        - name: company_name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: company_name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: company_name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: company_name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: type__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: description__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: country_code
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: country_code__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: external_id__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: permission_granted
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: is_self_managed
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: contact_name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: contact_name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: contact_name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: contact_name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: contact_email
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: contact_email__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: contact_email__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: contact_email__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__slug
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: tags__slug__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: passing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: failing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: ordering
          in: query
          description: Which field to use when ordering the results.
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: A search term.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                required:
                  - count
                  - results
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type: string
                    format: uri
                    nullable: true
                  previous:
                    type: string
                    format: uri
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/ValueChain'
      tags:
        - value-chains
    post:
      operationId: value-chains_create
      summary: Create a value chain partner
      description: >-
        Create a new value chain partner with company name, country code, and
        optional contact details.
      requestBody:
        $ref: '#/components/requestBodies/ValueChain'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValueChain'
      tags:
        - value-chains
    parameters: []
    servers: *ref_0
  /value-chains/{id}:
    get:
      operationId: value-chains_read
      summary: Retrieve a value chain partner
      description: Returns a single value chain partner by ID with full details.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValueChain'
      tags:
        - value-chains
    patch:
      operationId: value-chains_partial_update
      summary: Update a value chain partner
      description: Partially update an existing value chain partner.
      requestBody:
        $ref: '#/components/requestBodies/ValueChain'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValueChain'
      tags:
        - value-chains
    delete:
      operationId: value-chains_delete
      summary: Delete a value chain partner
      description: Soft-deletes a single value chain partner by ID.
      responses:
        '204':
          description: ''
      tags:
        - value-chains
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /eudr/due-diligence-statements:
    get:
      operationId: eudr_due-diligence-statements_list
      summary: List due diligence statements
      description: >-
        Returns a paginated list of EUDR Due Diligence Statements for the
        authenticated company. Each DDS includes its identifier, status, traced
        orders, and submission details.
      parameters:
        - name: created_at
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: created_at__gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: created_at__lte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: dds_identifier
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: ordering
          in: query
          description: Which field to use when ordering the results.
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: A search term.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                required:
                  - count
                  - results
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type: string
                    format: uri
                    nullable: true
                  previous:
                    type: string
                    format: uri
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/DueDiligenceStatement'
      tags:
        - eudr
    post:
      operationId: eudr_due-diligence-statements_create
      summary: Create a due diligence statement
      description: >-
        Create a new EUDR Due Diligence Statement. Orders can be traced to the
        DDS afterwards using the trace-orders endpoint.
      requestBody:
        $ref: '#/components/requestBodies/DueDiligenceStatement'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DueDiligenceStatement'
      tags:
        - eudr
    parameters: []
    servers: *ref_0
  /eudr/due-diligence-statements/{id}:
    get:
      operationId: eudr_due-diligence-statements_read
      summary: Retrieve a due diligence statement
      description: Returns a single DDS by ID with full details including traced orders.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DueDiligenceStatement'
      tags:
        - eudr
    patch:
      operationId: eudr_due-diligence-statements_partial_update
      summary: Update a due diligence statement
      description: Partially update an existing DDS. Only provided fields are changed.
      requestBody:
        $ref: '#/components/requestBodies/DueDiligenceStatement'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DueDiligenceStatement'
      tags:
        - eudr
    delete:
      operationId: eudr_due-diligence-statements_delete
      summary: Delete a due diligence statement
      description: Soft-deletes a Due Diligence Statement by ID.
      responses:
        '204':
          description: DDS successfully deleted
        '404':
          description: DDS not found or not accessible
      tags:
        - eudr
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /eudr/trace-orders:
    get:
      operationId: eudr_trace-orders_list
      summary: List available orders for tracing
      description: List orders available for tracing to Due Diligence Statements
      parameters:
        - name: ordering
          in: query
          description: Which field to use when ordering the results.
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: A search term.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          schema:
            type: integer
        - name: exclude_dds
          in: query
          description: >-
            Exclude orders already traced to DDS ID(s). Supports single ID or
            comma-separated list (e.g., '1' or '1,2,3')
          required: false
          schema:
            type: string
      responses:
        '200':
          description: List of available orders
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        buyer_external_id:
                          type: string
                        seller_external_id:
                          type: string
                        order_created_at:
                          type: string
                          format: date-time
                        type:
                          type: string
                  count:
                    type: integer
                  next:
                    type: string
                    format: uri
                  previous:
                    type: string
                    format: uri
      tags:
        - Order Tracing
    post:
      operationId: eudr_trace-orders_create
      summary: Trace orders to DDS
      description: Trace orders to Due Diligence Statement(s) (adds to existing orders)
      requestBody:
        content:
          application/json:
            schema:
              required:
                - dds_id
                - order_id
              type: object
              properties:
                dds_id:
                  description: >-
                    DDS ID or list of DDS IDs to trace orders to (accepts single
                    integer or array)
                  type: array
                  items:
                    type: integer
                order_id:
                  description: >-
                    Order ID or list of order IDs to trace to the DDS(s)
                    (accepts single integer or array)
                  type: array
                  items:
                    type: integer
        required: true
      responses:
        '201':
          description: Orders successfully traced
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        dds_id:
                          type: integer
                        added_orders:
                          type: array
                          items:
                            type: integer
                        total_orders:
                          type: integer
                        message:
                          type: string
                  summary:
                    type: object
                    properties:
                      total_dds_processed:
                        type: integer
                      total_orders_added:
                        type: integer
        '400':
          description: Validation error
      tags:
        - Order Tracing
    parameters: []
    servers: *ref_0
  /traces:
    get:
      operationId: traces_list
      summary: List traceable order items
      description: >-
        Returns order items where your company is the seller, showing their
        traceability status — which source orders and origins are linked. Use
        filters to narrow by product, volume, or assessment status.
      parameters:
        - name: buyer_product
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__isnull
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__isnull
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: volume
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: volume__gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: volume__lte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: unit
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: assessment_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order__type
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order__type__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order__order_created_at
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order__order_created_at__gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order__order_created_at__lte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order__buyer_company_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order__buyer_company_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order__seller_company_status
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: order__seller_company_status__in
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__sku
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__sku__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__sku__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__sku__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__commodity
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: buyer_product__composition
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__sku
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__sku__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__sku__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__sku__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__name
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__name__icontains
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__name__startswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__name__endswith
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__commodity
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: seller_product__composition
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: passing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: failing_percentage_gte
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: traced_orders_exists
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: traced_origins_exists
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: ordering
          in: query
          description: Which field to use when ordering the results.
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: A search term.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                required:
                  - count
                  - results
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type: string
                    format: uri
                    nullable: true
                  previous:
                    type: string
                    format: uri
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/TraceList'
      tags:
        - traces
    parameters: []
    servers: *ref_0
  /traces/{id}:
    get:
      operationId: traces_read
      summary: Retrieve a traceable order item
      description: >-
        Returns a single traceable order item by ID with its linked orders and
        origins.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceList'
      tags:
        - traces
    patch:
      operationId: traces_partial_update
      summary: Update trace
      description: >-
        Partially updates the traceability links for a single order item. To
        update multiple items at once use the bulk-update endpoint.
      requestBody:
        $ref: '#/components/requestBodies/TraceList'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceList'
      tags:
        - traces
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /information-requests:
    post:
      operationId: information-requests_create
      summary: Send an information request
      description: Create an information request for a specific order
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InformationRequest'
        required: true
      responses:
        '201':
          description: Information request created successfully
      tags:
        - information-requests
    parameters: []
    servers: *ref_0
  /information-requests/bulk:
    post:
      operationId: information-requests_bulk_create
      summary: Send information requests in bulk
      description: Create multiple information requests in bulk
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InformationRequestBulk'
        required: true
      responses:
        '202':
          description: Bulk information requests processed successfully
          content:
            application/json:
              schema:
                required:
                  - message
                  - results
                type: object
                properties:
                  message:
                    description: Success message
                    type: string
                    example: Bulk information requests processed
                  results:
                    required:
                      - summary
                      - processed
                      - failed
                    type: object
                    properties:
                      summary:
                        required:
                          - total_information_requests
                          - processed
                          - failed
                        type: object
                        properties:
                          total_information_requests:
                            description: Total number of requests in the batch
                            type: integer
                          processed:
                            description: Number of successfully processed requests
                            type: integer
                          failed:
                            description: Number of failed requests
                            type: integer
                      processed:
                        description: Successfully processed requests
                        type: array
                        items:
                          required:
                            - index
                            - invitation_action
                          type: object
                          properties:
                            index:
                              description: Index of the request in the original batch
                              type: integer
                            order_id:
                              description: Order ID (if applicable)
                              type: integer
                              nullable: true
                            value_chain_id:
                              description: Value Chain ID (if applicable)
                              type: integer
                              nullable: true
                            invitation_action:
                              description: The invitation action that was performed
                              type: string
                      failed:
                        description: Failed requests with error details
                        type: array
                        items:
                          required:
                            - index
                            - data
                            - error
                          type: object
                          properties:
                            index:
                              description: Index of the request in the original batch
                              type: integer
                            data:
                              description: The original request data that failed
                              type: object
                            error:
                              description: Error message describing why the request failed
                              type: string
              examples:
                response:
                  value:
                    message: Bulk information requests processed
                    results:
                      summary:
                        total_information_requests: 3
                        processed: 2
                        failed: 1
                      processed:
                        - index: 0
                          order_id: 123
                          value_chain_id: null
                          invitation_action: send_invitation
                        - index: 2
                          order_id: null
                          value_chain_id: 456
                          invitation_action: send_invitation
                      failed:
                        - index: 1
                          data:
                            order_id: 999
                          error: Order not found or not accessible
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  information_requests:
                    description: Validation errors for the request array
                    type: array
                    items:
                      type: string
      tags:
        - information-requests
    parameters: []
    servers: *ref_0
components:
  schemas:
    PromptSuggestion:
      required:
        - title
        - label
        - prompt
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          type: string
          maxLength: 255
          minLength: 1
        label:
          title: Label
          description: >-
            Short category descriptor shown above the prompt (e.g. 'Find
            valuable insights').
          type: string
          maxLength: 255
          minLength: 1
        prompt:
          title: Prompt
          description: The prompt text sent to the agent.
          type: string
          minLength: 1
        agent_config_name:
          title: Agent config name
          type: string
          readOnly: true
          minLength: 1
        tags:
          type: array
          items:
            type: string
          readOnly: true
    PulseParams:
      required:
        - identifier
        - model_identifier
      type: object
      properties:
        identifier:
          title: Identifier
          type: string
          minLength: 1
        model_identifier:
          title: Model identifier
          type: string
          minLength: 1
    ChatSession:
      required:
        - agent_name
      type: object
      properties:
        session_id:
          title: Session id
          type: string
          format: uuid
          readOnly: true
        agent_name:
          title: Agent name
          type: string
          maxLength: 255
          minLength: 1
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
    ChatSessionCreate:
      required:
        - agent_name
      type: object
      properties:
        session_id:
          title: Session id
          type: string
          format: uuid
          readOnly: true
        agent_name:
          title: Agent name
          type: string
          maxLength: 255
          minLength: 1
    Skill:
      required:
        - name
        - content
      type: object
      properties:
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        content:
          title: Content
          type: string
          minLength: 1
        is_public:
          title: Is public
          type: boolean
    Comment:
      required:
        - message
        - identifier
        - submitted_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        message:
          title: Message
          type: string
          minLength: 1
        identifier:
          title: Identifier
          type: string
          maxLength: 1024
          minLength: 1
        submitted_at:
          title: Submitted at
          type: string
          format: date-time
        return_url:
          title: Return url
          type: string
          format: uri
          maxLength: 200
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        is_edited:
          title: Is edited
          type: string
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
    CommentSearch:
      required:
        - identifiers
      type: object
      properties:
        identifiers:
          type: array
          items:
            type: string
            minLength: 1
    RiskAssessment:
      required:
        - identifier
        - assessment_type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        identifier:
          title: Identifier
          type: string
          maxLength: 1024
          minLength: 1
        display_name:
          title: Display name
          description: Human-readable display name for the assessment
          type: string
          readOnly: true
          minLength: 1
        assessment_type:
          title: Assessment type
          type: string
          enum:
            - eudr_origin_assessment
            - eudr_origin_harvest_assessment
            - eudr_company_maturity_self_assessment
            - eudr_supply_chain_assessment
            - eudr_order_item_assessment
            - eudr_order_assessment
            - eutr_origin_assessment
            - eutr_company_maturity_self_assessment
            - eutr_supply_chain_assessment
            - ppwr_packaging_assessment
            - ppwr_aggregate_packaging_assessment
        assessment_run_id:
          title: Assessment run id
          description: The UUID of the assessment run
          type: string
          format: uuid
        results:
          title: Results
          description: The output of the risk assessment
          type: object
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_date:
          title: Assessment date
          description: When this risk assessment was conducted
          type: string
          format: date-time
          readOnly: true
        analyzed_assessments:
          title: Analyzed assessments
          description: >-
            List of analyzed assessments (assessment runs) that contributed
            evidence to this assessment
          type: object
          readOnly: true
        assessable_objects:
          title: Assessable objects
          description: >-
            Snapshot of assessable object data at assessment creation time,
            keyed by pulse identifier. Same keys as `results`. Empty dict for
            assessments created before this field was added.
          type: object
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        metadata:
          title: Metadata
          description: >-
            Input parameters used to create this assessment (harvest_date,
            commodity, etc.)
          type: object
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    RiskAssessmentCreate:
      required:
        - identifier
        - assessment_type
      type: object
      properties:
        identifier:
          title: Identifier
          description: Pulse identifier of the object to assess
          type: string
          maxLength: 1024
          minLength: 1
        assessment_type:
          title: Assessment type
          description: Type of risk assessment to perform
          type: string
          enum:
            - eudr_origin_assessment
            - eudr_origin_harvest_assessment
            - eudr_company_maturity_self_assessment
            - eudr_supply_chain_assessment
            - eudr_order_item_assessment
            - eudr_order_assessment
            - eutr_origin_assessment
            - eutr_company_maturity_self_assessment
            - eutr_supply_chain_assessment
            - ppwr_packaging_assessment
            - ppwr_aggregate_packaging_assessment
        data_room_survey_submission_context:
          title: Data room survey submission context
          description: Context of the data room to assess
          type: object
        assessment_run_id:
          title: Assessment run id
          description: Assessment run ID
          type: string
          format: uuid
          readOnly: true
        results:
          title: Results
          description: Results of the risk assessment
          type: object
          default: {}
        assessment_date:
          title: Assessment date
          description: Date and time of the risk assessment
          type: string
          format: date-time
          default: '2026-05-01 11:42:06.106836+00:00'
        company_id:
          title: Company id
          description: Company ID
          type: integer
        metadata:
          title: Metadata
          description: Metadata of the risk assessment
          type: object
          default: {}
    Contributor:
      required:
        - type
        - contributor_id
        - identifier
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - assignee
            - reviewer
            - auditor
            - owner
        contributor_id:
          title: Contributor id
          type: integer
          maximum: 2147483647
          minimum: 0
        identifier:
          title: Identifier
          type: string
          maxLength: 1024
          minLength: 1
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        metadata:
          title: Metadata
          type: object
    BulkContributorCreate:
      required:
        - type
        - contributor_ids
        - identifiers
        - handle_existing_contributor_action
      type: object
      properties:
        type:
          title: Type
          type: string
          enum:
            - assignee
            - reviewer
            - auditor
            - owner
        contributor_ids:
          type: array
          items:
            type: integer
        identifiers:
          type: array
          items:
            type: string
            minLength: 1
        handle_existing_contributor_action:
          title: Handle existing contributor action
          type: string
          enum:
            - add
            - do_nothing
            - replace
        metadata:
          title: Metadata
          type: object
    BulkContributorCreateResponse:
      required:
        - created_count
      type: object
      properties:
        created_count:
          title: Created count
          type: integer
    ContributorBulkDelete:
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          type: string
          minLength: 1
        contributor_ids:
          type: array
          items:
            type: integer
        identifiers:
          type: array
          items:
            type: string
            minLength: 1
    ContributorBulkDeleteResponse:
      required:
        - deleted_count
      type: object
      properties:
        deleted_count:
          title: Deleted count
          type: integer
    ContributorSearch:
      type: object
      properties:
        type:
          title: Type
          type: string
          minLength: 1
        contributor_ids:
          type: array
          items:
            type: integer
        identifiers:
          type: array
          items:
            type: string
            minLength: 1
    DocumentIdentifierInline:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        identifier:
          title: Identifier
          type: string
          readOnly: true
          minLength: 1
        user_company_id:
          title: User company id
          type: integer
          readOnly: true
    DocumentGCP:
      required:
        - name
        - source
        - file_path
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 510
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
        source:
          title: Source
          type: string
          maxLength: 20
          minLength: 1
        file_path:
          title: File path
          description: 'GCS path: gs://bucket/path'
          type: string
          maxLength: 1024
          minLength: 1
        file_size:
          title: File size
          description: File size in bytes
          type: integer
          readOnly: true
          nullable: true
        content_type:
          title: Content type
          type: string
          maxLength: 255
          nullable: true
        upload_status:
          title: Upload status
          type: string
          enum:
            - pending
            - uploading
            - completed
            - failed
          readOnly: true
        uploaded_at:
          title: Uploaded at
          type: string
          format: date-time
          readOnly: true
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        user_company_id:
          title: User company id
          type: integer
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        identifiers:
          description: List of identifier strings
          type: array
          items:
            type: string
            minLength: 1
        identifiers_details:
          type: array
          items:
            $ref: '#/components/schemas/DocumentIdentifierInline'
          readOnly: true
    DocumentUploadRequest:
      required:
        - name
        - content_type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 510
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
        content_type:
          title: Content type
          description: Content type used to derive file extension
          type: string
          enum:
            - application/pdf
            - application/msword
            - >-
              application/vnd.openxmlformats-officedocument.wordprocessingml.document
            - application/vnd.ms-excel
            - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
            - application/vnd.ms-powerpoint
            - >-
              application/vnd.openxmlformats-officedocument.presentationml.presentation
            - image/jpeg
            - image/png
            - image/gif
            - image/webp
            - text/plain
            - text/csv
            - application/rtf
            - application/vnd.oasis.opendocument.text
            - application/vnd.oasis.opendocument.spreadsheet
            - application/vnd.oasis.opendocument.presentation
        source:
          title: Source
          type: string
          readOnly: true
          minLength: 1
        company_id:
          title: Company id
          type: integer
          readOnly: true
        user_company_id:
          title: User company id
          type: integer
          readOnly: true
        identifiers:
          description: List of identifier strings
          type: array
          items:
            type: string
            minLength: 1
    DocumentIdentifier:
      required:
        - identifier
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        identifier:
          title: Identifier
          type: string
          maxLength: 1024
          minLength: 1
        document:
          title: Document
          type: integer
          readOnly: true
    DocumentUpdate:
      required:
        - name
      type: object
      properties:
        name:
          title: Name
          type: string
          maxLength: 510
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
    RuleExecutionLog:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        rule:
          title: Rule
          description: The rule that was evaluated
          type: integer
          readOnly: true
        rule_name:
          title: Rule name
          type: string
          readOnly: true
          minLength: 1
        event_type:
          title: Event type
          description: Event topic that triggered evaluation
          type: string
          readOnly: true
          minLength: 1
        event_data:
          title: Event data
          description: Full event payload (optional, for debugging)
          type: object
          readOnly: true
          nullable: true
        conditions_met:
          title: Conditions met
          description: Whether the rule's conditions passed
          type: boolean
          readOnly: true
        actions_executed:
          title: Actions executed
          description: List of action execution results with status
          type: object
          readOnly: true
        success:
          title: Success
          description: Whether all actions published successfully
          type: boolean
          readOnly: true
        error_message:
          title: Error message
          description: Error details if something failed
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        execution_time_ms:
          title: Execution time ms
          description: How long the evaluation took in milliseconds
          type: integer
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
    DataExchangeRun:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        run_id:
          title: Run id
          description: Unique identifier for this data exchange run
          type: string
          format: uuid
          readOnly: true
        company_id:
          title: Company id
          description: ID of the company this data exchange run belongs to
          type: integer
          readOnly: true
        results:
          title: Results
          description: The output of the data exchange run
          type: object
        document:
          title: Document
          type: integer
          nullable: true
        model_identifier:
          title: Model identifier
          type: string
          readOnly: true
          minLength: 1
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    DataExchangeRunCreate:
      required:
        - results
        - document_id
        - model_identifier
      type: object
      properties:
        results:
          title: Results
          description: Results of the data exchange run
          type: object
        document_id:
          title: Document id
          description: Associated document ID
          type: integer
        model_identifier:
          title: Model identifier
          description: Associated model identifier
          type: string
          minLength: 1
        dry_run:
          title: Dry run
          description: Whether to run the data exchange run in dry run mode
          type: boolean
          default: true
        id:
          title: Id
          type: integer
          readOnly: true
        run_id:
          title: Run id
          type: string
          format: uuid
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    RagDocument:
      required:
        - display_name
        - file_type
        - gcs_uri
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        corpus:
          title: Corpus
          type: integer
          readOnly: true
        corpus_name:
          title: Corpus name
          type: string
          readOnly: true
          minLength: 1
        company_id:
          title: Company id
          description: Company this document belongs to
          type: integer
          readOnly: true
        display_name:
          title: Display name
          description: Human-readable document name
          type: string
          maxLength: 255
          minLength: 1
        source_uri:
          title: Source uri
          description: 'GCS URI: gs://bucket/path/file.pdf'
          type: string
          readOnly: true
          minLength: 1
        file_type:
          title: File type
          description: File extension (pdf, docx, txt, etc.)
          type: string
          maxLength: 50
          minLength: 1
        file_size:
          title: File size
          description: File size in bytes
          type: integer
          maximum: 9223372036854776000
          minimum: 0
          nullable: true
        status:
          title: Status
          description: Current import status
          type: string
          enum:
            - importing
            - active
            - failed
            - deleting
            - deleted
          readOnly: true
        chunk_size:
          title: Chunk size
          description: Chunk size used for document splitting
          type: integer
          maximum: 2147483647
          minimum: 0
        chunk_overlap:
          title: Chunk overlap
          description: Overlap between chunks
          type: integer
          maximum: 2147483647
          minimum: 0
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        document_id:
          title: Document id
          description: Optional ID of Document from documents app
          type: integer
          nullable: true
        gcs_uri:
          title: Gcs uri
          description: 'GCS URI: gs://bucket/path/file.pdf'
          type: string
          maxLength: 1024
          minLength: 1
    RagQueryRequest:
      required:
        - query_text
      type: object
      properties:
        query_text:
          title: Query text
          description: Natural language query
          type: string
          maxLength: 5000
          minLength: 1
        mode:
          title: Mode
          description: 'Query mode: retrieval_only or generation'
          type: string
          enum:
            - retrieval
            - generation
          default: retrieval
        top_k:
          title: Top k
          description: Number of chunks to retrieve
          type: integer
          default: 10
          maximum: 50
          minimum: 1
        vector_distance_threshold:
          title: Vector distance threshold
          description: Similarity threshold (0-1)
          type: number
          maximum: 1
          minimum: 0
          nullable: true
        file_ids:
          description: Optional list of Vertex AI file names to filter search
          type: array
          items:
            type: string
            minLength: 1
          nullable: true
        document_ids:
          description: >-
            Optional list of Document IDs to scope the search to specific
            documents
          type: array
          items:
            type: integer
          nullable: true
        model_name:
          title: Model name
          description: Gemini model to use for generation mode
          type: string
          default: gemini-2.5-flash
          minLength: 1
    RoutedDocument:
      required:
        - name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 510
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
        file:
          title: File
          type: string
          readOnly: true
          format: uri
        identifiers:
          description: List of identifier strings
          type: array
          items:
            type: string
            minLength: 1
        source:
          title: Source
          type: string
          readOnly: true
          minLength: 1
        file_path:
          title: File path
          description: 'GCS path: gs://bucket/path'
          type: string
          readOnly: true
          minLength: 1
        file_size:
          title: File size
          description: File size in bytes
          type: integer
          readOnly: true
          nullable: true
        content_type:
          title: Content type
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        upload_status:
          title: Upload status
          type: string
          enum:
            - pending
            - uploading
            - completed
            - failed
          readOnly: true
        uploaded_at:
          title: Uploaded at
          type: string
          format: date-time
          readOnly: true
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        user_company_id:
          title: User company id
          type: integer
          readOnly: true
    RuleList:
      required:
        - name
        - event_type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          description: Human-readable name for the rule
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Detailed description of the rule
          type: string
        event_type:
          title: Event type
          description: Event topic this rule listens to
          type: string
          maxLength: 255
          minLength: 1
        rule_type:
          title: Rule type
          description: GLOBAL (admin only) or COMPANY (customer rules)
          type: string
          enum:
            - GLOBAL
            - COMPANY
        is_active:
          title: Is active
          description: Whether the rule is currently active
          type: boolean
        test_mode:
          title: Test mode
          description: If True, evaluate conditions but don't execute actions (for testing)
          type: boolean
        priority:
          title: Priority
          description: Execution priority (lower number = higher priority)
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        company_id:
          title: Company id
          description: For COMPANY rules, which company this applies to (null for GLOBAL)
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        conditions_count:
          title: Conditions count
          type: string
          readOnly: true
        actions_count:
          title: Actions count
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    RuleCondition:
      required:
        - field_path
        - operator
        - value
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        field_path:
          title: Field path
          description: Dotted path to field (e.g., "order.seller_company.country")
          type: string
          maxLength: 255
          minLength: 1
        operator:
          title: Operator
          description: Comparison operator to use
          type: string
          enum:
            - equals
            - not_equals
            - gt
            - lt
            - gte
            - lte
            - contains
            - in_list
            - not_in
            - changed
            - changed_from
            - changed_to
            - changed_from_to
        value:
          title: Value
          description: Value to compare against (flexible JSON type)
          type: object
        condition_group:
          title: Condition group
          description: Group number for logical grouping (groups are joined by OR)
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        logical_operator:
          title: Logical operator
          description: How to combine with other conditions in same group
          type: string
          enum:
            - AND
            - OR
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    RuleAction:
      required:
        - action_type
        - target_object_path
        - field_mappings
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        action_type:
          title: Action type
          description: Name of the action (from action registry)
          type: string
          maxLength: 255
          minLength: 1
        target_object_path:
          title: Target object path
          description: Which object from event to operate on (e.g., "order.seller_company")
          type: string
          maxLength: 255
          minLength: 1
        field_mappings:
          title: Field mappings
          description: >-
            How to map event data to action payload (supports {{field.path}}
            templates)
          type: object
        execution_order:
          title: Execution order
          description: Order to execute multiple actions (lower = earlier)
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    Rule:
      required:
        - name
        - event_type
        - actions
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          description: Human-readable name for the rule
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Detailed description of the rule
          type: string
        event_type:
          title: Event type
          description: Event topic this rule listens to
          type: string
          maxLength: 255
          minLength: 1
        rule_type:
          title: Rule type
          description: GLOBAL (admin only) or COMPANY (customer rules)
          type: string
          enum:
            - GLOBAL
            - COMPANY
        is_active:
          title: Is active
          description: Whether the rule is currently active
          type: boolean
        test_mode:
          title: Test mode
          description: If True, evaluate conditions but don't execute actions (for testing)
          type: boolean
        priority:
          title: Priority
          description: Execution priority (lower number = higher priority)
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        company_id:
          title: Company id
          description: For COMPANY rules, which company this applies to (null for GLOBAL)
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        created_by:
          title: Created by
          description: User who created the rule
          type: string
          maxLength: 255
        updated_by:
          title: Updated by
          description: User who last updated the rule
          type: string
          maxLength: 255
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/RuleCondition'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/RuleAction'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    Task:
      required:
        - string_id
        - type
        - requirement_string_id
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        string_id:
          title: String id
          description: >-
            Unique slugified identifier for this task (e.g.
            eudr-product-survey). Used by rules to reference which requirement
            to add or remove.
          type: string
          maxLength: 255
          minLength: 1
        type:
          title: Type
          description: The kind of requirement this task represents.
          type: string
          enum:
            - survey
            - assessment
        requirement_string_id:
          title: Requirement string id
          description: >-
            Identifier of the corresponding external requirement — a data room
            survey slug or a risk assessment type slug.
          type: string
          maxLength: 255
          minLength: 1
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    TaskInstance:
      required:
        - task_string_id
        - taskable_identifier
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        task:
          $ref: '#/components/schemas/Task'
        task_string_id:
          title: Task string id
          type: string
        taskable_identifier:
          title: Taskable identifier
          description: >-
            Pulse identifier of the object this requirement is attached to (e.g.
            scranton$Product$42). Uses the Pulsify identifier format.
          type: string
          maxLength: 255
          minLength: 1
        requirement_instance_identifier:
          title: Requirement instance identifier
          description: >-
            Pulse identifier of the concrete external instance — e.g.
            data_room$SurveySubmission$<pk> or compliance$RiskAssessment$<pk>.
            Written when the producer creates the submission or assessment run,
            used to match subsequent result events back to this instance.
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        result:
          title: Result
          description: >-
            Free-form JSON holding the outcome of this requirement. Shape
            depends on the Task type — e.g. assessment risk scores, survey
            submission state. Written by the producing service.
          type: object
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    DueDiligenceStatement:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          description: Type of Due Diligence Statement (EUDR, EUTR)
          type: string
          enum:
            - EUDR
            - EUTR
        dds_identifier:
          title: Dds identifier
          type: string
        dds_data:
          title: Dds data
          type: object
          readOnly: true
        orders:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    HSCode:
      type: object
      properties:
        hscode:
          title: Hscode
          type: string
          readOnly: true
          minLength: 1
        description:
          title: Description
          type: string
          readOnly: true
          minLength: 1
        section:
          title: Section
          type: object
          readOnly: true
          nullable: true
        parent:
          title: Parent
          type: string
          readOnly: true
          minLength: 1
        level:
          title: Level
          type: string
          readOnly: true
          minLength: 1
        is_chapter:
          title: Is chapter
          type: boolean
          readOnly: true
        is_heading:
          title: Is heading
          type: boolean
          readOnly: true
        is_subheading:
          title: Is subheading
          type: boolean
          readOnly: true
        standards:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        commodity:
          title: Commodity
          type: string
          readOnly: true
          minLength: 1
    HSSection:
      type: object
      properties:
        section:
          title: Section
          type: string
          readOnly: true
          minLength: 1
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        display_name:
          title: Display name
          type: string
          readOnly: true
          minLength: 1
    InformationRequest:
      type: object
      properties:
        order_id:
          title: Order id
          type: integer
        value_chain_id:
          title: Value chain id
          type: integer
        invitation_action:
          title: Invitation action
          type: string
          readOnly: true
          minLength: 1
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        type:
          title: Type
          type: string
          readOnly: true
          minLength: 1
        city:
          title: City
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        country:
          title: Country
          type: string
          readOnly: true
          minLength: 1
        primary_contact_id:
          title: Primary contact id
          type: integer
          readOnly: true
        primary_contact_email:
          title: Primary contact email
          type: string
          format: email
          readOnly: true
          minLength: 1
    InformationRequestItem:
      type: object
      properties:
        order_id:
          title: Order id
          type: integer
        value_chain_id:
          title: Value chain id
          type: integer
    InformationRequestBulk:
      required:
        - information_requests
      type: object
      properties:
        information_requests:
          description: List of information requests to create
          type: array
          items:
            $ref: '#/components/schemas/InformationRequestItem'
          maxItems: 100
          minItems: 1
    Country:
      type: object
      properties:
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        alpha_2:
          title: Alpha 2
          type: string
          readOnly: true
          minLength: 1
        alpha_3:
          title: Alpha 3
          type: string
          readOnly: true
          minLength: 1
        numeric:
          title: Numeric
          type: string
          readOnly: true
          minLength: 1
        official_name:
          title: Official name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        flag:
          title: Flag
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        eu_status:
          title: Eu status
          type: string
          readOnly: true
          minLength: 1
          nullable: true
    OwnershipPeriod:
      required:
        - valid_from_month
      type: object
      properties:
        valid_from_month:
          title: Valid from month
          type: string
          pattern: ^\d{4}-(0[1-9]|1[0-2])$
          minLength: 1
        valid_to_month:
          title: Valid to month
          type: string
          pattern: ^\d{4}-(0[1-9]|1[0-2])$
          minLength: 1
          nullable: true
        consolidation_approach:
          title: Consolidation approach
          type: string
          enum:
            - equity_share
            - operational_control
            - financial_control
          nullable: true
        ownership_percentage:
          title: Ownership percentage
          type: string
          format: decimal
          default: '100'
    OwnershipInformation:
      required:
        - ownership_periods
      type: object
      properties:
        ownership_periods:
          type: array
          items:
            $ref: '#/components/schemas/OwnershipPeriod'
        sector_code:
          title: Sector code
          type: string
          maxLength: 32
          nullable: true
        notes:
          title: Notes
          type: string
          nullable: true
      nullable: true
    ValueChain:
      required:
        - company_name
        - type
        - country_code
        - contact_name
        - contact_email
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_name:
          title: Company name
          type: string
          maxLength: 255
          minLength: 1
        type:
          title: Type
          type: string
          enum:
            - supplier
            - customer
            - investment
            - investor
            - franchise
            - franchisor
            - group_member
            - group_parent
        description:
          title: Description
          type: string
          nullable: true
        status:
          title: Status
          type: string
          enum:
            - revoked
            - not_invited_yet
            - invitation_sent
            - connected
        country_code:
          title: Country code
          type: string
          maxLength: 2
          minLength: 1
        country:
          $ref: '#/components/schemas/Country'
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        permission_granted:
          title: Permission granted
          type: boolean
        is_self_managed:
          title: Is self managed
          type: boolean
        contact_name:
          title: Contact name
          type: string
          maxLength: 255
          minLength: 1
        contact_email:
          title: Contact email
          type: string
          format: email
          maxLength: 254
          minLength: 1
        send_information_request:
          title: Send information request
          type: boolean
          default: false
        invitation_id:
          title: Invitation id
          type: string
          format: uuid
          nullable: true
        reciprocal_company_id:
          title: Reciprocal company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        has_account:
          title: Has account
          type: string
          readOnly: true
        is_invited:
          title: Is invited
          type: string
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        ownership_information:
          $ref: '#/components/schemas/OwnershipInformation'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
    CoolsetCompany:
      type: object
      properties:
        id:
          title: Id
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        slug:
          title: Slug
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        type:
          title: Type
          type: string
          readOnly: true
          minLength: 1
        city:
          title: City
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        country:
          title: Country
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        nr_of_employees:
          title: Nr of employees
          type: integer
          readOnly: true
          nullable: true
        nr_of_locations:
          title: Nr of locations
          type: integer
          readOnly: true
          nullable: true
        default_currency:
          title: Default currency
          type: string
          readOnly: true
          minLength: 1
        default_locale:
          title: Default locale
          type: string
          readOnly: true
          minLength: 1
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    ProductList:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        sku:
          title: Sku
          type: string
          readOnly: true
          minLength: 1
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        description:
          title: Description
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        scientific_name:
          title: Scientific name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        common_name:
          title: Common name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        type:
          title: Type
          type: string
          enum:
            - manufactured
            - produced
            - purchased
          readOnly: true
        hs_code:
          title: Hs code
          type: string
          readOnly: true
          minLength: 1
        commodity:
          title: Commodity
          type: string
          enum:
            - cattle
            - cocoa
            - coffee
            - palm_oil
            - rubber
            - soya
            - wood
          readOnly: true
        composition:
          title: Composition
          type: string
          enum:
            - simple
            - composite
          readOnly: true
        external_id:
          title: External id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        is_packaging:
          title: Is packaging
          type: boolean
          readOnly: true
        volume:
          title: Volume
          type: number
          readOnly: true
          nullable: true
        unit:
          title: Unit
          type: string
          enum:
            - mg
            - g
            - kg
            - tonne
            - ml
            - cl
            - l
            - oz
            - lb
          readOnly: true
          nullable: true
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    TracePayload:
      type: object
      properties:
        traced_orders:
          type: array
          items:
            type: integer
        traced_origins:
          type: array
          items:
            type: integer
    NestedOrderItem:
      required:
        - volume
        - unit
      type: object
      properties:
        id:
          title: Id
          type: integer
        order:
          title: Order
          type: integer
          readOnly: true
        buyer_product:
          title: Buyer product
          type: integer
          nullable: true
        buyer_product_detail:
          $ref: '#/components/schemas/ProductList'
        seller_product:
          title: Seller product
          type: integer
          nullable: true
        seller_product_detail:
          $ref: '#/components/schemas/ProductList'
        volume:
          title: Volume
          type: number
        unit:
          title: Unit
          type: string
          maxLength: 3
          minLength: 1
        line_number:
          title: Line number
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        trace:
          $ref: '#/components/schemas/TracePayload'
        is_complete_match:
          title: Is complete match
          type: string
          readOnly: true
        traced_order_count:
          title: Traced order count
          type: string
          readOnly: true
        traced_origin_count:
          title: Traced origin count
          type: string
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
    DueDiligenceStatementNested:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        type:
          title: Type
          description: Type of Due Diligence Statement (EUDR, EUTR)
          type: string
          enum:
            - EUDR
            - EUTR
          readOnly: true
        dds_data:
          title: Dds data
          type: object
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    Order:
      required:
        - company_id
        - type
        - external_id
        - order_created_at
        - tags
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_id:
          title: Company id
          type: integer
          maximum: 2147483647
          minimum: 0
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        external_id:
          title: External id
          type: string
          maxLength: 255
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        value_chain_detail:
          $ref: '#/components/schemas/ValueChain'
        buyer_company_id:
          title: Buyer company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        seller_company_id:
          title: Seller company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedOrderItem'
          readOnly: true
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            $ref: '#/components/schemas/DueDiligenceStatementNested'
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        border_cross_country:
          $ref: '#/components/schemas/Country'
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    BatchOrder:
      required:
        - type
        - external_id
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        external_id:
          title: External id
          type: string
          maxLength: 255
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        value_chain:
          title: Value chain
          type: integer
          readOnly: true
          nullable: true
        seller_company_id:
          title: Seller company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedOrderItem'
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    NestedProductChain:
      description: Customer's order where I'm the seller (null if top of chain)
      required:
        - company_id
        - type
        - external_id
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_id:
          title: Company id
          type: integer
          maximum: 2147483647
          minimum: 0
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        external_id:
          title: External id
          type: string
          maxLength: 255
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
        assessment_summary:
          title: Assessment summary
          type: object
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        value_chain_detail:
          $ref: '#/components/schemas/ValueChain'
        buyer_company_id:
          title: Buyer company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        seller_company_id:
          title: Seller company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedOrderItem'
          readOnly: true
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
      nullable: true
    ProductChainList:
      type: object
      properties:
        product_chain_status:
          title: Product chain status
          description: >-
            Computed status: 'untraced' if no upstream, otherwise upstream's
            buyer_company_status
          type: string
          enum:
            - untraced
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
          readOnly: true
        downstream_product_chain:
          $ref: '#/components/schemas/NestedProductChain'
        upstream_product_chain:
          $ref: '#/components/schemas/NestedProductChain'
    NestedProductChainOrderItem:
      type: object
      properties:
        id:
          title: Id
          type: integer
        order:
          title: Order
          type: integer
          readOnly: true
        buyer_product:
          title: Buyer product
          type: integer
          nullable: true
        buyer_product_detail:
          $ref: '#/components/schemas/ProductList'
        seller_product_detail:
          $ref: '#/components/schemas/ProductList'
        line_number:
          title: Line number
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        trace:
          $ref: '#/components/schemas/TracePayload'
        traced_order_count:
          title: Traced order count
          type: string
          readOnly: true
        traced_origin_count:
          title: Traced origin count
          type: string
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
    ProductChainOrder:
      required:
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
          readOnly: true
        external_id:
          title: External id
          type: string
          readOnly: true
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        value_chain_detail:
          $ref: '#/components/schemas/ValueChain'
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedProductChainOrderItem'
        send_information_request:
          title: Send information request
          type: boolean
          default: false
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    ProductChainStatistics:
      required:
        - order_count
      type: object
      properties:
        order_count:
          title: Order count
          type: integer
        date:
          title: Date
          type: string
          format: date
        product_chain_status:
          title: Product chain status
          type: string
          minLength: 1
        assessment_status:
          title: Assessment status
          type: string
          minLength: 1
    PurchaseOrder:
      required:
        - type
        - external_id
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        external_id:
          title: External id
          type: string
          maxLength: 255
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        value_chain_detail:
          $ref: '#/components/schemas/ValueChain'
        seller_company_id:
          title: Seller company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedOrderItem'
        send_information_request:
          title: Send information request
          type: boolean
          default: false
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        border_cross_country:
          $ref: '#/components/schemas/Country'
        dds_identifiers:
          type: array
          items:
            type: string
            minLength: 1
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    SaleOrder:
      required:
        - type
        - external_id
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        external_id:
          title: External id
          type: string
          maxLength: 255
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
          readOnly: true
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        value_chain_detail:
          $ref: '#/components/schemas/ValueChain'
        buyer_company_id:
          title: Buyer company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedOrderItem'
        send_information_request:
          title: Send information request
          type: boolean
          default: false
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        dds_identifiers:
          type: array
          items:
            type: string
            minLength: 1
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        border_cross_country:
          $ref: '#/components/schemas/Country'
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    OrderStatistics:
      required:
        - order_count
      type: object
      properties:
        order_count:
          title: Order count
          type: integer
        date:
          title: Date
          type: string
          format: date
        type:
          title: Type
          type: string
          minLength: 1
        buyer_company_status:
          title: Buyer company status
          type: string
          minLength: 1
        seller_company_status:
          title: Seller company status
          type: string
          minLength: 1
        assessment_status:
          title: Assessment status
          type: string
          minLength: 1
    OrderList:
      required:
        - type
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        buyer_company_id:
          title: Buyer company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        seller_company_id:
          title: Seller company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          readOnly: true
          nullable: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    Origin:
      required:
        - name
        - country_code
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
        country_code:
          title: Country code
          type: string
          maxLength: 2
          minLength: 1
        country:
          $ref: '#/components/schemas/Country'
        location:
          title: Location
          type: object
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        open_atlas_external_id:
          title: Open atlas external id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        open_atlas_information:
          title: Open atlas information
          type: object
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
    RelatedOrderItem:
      required:
        - volume
        - unit
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        order:
          title: Order
          type: integer
          readOnly: true
        buyer_product:
          title: Buyer product
          type: integer
          nullable: true
        buyer_product_detail:
          $ref: '#/components/schemas/ProductList'
        seller_product:
          title: Seller product
          type: integer
          nullable: true
        seller_product_detail:
          $ref: '#/components/schemas/ProductList'
        volume:
          title: Volume
          type: number
        unit:
          title: Unit
          type: string
          maxLength: 3
          minLength: 1
        line_number:
          title: Line number
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        traced_orders_detail:
          type: array
          items:
            $ref: '#/components/schemas/OrderList'
          readOnly: true
        traced_origins_detail:
          type: array
          items:
            $ref: '#/components/schemas/Origin'
          readOnly: true
        is_complete_match:
          title: Is complete match
          type: string
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
    ProductComponent:
      required:
        - product
        - component_product
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        product:
          title: Product
          type: integer
        component_product:
          title: Component product
          type: integer
        component_product_detail:
          $ref: '#/components/schemas/ProductList'
        quantity:
          title: Quantity
          type: integer
          maximum: 2147483647
          minimum: 0
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        deleted_at:
          title: Deleted at
          type: string
          format: date-time
          nullable: true
    Product:
      required:
        - sku
        - name
        - type
        - hs_code
        - commodity
        - composition
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        sku:
          title: Sku
          type: string
          maxLength: 100
          minLength: 1
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
        scientific_name:
          title: Scientific name
          type: string
          maxLength: 255
          nullable: true
        common_name:
          title: Common name
          type: string
          maxLength: 255
          nullable: true
        type:
          title: Type
          type: string
          enum:
            - manufactured
            - produced
            - purchased
        hs_code:
          title: Hs code
          type: string
          maxLength: 255
          minLength: 1
        commodity:
          title: Commodity
          type: string
          enum:
            - cattle
            - cocoa
            - coffee
            - palm_oil
            - rubber
            - soya
            - wood
        composition:
          title: Composition
          type: string
          enum:
            - simple
            - composite
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        is_packaging:
          title: Is packaging
          type: boolean
        volume:
          title: Volume
          type: number
          nullable: true
        unit:
          title: Unit
          type: string
          enum:
            - mg
            - g
            - kg
            - tonne
            - ml
            - cl
            - l
            - oz
            - lb
          nullable: true
        product_components:
          description: A list of product IDs to set as components.
          type: array
          items:
            description: A list of product IDs to set as components.
            type: integer
          uniqueItems: true
        product_components_detail:
          type: array
          items:
            $ref: '#/components/schemas/ProductComponent'
          readOnly: true
        tags:
          type: array
          items:
            type: string
            minLength: 1
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    TraceList:
      required:
        - order
        - volume
        - unit
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        order:
          title: Order
          type: integer
        order_detail:
          $ref: '#/components/schemas/OrderList'
        buyer_product:
          title: Buyer product
          type: integer
          nullable: true
        buyer_product_detail:
          $ref: '#/components/schemas/ProductList'
        seller_product:
          title: Seller product
          type: integer
          nullable: true
        seller_product_detail:
          $ref: '#/components/schemas/ProductList'
        volume:
          title: Volume
          type: number
        unit:
          title: Unit
          type: string
          maxLength: 3
          minLength: 1
        line_number:
          title: Line number
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        traced_orders_detail:
          type: array
          items:
            $ref: '#/components/schemas/OrderList'
          readOnly: true
        traced_origins_detail:
          type: array
          items:
            $ref: '#/components/schemas/Origin'
          readOnly: true
        is_complete_match:
          title: Is complete match
          type: string
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
    APIKey:
      required:
        - name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          description: Descriptive name for this API key (e.g., 'Production Server')
          type: string
          maxLength: 255
          minLength: 1
        prefix:
          title: Prefix
          description: First 8 characters of key for identification
          type: string
          readOnly: true
          minLength: 1
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        last_used_at:
          title: Last used at
          type: string
          format: date-time
          readOnly: true
          nullable: true
        expires_at:
          title: Expires at
          description: Optional expiration date
          type: string
          format: date-time
          nullable: true
        is_active:
          title: Is active
          type: boolean
        scopes:
          title: Scopes
          description: List of permission scopes (e.g., ['read:data', 'write:data'])
          type: object
          default: []
        ip_whitelist:
          title: Ip whitelist
          description: Optional list of allowed IP addresses
          type: object
          default: []
        scope:
          title: Scope
          type: string
          enum:
            - workspace
            - user
          default: user
        company_id:
          title: Company id
          type: integer
          readOnly: true
        company_name:
          title: Company name
          type: string
          readOnly: true
        user_email:
          title: User email
          type: string
          readOnly: true
    BasicAuthRegistration:
      required:
        - email
        - password
        - first_name
        - last_name
        - user_invitation_id
      type: object
      properties:
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          nullable: true
        password:
          title: Password
          description: >-
            Minimum 10 characters. Consider using a passphrase (e.g. a short
            memorable sentence). Must not be similar to your personal
            information, must not be a commonly used password, and must not be
            entirely numeric.
          type: string
          minLength: 1
        first_name:
          title: First name
          type: string
          maxLength: 1024
          minLength: 1
        last_name:
          title: Last name
          type: string
          maxLength: 1024
          minLength: 1
        job_title:
          title: Job title
          type: string
          maxLength: 1024
          nullable: true
        user_invitation_id:
          title: User invitation id
          description: UUID of the user invitation
          type: string
          maxLength: 1024
          minLength: 1
    UserAuthInfo:
      type: object
      properties:
        id:
          title: Id
          type: integer
          readOnly: true
        email:
          title: Email
          type: string
          format: email
          readOnly: true
          minLength: 1
        first_name:
          title: First name
          type: string
          readOnly: true
          minLength: 1
        last_name:
          title: Last name
          type: string
          readOnly: true
          minLength: 1
        auth_type:
          title: Auth type
          type: string
          readOnly: true
          minLength: 1
    BasicAuthChangePassword:
      required:
        - old_password
        - new_password
      type: object
      properties:
        old_password:
          title: Old password
          type: string
          minLength: 1
        new_password:
          title: New password
          description: >-
            Minimum 10 characters. Consider using a passphrase (e.g. a short
            memorable sentence). Must not be similar to your personal
            information, must not be a commonly used password, and must not be
            entirely numeric.
          type: string
          minLength: 1
    BasicAuthConfirmResetPassword:
      required:
        - uid
        - token
        - new_password
      type: object
      properties:
        uid:
          title: Uid
          type: string
          minLength: 1
        token:
          title: Token
          type: string
          minLength: 1
        new_password:
          title: New password
          description: >-
            Minimum 10 characters. Consider using a passphrase (e.g. a short
            memorable sentence). Must not be similar to your personal
            information, must not be a commonly used password, and must not be
            entirely numeric.
          type: string
          minLength: 1
    BasicAuthLogin:
      required:
        - email
        - password
      type: object
      properties:
        email:
          title: Email
          type: string
          format: email
          minLength: 1
        password:
          title: Password
          type: string
          minLength: 1
        user_invitation_id:
          title: User invitation id
          description: 'Optional: UUID of user invitation to accept during login'
          type: string
          maxLength: 1024
    UserConfigResponse:
      required:
        - config
        - available_actions
        - company_type
      type: object
      properties:
        config:
          title: Config
          description: Current user configuration
          type: object
        available_actions:
          description: List of actions available to the user based on their current state
          type: array
          items:
            type: string
            minLength: 1
        company_type:
          title: Company type
          description: Type of company the user belongs to
          type: string
          minLength: 1
    UserConfigUpdate:
      type: object
      properties:
        sign_stakeholder_agreement:
          title: Sign stakeholder agreement
          description: Set to true to sign the stakeholder agreement
          type: boolean
    SimpleUserCompany:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        user_id:
          title: User id
          type: string
          readOnly: true
        company_id:
          title: Company id
          type: string
          readOnly: true
        auth_group_id:
          title: Auth group id
          type: string
          readOnly: true
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          maxLength: 1024
          nullable: true
        config:
          title: Config
          type: object
      nullable: true
    CompanyFlag:
      type: object
      properties:
        name:
          title: Name
          description: The human/computer readable name.
          type: string
          readOnly: true
          minLength: 1
    LegacyOptionalCompany:
      required:
        - name
        - country
        - default_currency
        - default_locale
        - flags
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 1024
          minLength: 1
        type:
          title: Type
          type: string
          enum:
            - active
            - inactive
            - test
            - demo
            - trial
            - stakeholder
          readOnly: true
        logo:
          title: Logo
          type: string
          readOnly: true
          format: uri
          nullable: true
        country:
          title: Country
          type: string
          maxLength: 2
          minLength: 1
        credits_used:
          title: Credits used
          type: string
          readOnly: true
        nr_of_employees:
          title: Nr of employees
          type: number
          readOnly: true
        nr_of_locations:
          title: Nr of locations
          type: number
          readOnly: true
        nr_of_transactions:
          title: Nr of transactions
          type: integer
          readOnly: true
        minimum_date_filter:
          title: Minimum date filter
          type: string
          format: date
          readOnly: true
        results_limit_earliest_year:
          title: Results limit earliest year
          type: string
          format: date
          readOnly: true
        results_limit_latest_year:
          title: Results limit latest year
          type: string
          format: date
          readOnly: true
          nullable: true
        min_transaction_date:
          title: Min transaction date
          type: string
          readOnly: true
        max_transaction_date:
          title: Max transaction date
          type: string
          readOnly: true
        public_page_url:
          title: Public page url
          type: string
          format: uri
          maxLength: 200
          nullable: true
        chift_consumer_id:
          title: Chift consumer id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        default_currency:
          title: Default currency
          type: string
          minLength: 1
        default_locale:
          title: Default locale
          type: string
          enum:
            - nl-NL
            - en-US
            - en-GB
            - fr-FR
            - fr-BE
            - sv-SE
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        information:
          title: Information
          type: object
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        flags:
          type: array
          items:
            $ref: '#/components/schemas/CompanyFlag'
    Permission:
      type: object
      properties:
        codename:
          title: Codename
          type: string
          readOnly: true
          minLength: 1
    Group:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
          readOnly: true
    UserMe:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        first_name:
          title: First name
          type: string
          readOnly: true
          minLength: 1
        last_name:
          title: Last name
          type: string
          readOnly: true
          minLength: 1
        email:
          title: Email
          type: string
          format: email
          readOnly: true
          minLength: 1
          nullable: true
        firebase_uid:
          title: Firebase uid
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        job_title:
          title: Job title
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        profile_picture:
          title: Profile picture
          type: string
          readOnly: true
          format: uri
          nullable: true
        is_mfa_enrolled:
          title: Is mfa enrolled
          type: boolean
          readOnly: true
        is_mfa_required:
          title: Is mfa required
          type: boolean
          readOnly: true
          nullable: true
        active_user_company_id:
          title: Active user company id
          type: integer
          readOnly: true
          nullable: true
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          readOnly: true
        pylon_email_hash:
          title: Pylon email hash
          type: string
          readOnly: true
        user_company:
          $ref: '#/components/schemas/SimpleUserCompany'
        company:
          $ref: '#/components/schemas/LegacyOptionalCompany'
        auth_group:
          $ref: '#/components/schemas/Group'
    Workspace:
      type: object
      properties:
        workspace_id:
          title: Workspace id
          type: integer
          readOnly: true
        workspace_name:
          title: Workspace name
          type: string
          readOnly: true
          minLength: 1
        workspace_logo:
          title: Workspace logo
          type: string
          readOnly: true
          format: uri
          nullable: true
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        logo:
          title: Logo
          type: string
          readOnly: true
          format: uri
          nullable: true
        type:
          title: Type
          type: string
          enum:
            - active
            - inactive
            - test
            - demo
            - trial
            - stakeholder
          readOnly: true
        country:
          title: Country
          type: string
          readOnly: true
          minLength: 1
        member_count:
          title: Member count
          type: integer
          readOnly: true
        is_mfa_enabled:
          title: Is mfa enabled
          type: boolean
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    ManualInput:
      required:
        - label
        - order
        - type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        label:
          title: Label
          type: string
          maxLength: 1000
          minLength: 1
        unit:
          title: Unit
          type: string
          readOnly: true
        order:
          title: Order
          type: integer
          maximum: 2147483647
          minimum: 1
        type:
          title: Type
          type: string
          enum:
            - dropdown
            - value
    BaseEmissionFactorCategory:
      required:
        - title
        - parent
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        icon:
          title: Icon
          description: SVG icon filename. Only set on top-level and sub-category levels.
          type: string
          readOnly: true
          format: uri
          nullable: true
        parent:
          title: Parent
          description: >-
            Parent category. Null for top-level categories. 3-level hierarchy:
            top-level → sub-category → classification.
          type: integer
          nullable: true
        category:
          title: Category
          type: integer
          readOnly: true
        manual_inputs:
          type: array
          items:
            $ref: '#/components/schemas/ManualInput'
    EmissionFactorCategory:
      required:
        - title
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        icon:
          title: Icon
          description: SVG icon filename. Only set on top-level and sub-category levels.
          type: string
          readOnly: true
          format: uri
          nullable: true
        parent:
          $ref: '#/components/schemas/BaseEmissionFactorCategory'
        category:
          title: Category
          type: integer
          readOnly: true
        manual_inputs:
          type: array
          items:
            $ref: '#/components/schemas/ManualInput'
    KgCO2eMultiplierUnit:
      required:
        - name
        - display_name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        display_name:
          title: Display name
          description: 'You can use HTML tags, e.g.: km&lt;sup&gt;2&lt;/sup&gt;'
          type: string
          maxLength: 255
          minLength: 1
    BaseEmissionFactor:
      required:
        - title
        - category
        - kg_co2e_multiplier
        - kg_co2e_multiplier_unit
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          description: Display name of the emission factor.
          type: string
          maxLength: 255
          minLength: 1
        category:
          $ref: '#/components/schemas/EmissionFactorCategory'
        company:
          title: Company
          description: Null for global EFs. Set for company-specific overrides.
          type: integer
          nullable: true
        kg_co2e_multiplier:
          title: Kg co2e multiplier
          description: CO2e conversion multiplier in kg per unit.
          type: number
        kg_co2e_multiplier_unit:
          $ref: '#/components/schemas/KgCO2eMultiplierUnit'
        year:
          title: Year
          description: Reference year for the emission factor data.
          type: string
          maxLength: 10
          nullable: true
        region:
          title: Region
          description: Geographic region. Mix of freetext and ISO-2 codes.
          type: string
          maxLength: 255
          nullable: true
    ActivityBasedTransactionsType:
      required:
        - count
        - sub_categories
      type: object
      properties:
        count:
          title: Count
          type: integer
        sub_categories:
          type: array
          items:
            $ref: '#/components/schemas/BaseEmissionFactorCategory'
    ManualInputTransactionsSubCategories:
      required:
        - open
        - completed
        - skipped
      type: object
      properties:
        open:
          $ref: '#/components/schemas/ActivityBasedTransactionsType'
        completed:
          $ref: '#/components/schemas/ActivityBasedTransactionsType'
        skipped:
          $ref: '#/components/schemas/ActivityBasedTransactionsType'
    ChartQueryParam:
      type: object
      properties:
        date_aggregation:
          title: Date aggregation
          type: string
          enum:
            - day
            - week
            - month
            - quarter
            - year
        date_gte:
          title: Date gte
          type: string
          format: date
        date_lte:
          title: Date lte
          type: string
          format: date
        group_by:
          title: Group by
          type: string
          enum:
            - category
            - parent_category
            - status
            - vendor_name
            - ledger
        relative_to:
          title: Relative to
          type: string
          enum:
            - absolute
            - per_employee
            - per_revenue_unit
        metric_label:
          title: Metric label
          type: string
          minLength: 1
        limit:
          title: Limit
          type: integer
        type:
          title: Type
          type: string
          enum:
            - pie
            - bar
            - line
            - area
            - dashed-line
            - dotted-line
            - tree-map
    TrendLineData:
      required:
        - date_aggregation
        - trend_line
      type: object
      properties:
        date_aggregation:
          title: Date aggregation
          type: string
          format: date-time
        trend_line:
          title: Trend line
          type: number
    TransactionEmissionClassificationUpdate:
      required:
        - emission_factor
      type: object
      properties:
        emission_factor:
          title: Emission factor
          type: integer
    LegacyCompany:
      required:
        - name
        - country
        - default_currency
        - default_locale
        - flags
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 1024
          minLength: 1
        type:
          title: Type
          type: string
          enum:
            - active
            - inactive
            - test
            - demo
            - trial
            - stakeholder
          readOnly: true
        logo:
          title: Logo
          type: string
          readOnly: true
          format: uri
          nullable: true
        country:
          title: Country
          type: string
          maxLength: 2
          minLength: 1
        credits_used:
          title: Credits used
          type: string
          readOnly: true
        nr_of_employees:
          title: Nr of employees
          type: number
          readOnly: true
        nr_of_locations:
          title: Nr of locations
          type: number
          readOnly: true
        nr_of_transactions:
          title: Nr of transactions
          type: integer
          readOnly: true
        minimum_date_filter:
          title: Minimum date filter
          type: string
          format: date
          readOnly: true
        results_limit_earliest_year:
          title: Results limit earliest year
          type: string
          format: date
          readOnly: true
        results_limit_latest_year:
          title: Results limit latest year
          type: string
          format: date
          readOnly: true
          nullable: true
        min_transaction_date:
          title: Min transaction date
          type: string
          readOnly: true
        max_transaction_date:
          title: Max transaction date
          type: string
          readOnly: true
        public_page_url:
          title: Public page url
          type: string
          format: uri
          maxLength: 200
          nullable: true
        chift_consumer_id:
          title: Chift consumer id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        default_currency:
          title: Default currency
          type: string
          minLength: 1
        default_locale:
          title: Default locale
          type: string
          enum:
            - nl-NL
            - en-US
            - en-GB
            - fr-FR
            - fr-BE
            - sv-SE
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        information:
          title: Information
          type: object
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        flags:
          type: array
          items:
            $ref: '#/components/schemas/CompanyFlag'
    CompanyTag:
      required:
        - company
        - name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company:
          title: Company
          type: integer
        name:
          title: Name
          type: string
          maxLength: 20
          minLength: 1
    DataPointCreateRequest:
      required:
        - context
        - value
        - field_id
      type: object
      properties:
        context:
          title: Context
          type: object
          additionalProperties:
            type: string
            nullable: true
        value:
          title: Value
          type: string
        field_id:
          title: Field id
          type: string
          minLength: 1
    DataPointCreateStatusRequest:
      required:
        - context
        - field_id
        - status
      type: object
      properties:
        context:
          title: Context
          type: object
          additionalProperties:
            type: string
            nullable: true
        field_id:
          title: Field id
          type: string
          minLength: 1
        status:
          title: Status
          type: string
          enum:
            - not_started
            - in_progress
            - ready_for_review
            - ready_for_audit
            - suggested
    Export:
      required:
        - context
      type: object
      properties:
        export_template:
          title: Export template
          type: integer
        survey:
          title: Survey
          type: integer
        application_survey_id:
          title: Application survey id
          type: integer
        export_configuration:
          title: Export configuration
          type: object
          additionalProperties:
            type: string
            nullable: true
        context:
          title: Context
          type: object
          additionalProperties:
            type: string
            nullable: true
    QueryContext:
      required:
        - context_object
        - context_value
        - precision
      type: object
      properties:
        context_object:
          title: Context object
          type: string
          minLength: 1
        context_value:
          title: Context value
          type: string
          minLength: 1
        precision:
          title: Precision
          type: string
          enum:
            - exact
            - exclude
            - nearest
    SurveySubmissionCreate:
      required:
        - application_survey_id
        - query_context
      type: object
      properties:
        application_survey_id:
          title: Application survey id
          type: integer
        query_context:
          type: array
          items:
            $ref: '#/components/schemas/QueryContext'
    EmissionFactor:
      required:
        - title
        - category
        - classification_category
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title + region. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        title:
          title: Title
          description: Display name of the emission factor.
          type: string
          maxLength: 255
          minLength: 1
        category:
          $ref: '#/components/schemas/EmissionFactorCategory'
        classification_category:
          $ref: '#/components/schemas/EmissionFactorCategory'
        company:
          title: Company
          description: Null for global EFs. Set for company-specific overrides.
          type: integer
          nullable: true
        kg_co2e_multiplier:
          title: Kg co2e multiplier
          type: number
          readOnly: true
        kg_co2e_multiplier_unit:
          title: Kg co2e multiplier unit
          type: object
          readOnly: true
        region:
          title: Region
          description: Geographic region. Mix of freetext and ISO-2 codes.
          type: string
          maxLength: 255
          nullable: true
        is_activity_based:
          title: Is activity based
          description: True for activity-based EFs, false for spend-based.
          type: boolean
        is_required_transactions_input_classifier:
          title: Is required transactions input classifier
          description: >-
            Marks the EF whose category requires transaction input. Very few EFs
            are truthy.
          type: boolean
        year:
          title: Year
          description: Reference year for the emission factor data.
          type: string
          maxLength: 10
          nullable: true
        source:
          title: Source
          description: Data source (e.g. EXIOBASE, BEIS, EPA, CBAM).
          type: string
          maxLength: 255
          nullable: true
        deleted_at:
          title: Deleted at
          description: Soft-delete tombstone. Null means active.
          type: string
          format: date-time
          nullable: true
    CreateUpdateCompanyEmissionFactor:
      required:
        - kg_co2e_multiplier
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          description: Display name of the emission factor.
          type: string
          maxLength: 255
          minLength: 1
        kg_co2e_multiplier:
          title: Kg co2e multiplier
          description: CO2e conversion multiplier in kg per unit.
          type: number
    EmissionFilter:
      type: object
      properties:
        id:
          title: Id
          type: number
          nullable: true
        id__in:
          title: Id  in
          type: string
        journal:
          title: Journal
          type: string
        journal__icontains:
          title: Journal  icontains
          type: string
        journal__istartswith:
          title: Journal  istartswith
          type: string
        journal__iendswith:
          title: Journal  iendswith
          type: string
        journal__isnull:
          title: Journal  isnull
          type: boolean
          nullable: true
        title:
          title: Title
          type: string
        title__icontains:
          title: Title  icontains
          type: string
        title__istartswith:
          title: Title  istartswith
          type: string
        title__iendswith:
          title: Title  iendswith
          type: string
        description:
          title: Description
          type: string
        description__icontains:
          title: Description  icontains
          type: string
        description__istartswith:
          title: Description  istartswith
          type: string
        description__iendswith:
          title: Description  iendswith
          type: string
        description__isnull:
          title: Description  isnull
          type: boolean
          nullable: true
        vendor_name:
          title: Vendor name
          type: string
        vendor_name__icontains:
          title: Vendor name  icontains
          type: string
        vendor_name__istartswith:
          title: Vendor name  istartswith
          type: string
        vendor_name__iendswith:
          title: Vendor name  iendswith
          type: string
        vendor_name__isnull:
          title: Vendor name  isnull
          type: boolean
          nullable: true
        accounting_date:
          title: Accounting date
          type: string
          format: date-time
          nullable: true
        accounting_date__gte:
          title: Accounting date  gte
          type: string
          format: date-time
          nullable: true
        accounting_date__lte:
          title: Accounting date  lte
          type: string
          format: date-time
          nullable: true
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
          nullable: true
        classification_category_id:
          title: Classification category id
          type: string
        classification_category_name:
          title: Classification category name
          type: string
        classification_category_name__icontains:
          title: Classification category name  icontains
          type: string
        classification_category_name__istartswith:
          title: Classification category name  istartswith
          type: string
        classification_category_name__iendswith:
          title: Classification category name  iendswith
          type: string
        sub_category_id:
          title: Sub category id
          type: string
        category_id:
          title: Category id
          type: string
        ghg_category_id:
          title: Ghg category id
          type: string
        is_tag_along:
          title: Is tag along
          type: boolean
          nullable: true
        confidence_status:
          title: Confidence status
          type: string
        co2_kg:
          title: Co2 kg
          type: number
          nullable: true
        co2_kg__gt:
          title: Co2 kg  gt
          type: number
          nullable: true
        co2_kg__lt:
          title: Co2 kg  lt
          type: number
          nullable: true
        co2_kg__gte:
          title: Co2 kg  gte
          type: number
          nullable: true
        co2_kg__lte:
          title: Co2 kg  lte
          type: number
          nullable: true
        controlled_by_identifier:
          title: Controlled by identifier
          type: string
        controlled_by_identifier__icontains:
          title: Controlled by identifier  icontains
          type: string
        controlled_by_identifier__istartswith:
          title: Controlled by identifier  istartswith
          type: string
        controlled_by_identifier__iendswith:
          title: Controlled by identifier  iendswith
          type: string
        controlled_by_identifier__isnull:
          title: Controlled by identifier  isnull
          type: boolean
          nullable: true
        scope:
          type: array
          items:
            type: string
            minLength: 1
        company_tags:
          type: array
          items:
            type: integer
        flags_key_value:
          title: Flags key value
          type: string
    TransactionFilter:
      type: object
      properties:
        id:
          title: Id
          type: number
          nullable: true
        id__in:
          title: Id  in
          type: string
        vendor_name:
          title: Vendor name
          type: string
        vendor_name__icontains:
          title: Vendor name  icontains
          type: string
        vendor_name__istartswith:
          title: Vendor name  istartswith
          type: string
        vendor_name__iendswith:
          title: Vendor name  iendswith
          type: string
        vendor_name__isnull:
          title: Vendor name  isnull
          type: boolean
          nullable: true
        ledger:
          title: Ledger
          type: string
        ledger__icontains:
          title: Ledger  icontains
          type: string
        ledger__istartswith:
          title: Ledger  istartswith
          type: string
        ledger__iendswith:
          title: Ledger  iendswith
          type: string
        journal:
          title: Journal
          type: string
        journal__icontains:
          title: Journal  icontains
          type: string
        journal__istartswith:
          title: Journal  istartswith
          type: string
        journal__iendswith:
          title: Journal  iendswith
          type: string
        journal__isnull:
          title: Journal  isnull
          type: boolean
          nullable: true
        description:
          title: Description
          type: string
        description__icontains:
          title: Description  icontains
          type: string
        description__istartswith:
          title: Description  istartswith
          type: string
        description__iendswith:
          title: Description  iendswith
          type: string
        description__isnull:
          title: Description  isnull
          type: boolean
          nullable: true
        source:
          title: Source
          type: string
        integration_id:
          title: Integration id
          type: string
        integration__name:
          title: Integration  name
          type: string
        integration__name__icontains:
          title: Integration  name  icontains
          type: string
        integration__name__istartswith:
          title: Integration  name  istartswith
          type: string
        integration__name__iendswith:
          title: Integration  name  iendswith
          type: string
        date:
          title: Date
          type: string
          format: date-time
          nullable: true
        date__gte:
          title: Date  gte
          type: string
          format: date-time
          nullable: true
        date__lte:
          title: Date  lte
          type: string
          format: date-time
          nullable: true
        net_amount:
          title: Net amount
          type: number
          nullable: true
        net_amount__gt:
          title: Net amount  gt
          type: number
          nullable: true
        net_amount__lt:
          title: Net amount  lt
          type: number
          nullable: true
        net_amount__gte:
          title: Net amount  gte
          type: number
          nullable: true
        net_amount__lte:
          title: Net amount  lte
          type: number
          nullable: true
        tags:
          type: array
          items:
            type: integer
        confidence_status:
          title: Confidence status
          type: string
        classified:
          title: Classified
          type: boolean
          nullable: true
    ActivityData:
      required:
        - date
        - volume
        - volume_unit
        - title
      type: object
      properties:
        date:
          title: Date
          description: ISO 8601 date/datetime, e.g. '2024-01-15T00:00:00Z'
          type: string
          minLength: 1
        volume:
          title: Volume
          description: Volume of the activity, e.g. 150.0 (km, kWh, tonne, …)
          type: number
        volume_unit:
          title: Volume unit
          description: Unit matching the emission factor, e.g. 'km', 'kWh'
          type: string
          minLength: 1
        title:
          title: Title
          description: Short label for the activity, e.g. 'Business Travel - Q1'
          type: string
          minLength: 1
        end_date:
          title: End date
          description: ISO 8601 end date for range activities
          type: string
          minLength: 1
        journal:
          title: Journal
          description: Journal/reference code
          type: string
        description:
          title: Description
          description: Free-text description
          type: string
        vendor_name:
          title: Vendor name
          description: Vendor / supplier name
          type: string
    BulkEmissionClassificationOperation:
      type: object
      properties:
        emission_filters:
          $ref: '#/components/schemas/EmissionFilter'
        transaction_filters:
          $ref: '#/components/schemas/TransactionFilter'
        emission_factor_id:
          title: Emission factor id
          type: integer
        classification_category_id:
          title: Classification category id
          type: integer
        ghg_category_id:
          title: Ghg category id
          type: integer
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
        activity_data:
          $ref: '#/components/schemas/ActivityData'
    BulkEmissionClassificationRequest:
      required:
        - operations
      type: object
      properties:
        operations:
          type: array
          items:
            $ref: '#/components/schemas/BulkEmissionClassificationOperation'
    BulkEmissionClassificationOperationResult:
      required:
        - index
        - count
        - status
      type: object
      properties:
        index:
          title: Index
          description: Zero-based index of the operation in the request.
          type: integer
        count:
          title: Count
          description: Number of records matched and sent for classification.
          type: integer
        status:
          title: Status
          description: '''accepted'' when the operation was processed successfully.'
          type: string
          minLength: 1
        error:
          title: Error
          description: >-
            Error message if the operation failed during processing or
            validation.
          type: string
          minLength: 1
    BulkEmissionClassificationResponse:
      required:
        - results
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/BulkEmissionClassificationOperationResult'
    Classification:
      type: object
      properties:
        id:
          title: Id
          description: >-
            ID of an **existing emission** to reclassify. Omit to create a new
            emission.
          type: integer
        transaction_id:
          title: Transaction id
          description: ID of the transaction being classified.
          type: integer
        emission_factor_id:
          title: Emission factor id
          description: >-
            Specific emission factor ID. Takes priority over
            `classification_category_id` when both are supplied.
          type: integer
        classification_category_id:
          title: Classification category id
          description: >-
            Emission factor category (leaf node). Required unless
            `emission_factor_id` is given.
          type: integer
        ghg_category_id:
          title: Ghg category id
          description: GHG category ID. If omitted the category's default GHG is used.
          type: integer
        is_activity_based_emission:
          title: Is activity based emission
          description: >-
            Set `true` for activity-based (volume-driven) emissions. Requires
            `activity_data`.
          type: boolean
        activity_data:
          $ref: '#/components/schemas/ActivityData'
        controlled_by_identifier:
          title: Controlled by identifier
          type: string
          nullable: true
    LegacyEmissionClassificationRequest:
      required:
        - classifications
      type: object
      properties:
        classifications:
          type: array
          items:
            $ref: '#/components/schemas/Classification'
    EmissionChart:
      required:
        - transaction_count
        - emission_count
        - total_co2_kg
      type: object
      properties:
        transaction_count:
          title: Transaction count
          type: integer
        emission_count:
          title: Emission count
          type: integer
        total_co2_kg:
          title: Total co2 kg
          type: number
        date:
          title: Date
          type: string
          format: date-time
        main_emission:
          title: Main emission
          type: integer
        category:
          title: Category
          type: integer
        category_name:
          title: Category name
          type: string
          minLength: 1
        sub_category:
          title: Sub category
          type: integer
        sub_category_name:
          title: Sub category name
          type: string
          minLength: 1
        ghg_category:
          title: Ghg category
          type: integer
        ghg_category_name:
          title: Ghg category name
          type: string
          minLength: 1
        scope:
          title: Scope
          type: string
          minLength: 1
        title:
          title: Title
          type: string
          minLength: 1
        vendor_name:
          title: Vendor name
          type: string
          minLength: 1
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
    Emission:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company:
          title: Company
          type: integer
          readOnly: true
        company_name:
          title: Company name
          type: string
          readOnly: true
          minLength: 1
        company_tags:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        emission_group_id:
          title: Emission group id
          type: string
          format: uuid
          readOnly: true
        transaction:
          title: Transaction
          type: integer
          readOnly: true
          nullable: true
        total_volume:
          title: Total volume
          type: number
          readOnly: true
          nullable: true
        volume:
          title: Volume
          type: number
          readOnly: true
          nullable: true
        volume_unit:
          title: Volume unit
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        journal:
          title: Journal
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        title:
          title: Title
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        description:
          title: Description
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        vendor_name:
          title: Vendor name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        accounting_date:
          title: Accounting date
          type: string
          format: date-time
          readOnly: true
          nullable: true
        accounting_end_date:
          title: Accounting end date
          type: string
          format: date-time
          readOnly: true
          nullable: true
        transaction_is_visible:
          title: Transaction is visible
          type: boolean
          readOnly: true
          nullable: true
        transaction_data:
          title: Transaction data
          type: object
          readOnly: true
          nullable: true
        transaction_id:
          title: Transaction id
          type: string
          readOnly: true
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
          readOnly: true
        activity_data:
          title: Activity data
          type: object
          readOnly: true
          nullable: true
        emission_factor:
          title: Emission factor
          type: integer
          readOnly: true
          nullable: true
        emission_unit:
          title: Emission unit
          type: integer
          readOnly: true
          nullable: true
        emission_unit_name:
          title: Emission unit name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        emission_factor_data:
          title: Emission factor data
          type: object
          readOnly: true
          nullable: true
        classification_category:
          title: Classification category
          type: integer
          readOnly: true
          nullable: true
        classification_category_name:
          title: Classification category name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        sub_category:
          title: Sub category
          type: integer
          readOnly: true
          nullable: true
        sub_category_name:
          title: Sub category name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        category:
          title: Category
          type: integer
          readOnly: true
          nullable: true
        category_name:
          title: Category name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        ghg_category:
          title: Ghg category
          type: integer
          readOnly: true
          nullable: true
        ghg_category_name:
          title: Ghg category name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
          readOnly: true
        is_tag_along:
          title: Is tag along
          type: boolean
          readOnly: true
        main_emission:
          title: Main emission
          type: integer
          readOnly: true
          nullable: true
        created_by:
          title: Created by
          type: integer
          readOnly: true
          nullable: true
        classification_source:
          title: Classification source
          type: string
          enum:
            - auto
            - script
            - manual
          readOnly: true
        confidence:
          title: Confidence
          type: number
          readOnly: true
          nullable: true
        confidence_threshold:
          title: Confidence threshold
          type: number
          readOnly: true
          nullable: true
        confidence_status:
          title: Confidence status
          type: string
          enum:
            - confident
            - needs_attention
          readOnly: true
          nullable: true
        co2_kg:
          title: Co2 kg
          type: number
          readOnly: true
          nullable: true
        flags:
          title: Flags
          type: object
          readOnly: true
          nullable: true
        controlled_by_identifier:
          title: Controlled by identifier
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        deleted_at:
          title: Deleted at
          type: string
          format: date-time
          readOnly: true
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    EmissionCsvExport:
      type: object
      properties:
        accounting_date:
          title: Accounting date
          type: string
          format: date-time
          nullable: true
        journal:
          title: Journal
          type: string
          maxLength: 255
          nullable: true
        title:
          title: Title
          type: string
          maxLength: 255
          nullable: true
        vendor_name:
          title: Vendor name
          type: string
          maxLength: 255
          nullable: true
        description:
          title: Description
          type: string
          maxLength: 1024
          nullable: true
        company_tags_names:
          title: Company tags names
          type: string
          minLength: 1
        volume:
          title: Volume
          type: number
          nullable: true
        volume_unit:
          title: Volume unit
          type: string
          maxLength: 255
          nullable: true
        co2_kg:
          title: Co2 kg
          type: number
          nullable: true
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
        ghg_category_name:
          title: Ghg category name
          type: string
          maxLength: 255
          nullable: true
        category_name:
          title: Category name
          type: string
          maxLength: 255
          nullable: true
        ef_title:
          title: Ef title
          type: string
          minLength: 1
        ef_description:
          title: Ef description
          type: string
          minLength: 1
        ef_multiplier:
          title: Ef multiplier
          type: string
          minLength: 1
        emission_unit_name:
          title: Emission unit name
          type: string
          maxLength: 255
          nullable: true
        ef_source:
          title: Ef source
          type: string
          minLength: 1
        ef_year:
          title: Ef year
          type: string
          minLength: 1
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
        is_tag_along:
          title: Is tag along
          type: boolean
        transaction:
          title: Transaction
          type: integer
          nullable: true
    DocxExport:
      required:
        - report_type
        - start_date
        - end_date
      type: object
      properties:
        report_type:
          title: Report type
          type: string
          enum:
            - climatiq_emission
            - ghg_emission
        start_date:
          title: Start date
          type: string
          format: date
        end_date:
          title: End date
          type: string
          format: date
    BaseEFCategorySerializer:
      required:
        - title
        - parent
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        icon:
          title: Icon
          description: SVG icon filename. Only set on top-level and sub-category levels.
          type: string
          readOnly: true
          format: uri
          nullable: true
        parent:
          title: Parent
          description: >-
            Parent category. Null for top-level categories. 3-level hierarchy:
            top-level → sub-category → classification.
          type: integer
          nullable: true
        is_classification_category:
          title: Is classification category
          description: >-
            True for leaf-node classification categories (level-3). The majority
            of EFCs are classification categories.
          type: boolean
        is_tag_along:
          title: Is tag along
          description: >-
            True for tag-along categories. Tag-along emissions are
            auto-generated alongside primary emissions.
          type: boolean
    EFCategorySerializer:
      required:
        - title
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        icon:
          title: Icon
          description: SVG icon filename. Only set on top-level and sub-category levels.
          type: string
          readOnly: true
          format: uri
          nullable: true
        parent:
          $ref: '#/components/schemas/BaseEFCategorySerializer'
        is_classification_category:
          title: Is classification category
          description: >-
            True for leaf-node classification categories (level-3). The majority
            of EFCs are classification categories.
          type: boolean
        is_tag_along:
          title: Is tag along
          description: >-
            True for tag-along categories. Tag-along emissions are
            auto-generated alongside primary emissions.
          type: boolean
    EFCSearchGrandparent:
      required:
        - title
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
    EFCSearchParent:
      required:
        - title
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        parent:
          $ref: '#/components/schemas/EFCSearchGrandparent'
    EFCSearchGHGCategory:
      required:
        - title
        - scope
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          type: string
          maxLength: 255
          minLength: 1
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
        slug:
          title: Slug
          type: string
          maxLength: 255
          nullable: true
        color:
          title: Color
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
    EFCSearchGHGMapping:
      type: object
      properties:
        greenhouse_gas_category:
          $ref: '#/components/schemas/EFCSearchGHGCategory'
    EFCSearchSerializer:
      required:
        - title
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        parent:
          $ref: '#/components/schemas/EFCSearchParent'
        parent_id:
          title: Parent id
          type: integer
          readOnly: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        is_classification_category:
          title: Is classification category
          description: >-
            True for leaf-node classification categories (level-3). The majority
            of EFCs are classification categories.
          type: boolean
        ghg_mappings:
          type: array
          items:
            $ref: '#/components/schemas/EFCSearchGHGMapping'
          readOnly: true
    EFKgCO2eMultiplierUnit:
      required:
        - name
        - display_name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        display_name:
          title: Display name
          description: 'You can use HTML tags, e.g.: km&lt;sup&gt;2&lt;/sup&gt;'
          type: string
          maxLength: 255
          minLength: 1
    EFSerializer:
      required:
        - title
        - kg_co2e_multiplier
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title + region. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        title:
          title: Title
          description: Display name of the emission factor.
          type: string
          maxLength: 255
          minLength: 1
        category:
          $ref: '#/components/schemas/EFCategorySerializer'
        classification_category:
          $ref: '#/components/schemas/EFCategorySerializer'
        company:
          title: Company
          description: Null for global EFs. Set for company-specific overrides.
          type: integer
          nullable: true
        kg_co2e_multiplier:
          title: Kg co2e multiplier
          description: CO2e conversion multiplier in kg per unit.
          type: number
        kg_co2e_multiplier_unit:
          $ref: '#/components/schemas/EFKgCO2eMultiplierUnit'
        region:
          title: Region
          description: Geographic region. Mix of freetext and ISO-2 codes.
          type: string
          maxLength: 255
          nullable: true
        is_activity_based:
          title: Is activity based
          description: True for activity-based EFs, false for spend-based.
          type: boolean
        is_required_transactions_input_classifier:
          title: Is required transactions input classifier
          description: >-
            Marks the EF whose category requires transaction input. Very few EFs
            are truthy.
          type: boolean
        year:
          title: Year
          description: Reference year for the emission factor data.
          type: string
          maxLength: 10
          nullable: true
        source:
          title: Source
          description: Data source (e.g. EXIOBASE, BEIS, EPA, CBAM).
          type: string
          maxLength: 255
          nullable: true
        deleted_at:
          title: Deleted at
          description: Soft-delete tombstone. Null means active.
          type: string
          format: date-time
          nullable: true
    GreenhouseGasCategory:
      required:
        - title
        - scope
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          type: string
          maxLength: 255
          nullable: true
        title:
          title: Title
          type: string
          maxLength: 255
          minLength: 1
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
        category_number:
          title: Category number
          description: GHG Protocol category number (1–15 for Scope 3, null otherwise).
          type: integer
          maximum: 32767
          minimum: 0
          nullable: true
        emission_direction:
          title: Emission direction
          type: string
          enum:
            - upstream
            - downstream
          nullable: true
    ETransaction:
      required:
        - net_amount
        - currency
        - date
        - ledger
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        net_amount:
          title: Net amount
          type: number
        currency:
          title: Currency
          type: string
          maxLength: 10
          minLength: 1
        vendor_name:
          title: Vendor name
          type: string
          maxLength: 255
          nullable: true
        date:
          title: Date
          type: string
          format: date-time
        end_date:
          title: End date
          type: string
          format: date-time
          nullable: true
        ledger:
          title: Ledger
          type: string
          maxLength: 255
          minLength: 1
        journal:
          title: Journal
          type: string
          maxLength: 255
          nullable: true
        description:
          title: Description
          type: string
          maxLength: 1024
          nullable: true
        tags:
          type: array
          items:
            type: string
          readOnly: true
        status:
          title: Status
          type: string
          enum:
            - new
            - classified
        source:
          title: Source
          type: string
          enum:
            - codat
            - chift
            - lune
            - regreener
            - csv
        total_co2_kg:
          title: Total co2 kg
          type: string
          readOnly: true
        emissions:
          title: Emissions
          type: string
          readOnly: true
    TransactionChart:
      required:
        - count
      type: object
      properties:
        count:
          title: Count
          type: integer
        total_net_amount:
          title: Total net amount
          type: number
        period:
          title: Period
          type: string
          format: date-time
        ledger:
          title: Ledger
          type: string
          minLength: 1
        vendor_name:
          title: Vendor name
          type: string
          minLength: 1
        journal:
          title: Journal
          type: string
          minLength: 1
        source:
          title: Source
          type: string
          minLength: 1
        currency:
          title: Currency
          type: string
          minLength: 1
    TransactionStatistics:
      required:
        - count
        - total_amount
        - currency
        - total_co2_kg
      type: object
      properties:
        count:
          title: Count
          type: integer
        total_amount:
          title: Total amount
          type: number
        currency:
          title: Currency
          type: string
          minLength: 1
        total_co2_kg:
          title: Total co2 kg
          type: number
    SimpleCompanyTag:
      required:
        - name
      type: object
      properties:
        name:
          title: Name
          type: string
          maxLength: 20
          minLength: 1
    SimpleEmissionFactorCategory:
      required:
        - title
      type: object
      properties:
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
    SimpleGreenhouseGasCategory:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        title:
          title: Title
          type: string
          readOnly: true
          minLength: 1
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
          readOnly: true
        category_number:
          title: Category number
          description: GHG Protocol category number (1–15 for Scope 3, null otherwise).
          type: integer
          readOnly: true
          nullable: true
        emission_direction:
          title: Emission direction
          type: string
          enum:
            - upstream
            - downstream
          readOnly: true
          nullable: true
        color:
          title: Color
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        icon:
          title: Icon
          type: string
          readOnly: true
          format: uri
          nullable: true
    RelatedEmission:
      required:
        - classification_category
        - sub_category
        - category
        - ghg_category
        - company_name
        - company
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_tags:
          type: array
          items:
            $ref: '#/components/schemas/SimpleCompanyTag'
          readOnly: true
        transaction_vendor_name:
          title: Transaction vendor name
          type: string
          minLength: 1
          nullable: true
        transaction_description:
          title: Transaction description
          type: string
          minLength: 1
          nullable: true
        classification_category:
          $ref: '#/components/schemas/SimpleEmissionFactorCategory'
        sub_category:
          $ref: '#/components/schemas/SimpleEmissionFactorCategory'
        category:
          $ref: '#/components/schemas/SimpleEmissionFactorCategory'
        ghg_category:
          $ref: '#/components/schemas/SimpleGreenhouseGasCategory'
        tag_along_emissions:
          title: Tag along emissions
          type: object
          readOnly: true
        transaction_total_net_amount:
          title: Transaction total net amount
          type: number
          readOnly: true
        transaction_net_amount:
          title: Transaction net amount
          type: number
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        company_name:
          title: Company name
          type: string
          maxLength: 1024
          minLength: 1
        emission_group_id:
          title: Emission group id
          type: string
          format: uuid
        total_volume:
          title: Total volume
          type: number
          nullable: true
        volume:
          title: Volume
          type: number
          nullable: true
        volume_unit:
          title: Volume unit
          type: string
          maxLength: 255
          nullable: true
        journal:
          title: Journal
          type: string
          maxLength: 255
          nullable: true
        title:
          title: Title
          type: string
          maxLength: 255
          nullable: true
        description:
          title: Description
          type: string
          maxLength: 1024
          nullable: true
        vendor_name:
          title: Vendor name
          type: string
          maxLength: 255
          nullable: true
        accounting_date:
          title: Accounting date
          type: string
          format: date-time
          nullable: true
        accounting_end_date:
          title: Accounting end date
          type: string
          format: date-time
          nullable: true
        transaction_is_visible:
          title: Transaction is visible
          type: boolean
          nullable: true
        transaction_data:
          title: Transaction data
          type: object
          nullable: true
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
        activity_data:
          title: Activity data
          type: object
          nullable: true
        emission_unit_name:
          title: Emission unit name
          type: string
          maxLength: 255
          nullable: true
        emission_factor_data:
          title: Emission factor data
          type: object
          nullable: true
        classification_category_name:
          title: Classification category name
          type: string
          maxLength: 255
          nullable: true
        sub_category_name:
          title: Sub category name
          type: string
          maxLength: 255
          nullable: true
        category_name:
          title: Category name
          type: string
          maxLength: 255
          nullable: true
        ghg_category_name:
          title: Ghg category name
          type: string
          maxLength: 255
          nullable: true
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
        is_tag_along:
          title: Is tag along
          type: boolean
        classification_source:
          title: Classification source
          type: string
          enum:
            - auto
            - script
            - manual
        confidence:
          title: Confidence
          type: number
          nullable: true
        confidence_threshold:
          title: Confidence threshold
          type: number
          nullable: true
        confidence_status:
          title: Confidence status
          type: string
          enum:
            - confident
            - needs_attention
          nullable: true
        co2_kg:
          title: Co2 kg
          type: number
          nullable: true
        ml_metadata:
          title: Ml metadata
          type: object
          nullable: true
        testing_data:
          title: Testing data
          type: boolean
        flags:
          title: Flags
          type: object
          nullable: true
        controlled_by_identifier:
          title: Controlled by identifier
          type: string
          maxLength: 255
          nullable: true
        deleted_at:
          title: Deleted at
          type: string
          format: date-time
          nullable: true
        company:
          title: Company
          type: integer
        transaction:
          title: Transaction
          type: integer
          nullable: true
        emission_factor:
          title: Emission factor
          type: integer
          nullable: true
        emission_unit:
          title: Emission unit
          type: integer
          nullable: true
        main_emission:
          title: Main emission
          type: integer
          nullable: true
        created_by:
          title: Created by
          type: integer
          nullable: true
    AirtableRequest:
      required:
        - url
      type: object
      properties:
        url:
          title: Url
          type: string
          format: uri
          minLength: 1
    SyncChiftTransactions:
      required:
        - company_id
        - integration_id
      type: object
      properties:
        company_id:
          title: Company id
          type: integer
        integration_id:
          title: Integration id
          type: integer
    AccountingSelection:
      required:
        - name
        - type
        - journal
        - company
        - integration
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        transaction_count:
          title: Transaction count
          type: string
          readOnly: true
        journal_name:
          title: Journal name
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 1024
          nullable: true
        type:
          title: Type
          type: string
          enum:
            - ledger
            - journal
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        is_included_in_analysis:
          title: Is included in analysis
          type: boolean
          nullable: true
        journal:
          title: Journal
          type: integer
          nullable: true
        company:
          title: Company
          type: integer
        integration:
          title: Integration
          type: integer
    Integration:
      required:
        - type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - codat
            - chift
            - lune
            - regreener
            - csv
        name:
          title: Name
          type: string
          maxLength: 1024
          nullable: true
        lune_account_id:
          title: Lune account id
          type: string
          maxLength: 1024
          nullable: true
        type_access_token:
          title: Type access token
          type: string
          maxLength: 1024
          nullable: true
        company:
          title: Company
          type: integer
        created_by:
          title: Created by
          type: integer
          nullable: true
        last_synced_at:
          title: Last synced at
          type: string
          format: date-time
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        logs:
          title: Logs
          type: object
          nullable: true
        linked_by_first_name:
          title: Linked by first name
          type: string
          readOnly: true
        linked_by_last_name:
          title: Linked by last name
          type: string
          readOnly: true
        linked_by_email:
          title: Linked by email
          type: string
          readOnly: true
        transactions_count:
          title: Transactions count
          type: string
          readOnly: true
        status:
          title: Status
          type: string
          enum:
            - inactive
            - uploading
            - importing transactions
            - upload failed
            - needs review
            - analysis running
            - analysis completed
          nullable: true
        connection_status:
          title: Connection status
          type: string
          enum:
            - active
            - inactive
          nullable: true
    CreateManualInputTransactions:
      required:
        - sub_category_id
      type: object
      properties:
        sub_category_id:
          title: Sub category id
          type: integer
    SSOSignup:
      type: object
      properties:
        user_invitation_id:
          title: User invitation id
          type: string
          maxLength: 1024
    Signup:
      required:
        - password
        - repeated_password
        - first_name
        - last_name
        - email
      type: object
      properties:
        password:
          title: Password
          description: >-
            Minimum 10 characters. Consider using a passphrase (e.g. a short
            memorable sentence). Must not be similar to your personal
            information, must not be a commonly used password, and must not be
            entirely numeric.
          type: string
          maxLength: 1024
          minLength: 1
        repeated_password:
          title: Repeated password
          type: string
          maxLength: 1024
          minLength: 1
        first_name:
          title: First name
          type: string
          maxLength: 1024
          minLength: 1
        last_name:
          title: Last name
          type: string
          maxLength: 1024
          minLength: 1
        company:
          title: Company
          type: string
          maxLength: 1024
        job_title:
          title: Job title
          type: string
          maxLength: 1024
        email:
          title: Email
          type: string
          maxLength: 1024
          minLength: 1
        user_invitation_id:
          title: User invitation id
          type: string
          maxLength: 1024
    Survey:
      required:
        - name
        - questions
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        questions:
          title: Questions
          type: object
        survey_questions:
          title: Survey questions
          type: string
          readOnly: true
        survey_answers:
          title: Survey answers
          type: string
          readOnly: true
    SurveyAnswer:
      required:
        - year
        - answers
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        year:
          title: Year
          type: string
          format: date
        answers:
          title: Answers
          type: object
    Answer:
      required:
        - question
        - year
        - text
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        question:
          title: Question
          type: integer
        year:
          title: Year
          type: string
          format: date
        text:
          title: Text
          type: string
          maxLength: 255
          minLength: 1
    BasicIntegration:
      required:
        - type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - codat
            - chift
            - lune
            - regreener
            - csv
        name:
          title: Name
          type: string
          maxLength: 1024
          nullable: true
    TransactionEmissionClassification:
      required:
        - transaction
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        transaction:
          title: Transaction
          type: integer
        emission_factor:
          $ref: '#/components/schemas/EmissionFactor'
        confidence:
          title: Confidence
          type: number
          nullable: true
        source:
          title: Source
          type: string
          enum:
            - auto
            - manual
        auto_classification_version:
          title: Auto classification version
          type: string
          maxLength: 16
          nullable: true
        co2_kg:
          title: Co2 kg
          type: number
          nullable: true
    ManualInputAnswer:
      type: object
      properties:
        manual_input_id:
          title: Manual input id
          type: string
          readOnly: true
        emission_factor_title:
          title: Emission factor title
          type: string
          readOnly: true
        value:
          title: Value
          type: number
          nullable: true
    Transaction:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - income
            - expense
          readOnly: true
        vat_rate:
          title: Vat rate
          type: number
          readOnly: true
          nullable: true
        net_amount:
          title: Net amount
          type: number
          readOnly: true
        gross_amount:
          title: Gross amount
          type: number
          readOnly: true
        currency:
          title: Currency
          type: string
          readOnly: true
          minLength: 1
        vendor_name:
          title: Vendor name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        date:
          title: Date
          type: string
          format: date-time
          readOnly: true
        end_date:
          title: End date
          type: string
          format: date-time
          readOnly: true
          nullable: true
        title:
          title: Title
          type: string
          readOnly: true
        ledger:
          title: Ledger
          type: string
          readOnly: true
          minLength: 1
        journal:
          title: Journal
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        status:
          title: Status
          type: string
          enum:
            - new
            - classified
          readOnly: true
        description:
          title: Description
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        external_id:
          title: External id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        integration:
          $ref: '#/components/schemas/BasicIntegration'
        emission_classification:
          $ref: '#/components/schemas/TransactionEmissionClassification'
        company:
          title: Company
          type: integer
          readOnly: true
        skip_manual_input:
          title: Skip manual input
          type: boolean
          readOnly: true
        manual_input_completed:
          title: Manual input completed
          type: boolean
          readOnly: true
        manual_input_answers:
          type: array
          items:
            $ref: '#/components/schemas/ManualInputAnswer'
        tags:
          title: Tags
          type: string
          readOnly: true
    BulkClassificationConfidenceRequest:
      required:
        - transaction_ids
        - source
      type: object
      properties:
        transaction_ids:
          type: array
          items:
            type: integer
        source:
          title: Source
          type: string
          enum:
            - auto
            - manual
    BulkClassificationRequest:
      required:
        - transaction_id
      type: object
      properties:
        transaction_id:
          title: Transaction id
          type: integer
        emission_factor_id:
          title: Emission factor id
          type: integer
    CreateUserInvitationMultiCompany:
      required:
        - email
        - auth_group
      type: object
      properties:
        id:
          title: Id
          type: string
          format: uuid
          readOnly: true
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          minLength: 1
        auth_group:
          title: Auth group
          type: integer
    RetrieveUserInvitation:
      required:
        - is_existing_user
      type: object
      properties:
        id:
          title: Id
          type: string
          format: uuid
          readOnly: true
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          nullable: true
        company:
          $ref: '#/components/schemas/LegacyCompany'
        auth_group_id:
          title: Auth group id
          type: string
          readOnly: true
        is_existing_user:
          title: Is existing user
          type: boolean
        is_active:
          title: Is active
          type: string
          readOnly: true
        is_mfa_enabled:
          title: Is mfa enabled
          type: string
          readOnly: true
    User:
      required:
        - first_name
        - last_name
      type: object
      properties:
        first_name:
          title: First name
          type: string
          maxLength: 1024
          minLength: 1
        last_name:
          title: Last name
          type: string
          maxLength: 1024
          minLength: 1
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          nullable: true
        id:
          title: ID
          type: integer
          readOnly: true
        firebase_uid:
          title: Firebase uid
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        active_user_company_id:
          title: Active user company id
          type: integer
        user_company:
          $ref: '#/components/schemas/SimpleUserCompany'
        company:
          $ref: '#/components/schemas/LegacyOptionalCompany'
        job_title:
          title: Job title
          type: string
          maxLength: 1024
          nullable: true
        profile_picture:
          title: Profile picture
          type: string
          readOnly: true
          format: uri
          nullable: true
        auth_group:
          $ref: '#/components/schemas/Group'
        is_mfa_enrolled:
          title: Is mfa enrolled
          type: boolean
          readOnly: true
        is_mfa_required:
          title: Is mfa required
          type: boolean
          readOnly: true
          nullable: true
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          readOnly: true
        pylon_email_hash:
          title: Pylon email hash
          type: string
          readOnly: true
    ResetPassword:
      required:
        - email
      type: object
      properties:
        email:
          title: Email
          type: string
          format: email
          minLength: 1
    UserUpdate:
      required:
        - first_name
        - last_name
      type: object
      properties:
        first_name:
          title: First name
          type: string
          maxLength: 1024
          minLength: 1
        last_name:
          title: Last name
          type: string
          maxLength: 1024
          minLength: 1
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          nullable: true
        job_title:
          title: Job title
          type: string
          maxLength: 1024
          nullable: true
        profile_picture:
          title: Profile picture
          type: string
          readOnly: true
          format: uri
          nullable: true
    BatchChannelAuth:
      required:
        - socket_id
        - channel_names
      type: object
      properties:
        socket_id:
          title: Socket id
          type: string
          maxLength: 100
          minLength: 1
        channel_names:
          type: array
          items:
            type: string
            maxLength: 100
            minLength: 1
    ChannelAuth:
      required:
        - channel_name
        - socket_id
      type: object
      properties:
        channel_name:
          title: Channel name
          type: string
          maxLength: 100
          minLength: 1
        socket_id:
          title: Socket id
          type: string
          maxLength: 100
          minLength: 1
    TeamMember:
      required:
        - first_name
        - last_name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        first_name:
          title: First name
          type: string
          maxLength: 1024
          minLength: 1
        last_name:
          title: Last name
          type: string
          maxLength: 1024
          minLength: 1
        job_title:
          title: Job title
          type: string
          maxLength: 1024
          nullable: true
        profile_picture:
          title: Profile picture
          type: string
          readOnly: true
          format: uri
          nullable: true
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          nullable: true
    WorkspaceTeamMember:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        user:
          $ref: '#/components/schemas/TeamMember'
        auth_group:
          title: Auth group
          type: integer
          nullable: true
        auth_group_name:
          title: Auth group name
          type: string
          readOnly: true
          minLength: 1
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          maxLength: 1024
          nullable: true
  securitySchemes:
    Bearer:
      description: >-
        Our firebase api token, used to authenticate. Bearer prefix required
        before token
      type: apiKey
      name: Authorization
      in: header
  requestBodies:
    routed-documents_create:
      content:
        multipart/form-data:
          schema:
            type: object
            properties:
              name:
                type: string
                minLength: 1
                maxLength: 510
              description:
                type: string
                x-nullable: true
              file:
                type: string
                format: binary
              identifiers:
                description: List of identifier strings
                type: array
                items:
                  type: string
                  minLength: 1
            required:
              - name
      required: true
    Rule:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Rule'
      required: true
    Comment:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Comment'
      required: true
    SaleOrder:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SaleOrder'
      required: true
    PurchaseOrder:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PurchaseOrder'
      required: true
    BatchOrder:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BatchOrder'
      required: true
    Product:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Product'
      required: true
    Origin:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Origin'
      required: true
    DueDiligenceStatement:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DueDiligenceStatement'
      required: true
    ProductChainOrder:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProductChainOrder'
      required: true
    TraceList:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TraceList'
      required: true
    ValueChain:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValueChain'
      required: true
    UserUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserUpdate'
      required: true
    transactions_async_csv_uploadData:
      content:
        application/json:
          schema:
            required:
              - file_name
              - data
            type: object
            properties:
              file_name:
                description: Name of the CSV file
                type: string
              data:
                description: List of data entries in the CSV file
                type: array
                items:
                  type: object
                  properties:
                    vat_rate:
                      description: VAT Rate (optional)
                      type: string
                    net_amount:
                      description: Net Amount
                      type: string
                    gross_amount:
                      description: Gross Amount (optional)
                      type: string
                    currency:
                      description: Currency (optional)
                      type: string
                    vendor_name:
                      description: Vendor Name (optional)
                      type: string
                    date:
                      description: Date
                      type: string
                    ledger:
                      description: Ledger
                      type: string
                    journal:
                      description: Journal (optional)
                      type: string
                    description:
                      description: Description (optional)
                      type: string
                    external_id:
                      description: External ID (optional)
                      type: string
                    tags:
                      description: Tags (optional)
                      type: string
      required: true
    SSOSignup:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SSOSignup'
      required: true
    TransactionEmissionClassificationUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TransactionEmissionClassificationUpdate'
      required: true
    LegacyCompany:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyCompany'
      required: true
    CreateUpdateCompanyEmissionFactor:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateUpdateCompanyEmissionFactor'
      required: true
    Integration:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Integration'
      required: true
    CreateManualInputTransactions:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateManualInputTransactions'
      required: true
    SurveyAnswer:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SurveyAnswer'
      required: true
    Transaction:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Transaction'
      required: true
security:
  - Bearer: []
tags:
  - name: Order Tracing
  - name: eudr
  - name: information-requests
  - name: orders
  - name: origins
  - name: products
  - name: traces
  - name: value-chains
