> ## 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.

# Disburse a scheduled/approved bill via FluidePay (settles the bill)



## OpenAPI

````yaml /openapi/fluide-books.json post /api/v1/bills/{id}/disburse
openapi: 3.0.0
info:
  title: Fluide Books API
  description: >-
    Accounting: chart of accounts, journal entries, invoices, bills, banking,
    budgets, and payroll GL integration. 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: Sandbox
  - url: https://api.fluideglobal.com
    description: Production
security:
  - bearer: []
    fluideApiKey: []
    fluideClientId: []
tags:
  - name: App
    description: Service root and build metadata. Use for quick connectivity checks.
    x-group: Operations
  - name: Audit
  - 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: Chart of Accounts
  - name: Journal Entries
  - name: Fiscal Periods
  - name: Invoices
  - name: Public Invoices
  - name: Invoice collection settings
  - name: Exchange rates
  - name: Payroll GL mappings
  - name: Ledger
  - name: Reconciliation
  - name: Bills
  - name: Banking
  - name: Budgets
  - name: Fixed assets
  - name: Dashboard
  - name: Projects
  - name: AccountingClients
  - name: Company accounting settings
  - name: Accounting Modes
  - name: Inventory
  - name: Mode Metrics
  - name: Funds (NGO)
  - name: Fund Capital
  - name: Loan Book (FI)
  - name: Business Partners
  - name: Recurring
  - name: Transactions
  - name: Inter company
  - name: Treasury
  - name: Internal Payments
