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

# Update draft expense claim



## OpenAPI

````yaml /openapi/fluide-hr.json patch /api/v1/hr/expenses/claims/{id}
openapi: 3.0.0
info:
  title: Fluide HR API
  description: >-
    Employee records, contracts, leave, performance, OKRs, and HR insights. HR
    is the canonical employee source consumed by payroll and other suite
    services. In the API playground, click Authorize and provide Bearer JWT,
    X-Fluide-Api-Key, and X-Fluide-Client-Id (fluide-developer). For partner /
    ISV integrations acting on a merchant, also set optional X-Workspace-Id and
    X-Acting-Company-Id on each request (see Multi-tenancy).
  version: '1.0'
  contact: {}
servers:
  - url: https://test.api.fluidehr.com
    description: API
security:
  - bearer: []
    fluideApiKey: []
    fluideClientId: []
tags:
  - name: Health
    description: >-
      Liveness and readiness probes. Returns dependency status (database, Redis,
      etc.) for orchestrators and uptime monitors.
    x-group: Operations
  - name: Prometheus
    description: >-
      Prometheus scrape endpoint in text exposition format. Configure your
      metrics collector to poll this path on each service.
    x-group: Operations
  - name: Audit
  - name: HR Employees
    description: Create and manage employee records tied to your organization.
  - name: Onboarding
  - name: HR Employment contracts
  - name: Leave
  - name: Leave accrual
  - name: Performance
  - name: OKR
  - name: Country configuration (CCS)
  - name: Compliance
  - name: Insights
  - name: Dashboard
  - name: Attendance
  - name: Geofence sites
  - name: Recruitment
  - name: Workforce planning
  - name: Expenses
  - name: Benefits
  - name: Loans
  - name: Timesheets
  - name: Talent
  - name: Authorize
    description: >-
      Exchange API key and secret for a machine JWT, read developer metadata,
      rotate secrets, and manage API billing.
