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

# List customers

> List customer records in your Alvys tenant with pagination, returning company profiles, billing addresses, credit terms, and default rate agreements.

The endpoint for retrieving customer details allows you to access a single customer record by providing either the customer ID or the company number. At least one of these parameters (`id` or `companyNumber`) must be included in the request, ensuring flexibility and ease of use. For more information on how versioning works and how to include it in your requests, please refer to the [Versioning](/docs/versioning) page.

### Request Parameters

The following parameters are conditionally required in the URL:

| Parameter     | Type   | Required    | Description                                                                             |
| ------------- | ------ | ----------- | --------------------------------------------------------------------------------------- |
| id            | String | Conditional | The unique identifier of the customer. Either `id` or `companyNumber` must be provided. |
| companyNumber | String | Conditional | The company number of the customer. Either `companyNumber` or `id` must be provided.    |

***

#### Example CURL Request

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v1/customers?id=01fec4d332ed49ff96595c8d4434ea96' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```

OR

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v1/customers?companyNumber=DLA87FOVA22060' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```

Replace `YOUR_ACCESS_TOKEN` with your actual Bearer token. Use either `id` or `companyNumber` as required.

### Response Fields

The following fields are included in the response:

| Field                                   | Type               | Description                                                                                                 |
| --------------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------- |
| Id                                      | String             | The unique identifier of the customer.                                                                      |
| Name                                    | String             | The name of the customer.                                                                                   |
| CompanyNumber                           | String             | The company number of the customer. A customer-provided reference or registration number for their company. |
| Type                                    | String             | The type of customer (e.g., "Customer" or  "Broker/3PL").                                                   |
| Status                                  | String             | The status of the customer. Either "Active" or "Inactive".                                                  |
| BillingAddress                          | Object             | The billing address of the customer.                                                                        |
| BillingAddress.Street                   | String             | The street address of the billing location.                                                                 |
| BillingAddress.City                     | String             | The city of the billing address.                                                                            |
| BillingAddress.State                    | String             | The state of the billing address.                                                                           |
| BillingAddress.ZipCode                  | String             | The postal code of the billing address.                                                                     |
| Email                                   | Array              | A list of email addresses associated with the customer.                                                     |
| Phone                                   | Array              | A list of phone numbers associated with the customer.                                                       |
| Fax                                     | String             | The fax number of the customer.                                                                             |
| DateCreated                             | String (Date-Time) | The date and time when the customer was created.                                                            |
| InvoicingInformation                    | Object             | The invoicing information for the customer.                                                                 |
| InvoicingInformation.Address            | Object             | The address used for invoicing.                                                                             |
| InvoicingInformation.Address.Street     | String             | The street address for invoicing.                                                                           |
| InvoicingInformation.Address.City       | String             | The city of the invoicing address.                                                                          |
| InvoicingInformation.Address.State      | String             | The state of the invoicing address.                                                                         |
| InvoicingInformation.Address.ZipCode    | String             | The postal code of the invoicing address.                                                                   |
| InvoicingInformation.EmailAddresses     | Array              | Email addresses used for invoicing.                                                                         |
| InvoicingInformation.PhoneNumber        | String             | The phone number used for invoicing.                                                                        |
| InvoicingInformation.InvoicingName      | String             | The name used for invoicing.                                                                                |
| InvoicingInformation.InvoicingNameAlias | String             | The alias for the invoicing name.                                                                           |
| InvoicingInformation.PaymentType        | String             | The payment type for invoicing.                                                                             |
| InvoicingInformation.PaymentTermsInDays | Integer            | The payment terms, in days.                                                                                 |
| ExternalId                              | String             | The external identifier associated with the customer.                                                       |
| Contacts                                | Array              | A list of contacts associated with the customer.                                                            |
| SalesAgentId                            | String             | The identifier of the assigned sales agent.                                                                 |
| Notes                                   | Array              | A list of notes related to the customer.                                                                    |

***

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

This page is interactive, allowing you to try a request by completing the fields for the parameters below. As you fill out the parameters, the CURL command on the right side of the page will be automatically updated. Alternatively, you can fork our [Public API Postman Collection](https://app.getpostman.com/run-collection/39138316-54c493c3-15e5-4fd7-a651-6e45b308548f?action=collection%2Ffork\&source=rip_markdown\&collection-url=entityId%3D39138316-54c493c3-15e5-4fd7-a651-6e45b308548f%26entityType%3Dcollection%26workspaceId%3Dc0255544-5964-4c52-9d24-05b30a9b021c) directly. Make sure to authorize yourself before trying a request.


## OpenAPI

````yaml GET /api/p/v{version}/customers
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}/customers:
    get:
      tags:
        - Customers
      summary: List customers
      parameters:
        - name: id
          in: query
          schema:
            type: string
        - name: companyNumber
          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.Customers.CustomerResponse'
        '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.Customers.CustomerResponse:
      required:
        - CompanyNumber
        - Contacts
        - Email
        - Id
        - Name
        - Notes
        - Phone
        - Status
        - Type
      type: object
      properties:
        Id:
          type: string
        Name:
          type: string
        CompanyNumber:
          type: string
        Type:
          type: string
        Status:
          type: string
        BillingAddress:
          allOf:
            - $ref: '#/components/schemas/Alvys.Features.Locations.ShortAddress'
          nullable: true
        Email:
          type: array
          items:
            type: string
        Phone:
          type: array
          items:
            type: string
        Fax:
          type: string
          nullable: true
        DateCreated:
          type: string
          format: date-time
          nullable: true
        InvoicingInformation:
          allOf:
            - $ref: >-
                #/components/schemas/Alvys.Models.Customers.InvoicingInformationResponse
          nullable: true
        ExternalId:
          type: string
          nullable: true
        Contacts:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Customers.ContactResponse'
        SalesAgentId:
          type: string
          nullable: true
        Notes:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Notes.NoteDto'
      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.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.Customers.InvoicingInformationResponse:
      required:
        - EmailAddresses
      type: object
      properties:
        Address:
          allOf:
            - $ref: '#/components/schemas/Alvys.Features.Locations.ShortAddress'
          nullable: true
        EmailAddresses:
          type: array
          items:
            type: string
        PhoneNumber:
          type: string
          nullable: true
        InvoicingName:
          type: string
          nullable: true
        InvoicingNameAlias:
          type: string
          nullable: true
        PaymentType:
          type: string
          nullable: true
        PaymentTermsInDays:
          type: integer
          format: int32
          nullable: true
      additionalProperties: false
    Alvys.Models.Customers.ContactResponse:
      required:
        - Id
        - PrimaryContact
      type: object
      properties:
        Id:
          type: string
        Name:
          type: string
          nullable: true
        Email:
          type: string
          nullable: true
        Phone:
          type: string
          nullable: true
        Mobile:
          type: string
          nullable: true
        Extension:
          type: string
          nullable: true
        Title:
          type: string
          nullable: true
        PrimaryContact:
          type: boolean
      additionalProperties: false
    Alvys.Models.Notes.NoteDto:
      required:
        - Description
        - id
        - NoteType
        - User
      type: object
      properties:
        id:
          type: string
        Description:
          type: string
        NoteType:
          type: string
        Time:
          type: string
          format: date-time
          nullable: true
        User:
          type: string
        UserId:
          type: string
          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>`.

````