---
title: "Add or update fare contracts for an order"
method: POST
path: "/v1/fare-contracts/orders/{orderId}"
tags: ["Fare Contracts"]
---

# Add or update fare contracts for an order

`POST /v1/fare-contracts/orders/{orderId}`

## Request

- Base URL: `https://abt-integration-entur-production.entur.io`
- URL: `https://abt-integration-entur-production.entur.io/v1/fare-contracts/orders/{orderId}`
- Auth: none declared

Triggers distribution of an order to ABT, creating or updating fare contracts. If the fare contract already exists, no duplicate will be created.

## Path parameters

- `orderId` string, required

## Request body

- FareContractRequest: Request to add/update fare contracts for an order to ABT.
  - `orderVersion` integer, required: The version of the order to distribute.

## Response `200`

OK

- FareContractResponse: Response from adding/updating fare contracts in ABT for an order.
  - `orderId` string, required: The order ID that fare contract was added/updated for.
  - `orderVersion` integer, required: The version of the order that fare contract was added/updated for.
  - `successfulDistributions` SuccessfulFareContract[], required: Fare contracts that were successfully added/updated.
    - `customerAccountRef` string, required
    - `fareContractRef` string, required
    - `travelDocumentIssuedRef` string: Reference to a new travel document (token) issued for the fare contract.
    - `travelDocumentAttachedRef` string: Reference to an existing travel document (token) attached to the fare contract.
    - `orderLineIds` string[]: The order line IDs that were added/updated in the fare contract.
  - `failedDistributions` FailedFareContract[], required: Customer accounts for which distribution failed.
    - `customerAccountRef` string, required: The customer account the fare contract was attempted to be added/updated to.
    - `orderLineIds` string[], required: The order line IDs that failed.
    - `errorMessage` string, required: Description of why the fare contract was rejected by ABT.

## Other responses

- `500`: Internal Server Error

---

[API](https://skmtc.dev/entur/apis/abt-integration-entur-api.md) - [All operations](https://skmtc.dev/entur/apis/abt-integration-entur-api/llms.txt) - [OpenAPI document](https://skmtc.dev/entur/apis/abt-integration-entur-api/revisions/dfc1ed85250a?raw)