paths:
  /api/v1/hr/expenses/claims/{id}:
    patch:
      tags:
        - Expenses
      summary: Update draft expense claim
      operationId: ExpensesController_updateClaim
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-Workspace-Id
          in: header
          required: false
          description: >-
            Partner / ISV only: UUID of the workspace that owns the client
            company. Required together with X-Acting-Company-Id when scoping
            product APIs to a merchant. See /getting-started/multi-tenancy.
          schema:
            type: string
            format: uuid
          example: b03fa178-67bd-4378-a5aa-d169c01ccb6f
        - name: X-Acting-Company-Id
          in: header
          required: false
          description: >-
            Partner / ISV only: UUID of the client company to act on. Must
            belong to the workspace in X-Workspace-Id.
          schema:
            type: string
            format: uuid
          example: ab2df10a-c66c-4bef-b7d6-efda26cca494
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateExpenseClaimDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseClaim'
      security:
        - bearer: []
          fluideApiKey: []
          fluideClientId: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl -sS -X PATCH
            "$FLUIDE_BASE_URL/api/v1/hr/expenses/claims/string" \
              -H "Authorization: Bearer $FLUIDE_ACCESS_TOKEN" \
              -H "X-Fluide-Api-Key: $FLUIDE_API_KEY" \
              -H "X-Fluide-Client-Id: fluide-developer" \
              -H "X-Workspace-Id: $FLUIDE_WORKSPACE_ID" \
              -H "X-Acting-Company-Id: $FLUIDE_COMPANY_ID" \
              -H "Content-Type: application/json" \
              -d '{}'
        - lang: node
          label: Node.js
          source: >-
            const baseUrl = process.env.FLUIDE_BASE_URL;


            const response = await
            fetch(`${baseUrl}/api/v1/hr/expenses/claims/string`, {
              method: 'PATCH',
              headers: {
                Authorization: `Bearer ${process.env.FLUIDE_ACCESS_TOKEN}`,
                'X-Fluide-Api-Key': process.env.FLUIDE_API_KEY,
                'X-Fluide-Client-Id': 'fluide-developer',
                'X-Workspace-Id': process.env.FLUIDE_WORKSPACE_ID,
                'X-Acting-Company-Id': process.env.FLUIDE_COMPANY_ID,
                'Content-Type': 'application/json',
              },
              body: JSON.stringify({}),
            });


            if (!response.ok) throw new Error(`HTTP ${response.status}: ${await
            response.text()}`);

            console.log(await response.json());
        - lang: python
          label: Python
          source: |-
            import os
            import requests

            base_url = os.environ["FLUIDE_BASE_URL"]
            headers = {
                    "Authorization": f"Bearer {os.environ['FLUIDE_ACCESS_TOKEN']}",
                    "X-Fluide-Api-Key": os.environ["FLUIDE_API_KEY"],
                    "X-Fluide-Client-Id": "fluide-developer",
                    "X-Workspace-Id": os.environ["FLUIDE_WORKSPACE_ID"],
                    "X-Acting-Company-Id": os.environ["FLUIDE_COMPANY_ID"],
            }

            response = requests.patch(
                f"{base_url}/api/v1/hr/expenses/claims/string",
                headers=headers,
                json={},
                timeout=30,
            )
            response.raise_for_status()
            print(response.json())
        - lang: java
          label: Java
          source: >-
            import java.net.URI;

            import java.net.http.HttpClient;

            import java.net.http.HttpRequest;

            import java.net.http.HttpResponse;


            String baseUrl = System.getenv("FLUIDE_BASE_URL");

            HttpClient client = HttpClient.newHttpClient();

            HttpRequest.Builder builder = HttpRequest.newBuilder()
                .uri(URI.create(baseUrl + "/api/v1/hr/expenses/claims/string"))
                .header("Authorization", "Bearer " + System.getenv("FLUIDE_ACCESS_TOKEN"))
                .header("X-Fluide-Api-Key", System.getenv("FLUIDE_API_KEY"))
                .header("X-Fluide-Client-Id", "fluide-developer")
                .header("X-Workspace-Id", System.getenv("FLUIDE_WORKSPACE_ID"))
                .header("X-Acting-Company-Id", System.getenv("FLUIDE_COMPANY_ID"))
                .header("Content-Type", "application/json")
                .PATCH(HttpRequest.BodyPublishers.ofString("{}"))
                .build();
            HttpResponse<String> response = client.send(builder.build(),
            HttpResponse.BodyHandlers.ofString());

            if (response.statusCode() >= 400) throw new RuntimeException("HTTP "
            + response.statusCode() + ": " + response.body());

            System.out.println(response.body());
        - lang: php
          label: PHP
          source: >-
            <?php

            $baseUrl = getenv("FLUIDE_BASE_URL");

            $ch = curl_init($baseUrl . "/api/v1/hr/expenses/claims/string");

            curl_setopt_array($ch, [
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_CUSTOMREQUEST => 'PATCH',
                CURLOPT_HTTPHEADER => [
                    'Authorization: Bearer ' . getenv('FLUIDE_ACCESS_TOKEN'),
                    'X-Fluide-Api-Key: ' . getenv('FLUIDE_API_KEY'),
                    'X-Fluide-Client-Id: fluide-developer',
                    'X-Workspace-Id: ' . getenv('FLUIDE_WORKSPACE_ID'),
                    'X-Acting-Company-Id: ' . getenv('FLUIDE_COMPANY_ID'),
                    'Content-Type: application/json',
                ],
                CURLOPT_POSTFIELDS => "{}",
            ]);

            $response = curl_exec($ch);

            if ($response === false) throw new
            RuntimeException(curl_error($ch));

            $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

            if ($status >= 400) throw new RuntimeException("HTTP $status:
            $response");

            echo $response;
components:
  schemas:
    UpdateExpenseClaimDto:
      type: object
      properties:
        title:
          type: string
        currency:
          type: string
          example: XAF
        notes:
          type: string
        lines:
          type: array
          items:
            $ref: '#/components/schemas/ExpenseClaimLineDto'
    ExpenseClaim:
      type: object
      properties:
        organizationId:
          type: string
        companyId:
          type: string
        hrEmployeeId:
          type: string
        employee:
          $ref: '#/components/schemas/Employee'
        claimNumber:
          type: string
        title:
          type: string
        currency:
          type: string
        totalAmount:
          type: number
        status:
          enum:
            - DRAFT
            - SUBMITTED
            - APPROVED
            - REJECTED
            - PAID
            - CANCELLED
          type: string
        submittedAt:
          format: date-time
          type: string
          nullable: true
        approvedAt:
          format: date-time
          type: string
          nullable: true
        paidAt:
          format: date-time
          type: string
          nullable: true
        notes:
          type: string
          nullable: true
        lines:
          type: array
          items:
            $ref: '#/components/schemas/ExpenseClaimLine'
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        deletedAt:
          format: date-time
          type: string
      required:
        - organizationId
        - companyId
        - hrEmployeeId
        - employee
        - claimNumber
        - title
        - currency
        - totalAmount
        - status
        - submittedAt
        - approvedAt
        - paidAt
        - notes
        - lines
        - id
        - createdAt
        - updatedAt
    ExpenseClaimLineDto:
      type: object
      properties:
        expenseDate:
          type: string
        category:
          type: string
        description:
          type: string
        amount:
          type: number
          minimum: 0.01
        receiptArtifactId:
          type: string
          format: uuid
        costCenterId:
          type: string
          format: uuid
      required:
        - expenseDate
        - category
        - amount
    Employee:
      type: object
      properties: {}
    ExpenseClaimLine:
      type: object
      properties:
        claimId:
          type: string
        claim:
          $ref: '#/components/schemas/ExpenseClaim'
        expenseDate:
          format: date-time
          type: string
        category:
          type: string
        description:
          type: string
          nullable: true
        amount:
          type: number
        receiptArtifactId:
          type: string
          nullable: true
        costCenterId:
          type: string
          nullable: true
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        deletedAt:
          format: date-time
          type: string
      required:
        - claimId
        - claim
        - expenseDate
        - category
        - description
        - amount
        - receiptArtifactId
        - costCenterId
        - id
        - createdAt
        - updatedAt
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Access token JWT. Use as Authorization: Bearer <token>. In the API
        playground, paste the JWT only.
    fluideApiKey:
      type: apiKey
      in: header
      name: X-Fluide-Api-Key
      description: >-
        Developer API key (fl_dev_...). Required on every API call with a
        machine access token.
      x-default: fl_dev_your_key
    fluideClientId:
      type: apiKey
      in: header
      name: X-Fluide-Client-Id
      description: >-
        First-party client audience. Must match the fluide_client_id claim on
        the JWT. Use fluide-developer for Connect.
      x-default: fluide-developer

````