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

# Generate carrier rate confirmation

> Generate a trip's carrier rate confirmation from your own system and get a download link, with an optional Idempotency-Key so a retry never stores it twice.

The Generate Carrier Rate Confirmation endpoint creates the carrier rate confirmation for a trip, the same document as **Generate** in the Tender panel in Alvys, and returns it with a download link. For more information on how versioning works and how to include it in your requests, please refer to the [Versioning](https://docs.alvys.com/en/api/guides/versioning.md) page.

It does not email the carrier or request a signature. Download the PDF from `DownloadUrl` and send it the way you already do.

> [!NOTE]
>
> This endpoint requires the `trip:update` scope. See [Authentication](https://docs.alvys.com/en/api/guides/authentication-1.md).

### Request parameters

| Parameter | In | Type | Required | Description |
| - | - | - | - | - |
| version | path | String | Yes | API version to use. |
| tripId | path | String | Yes | The trip's `Id`, as returned by [Search trips](https://docs.alvys.com/en/api/reference/trips/search-trips.md). |
| Idempotency-Key | header | String | No | 1 to 100 characters. Makes a retry safe: see [Retry safely](#retry-safely). |

The request has no body.

### Before you call it

The trip must be ready for a carrier rate confirmation. Each of these returns `422 Unprocessable Content` and stores nothing:

* The trip has no carrier. Assign one first.
* The trip is run by an owner operator. Only carrier rate confirmations can be generated through the API.
* The trip is tendered to one of your own carrier subsidiaries. Rate confirmations can be generated here for brokered carriers only.
* The trip has no dispatcher, or its dispatcher is no longer an active user. Set one with `dispatcherId` on [Assign trip](https://docs.alvys.com/en/api/reference/trips/assign-trip.md).

The contact printed on the rate confirmation is the trip's dispatcher, not your API credential.

### Where the document is stored

The rate confirmation is stored on the trip's load, not on the trip: `ParentType` is `Load` and `ParentId` is the load number. [List load documents](https://docs.alvys.com/en/api/reference/loads/list-load-documents.md) lists it and [List trip documents](https://docs.alvys.com/en/api/reference/trips/list-trip-documents.md) does not.

### Retry safely

Without an `Idempotency-Key`, every call stores a new rate confirmation, so a retry after a timeout can leave two on the load.

With an `Idempotency-Key`, the key is tied to this trip:

* The first call generates and stores the rate confirmation.
* A call with the same key returns that rate confirmation with a new download link and generates nothing.
* The key is also tied to the trip's carrier, owner operator and carrier rate. After any of them changes, the same key goes through every check again and generates a new rate confirmation.
* Other trip edits do not change what the key returns. Send a new key to get a rate confirmation that shows them.
* If the rate confirmation stored for a key was deleted, the same key returns `409 Conflict` with a `type` ending in `IdempotencyKeyReused`. Send a new key.

An empty key, or one over 100 characters, returns `400 Bad Request`.

### Response

`200 OK` with the rate confirmation.

| Name | Type | Description |
| - | - | - |
| id | string | The document's id. |
| AttachmentPath | string | The file name of the PDF. |
| AttachmentType | string | `Carrier Rate Confirmation`. |
| AttachmentSize | integer | Size of the file in bytes. |
| UploadedAt | string | When the document was stored (ISO 8601). |
| ParentId | string | The load number of the trip's load. |
| ParentType | string | `Load`. |
| UploadedBy | string | Who stored the document. |
| DownloadUrl | string | A link to download the PDF. It works for 10 minutes. |
| ExpiresAt | string | When `DownloadUrl` stops working (ISO 8601). |

Fields with no value are left out of the response.

### Errors

| Status | When |
| - | - |
| `400 Bad Request` | The `Idempotency-Key` is empty or over 100 characters. |
| `401 Unauthorized` | The access token is missing, invalid or expired. |
| `403 Forbidden` | Your credential does not have the `trip:update` scope. |
| `404 Not Found` | The trip does not exist or your credential cannot see it. |
| `409 Conflict` | The `type` ends in `IdempotencyKeyReused`: the rate confirmation stored for this key was deleted. Send a new key. |
| `422 Unprocessable Content` | The trip is not ready: see [Before you call it](#before-you-call-it). Also returned when the document is too large to generate through the API (generate it in Alvys instead), and when generating PDFs through the API is not turned on for your account (contact Alvys support). The `detail` says which. |
| `429 Too Many Requests` | You are rate limited. See [Rate limits](https://docs.alvys.com/en/api/guides/rate-limits.md). |
| `503 Service Unavailable` | PDF generation is busy. Retry after the number of seconds in the `Retry-After` header, with the same `Idempotency-Key`. |

### Example cURL request

```bash theme={null}
curl --location --request POST 'https://integrations.alvys.com/api/p/v{version}/trips/{tripId}/rate-confirmation' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Idempotency-Key: tms-ratecon-58213'
```

### Example response (200 OK)

```json theme={null}
{
  "id": "6c1f0e2d9a8b4c7d8e5f4a3b2c1d0e9f",
  "AttachmentPath": "CarrierRateConfirmation-1764775200.pdf",
  "AttachmentType": "Carrier Rate Confirmation",
  "AttachmentSize": 91234,
  "UploadedAt": "2026-12-03T15:20:00+00:00",
  "ParentId": "1001",
  "ParentType": "Load",
  "UploadedBy": "Example Integration",
  "DownloadUrl": "https://files.alvys.com/...",
  "ExpiresAt": "2026-12-03T15:30:00+00:00"
}
```

***

### Rate limits

All endpoints are subject to rate limits to protect the API from traffic spikes.
For detailed information, see the [Rate Limits](https://docs.alvys.com/en/api/guides/rate-limits.md) section.


## OpenAPI

````yaml POST /api/p/v{version}/trips/{tripId}/rate-confirmation
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, and search loads; manage load documents, notes, and custom
      references.
  - name: Locations
    description: Read and search company location details.
  - name: Maintenance
    description: Read and search maintenance records.
  - name: References
    description: >-
      List tenant custom reference definitions and create or update values on
      existing loads, stops, and trips.
  - name: Subsidiaries
    description: >-
      List your company's subsidiaries and read a single subsidiary, so an
      integration can resolve a subsidiary id to a recognizable name.
  - name: Tenders
    description: Create, accept, reject, cancel, update, and search inbound EDI tenders.
  - name: Tolls
    description: Read and search toll transactions.
  - name: Tracking
    description: >-
      Record an asset's current location or telemetry from a third-party source,
      such as an external ELD or a self-reporting vehicle.
  - name: Trailers
    description: Read trailers, search trailer events, and manage trailer documents.
  - name: Trips
    description: >-
      Read and search trips; manage trip documents, stop appointments, arrivals,
      departures, and stop and trip custom references.
  - 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.
  - name: Accessorials
  - name: Credits
paths:
  /api/p/v{version}/trips/{tripId}/rate-confirmation:
    post:
      tags:
        - Trips
      summary: Generate carrier rate confirmation
      description: >-
        Generates the carrier rate confirmation for a trip, the same document as
        Generate in the app's Tender panel, and returns it with a download link
        that expires after 10 minutes.


        **Where it is stored.** The document is stored on the trip's load
        (`ParentType` `Load`, `ParentId` the load number), so `GET
        /loads/{loadNumber}/documents` lists it and `GET
        /trips/{tripId}/documents` does not.


        **Contact.** The contact printed on it is the trip's dispatcher, set by
        `POST /trips/{tripId}/assign`, not the API client and not the user who
        clicks Generate in the app.


        **Refused with 422, nothing stored,** when the trip is run by an owner
        operator, is tendered as one of your own carrier subsidiaries, has no
        carrier, has no dispatcher, or its dispatcher is no longer an active
        user, and when PDF rendering through the public API is not switched on
        for the account.


        **Retries.** Send an `Idempotency-Key` header (up to 100 characters) to
        make a retry safe: a call with a key already used on this trip returns
        the rate confirmation that key stored. A retry sent while the first call
        is still running may re-check the trip, but it ends on the same stored
        rate confirmation. The key is tied to the trip's carrier, owner operator
        and carrier rate: after any of them changes, the same key goes through
        every check again and generates a new rate confirmation. Other trip
        edits do not, so send a new key to get a rate confirmation that reflects
        them. Without the header every call stores a new one, so a retry after a
        timeout can leave two on the load. A key whose rate confirmation was
        deleted is refused with 409.


        It does not email the carrier or request a signature.
      parameters:
        - name: tripId
          in: path
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          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.PublicAPI.AttachmentResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails
            application/problem+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'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - Public: []
components:
  schemas:
    Alvys.Models.PublicAPI.AttachmentResponse:
      required:
        - AttachmentPath
        - AttachmentType
        - id
        - ParentId
        - ParentType
      type: object
      properties:
        id:
          type: string
        AttachmentPath:
          type: string
        AttachmentType:
          type: string
        AttachmentSize:
          type: integer
          format: int64
          nullable: true
        UploadedAt:
          type: string
          format: date-time
          nullable: true
        ParentId:
          type: string
        ParentType:
          type: string
        UploadedBy:
          type: string
          nullable: true
        DownloadUrl:
          type: string
          nullable: true
        ExpiresAt:
          type: string
          format: date-time
          nullable: true
    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: {}
  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>`.

````