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

# Update or complete a task

> Update attributes of an existing task, or complete it. Tasks are created automatically by warehouse operations and this endpoint allows modifying task properties such as priority, notes, locations, quantities, and custom fields. To complete a single task, send `status: "completed"` together with the attributes required by that task's type. To complete multiple tasks of the same type in one call use `POST /api/tasks/complete_collection`. Type-specific receive and load actions are documented under the *Goods In: Receipts* and *Loads* tags respectively.

## Request Structure

```json expandable
{
  "data": {
    "type": "tasks",
    "attributes": {
      "priority": 10,
      "notes": "Urgent - customer waiting",
      "location_to_id": 25,
      "confirmed_quantity": 8.0
    }
  }
}
```

## Completing a Task

A single task is completed through this endpoint by setting `status` to `"completed"` together with the attributes required for the task's type. The table below lists the minimum payload to complete each type; additional fields may be set in the same request when they need updating at the same time.

| Task type | Minimum attributes to complete                                                                                                    |
| --------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `PICK`    | `status`, `confirmed_quantity`, `location_to_id` (drop location)                                                                  |
| `RCV`     | `status`, `confirmed_quantity`, `location_to_id`, `storage_unit_to_id`                                                            |
| `PWAY`    | `status`, `confirmed_quantity`, `location_to_id`, `storage_unit_to_id`                                                            |
| `TRAN`    | `status`, `location_to_id`, `storage_unit_to_id`                                                                                  |
| `CONV`    | `status` (optionally `confirmed_quantity`; defaults to the task's `start_quantity`)                                               |
| `REPLEN`  | `status`, `confirmed_quantity`, `location_to_id`                                                                                  |
| `DISP`    | `status` for `SHIPMENT` subtype only. `LOAD`-subtype DISP tasks must be completed by dispatching the load, not via this endpoint. |
| `LOAD`    | Not completable via this endpoint. Use `POST /api/load_tasks/{id}/load_storage_unit`.                                             |

To complete many tasks of the same type in one call, use `POST /api/tasks/complete_collection` with a `task_type_code` and a `filters` block.

## Key Fields

| Field                   | Required | Description                                                                           |
| ----------------------- | -------- | ------------------------------------------------------------------------------------- |
| `account_id`            | No       | Stock account ID                                                                      |
| `warehouse_id`          | No       | Warehouse ID                                                                          |
| `priority`              | No       | Task priority (higher = more urgent)                                                  |
| `notes`                 | No       | Free-text notes                                                                       |
| `status`                | No       | Task status. Set to `completed` to complete the task (see *Completing a Task* above). |
| `location_from_id`      | No       | Source location ID                                                                    |
| `location_to_id`        | No       | Destination location ID                                                               |
| `product_id`            | No       | Product ID                                                                            |
| `start_quantity`        | No       | Starting quantity (>= 0)                                                              |
| `confirmed_quantity`    | No       | Confirmed/completed quantity (>= 0)                                                   |
| `start_at`              | No       | Planned start datetime                                                                |
| `end_at`                | No       | Planned end datetime                                                                  |
| `completed_at`          | No       | Completion datetime                                                                   |
| `assigned_at`           | No       | Assignment datetime                                                                   |
| `user_id`               | No       | Assigned user ID                                                                      |
| `user_created_by_id`    | No       | User who created the task                                                             |
| `user_completed_by_id`  | No       | User who completed the task                                                           |
| `device_type_id`        | No       | Device type ID                                                                        |
| `device_id`             | No       | Device ID                                                                             |
| `storage_unit_from_id`  | No       | Source storage unit ID                                                                |
| `storage_unit_to_id`    | No       | Destination storage unit ID                                                           |
| `stock_id`              | No       | Associated stock record ID                                                            |
| `load_id`               | No       | Associated load ID                                                                    |
| `load_drop_id`          | No       | Associated load drop ID                                                               |
| `dispatch_container_id` | No       | Associated dispatch container ID                                                      |
| `parent_task_id`        | No       | Parent task ID for subtasks                                                           |
| `transaction_number_id` | No       | Transaction number ID                                                                 |
| `transaction_line_id`   | No       | Transaction line ID                                                                   |
| `stock_description`     | No       | Stock description text                                                                |
| `drop_sequence`         | No       | Drop sequence (1-9999999999)                                                          |
| `serial_numbers`        | No       | Array of serial number strings                                                        |
| `string1`-`string5`     | No       | Custom string fields                                                                  |
| `integer1`-`integer5`   | No       | Custom integer fields                                                                 |
| `datetime1`-`datetime5` | No       | Custom datetime fields                                                                |
| `boolean1`-`boolean5`   | No       | Custom boolean fields                                                                 |


## OpenAPI

````yaml /api-reference/clarus-api.json patch /api/tasks/{id}
openapi: 3.0.3
info:
  title: ClarusWMS API
  description: >-
    REST and GraphQL API for ClarusWMS - a multi-tenanted SaaS warehouse
    management system. This API provides REST mutation endpoints (POST, PATCH,
    DELETE) for managing warehouse operations and GraphQL list endpoints for
    data retrieval.


    **REST mutations** are available at `/api/*` paths.


    **GraphQL queries** are available at `/graphql` — each resource has a
    documented list query.


    ## Authentication


    All endpoints require OAuth 2.0 Bearer token authentication. Use the client
    credentials or authorization code flow to obtain an access token from
    `https://clarus-api.com/oauth/token`.


    ## Multi-Tenancy


    This is a multi-tenant system. Each tenant (subdomain) has isolated data.
    **You must include the `X-Clarus-Subdomain` header with every request** to
    specify which tenant you are operating on.


    ### Required Header


    | Header | Required | Description |

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

    | `X-Clarus-Subdomain` | Yes | The subdomain/tenant name identifying which
    tenant's data to access |


    **Example:**

    ```

    X-Clarus-Subdomain: acme-warehouse

    ```


    ## Request Format (JSON:API)


    All REST mutation requests use JSON:API format. Data must be sent within a
    `data` object containing `type` and `attributes`:


    ```json

    {
      "data": {
        "type": "resource_name",
        "attributes": {
          "field1": "value1"
        }
      }
    }

    ```


    ## GraphQL Queries


    All data retrieval uses GraphQL at `POST /graphql`. Send a JSON body with
    `query` and optional `variables`:


    ```json

    {
      "query": "query($code: String) { accounts { all(code: $code) { edges { node { id code name } } } } }",
      "variables": { "code": "ACME" }
    }

    ```
  version: 1.0.0
  contact:
    name: Clarus Software
    url: https://claruswms.com
servers:
  - url: https://clarus-api.com
    description: Production API
security:
  - BearerAuth: []
    ClarusSubdomain: []
tags:
  - name: Account Warehouses
    description: >-
      Account-warehouse association endpoints for managing which accounts can
      operate in which warehouses
  - name: Accounts
    description: Account/customer management endpoints for 3PL client management
  - name: Addresses
    description: >-
      Generic address management endpoints. Town/city is held in `address_3`
      (passed to couriers as the city).
  - name: Alternative Code Types
    description: Alternative code type reference endpoints categorising alternative codes.
  - name: Alternative Codes
    description: >-
      Alternative code management endpoints — additional identifiers (e.g.
      customer SKUs) attached to products, suppliers, carriers, or warehouses.
  - name: Automations
    description: >-
      Event-driven automation rules that trigger destination actions (API, FTP,
      email, webhook, file import, AI) when warehouse resource events fire,
      gated by configurable conditions.
  - name: Barcode Formats
    description: Barcode format reference endpoints.
  - name: Bookings
    description: >-
      Booking diary management endpoints for scheduling inbound and outbound
      dock appointments
  - name: Carriers
    description: >-
      Shipping carrier management endpoints (e.g. DHL, DPD, Royal Mail) used on
      shipments and goods out orders.
  - name: 'Carriers: Services'
    description: >-
      Carrier service-level endpoints (e.g. Next Day, Express) belonging to a
      carrier.
  - name: 'Charging: Baskets'
    description: >-
      Charge basket endpoints for collecting and invoicing billable charges
      against accounts. Each account has one open basket at a time that
      accumulates charge lines from warehouse operations. Use these endpoints to
      manage basket lifecycle and generate invoices.
  - name: 'Charging: Configuration'
    description: >-
      Charge configuration endpoints for managing charge cards, charge prices,
      and charge windows. Charge cards define billing profiles assigned to
      accounts. Charge prices define pricing rules within a card. Charge windows
      define recurring billing schedules.
  - name: 'Charging: Lines'
    description: >-
      Charge line management endpoints for individual billable line items within
      charge baskets. Charge lines are typically created automatically by
      warehouse operations but can also be created and managed manually.
  - name: Collection Addresses
    description: >-
      Collection address management endpoints. Collection addresses belong to a
      supplier and are used for inbound collections.
  - name: Crossdocks
    description: >-
      External crossdock management endpoints for direct inbound-to-outbound
      transfer.
  - name: Currencies
    description: Currency management endpoints. Codes are ISO 4217 in lowercase.
  - name: Custom Carrier Types
    description: >-
      Custom carrier type management endpoints, including print layout
      parameters for label/document templates.
  - name: Customers
    description: >-
      Customer management endpoints. Customers are the end-recipients of goods
      (distinct from stock accounts).
  - name: Dashboard Widgets
    description: >-
      Dashboard widget management endpoints for creating, updating, and deleting
      widgets. Each widget is bound to a report query and rendered on dashboards
      as a configurable chart (bar, line, pie, gauge, etc.). Widgets are placed
      onto dashboards via the dashboard's widget placement endpoint.
  - name: Dashboards
    description: >-
      Dashboard management endpoints for creating, updating, and deleting
      dashboards together with the widgets placed on them. Dashboards are
      role-scoped collections of widgets that render report query data as
      charts. Use the placement endpoint to atomically replace the widgets shown
      on a dashboard.
  - name: Delivery Addresses
    description: >-
      Delivery address management endpoints. Delivery addresses belong to an end
      customer and are used for outbound deliveries.
  - name: Documents
    description: >-
      Document management endpoints for downloading, uploading, and transferring
      generated files
  - name: External Entities
    description: >-
      External entity endpoints — references to items in external systems (e.g.
      Shopify products, carriers, shipping rates, warehouses) that are linked to
      internal ClarusWMS entities via mappings.
  - name: 'Goods In: Receipts'
    description: >-
      Inbound receipt management endpoints for receiving inventory into the
      warehouse, including the receive task actions used to confirm stock has
      been received against a receipt
  - name: 'Goods Out: Orders'
    description: >-
      Outbound order management endpoints for creating, updating, and cancelling
      sales orders
  - name: 'Goods Out: Pick Lists'
    description: Pick list management endpoints for updating and removing pick lists
  - name: 'Goods Out: Processing'
    description: >-
      Pick processing endpoints for generating pick lists and order fulfillment
      workflows
  - name: Groups
    description: Group management endpoints for organizing products and locations
  - name: HHD Flows
    description: >-
      Handheld device (HHD) flow definitions — configurable RF/HHD workflows
      belonging to an HHD implementation. Known internally as RF flows.
  - name: HHD Users
    description: >-
      RF (handheld device) user query endpoints. RF users are dedicated
      warehouse device operators.
  - name: Import Configurations
    description: >-
      Import configuration endpoints for ingesting external files (CSV, XML,
      EDI, TXT) and transforming them into warehouse resources via configurable
      processing flows.
  - name: Import Templates
    description: >-
      Import template management endpoints. Templates map inbound files (matched
      by filename regexp) onto warehouse resources for an SFTP user.
  - name: Integrations
    description: >-
      Third-party integration management endpoints for ecommerce, carrier, and
      ERP connections
  - name: Load Drops
    description: >-
      Load drop management endpoints — the individual delivery/collection stops
      on a load, including stop re-sequencing.
  - name: Loads
    description: Load management endpoints for grouping shipments onto vehicles
  - name: Location Types
    description: Location type management endpoints for classifying warehouse locations.
  - name: Locations
    description: Location management endpoints for warehouse storage locations
  - name: Mapping Groups
    description: >-
      Mapping group endpoints — containers that link external entities to
      internal entities for a given operation type, plus their field
      definitions.
  - name: Mappings
    description: >-
      Mapping endpoints — link external entities to internal records within a
      mapping group. Includes the generic mappings endpoint (for non-integration
      operation types) and the dedicated endpoints for integration carrier,
      shipping rate, warehouse, product, and FTP mappings.
  - name: Order Types
    description: Order type reference endpoints.
  - name: Packages
    description: >-
      Package endpoints — parcels within a shipment, with dimensions and
      tracking.
  - name: Printers
    description: Cloud Print printer management endpoints for document and label printing.
  - name: Products
    description: >-
      Product management endpoints for creating, updating, and deleting products
      in the warehouse catalog.


      ## GraphQL Filtering Guide


      Products support individual code/barcode filters: `code`, `barcode`,
      `case_barcode`, `inner_barcode`, `outer_barcode`. Each supports operators:
      `eq`, `ilike`, `in`, `like`, `between`. When multiple individual filters
      are used together, they are AND'd (all conditions must match).


      ### The `all_codes` filter


      `all_codes` is a **specialized cross-field search** that ORs across all 5
      code fields (`code`, `barcode`, `case_barcode`, `inner_barcode`,
      `outer_barcode`) in a single query. It performs exact matching (IN
      operator), not partial/ILIKE matching.


      **When to use `all_codes`:** Only when you have a code or barcode value
      and don't know which field it belongs to — e.g., a user scans a barcode
      that could be a unit barcode, case barcode, inner barcode, or outer
      barcode.


      **When NOT to use `all_codes`:** When you know which specific code field
      to search. Use the individual filter instead for better performance and
      precision.
  - name: 'Products: Accounts'
    description: Assignments linking products to stock accounts.
  - name: 'Products: Materials'
    description: Bill-of-materials component lines for a parent product.
  - name: 'Products: Storage Units'
    description: >-
      Product storage unit configuration — how a product is packed into storage
      unit types (per-layer, layers, totals).
  - name: Putaway Rules
    description: Per-account putaway ordering rules, with re-sequencing.
  - name: Reason Codes
    description: >-
      Reason code endpoints for stock adjustments, holds, transfers, and stock
      checks.
  - name: Replenishment
    description: Replenishment endpoints for restocking pick faces from bulk storage
  - name: Report Queries
    description: Report query management endpoints for custom reporting and data extraction
  - name: Reports
    description: >-
      Report management endpoints for creating report definitions, updating
      configurations, and generating report output as downloadable documents
  - name: Roles
    description: Role and permission management endpoints for access control
  - name: Scheduled Reports
    description: >-
      Scheduled report management endpoints for recurring report delivery via
      email and FTP
  - name: SFTP Users
    description: >-
      FTP/SFTP user management endpoints for inbound (upload) and outbound
      (download) file transfer.
  - name: Shipments
    description: Shipment management endpoints for carrier integration and parcel tracking
  - name: Sites
    description: >-
      Site management endpoints. Sites group warehouses for multi-site
      operations.
  - name: Stock Balances
    description: >-
      Aggregated stock balance query endpoints summarising available, allocated,
      ordered, received, and picked quantities per product/account/warehouse.
  - name: Stock Checks
    description: >-
      Stock check endpoints for counting the products held at a location and
      reconciling them against the system. A stock check moves through `pending`
      to either `passed` or `failed`, and failed checks can subsequently be
      `resolved` with a reason code.
  - name: Stock Unit Types
    description: >-
      Stock unit type reference endpoints (the unit a product's stock is
      measured in).
  - name: Stocks
    description: >-
      Stock management endpoints for inventory operations including holds,
      moves, transfers, and adjustments
  - name: Storage Unit Types
    description: >-
      Storage unit type endpoints (pallets, cages, totes) with dimensions and
      barcode settings.
  - name: Storage Units
    description: >-
      Storage unit management endpoints for containers like pallets, cages, and
      boxes
  - name: Subdomains
    description: >-
      Tenant (subdomain) management endpoints. Creating a subdomain provisions a
      new tenant with its own isolated data; the subdomain slug cannot be
      changed once created.
  - name: Suppliers
    description: Supplier management endpoints. Suppliers are the source of inbound goods.
  - name: Tasks
    description: >-
      Task management endpoints for warehouse operations including picking,
      putaway, receiving, dispatch, and replenishment tasks. Tasks are created
      automatically by warehouse operations (e.g., goods in receipts, goods out
      orders, replenishment) and cannot be created or deleted via the API. Use
      these endpoints to update task attributes, manage task allocation to
      users, and complete tasks.
  - name: Tax Rates
    description: Tax rate management endpoints with percentage component rates.
  - name: Tax Types
    description: Tax type management endpoints.
  - name: Templates
    description: >-
      Template management endpoints for creating, updating, and testing Liquid
      HTML print templates
  - name: Trailer Types
    description: Trailer type reference endpoints.
  - name: Trailers
    description: Trailer management endpoints for loading and dispatch.
  - name: Transactions
    description: >-
      Read-only stock transaction history query endpoints. Transactions record
      every stock movement and cannot be created or modified via the API.
  - name: Users
    description: User management endpoints for system access and permissions
  - name: Warehouse Routes
    description: Per-product warehouse routing priorities, with re-sequencing.
  - name: Warehouses
    description: Warehouse management endpoints for multi-site operations
paths:
  /api/tasks/{id}:
    patch:
      tags:
        - Tasks
      summary: Update or complete a task
      description: >-
        Update attributes of an existing task, or complete it. Tasks are created
        automatically by warehouse operations and this endpoint allows modifying
        task properties such as priority, notes, locations, quantities, and
        custom fields. To complete a single task, send `status: "completed"`
        together with the attributes required by that task's type. To complete
        multiple tasks of the same type in one call use `POST
        /api/tasks/complete_collection`. Type-specific receive and load actions
        are documented under the *Goods In: Receipts* and *Loads* tags
        respectively.
      operationId: updateTask
      parameters:
        - name: id
          in: path
          required: true
          description: The unique identifier of the task to update
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - data
              properties:
                data:
                  type: object
                  required:
                    - type
                    - attributes
                  properties:
                    type:
                      type: string
                      enum:
                        - tasks
                      description: Resource type identifier
                    attributes:
                      $ref: '#/components/schemas/TaskUpdateAttributes'
            example:
              data:
                type: tasks
                attributes:
                  priority: 10
                  notes: Urgent - customer waiting
                  location_to_id: 25
                  confirmed_quantity: 8
      responses:
        '200':
          description: Task updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
              example:
                data:
                  id: '1'
                  type: tasks
                  attributes:
                    status: AVAILABLE
                    subtype: standard
                    priority: 10
                    notes: Urgent - customer waiting
                    start_quantity: 10
                    confirmed_quantity: 8
                    stock_description: Widget A
                    created_at: '2026-03-10T08:00:00Z'
                    completed_at: null
                    last_accessed_at: '2026-03-12T09:30:00Z'
                    start_at: null
                    boolean1: null
                    boolean2: null
                    boolean3: null
                    boolean4: null
                    boolean5: null
                    datetime1: null
                    datetime2: null
                    datetime3: null
                    datetime4: null
                    datetime5: null
                    integer1: null
                    integer2: null
                    integer3: null
                    integer4: null
                    integer5: null
                    string1: null
                    string2: null
                    string3: null
                    string4: null
                    string5: null
                  relationships:
                    account:
                      data:
                        id: '1'
                        type: accounts
                    warehouse:
                      data:
                        id: '1'
                        type: warehouses
                    product:
                      data:
                        id: '42'
                        type: products
                    location_from:
                      data:
                        id: '10'
                        type: locations
                    location_to:
                      data:
                        id: '25'
                        type: locations
                    task_type:
                      data:
                        id: '1'
                        type: task_types
                    goods_out:
                      data:
                        id: '100'
                        type: goods_outs
                    goods_out_line:
                      data: null
                    goods_out_pick_list:
                      data: null
                    inbound_good:
                      data: null
                    inbound_item:
                      data: null
                    last_accessed_by_user:
                      data: null
                    stock:
                      data: null
                    storage_unit_from:
                      data: null
                    storage_unit_to:
                      data: null
                    user_completed_by:
                      data: null
                    user_created_by:
                      data:
                        id: '5'
                        type: users
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    TaskUpdateAttributes:
      type: object
      description: Task update attributes. All fields are optional.
      properties:
        account_id:
          type: integer
          description: Stock account ID
          example: 1
        assigned_at:
          type: string
          format: date-time
          nullable: true
          description: Assignment datetime
          example: '2026-03-12T08:00:00Z'
        boolean1:
          type: boolean
          nullable: true
          description: Custom boolean field 1
          example: false
        boolean2:
          type: boolean
          nullable: true
          description: Custom boolean field 2
          example: null
        boolean3:
          type: boolean
          nullable: true
          description: Custom boolean field 3
          example: null
        boolean4:
          type: boolean
          nullable: true
          description: Custom boolean field 4
          example: null
        boolean5:
          type: boolean
          nullable: true
          description: Custom boolean field 5
          example: null
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: Completion datetime
          example: '2026-03-12T16:30:00Z'
        confirmed_quantity:
          type: number
          nullable: true
          minimum: 0
          description: Confirmed/completed quantity
          example: 8
        datetime1:
          type: string
          format: date-time
          nullable: true
          description: Custom datetime field 1
          example: null
        datetime2:
          type: string
          format: date-time
          nullable: true
          description: Custom datetime field 2
          example: null
        datetime3:
          type: string
          format: date-time
          nullable: true
          description: Custom datetime field 3
          example: null
        datetime4:
          type: string
          format: date-time
          nullable: true
          description: Custom datetime field 4
          example: null
        datetime5:
          type: string
          format: date-time
          nullable: true
          description: Custom datetime field 5
          example: null
        device_id:
          type: integer
          nullable: true
          description: Device ID
          example: 3
        device_type_id:
          type: integer
          nullable: true
          description: Device type ID
          example: 1
        dispatch_container_id:
          type: integer
          nullable: true
          description: Associated dispatch container ID
          example: 50
        drop_sequence:
          type: integer
          nullable: true
          minimum: 1
          maximum: 9999999999
          description: Drop sequence order
          example: 1
        end_at:
          type: string
          format: date-time
          nullable: true
          description: Planned end datetime
          example: '2026-03-12T17:00:00Z'
        integer1:
          type: integer
          nullable: true
          description: Custom integer field 1
          example: null
        integer2:
          type: integer
          nullable: true
          description: Custom integer field 2
          example: null
        integer3:
          type: integer
          nullable: true
          description: Custom integer field 3
          example: null
        integer4:
          type: integer
          nullable: true
          description: Custom integer field 4
          example: null
        integer5:
          type: integer
          nullable: true
          description: Custom integer field 5
          example: null
        load_drop_id:
          type: integer
          nullable: true
          description: Associated load drop ID
          example: 10
        load_id:
          type: integer
          nullable: true
          description: Associated load ID
          example: 5
        location_from_id:
          type: integer
          nullable: true
          description: Source location ID
          example: 10
        location_to_id:
          type: integer
          nullable: true
          description: Destination location ID
          example: 25
        notes:
          type: string
          nullable: true
          description: Free-text notes
          example: Urgent - customer waiting
        parent_task_id:
          type: integer
          nullable: true
          description: Parent task ID for subtasks
          example: 100
        priority:
          type: integer
          nullable: true
          description: Task priority (higher = more urgent)
          example: 10
        product_id:
          type: integer
          description: Product ID
          example: 42
        serial_numbers:
          type: array
          items:
            type: string
          description: Array of serial number strings
          example:
            - SN-001
            - SN-002
        start_at:
          type: string
          format: date-time
          nullable: true
          description: Planned start datetime
          example: '2026-03-12T08:00:00Z'
        start_quantity:
          type: number
          nullable: true
          minimum: 0
          description: Starting quantity
          example: 10
        status:
          type: string
          nullable: true
          description: Task status
          example: AVAILABLE
        stock_description:
          type: string
          nullable: true
          description: Stock description text
          example: Widget A
        stock_id:
          type: integer
          nullable: true
          description: Associated stock record ID
          example: 200
        storage_unit_from_id:
          type: integer
          nullable: true
          description: Source storage unit ID
          example: 30
        storage_unit_to_id:
          type: integer
          nullable: true
          description: Destination storage unit ID
          example: 31
        string1:
          type: string
          nullable: true
          description: Custom string field 1
          example: null
        string2:
          type: string
          nullable: true
          description: Custom string field 2
          example: null
        string3:
          type: string
          nullable: true
          description: Custom string field 3
          example: null
        string4:
          type: string
          nullable: true
          description: Custom string field 4
          example: null
        string5:
          type: string
          nullable: true
          description: Custom string field 5
          example: null
        transaction_line_id:
          type: integer
          nullable: true
          description: Transaction line ID
          example: 15
        transaction_number_id:
          type: integer
          nullable: true
          description: Transaction number ID
          example: 500
        user_completed_by_id:
          type: integer
          nullable: true
          description: User who completed the task
          example: 5
        user_created_by_id:
          type: integer
          nullable: true
          description: User who created the task
          example: 3
        user_id:
          type: integer
          nullable: true
          description: Assigned user ID
          example: 5
        warehouse_id:
          type: integer
          description: Warehouse ID
          example: 1
    TaskResponse:
      type: object
      description: Task response in JSON:API format
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              description: Task ID
              example: '1'
            type:
              type: string
              enum:
                - tasks
              description: Resource type
              example: tasks
            attributes:
              type: object
              properties:
                boolean1:
                  type: boolean
                  nullable: true
                  description: Custom boolean field 1
                  example: null
                boolean2:
                  type: boolean
                  nullable: true
                  description: Custom boolean field 2
                  example: null
                boolean3:
                  type: boolean
                  nullable: true
                  description: Custom boolean field 3
                  example: null
                boolean4:
                  type: boolean
                  nullable: true
                  description: Custom boolean field 4
                  example: null
                boolean5:
                  type: boolean
                  nullable: true
                  description: Custom boolean field 5
                  example: null
                completed_at:
                  type: string
                  format: date-time
                  nullable: true
                  description: Completion datetime
                  example: null
                confirmed_quantity:
                  type: number
                  nullable: true
                  description: Confirmed/completed quantity
                  example: null
                created_at:
                  type: string
                  format: date-time
                  description: Creation timestamp
                  example: '2026-03-10T08:00:00Z'
                datetime1:
                  type: string
                  format: date-time
                  nullable: true
                  description: Custom datetime field 1
                  example: null
                datetime2:
                  type: string
                  format: date-time
                  nullable: true
                  description: Custom datetime field 2
                  example: null
                datetime3:
                  type: string
                  format: date-time
                  nullable: true
                  description: Custom datetime field 3
                  example: null
                datetime4:
                  type: string
                  format: date-time
                  nullable: true
                  description: Custom datetime field 4
                  example: null
                datetime5:
                  type: string
                  format: date-time
                  nullable: true
                  description: Custom datetime field 5
                  example: null
                device_id:
                  type: integer
                  nullable: true
                  description: Device ID
                  example: null
                device_type_id:
                  type: integer
                  nullable: true
                  description: Device type ID
                  example: null
                id:
                  type: integer
                  description: Task ID
                  example: 1
                integer1:
                  type: integer
                  nullable: true
                  description: Custom integer field 1
                  example: null
                integer2:
                  type: integer
                  nullable: true
                  description: Custom integer field 2
                  example: null
                integer3:
                  type: integer
                  nullable: true
                  description: Custom integer field 3
                  example: null
                integer4:
                  type: integer
                  nullable: true
                  description: Custom integer field 4
                  example: null
                integer5:
                  type: integer
                  nullable: true
                  description: Custom integer field 5
                  example: null
                last_accessed_at:
                  type: string
                  format: date-time
                  nullable: true
                  description: Last accessed timestamp
                  example: null
                notes:
                  type: string
                  nullable: true
                  description: Free-text notes
                  example: null
                parent_task_id:
                  type: integer
                  nullable: true
                  description: Parent task ID for subtasks
                  example: null
                priority:
                  type: integer
                  nullable: true
                  description: Task priority
                  example: 5
                start_at:
                  type: string
                  format: date-time
                  nullable: true
                  description: Planned start datetime
                  example: null
                start_quantity:
                  type: number
                  nullable: true
                  description: Starting quantity
                  example: 10
                status:
                  type: string
                  description: Task status (e.g., AVAILABLE, ALLOCATED, COMPLETED)
                  example: AVAILABLE
                stock_description:
                  type: string
                  nullable: true
                  description: Stock description text
                  example: Widget A
                string1:
                  type: string
                  nullable: true
                  description: Custom string field 1
                  example: null
                string2:
                  type: string
                  nullable: true
                  description: Custom string field 2
                  example: null
                string3:
                  type: string
                  nullable: true
                  description: Custom string field 3
                  example: null
                string4:
                  type: string
                  nullable: true
                  description: Custom string field 4
                  example: null
                string5:
                  type: string
                  nullable: true
                  description: Custom string field 5
                  example: null
                subtype:
                  type: string
                  nullable: true
                  description: Task subtype
                  example: standard
                transaction_id:
                  type: integer
                  nullable: true
                  description: Transaction ID
                  example: null
                transaction_line_id:
                  type: integer
                  nullable: true
                  description: Transaction line ID
                  example: null
                transaction_number_id:
                  type: integer
                  nullable: true
                  description: Transaction number ID
                  example: null
            relationships:
              type: object
              properties:
                account:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                          example: '1'
                        type:
                          type: string
                          enum:
                            - accounts
                          example: accounts
                goods_out:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                          example: '100'
                        type:
                          type: string
                          enum:
                            - goods_outs
                          example: goods_outs
                goods_out_line:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - goods_out_lines
                goods_out_pick_list:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - goods_out_pick_lists
                inbound_good:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - inbound_goods
                inbound_item:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - inbound_items
                last_accessed_by_user:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - users
                location_from:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                          example: '10'
                        type:
                          type: string
                          enum:
                            - locations
                          example: locations
                location_to:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                          example: '20'
                        type:
                          type: string
                          enum:
                            - locations
                          example: locations
                product:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                          example: '42'
                        type:
                          type: string
                          enum:
                            - products
                          example: products
                stock:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - stocks
                storage_unit_from:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - storage_units
                storage_unit_to:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - storage_units
                task_type:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                          example: '1'
                        type:
                          type: string
                          enum:
                            - task_types
                          example: task_types
                user_completed_by:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - users
                user_created_by:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                          example: '5'
                        type:
                          type: string
                          enum:
                            - users
                          example: users
                warehouse:
                  type: object
                  properties:
                    data:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                          example: '1'
                        type:
                          type: string
                          enum:
                            - warehouses
                          example: warehouses
    ErrorResponse:
      type: object
      description: Standard error response wrapper
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
          description: Array of error objects
      required:
        - errors
    Error:
      type: object
      description: Detailed error information
      properties:
        code:
          type: integer
          description: Numeric error code for programmatic handling
        symbol:
          type: string
          description: Symbolic error identifier (e.g., 'product_code_exists')
        details:
          type: string
          description: Human-readable error message
        source:
          type: string
          nullable: true
          description: Source of the error (service and method name)
        context:
          type: object
          nullable: true
          additionalProperties: true
          description: Additional context about the error
      required:
        - code
        - symbol
        - details
  responses:
    Unauthorized:
      description: Authentication required - provide a valid Bearer token
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: Error message explaining authentication failure
    NotFound:
      description: The requested resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnprocessableEntity:
      description: Validation error or business logic error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: oauth2
      description: >-
        OAuth 2.0 authentication. Use the client credentials or authorization
        code flow to obtain an access token.
      flows:
        clientCredentials:
          tokenUrl: https://clarus-api.com/oauth/token
          scopes: {}
        authorizationCode:
          authorizationUrl: https://clarus-api.com/oauth/authorize
          tokenUrl: https://clarus-api.com/oauth/token
          scopes: {}
    ClarusSubdomain:
      type: apiKey
      in: header
      name: X-Clarus-Subdomain
      description: >-
        The subdomain/tenant name identifying which tenant's data to access.
        Required for all API requests.

````