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

# Get invoice

> Retrieve invoice records from Alvys by invoice number or reference, including carrier and customer invoices, line items, aging status, and payment history.

The Invoices endpoint allows you to retrieve detailed information about a specific invoice using its unique ID and version.  To ensure compatibility and stability, it is essential to include the correct version number in the URL path when making a request. For more information on versioning, refer to the [Versioning](/docs/versioning) page.

### Request Parameters

The following parameters are accepted as query parameters, except `version` which is part of the URL path:

| Parameter     | Type   | Required      | Description                                                                                                                   |
| ------------- | ------ | ------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| id            | String | Conditionally | The unique Alvys identifier of the invoice. This field is required if the other conditionally required fields are left empty. |
| invoiceNumber | String | Conditionally | The invoice number to retrieve details. This field is required if the other conditionally required fields are left empty.     |
| version       | String | Yes           | The API version to interact with.                                                                                             |

#### Example CURL request

CURL Example using Invoice ID:

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v{version}/invoices?id={invoiceId}' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```

CURL Example using Invoice Number:

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v{version}/invoices?invoiceNumber={invoiceNumber}' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```

Replace `{version}` with the API version number, `{invoiceNumber}` with the actual invoice number, and `YOUR_ACCESS_TOKEN` with your actual Bearer token:

Using Invoice ID:

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v1/invoices?id=15fd1695595a48a48163490e3f21ddd6' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpX....'
```

Using Invoice Number:

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v1/invoices?invoiceNumber=123456789' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpX....'
```

### Response Parameters

The following table lists the parameters included in the response for invoice-related requests.