paths:
  /api/v1/bills/{id}/disburse:
    post:
      tags:
        - Bills
      summary: Disburse a scheduled/approved bill via FluidePay (settles the bill)
      operationId: BillsController_disburse
      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
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bill'
      security:
        - bearer: []
          fluideApiKey: []
          fluideClientId: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl -sS -X POST "$FLUIDE_BASE_URL/api/v1/bills/string/disburse" \
            -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"
        - lang: node
          label: Node.js
          source: >-
            const baseUrl = process.env.FLUIDE_BASE_URL; const response = await
            fetch(`${baseUrl}/api/v1/bills/string/disburse`, { method: 'POST',
            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, },

            }); 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.post(
            f"{base_url}/api/v1/bills/string/disburse", headers=headers,
            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/bills/string/disburse"))
            .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"))
            .POST(HttpRequest.BodyPublishers.noBody()) .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/bills/string/disburse");

            curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true,
            CURLOPT_CUSTOMREQUEST => 'POST', 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'), ],

            ]);

            $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:
    Bill:
      type: object
      properties:
        organizationId:
          type: string
        companyId:
          type: string
          nullable: true
        billNumber:
          type: string
        vendorId:
          type: string
          nullable: true
        projectId:
          type: string
          nullable: true
          description: Project accounting dimension (optional).
        clientId:
          type: string
          nullable: true
          description: Client / sub-ledger dimension (optional).
        issueDate:
          format: date-time
          type: string
        dueDate:
          format: date-time
          type: string
        subtotal:
          type: number
        taxAmount:
          type: number
        total:
          type: number
        currency:
          type: string
        status:
          enum:
            - DRAFT
            - RECEIVED
            - UNDER_REVIEW
            - APPROVED
            - REJECTED
            - SCHEDULED
            - PENDING_PAYMENT
            - PAID
            - VOID
          type: string
        settlementStatus:
          enum:
            - UNPAID
            - PARTIALLY_PAID
            - PAID
          type: string
        amountPaid:
          type: number
        balanceDue:
          type: number
        approvedAt:
          format: date-time
          type: string
          nullable: true
        approvedBy:
          type: string
          nullable: true
        rejectedAt:
          format: date-time
          type: string
          nullable: true
        rejectedBy:
          type: string
          nullable: true
        rejectionReason:
          type: string
          nullable: true
        postedAt:
          format: date-time
          type: string
          nullable: true
          description: >-
            Accounting posting moment. After posting, financial values are
            immutable; changes require reversals/adjustments.
        postedBy:
          type: string
          nullable: true
        postedJournalEntryId:
          type: string
          nullable: true
        scheduledPaymentDate:
          format: date-time
          type: string
          nullable: true
        notes:
          type: string
          nullable: true
        sourceDocumentIds:
          type: array
          items:
            type: string
        approvalPercent:
          type: number
          description: Approval progress for policy-based approvals (0-100).
        approvalRequiredPercent:
          type: number
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/BillLineItem'
        allocations:
          type: array
          items:
            $ref: '#/components/schemas/BillPaymentAllocation'
        disbursement:
          $ref: '#/components/schemas/BillDisbursement'
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        deletedAt:
          format: date-time
          type: string
      required:
        - organizationId
        - companyId
        - billNumber
        - vendorId
        - projectId
        - clientId
        - issueDate
        - dueDate
        - subtotal
        - taxAmount
        - total
        - currency
        - status
        - settlementStatus
        - amountPaid
        - balanceDue
        - approvedAt
        - approvedBy
        - rejectedAt
        - rejectedBy
        - rejectionReason
        - postedAt
        - postedBy
        - postedJournalEntryId
        - scheduledPaymentDate
        - notes
        - sourceDocumentIds
        - approvalPercent
        - approvalRequiredPercent
        - lineItems
        - allocations
        - id
        - createdAt
        - updatedAt
    BillLineItem:
      type: object
      properties:
        billId:
          type: string
        bill:
          $ref: '#/components/schemas/Bill'
        lineNumber:
          type: number
        description:
          type: string
        quantity:
          type: number
        unitPrice:
          type: number
        discountAmount:
          type: number
        taxAmount:
          type: number
        lineTotal:
          type: number
        glAccountId:
          type: string
          nullable: true
        taxCodeId:
          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:
        - billId
        - bill
        - lineNumber
        - description
        - quantity
        - unitPrice
        - discountAmount
        - taxAmount
        - lineTotal
        - glAccountId
        - taxCodeId
        - id
        - createdAt
        - updatedAt
    BillPaymentAllocation:
      type: object
      properties:
        billId:
          type: string
        bill:
          $ref: '#/components/schemas/Bill'
        fluidePayTransactionId:
          type: string
          nullable: true
        paymentSource:
          type: string
          enum:
            - FLUIDEPAY
            - MANUAL
            - BANK_TRANSFER
            - CASH
            - CHEQUE
        externalReference:
          type: string
          nullable: true
        evidenceDocumentIds:
          type: array
          items:
            type: string
        allocatedAmount:
          type: number
        currency:
          type: string
        allocatedAt:
          format: date-time
          type: string
        allocatedBy:
          type: string
          nullable: true
        memo:
          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:
        - billId
        - bill
        - fluidePayTransactionId
        - paymentSource
        - externalReference
        - evidenceDocumentIds
        - allocatedAmount
        - currency
        - allocatedAt
        - allocatedBy
        - memo
        - id
        - createdAt
        - updatedAt
    BillDisbursement:
      type: object
      properties:
        billId:
          type: string
        bill:
          $ref: '#/components/schemas/Bill'
        status:
          type: string
          enum:
            - INITIATED
            - SUCCEEDED
            - FAILED
        provider:
          type: string
        reference:
          type: string
        providerReference:
          type: string
          nullable: true
        providerReceiptUrl:
          type: string
          nullable: true
        attemptCount:
          type: number
        lastAttemptAt:
          format: date-time
          type: string
          nullable: true
        request:
          type: object
          nullable: true
        response:
          type: object
          nullable: true
        errorMessage:
          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:
        - billId
        - bill
        - status
        - provider
        - reference
        - providerReference
        - providerReceiptUrl
        - attemptCount
        - lastAttemptAt
        - request
        - response
        - errorMessage
        - 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

````