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

# Record invoice financing

> Record a factoring or invoice financing event in Alvys for one or more carrier invoices, including funder, funded amount, reserve, and remittance details.

This endpoint records a financing transaction for a load.

Financing represents funds advanced against an invoice, typically by a factoring provider.

### Path Parameters

| Parameter | Type   | Required | Description               |
| --------- | ------ | -------- | ------------------------- |
| version   | string | Yes      | API version (e.g., `1.0`) |

### Request Body

Content-Type: `application/json-patch+json`

| Field               | Type               | Required | Description                                                                     |
| ------------------- | ------------------ | -------- | ------------------------------------------------------------------------------- |
| LoadNumber          | string             | Yes      | Load number the financing should be applied to                                  |
| AmountFunded        | number             | Yes      | Amount funded for the load                                                      |
| Fee                 | number             | No       | Financing fee associated with the transaction                                   |
| DateFunded          | string (date-time) | No       | Date when the financing was issued. Defaults to the current UTC time if omitted |
| ReserveEscrowAmount | number             | No       | Amount retained in reserve or escrow                                            |
| ReferenceNumber     | string             | Yes      | External reference number used for idempotency and tracking                     |

### Example Request

```json id="gk3w1f" theme={null}
{
  "LoadNumber": "string",
  "AmountFunded": 0,
  "Fee": 0,
  "DateFunded": "2026-03-16T14:15:18.848Z",
  "ReserveEscrowAmount": 0,
  "ReferenceNumber": "string"
}
```

### Response Body

| Field       | Type   | Description                                      |
| ----------- | ------ | ------------------------------------------------ |
| LoadNumber  | string | Load number the financing was applied to         |
| Status      | string | Current load status after applying the financing |
| TotalFunded | object | Total amount funded for the load                 |
| TotalFees   | object | Total financing fees recorded for the load       |

#### Money Object

| Field    | Type    | Description         |
| -------- | ------- | ------------------- |
| Amount   | number  | Monetary amount     |
| Currency | integer | Currency identifier |

### Example Response

```json id="s4p2md" theme={null}
{
  "LoadNumber": "string",
  "Status": "string",
  "TotalFunded": {
    "Amount": 0,
    "Currency": 0
  },
  "TotalFees": {
    "Amount": 0,
    "Currency": 0
  }
}
```

### Related Load Fields Updated After Successful Financing

Successful requests may update the related load status to `Financed` and increase cumulative funded / fee totals used for load payment and factoring workflows.

### Notes

* This endpoint records **financing transactions for loads**.
* The request body content type exposed by the API is `application/json-patch+json`.
* `ReferenceNumber` is required and used for **idempotency**. Repeating the same `ReferenceNumber` for the same load returns the original financing record instead of creating a duplicate.
* Successful financing requests may update the related load to financing-related status values such as `Financed`.
* Financing can only be recorded when the load is in one of the following statuses:

  * `Invoiced`
  * `Completed`
  * `Financed`
* Loads in non-payable statuses such as `Dispatched` are rejected with:

```text id="v1s9zr" theme={null}
400 Bad Request
Load must be in one of: Invoiced, Completed, Financed.
```

* If the `LoadNumber` does not exist, the endpoint returns:

```text id="hys8u4" theme={null}
404 Not Found
```

* If `AmountFunded` is negative or zero, the endpoint returns:

```text id="fzk6t1" theme={null}
400 Bad Request
AmountFunded must be greater than zero.
```

* If `Fee` is negative, the endpoint returns:

```text id="vyu1tc" theme={null}
400 Bad Request
Fee cannot be negative.
```


## OpenAPI

````yaml POST /api/p/v{version}/invoices/financing
openapi: 3.0.1
info:
  title: Alvys
  description: >-
    Alvys provides a robust set of REST APIs to allow you to integrate Alvys
    into virtually any platform. These APIs cover most of Alvys' major product
    areas with additional endpoints being added regularly based on customer
    requests.
  contact:
    name: Alvys Support
    url: https://www.alvys.com/resources/contact/
  version: v1
servers:
  - url: https://integrations.alvys.com
    description: Public API Server
  - url: https://api.alvys.com/
    description: Public API Server
security:
  - Public: []