| Parameter                        | Type               | Description                                                                             |
| -------------------------------- | ------------------ | --------------------------------------------------------------------------------------- |
| Id                               | String             | The unique identifier of the invoice.                                                   |
| Number                           | String             | The invoice number.                                                                     |
| Type                             | String             | The type of the invoice (LoadInvoice, OrderInvoice, SummaryInvoice, StandaloneInvoice). |
| Status                           | String             | The current status of the invoice (Draft, AwaitingPayment, Paid).                       |
| CreatedDate                      | String (Date-Time) | The date and time when the invoice was created.                                         |
| InvoicedDate                     | String (Date-Time) | The date and time when the invoice was issued.                                          |
| DueDate                          | String (Date-Time) | The due date for the invoice payment.                                                   |
| PaidDate                         | String (Date-Time) | The date when the invoice was fully paid.                                               |
| Total                            | Object             | The total amount of the invoice.                                                        |
| Total.Amount                     | Number             | The monetary value of the total amount.                                                 |
| Total.Currency                   | Integer            | The currency in which the invoice is issued.                                            |
| AmountPaid                       | Object             | The amount that has been paid towards the invoice.                                      |
| AmountPaid.Amount                | Number             | The monetary value of the amount paid.                                                  |
| AmountPaid.Currency              | Integer            | The currency in which the payment was made.                                             |
| RemainingBalance                 | Object             | The remaining balance due on the invoice.                                               |
| RemainingBalance.Amount          | Number             | The monetary value of the remaining balance.                                            |
| RemainingBalance.Currency        | Integer            | The currency in which the balance is due.                                               |
| OverPaymentAmount                | Object             | The overpayment amount if any.                                                          |
| OverPaymentAmount.Amount         | Number             | The monetary value of the overpayment.                                                  |
| OverPaymentAmount.Currency       | Integer            | The currency in which the overpayment was made.                                         |
| IsSubmitted                      | Boolean            | Indicates if the invoice has been submitted.                                            |
| LastSendDate                     | String (Date-Time) | The last date and time when the invoice was sent.                                       |
| SupplementalInvoiceType          | String             | The type of supplemental invoice if applicable.                                         |
| Vendor                           | Object             | Vendor details associated with the invoice.                                             |
| Vendor.Id                        | String             | The unique identifier of the vendor.                                                    |
| Vendor.Name                      | String             | The name of the vendor.                                                                 |
| Vendor.RemitAddress              | Object             | The remit address of the vendor.                                                        |
| Vendor.RemitAddress.Street       | String             | The street address of the vendor.                                                       |
| Vendor.RemitAddress.City         | String             | The city of the vendor's address.                                                       |
| Vendor.RemitAddress.State        | String             | The state of the vendor's address.                                                      |
| Vendor.RemitAddress.ZipCode      | String             | The zip code of the vendor's address.                                                   |
| Vendor.RemitEmail                | String             | The email address for remittances to the vendor.                                        |
| Vendor.RemitPhone                | String             | The phone number for remittances to the vendor.                                         |
| Customer                         | Object             | Customer details associated with the invoice.                                           |
| Customer.Id                      | String             | The unique identifier of the customer.                                                  |
| Customer.Name                    | String             | The name of the customer.                                                               |
| Customer.EmailAddresses          | Array of Strings   | The list of email addresses for the customer.                                           |
| Customer.PhoneNumbers            | Array of Strings   | The list of phone numbers for the customer.                                             |
| Customer.BillingAddress          | Object             | The billing address of the customer.                                                    |
| Customer.BillingAddress.Street   | String             | The street address of the customer.                                                     |
| Customer.BillingAddress.City     | String             | The city of the customer's billing address.                                             |
| Customer.BillingAddress.State    | String             | The state of the customer's billing address.                                            |
| Customer.BillingAddress.ZipCode  | String             | The zip code of the customer's billing address.                                         |
| Customer.ShippingAddress         | Object             | The shipping address of the customer.                                                   |
| Customer.ShippingAddress.Street  | String             | The street address of the customer.                                                     |
| Customer.ShippingAddress.City    | String             | The city of the customer's shipping address.                                            |
| Customer.ShippingAddress.State   | String             | The state of the customer's shipping address.                                           |
| Customer.ShippingAddress.ZipCode | String             | The zip code of the customer's shipping address.                                        |
| LineItems                        | Array of Objects   | The line items included in the invoice.                                                 |
| LineItems.Id                     | String             | The unique identifier of the line item.                                                 |
| LineItems.Name                   | String             | The name of the line item.                                                              |
| LineItems.Amount                 | Object             | The amount associated with the line item.                                               |
| LineItems.Amount.Amount          | Number             | The monetary value of the line item.                                                    |
| LineItems.Amount.Currency        | Integer            | The currency in which the line item is priced.                                          |
| LineItems.Rate                   | Object             | The rate details for the line item.                                                     |
| LineItems.Rate.UnitOfMeasurement | String             | The unit of measurement for the rate (e.g., hours, miles).                              |
| LineItems.Rate.Units             | Number             | The number of units billed.                                                             |
| LineItems.Rate.Rate              | Number             | The rate per unit.                                                                      |
| LineItems.LoadNumber             | String             | The load number associated with the line item.                                          |
| LineItems.CustomerId             | String             | The customer ID associated with the line item.                                          |
| LineItems.Category               | String             | The category of the line item.                                                          |
| Loads                            | Array of Objects   | The loads associated with the invoice.                                                  |
| Loads.Id                         | String             | The unique identifier of the load.                                                      |
| Loads.LoadNumber                 | String             | The load number associated with the invoice.                                            |
| Loads.SubsidiaryName             | String             | The name of the subsidiary associated with the load.                                    |
| Loads.Source                     | String             | The source of the load.                                                                 |
| Loads.OrderNumber                | String             | The order number associated with the load.                                              |
| Loads.PONumber                   | String             | The purchase order number associated with the load.                                     |
| Payments                         | Array of Objects   | The payments made against the invoice.                                                  |
| Payments.Id                      | String             | The unique identifier of the payment.                                                   |
| Payments.PaymentDate             | String (Date-Time) | The date and time when the payment was made.                                            |
| Payments.Amount                  | Object             | The amount paid in the payment.                                                         |
| Payments.Amount.Amount           | Number             | The monetary value of the payment.                                                      |
| Payments.Amount.Currency         | Integer            | The currency in which the payment was made.                                             |
| Payments.CheckNumber             | String             | The check number associated with the payment.                                           |
| Payments.PaymentReference        | String             | The payment reference number.                                                           |

#### Example Response

On the right side, you can see examples of different error codes by clicking "Example" and selecting the response code.

#### Rate Limits

All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information on rate limits, please refer to the [Rate Limits](/docs/rate-limits)  page.

This page is interactive, allowing you to try a request by specifying the API version in the URL path and providing the necessary request body. As you fill out the parameters, the Curl command on the right side of the page will be automatically updated. Alternatively, you can directly edit the Curl command. Make sure to authorize yourself before trying a request.


## OpenAPI