tags:
  - name: Authentication
    description: Obtain an OAuth 2.0 access token for the Alvys Public API.
  - name: Carrier Settlement Statements
    description: >-
      Search carrier settlement statements and retrieve a single statement by
      number.
  - name: Carriers
    description: Read carrier records, search carriers, and manage carrier documents.
  - name: Customers
    description: Create, read, update, delete, and search customer records.
  - name: Deductions
    description: >-
      Create one-time deductions and search or delete existing deduction
      records.
  - name: DispatchPreferences
    description: Dispatch preferences endpoints for reading dispatch rules and preferences.
  - name: Driver Settlement Statements
    description: >-
      Search driver settlement statements and retrieve a single statement by
      number.
  - name: Drivers
    description: >-
      Read driver records, search drivers and driver events, and manage driver
      documents.
  - name: Fuel
    description: Read and search fuel transactions.
  - name: Invoices
    description: >-
      Read invoices, create carrier invoices, and record carrier and customer
      payments.
  - name: Loads
    description: Read, update, search loads, and manage load documents and notes.
  - name: Locations
    description: Read and search company location details.
  - name: Maintenance
    description: Read and search maintenance records.
  - name: Tenders
    description: Create, accept, reject, cancel, update, and search inbound EDI tenders.
  - name: Tolls
    description: Read and search toll transactions.
  - name: Trailers
    description: Read trailers, search trailer events, and manage trailer documents.
  - name: Trips
    description: >-
      Read, search trips, manage trip documents, and record stop appointments,
      arrivals, and departures.
  - name: Trucks
    description: Read trucks, search truck events, and manage truck documents.
  - name: Users
    description: List and search users.
  - name: Visibility
    description: >-
      Read inbound and outbound visibility history and search outbound
      visibility errors.
  - name: Webhooks
    description: >-
      Create, read, update, delete, enable, disable, verify, test, and rotate
      secrets for webhook subscriptions; read event types, delivery logs, and
      health metrics.
paths:
  /api/p/v{version}/invoices/financing:
    post:
      tags:
        - Invoices
      summary: Record invoice financing
      parameters:
        - name: version
          in: path
          description: API version (e.g., 1.0)
          required: true
          schema:
            type: string
            default: '1.0'
            example: '1.0'
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.Invoices.Request.FinancingRequest
          application/json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.Invoices.Request.FinancingRequest
          text/json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.Invoices.Request.FinancingRequest
          application/*+json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.Invoices.Request.FinancingRequest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Alvys.Models.Invoices.Response.FinancingResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - Public: []
components:
  schemas:
    Alvys.Models.Invoices.Request.FinancingRequest:
      required:
        - AmountFunded
        - Fee
        - LoadNumber
        - ReferenceNumber
      type: object
      properties:
        LoadNumber:
          type: string
        AmountFunded:
          type: number
          format: double
        Fee:
          type: number
          format: double
        DateFunded:
          type: string
          format: date-time
          nullable: true
        ReserveEscrowAmount:
          type: number
          format: double
          nullable: true
        ReferenceNumber:
          type: string
      additionalProperties: false
    Alvys.Models.Invoices.Response.FinancingResponse:
      required:
        - LoadNumber
        - Status
        - TotalFees
        - TotalFunded
      type: object
      properties:
        LoadNumber:
          type: string
        Status:
          type: string
        TotalFunded:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        TotalFees:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
      additionalProperties: false
    Microsoft.AspNetCore.Mvc.ValidationProblemDetails:
      required:
        - Errors
      type: object
      properties:
        Errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        Type:
          type: string
          nullable: true
        Title:
          type: string
          nullable: true
        Status:
          type: integer
          format: int32
          nullable: true
        Detail:
          type: string
          nullable: true
        Instance:
          type: string
          nullable: true
      additionalProperties: {}
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        Type:
          type: string
          nullable: true
        Title:
          type: string
          nullable: true
        Status:
          type: integer
          format: int32
          nullable: true
        Detail:
          type: string
          nullable: true
        Instance:
          type: string
          nullable: true
      additionalProperties: {}
    Alvys.Money:
      required:
        - Amount
      type: object
      properties:
        Amount:
          type: number
          format: double
        Currency:
          type: integer
          format: int32
          nullable: true
      additionalProperties: false
  securitySchemes:
    Public:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        OAuth 2.0 client-credentials access token. Obtain one from
        https://auth.alvys.com/oauth/token (grant_type=client_credentials,
        audience=https://api.alvys.com/public/), then paste it here. The
        playground sends it as `Authorization: Bearer <token>`.

````