````yaml GET /api/p/v{version}/invoices
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:
    get:
      tags:
        - Invoices
      summary: Get invoice
      parameters:
        - name: id
          in: query
          schema:
            type: string
        - name: invoiceNumber
          in: query
          schema:
            type: string
        - name: version
          in: path
          description: API version (e.g., 1.0)
          required: true
          schema:
            type: string
            default: '1.0'
            example: '1.0'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alvys.Models.Invoices.InvoiceResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            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.InvoiceResponse:
      required:
        - AmountPaid
        - CreatedDate
        - Customer
        - Id
        - IsSubmitted
        - LineItems
        - Loads
        - Number
        - OverPaymentAmount
        - Payments
        - RemainingBalance
        - Status
        - Total
        - Type
        - Vendor
        - IsVoided
      type: object
      properties:
        Id:
          type: string
        Number:
          type: string
        Type:
          type: string
        Status:
          type: string
        CreatedDate:
          type: string
          format: date-time
        InvoicedDate:
          type: string
          format: date-time
          nullable: true
        DueDate:
          type: string
          format: date-time
          nullable: true
        PaidDate:
          type: string
          format: date-time
          nullable: true
        Total:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        AmountPaid:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        RemainingBalance:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        OverPaymentAmount:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        IsSubmitted:
          type: boolean
        LastSendDate:
          type: string
          format: date-time
          nullable: true
        SupplementalInvoiceType:
          type: string
          nullable: true
        Vendor:
          allOf:
            - $ref: >-
                #/components/schemas/Alvys.Models.Invoices.InvoiceResponseVendorDto
        Customer:
          allOf:
            - $ref: >-
                #/components/schemas/Alvys.Models.Invoices.InvoiceResponseCustomerDto
        LineItems:
          type: array
          items:
            $ref: >-
              #/components/schemas/Alvys.Models.Invoices.InvoiceResponseLineItemDto
        Loads:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Invoices.InvoiceResponseLoadDto'
        Payments:
          type: array
          items:
            $ref: >-
              #/components/schemas/Alvys.Models.Invoices.InvoiceResponsePaymentDto
        IsVoided:
          type: boolean
      additionalProperties: false
    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
    Alvys.Models.Invoices.InvoiceResponseVendorDto:
      required:
        - Id
        - Name
      type: object
      properties:
        Id:
          type: string
        Name:
          type: string
        RemitAddress:
          allOf:
            - $ref: '#/components/schemas/Alvys.Features.Locations.ShortAddress'
          nullable: true
        RemitEmail:
          type: string
          nullable: true
        RemitPhone:
          type: string
          nullable: true
      additionalProperties: false
    Alvys.Models.Invoices.InvoiceResponseCustomerDto:
      required:
        - EmailAddresses
        - Id
        - Name
        - PhoneNumbers
      type: object
      properties:
        Id:
          type: string
        Name:
          type: string
        EmailAddresses:
          type: array
          items:
            type: string
        PhoneNumbers:
          type: array
          items:
            type: string
        BillingAddress:
          allOf:
            - $ref: '#/components/schemas/Alvys.Features.Locations.ShortAddress'
          nullable: true
        ShippingAddress:
          allOf:
            - $ref: '#/components/schemas/Alvys.Features.Locations.ShortAddress'
          nullable: true
      additionalProperties: false
    Alvys.Models.Invoices.InvoiceResponseLineItemDto:
      required:
        - Amount
        - Id
        - Name
        - Rate
      type: object
      properties:
        Id:
          type: string
        Name:
          type: string
        Amount:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        Rate:
          allOf:
            - $ref: >-
                #/components/schemas/Alvys.Models.Invoices.InvoiceResponseLineItemDtoRateDto
        LoadNumber:
          type: string
          nullable: true
        CustomerId:
          type: string
          nullable: true
        Category:
          type: string
          nullable: true
      additionalProperties: false
    Alvys.Models.Invoices.InvoiceResponseLoadDto:
      required:
        - Id
        - LoadNumber
        - SubsidiaryName
      type: object
      properties:
        Id:
          type: string
        LoadNumber:
          type: string
        SubsidiaryName:
          type: string
        Source:
          type: string
          nullable: true
        OrderNumber:
          type: string
          nullable: true
        PONumber:
          type: string
          nullable: true
      additionalProperties: false
    Alvys.Models.Invoices.InvoiceResponsePaymentDto:
      required:
        - Amount
        - Id
      type: object
      properties:
        Id:
          type: string
        PaymentDate:
          type: string
          format: date-time
          nullable: true
        Amount:
          allOf:
            - $ref: '#/components/schemas/Alvys.Money'
        CheckNumber:
          type: string
          nullable: true
        PaymentReference:
          type: string
          nullable: true
      additionalProperties: false
    Alvys.Features.Locations.ShortAddress:
      required:
        - City
        - State
        - Street
        - ZipCode
      type: object
      properties:
        Street:
          type: string
        City:
          type: string
        State:
          type: string
        ZipCode:
          type: string
      additionalProperties: false
    Alvys.Models.Invoices.InvoiceResponseLineItemDtoRateDto:
      required:
        - Rate
        - Units
      type: object
      properties:
        UnitOfMeasurement:
          type: string
          nullable: true
        Units:
          type: number
          format: double
        Rate:
          type: number
          format: double
      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>`.

````