{
  "openapi": "3.1.1",
  "info": {
    "title": "Reserve Offers",
    "description": "Simplify adding offers to an order",
    "version": "2026.04.0"
  },
  "servers": [
    {
      "url": "https://api.staging.entur.io/sales",
      "description": "Staging test environment"
    },
    {
      "url": "https://api.dev.entur.io/sales",
      "description": "Development test environment"
    },
    {
      "url": "https://api.entur.io/sales",
      "description": "Production environment"
    }
  ],
  "security": [
    {
      "authHeader": []
    }
  ],
  "tags": [
    {
      "name": "Reserve Offers",
      "description": "Add regular products to order through offer."
    },
    {
      "name": "Reserve Third Party Products",
      "description": "Add external products to order."
    },
    {
      "name": "Change Options",
      "description": "Retrieve possible change options for an order."
    }
  ],
  "paths": {
    "/v1/update-order": {
      "post": {
        "tags": [
          "Reserve Offers"
        ],
        "summary": "Update order lines in an order with reservable offers",
        "description": "Updates a set of order lines on an order with new offer and traveller details",
        "operationId": "updateOrderLinesInOrder",
        "parameters": [
          {
            "name": "Entur-Distribution-Channel",
            "in": "header",
            "description": "A header containing the distribution channel ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Entur-Pos",
            "in": "header",
            "description": "Point-of-sale identifier.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeOrderLinesRequest"
              },
              "examples": {
                "default": {
                  "value": {
                    "orderId": "ABCD1234",
                    "offerConfigurations": [
                      {
                        "offerId": "6b166022-bfca-4b92-b093-34a54ab2063e",
                        "orderLineId": "fc93f175-5518-4a72-9618-43ae68804d4a",
                        "selectableProductIds": [
                          "gjk956"
                        ],
                        "selectedTravellerIds": [
                          "2e761c3f-ce97-4305-a01c-6aef40daafa2"
                        ]
                      }
                    ],
                    "refundPriceDifference": false
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderLineIdsAndReservationIds"
                },
                "examples": {
                  "default": {
                    "value": {
                      "orderId": "ABCD1234",
                      "orderLineIds": [
                        "fc93f175-5518-4a72-9618-43ae68804d4a"
                      ],
                      "reservationIds": [
                        "deeb861c-e732-4689-b148-f575f8ca71c1"
                      ],
                      "replacedByOrderLineIds": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/badRequest"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/v1/reserve-offers": {
      "post": {
        "tags": [
          "Reserve Offers"
        ],
        "summary": "Add reservable offers to an order",
        "description": "Takes a set of offerIds which might need reservations, performs reservations where applicable and adds the offers as orderlines to an existing order",
        "operationId": "reserveOffers",
        "parameters": [
          {
            "name": "Entur-Distribution-Channel",
            "in": "header",
            "description": "A header containing the distribution channel ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Entur-Pos",
            "in": "header",
            "description": "Point-of-sale identifier.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReserveOffersRequest"
              },
              "examples": {
                "default": {
                  "value": {
                    "offerConfigurations": [
                      {
                        "offerId": "5d3e9d2c-f9ab-4dd0-a735-100886278e0b",
                        "customers": [
                          {
                            "customerId": "12345678",
                            "entitlements": [
                              {
                                "contractId": "33370312-aa00-4d22-8ffb-704418d77484",
                                "entitlementProductRef": {
                                  "id": "ABC:Entitlement:abcd1234-ab12-cd34-ef56-abcdef123456"
                                }
                              }
                            ]
                          }
                        ],
                        "distributionDetails": {
                          "customerAccountRef": {
                            "id": "ABC:CustomerAccount:dcf4df02-aa15-4062-a694-3426dc27d03f"
                          },
                          "fulfillmentMethodRef": {
                            "id": "ENT:FulfilmentMethod:Electronic"
                          }
                        },
                        "selectableProductIds": [
                          "frt567"
                        ],
                        "selectedTravellerIds": [
                          "37a07da0-c972-4e8f-b5f3-553856da49d9"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderLineIdsAndReservationIds"
                },
                "examples": {
                  "default": {
                    "value": {
                      "orderId": "ABCD1234",
                      "orderLineIds": [
                        "fc93f175-5518-4a72-9618-43ae68804d4a"
                      ],
                      "reservationIds": [
                        "e9729837-375b-4369-991f-54adf35dd2fd"
                      ],
                      "replacedByOrderLineIds": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/badRequest"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/v1beta/change-options": {
      "get": {
        "tags": [
          "Change Options"
        ],
        "summary": "Find available changes which are available to perform",
        "description": "Gives a list of change options for an order. Change options are options which either comes with a fee which have to be paid for, or free.",
        "operationId": "getChangeOptions",
        "parameters": [
          {
            "name": "Entur-Distribution-Channel",
            "in": "header",
            "description": "A header containing the distribution channel ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Entur-Pos",
            "in": "header",
            "description": "Point-of-sale identifier.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "query",
            "description": "orderId",
            "required": true,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChangeOption"
                  }
                },
                "examples": {
                  "default": {
                    "value": [
                      {
                        "orderId": "ABCD1234",
                        "orderLineOptions": [
                          {
                            "options": [
                              {
                                "id": "ABC:Exchanging:Any",
                                "types": [
                                  "ANY_PRODUCT",
                                  "DEPARTURE_ANY_DAY",
                                  "SEAT_MAP"
                                ],
                                "version": "ABC:Version:Ex-1",
                                "specifiedProducts": [
                                  "ybe287"
                                ]
                              }
                            ],
                            "orderLineId": "fc93f175-5518-4a72-9618-43ae68804d4a"
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/badRequest"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/v1/update-order/supplement-products": {
      "post": {
        "tags": [
          "Reserve Offers"
        ],
        "summary": "Update order lines in an order with additional supplement products",
        "description": "Updates a set of order lines on an order with additional supplement products. Only products which does not modify current seating are currently supported.",
        "operationId": "addSupplementProductsToOrder",
        "parameters": [
          {
            "name": "Entur-Distribution-Channel",
            "in": "header",
            "description": "A header containing the distribution channel ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Entur-Pos",
            "in": "header",
            "description": "Point-of-sale identifier.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddSupplementProductsRequest"
              },
              "examples": {
                "default": {
                  "value": {
                    "orderId": "ABCD1234",
                    "offerConfigurations": [
                      {
                        "offerId": "6b166022-bfca-4b92-b093-34a54ab2063e",
                        "orderLineId": "fc93f175-5518-4a72-9618-43ae68804d4a",
                        "selectedProductsConfiguration": [
                          {
                            "count": 2,
                            "selectedProductId": "ybe287"
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderLineIdsAndReservationIds"
                },
                "examples": {
                  "default": {
                    "value": {
                      "orderId": "ABCD1234",
                      "orderLineIds": [
                        "fc93f175-5518-4a72-9618-43ae68804d4a"
                      ],
                      "reservationIds": [
                        "deeb861c-e732-4689-b148-f575f8ca71c1"
                      ],
                      "replacedByOrderLineIds": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/badRequest"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/v1beta/reserve-third-party-products": {
      "post": {
        "tags": [
          "Reserve Third Party Products"
        ],
        "summary": "Add a third party product to an order",
        "description": "Take one or more third party products and add them as order lines to an existing order",
        "operationId": "createThirdPartyProducts",
        "parameters": [
          {
            "name": "Entur-Distribution-Channel",
            "in": "header",
            "description": "A header containing the distribution channel ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Entur-Pos",
            "in": "header",
            "description": "Point-of-sale identifier.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The request for creating third party products.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReserveThirdPartyProductsRequest"
              },
              "examples": {
                "default": {
                  "value": {
                    "orderId": "ABCD1234",
                    "thirdPartyProductConfigurations": [
                      {
                        "name": [
                          {
                            "lang": "eng",
                            "value": "La baguette"
                          }
                        ],
                        "price": {
                          "amount": "50.00",
                          "currency": "NOK",
                          "taxAmount": "2.00"
                        },
                        "quantity": 2,
                        "parameters": {
                          "userProfile": {
                            "name": [
                              {
                                "lang": "eng",
                                "value": "Adult"
                              }
                            ],
                            "userProfileRef": {
                              "id": "EXT:UserProfile:Adult"
                            }
                          }
                        },
                        "productRef": {
                          "id": "EXT:ThirdPartyProduct:Baguette"
                        },
                        "externalReference": "external-ref-5678",
                        "priceContribution": {
                          "amount": "50.00",
                          "taxRate": "0.04",
                          "currency": "NOK",
                          "taxAmount": "2.00"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReserveThirdPartyProductsResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "orderId": "ABCD1234",
                      "orderLineIds": [
                        "09f682e5-5cb4-4a1a-a2d7-168d95164bf6"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/badRequest"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          },
          "500": {
            "$ref": "#/components/responses/internalServerError"
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    }
  },
  "components": {
    "schemas": {
      "Fee": {
        "title": "Fee",
        "required": [
          "amount",
          "currency"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "examples": [
              "100.00"
            ]
          },
          "currency": {
            "type": "string",
            "examples": [
              "NOK"
            ]
          }
        }
      },
      "Option": {
        "title": "Option",
        "required": [
          "id",
          "specifiedProducts",
          "types",
          "version"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "fee": {
            "$ref": "#/components/schemas/Fee"
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ANY_PRODUCT",
                "SAME_PRODUCT",
                "DEPARTURE_SAME_DAY",
                "DEPARTURE_ANY_DAY",
                "SPECIFIED_PRODUCT",
                "SPECIFIED_FARE_CLASS",
                "SEAT_MAP",
                "TRANSFER_TICKET"
              ]
            },
            "default": []
          },
          "legIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "validTo": {
            "type": "string",
            "format": "date-time"
          },
          "version": {
            "type": "string"
          },
          "validFrom": {
            "type": "string",
            "format": "date-time"
          },
          "toFareClass": {
            "type": "string"
          },
          "specifiedProducts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": []
          }
        }
      },
      "RefType": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Value to identify a given resource"
          },
          "version": {
            "type": "string",
            "description": "Optional version for a given resource"
          }
        },
        "description": "Versioned Reference to a resource"
      },
      "ApiError": {
        "title": "ApiError",
        "required": [
          "error",
          "exception",
          "message",
          "path",
          "status",
          "timestamp",
          "title"
        ],
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "description": "Short, human-readable summary of the problem"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "examples": [
              500
            ]
          },
          "message": {
            "type": "string"
          },
          "exception": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "examples": [
              "2025-01-01T12:00:00Z"
            ]
          }
        }
      },
      "Customer": {
        "title": "Customer",
        "required": [
          "customerId",
          "entitlements"
        ],
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "description": "Customer id that will be linked to the order line created from the offer specified",
            "examples": [
              "1234567"
            ]
          },
          "entitlements": {
            "type": "array",
            "description": "The entitlement data for a customer; used if the the offer is created with entitlements",
            "items": {
              "$ref": "#/components/schemas/CustomerEntitlement"
            },
            "default": []
          }
        },
        "description": "A holder for a customer and entitlements used by the customer for the offer"
      },
      "Parameters": {
        "title": "Parameters",
        "type": "object",
        "properties": {
          "userProfile": {
            "$ref": "#/components/schemas/UserProfile"
          }
        },
        "description": "Similar to OrderLine.fareProducts.parameters, but with additional fields for third party products."
      },
      "UserProfile": {
        "title": "UserProfile",
        "required": [
          "name",
          "userProfileRef"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "A human-readable list of names for the product",
            "items": {
              "$ref": "#/components/schemas/TextInLanguage"
            }
          },
          "price": {
            "$ref": "#/components/schemas/PriceWithTax"
          },
          "userProfileRef": {
            "$ref": "#/components/schemas/RefType"
          },
          "priceContribution": {
            "$ref": "#/components/schemas/PriceWithTax"
          }
        }
      },
      "ChangeOption": {
        "title": "ChangeOption",
        "required": [
          "orderId",
          "orderLineOptions"
        ],
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "examples": [
              "ABCD1234"
            ]
          },
          "orderLineOptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineOptions"
            }
          }
        }
      },
      "PriceWithTax": {
        "title": "PriceWithTax",
        "required": [
          "amount",
          "currency",
          "taxAmount"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount including tax amount.",
            "examples": [
              "399.00"
            ]
          },
          "taxCode": {
            "type": "string",
            "description": "Tax code for this tax rate",
            "examples": [
              "12"
            ]
          },
          "taxRate": {
            "type": "string",
            "description": "Tax rate",
            "examples": [
              "12"
            ]
          },
          "currency": {
            "type": "string",
            "description": "Currency",
            "default": "NOK",
            "examples": [
              "NOK"
            ]
          },
          "taxAmount": {
            "type": "string",
            "description": "Tax amount",
            "examples": [
              "36.27"
            ]
          }
        },
        "description": "Price with included tax amounts and an optional rate."
      },
      "TextInLanguage": {
        "required": [
          "lang",
          "value"
        ],
        "type": "object",
        "properties": {
          "lang": {
            "type": "string",
            "description": "The language of the text"
          },
          "value": {
            "type": "string",
            "description": "The value of the text in the given language"
          }
        },
        "description": "Contains a text value in a given language",
        "x-examples": {
          "example-1": {
            "lang": "nob",
            "value": "Bergen Stasjon"
          }
        }
      },
      "IdAndVersionRef": {
        "title": "IdAndVersionRef",
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Id reference to an external entity"
          },
          "version": {
            "type": "string",
            "description": "Optional version reference to an external entity"
          }
        },
        "description": "A holder for an id and version combination"
      },
      "OrderLineOptions": {
        "title": "OrderLineOptions",
        "required": [
          "options",
          "orderLineId"
        ],
        "type": "object",
        "properties": {
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "orderLineId": {
            "type": "string",
            "examples": [
              "5d3e9d2c-f9ab-4dd0-a735-100886278e0b"
            ]
          }
        },
        "description": "Holder for possible change options for a given order line"
      },
      "OfferConfiguration": {
        "title": "OfferConfiguration",
        "required": [
          "offerId"
        ],
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "description": "Deprecated: Please use either selectedTravellerIds or multiple offer configurations, depending on your use case. Old description: The number of instances of the salespackage(s), represented in the offer, and customer combination one would like to purchase. Default value = 1. If set to anything other than 1 when orderLineId is set, the endpoint will return 400 bad request.",
            "format": "int32",
            "deprecated": true,
            "default": 1
          },
          "offerId": {
            "type": "string",
            "description": "The id of the offer that is used",
            "format": "uuid",
            "examples": [
              "5d3e9d2c-f9ab-4dd0-a735-100886278e0b"
            ]
          },
          "customers": {
            "type": "array",
            "description": "Customers with optional entitlement data; used to link travellers to order line and when offers are created with entitlements",
            "items": {
              "$ref": "#/components/schemas/Customer"
            },
            "default": []
          },
          "customerIds": {
            "type": "array",
            "description": "Deprecated: Use customers to supply customer ids",
            "deprecated": true,
            "items": {
              "type": "string"
            },
            "default": []
          },
          "orderLineId": {
            "type": "string",
            "description": "Please use /change-order-line instead. If replacing an order line, this is the id of the order line to replace",
            "deprecated": true
          },
          "externalReference": {
            "type": "string",
            "description": "External reference to an order line. Only used by external operators to identify order lines created by OfferConfigurations"
          },
          "customerEntitlement": {
            "$ref": "#/components/schemas/CustomerEntitlement"
          },
          "distributionDetails": {
            "$ref": "#/components/schemas/DistributionDetails"
          },
          "selectableProductIds": {
            "type": "array",
            "description": "A list of ids for selected products. Duplicates are only supported for SupplementProducts which does not modify seating assignments for the PreassignedFareProduct",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "selectedTravellerIds": {
            "type": "array",
            "description": "This field is used to specify which travellers will be included in the use of this offer. This field cannot be used in combination with count. It is validated against the travellers identified in the travellerMappings property of the selected Offer, as well as the legal number of UserProfiles per compartment when reserving a group product. When reserving a group product, validation is performed against the valid number of UserProfiles per compartment. When reserving regular products, a number of order lines will be made, corresponding to the number of selectedTravellerIds. Each order line will have one of the selectedTravellerIds.",
            "items": {
              "type": "string"
            },
            "default": []
          }
        },
        "description": "The configuration-holder for an offer configuration"
      },
      "CustomerEntitlement": {
        "title": "CustomerEntitlement",
        "required": [
          "entitlementProductRef"
        ],
        "type": "object",
        "properties": {
          "contractId": {
            "type": "string",
            "description": "The id of a benefit-contract that gives a customer an entitlement",
            "format": "uuid",
            "examples": [
              "5d3e9d2c-f9ab-4dd0-a735-100886278e0b"
            ]
          },
          "entitlementProductRef": {
            "$ref": "#/components/schemas/IdAndVersionRef"
          },
          "externalEntitlementRef": {
            "$ref": "#/components/schemas/IdAndVersionRef"
          }
        },
        "description": "A holder for a customers entitlements"
      },
      "DistributionDetails": {
        "title": "DistributionDetails",
        "type": "object",
        "properties": {
          "customerAccountRef": {
            "$ref": "#/components/schemas/RefType"
          },
          "fulfillmentMethodRef": {
            "$ref": "#/components/schemas/RefType"
          },
          "distributionHolderCustomerId": {
            "type": "string",
            "description": "The Entur customer id that will be linked to the distribution of the order line created",
            "examples": [
              "1234556"
            ]
          },
          "typeOfTravelDocumentToIssueRef": {
            "$ref": "#/components/schemas/RefType"
          }
        },
        "description": "Wrapper for references connected to distribution of travel rights and/or tickets"
      },
      "ReplacedOrderLineIds": {
        "title": "ReplacedOrderLineIds",
        "required": [
          "originalOrderLineIds",
          "replacedByOrderLineIds"
        ],
        "type": "object",
        "properties": {
          "originalOrderLineIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "5d3e9d2c-f9ab-4dd0-a735-100886278e0b"
              ]
            ]
          },
          "replacedByOrderLineIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "818d3ef9-925e-493f-bc21-8763314749ec",
                "79006e6b-6c72-48b6-a9e6-ddadec19cbca"
              ]
            ]
          }
        },
        "description": "A holder that combines orginal order line ids with those that replaces them"
      },
      "ReserveOffersRequest": {
        "title": "ReserveOffersRequest",
        "required": [
          "offerConfigurations"
        ],
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "description": "The offer to add the order to. If no orderId is specified, a new order is created",
            "examples": [
              "ABCD1234"
            ]
          },
          "offerConfigurations": {
            "type": "array",
            "description": "A list of offer configurations selected for purchase",
            "items": {
              "$ref": "#/components/schemas/OfferConfiguration"
            }
          }
        },
        "description": "The input-holder for reserving offers and add them to an existing order."
      },
      "TPPTravelSpecification": {
        "type": "object",
        "properties": {
          "aimedEndTime": {
            "type": "string",
            "description": "Timestamp used when determining the end of the product's validity.",
            "format": "date-time",
            "examples": [
              "2025-01-01T12:00:00Z"
            ]
          },
          "aimedStartTime": {
            "type": "string",
            "description": "Timestamp used when determining the beginning of the product's validity.",
            "format": "date-time",
            "examples": [
              "2025-01-01T12:00:00Z"
            ]
          }
        },
        "description": "Optional travel information for the order lines to be created"
      },
      "ChangeOrderLinesRequest": {
        "title": "ChangeOrderLinesRequest",
        "required": [
          "offerConfigurations",
          "orderId",
          "refundPriceDifference"
        ],
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "description": "The order to add the offer(s) to",
            "examples": [
              "ABCD1234"
            ]
          },
          "offerConfigurations": {
            "type": "array",
            "description": "A list of change offer configurations selected for purchase",
            "items": {
              "$ref": "#/components/schemas/ChangeOrderLinesConfiguration"
            }
          },
          "refundPriceDifference": {
            "type": "boolean",
            "description": "Experimental value that is used to refund the price difference between the original purchase and the change, if the change is cheaper than the original product.",
            "default": false
          }
        },
        "description": "The holder for a change offer configuration."
      },
      "AddSupplementProductsRequest": {
        "title": "AddSupplementProductsRequest",
        "required": [
          "offerConfigurations",
          "orderId"
        ],
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "description": "The order to add the supplement product(s) to",
            "examples": [
              "ABCD1234"
            ]
          },
          "offerConfigurations": {
            "type": "array",
            "description": "A list of supplement product configurations selected for purchase",
            "items": {
              "$ref": "#/components/schemas/AddSupplementProductsConfiguration"
            }
          }
        },
        "description": "The holder for an add supplement product configuration."
      },
      "SelectedProductConfiguration": {
        "title": "SelectedProductConfiguration",
        "required": [
          "count",
          "selectedProductId"
        ],
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "description": "The number of times to add said product. Count will only be considered on a fare product level. Default 1",
            "format": "int32",
            "default": 1
          },
          "selectedProductId": {
            "type": "string",
            "description": "A selectable product id."
          }
        },
        "description": "Configuration for a selectable product from an offer"
      },
      "ChangeOrderLinesConfiguration": {
        "title": "ChangeOrderLinesConfiguration",
        "required": [
          "offerId",
          "orderLineId"
        ],
        "type": "object",
        "properties": {
          "offerId": {
            "type": "string",
            "description": "The id of the offer that is used",
            "format": "uuid",
            "examples": [
              "5d3e9d2c-f9ab-4dd0-a735-100886278e0b"
            ]
          },
          "customers": {
            "type": "array",
            "description": "Customers with optional entitlement data; used to link travellers to order line and when offers are created with entitlements",
            "items": {
              "$ref": "#/components/schemas/Customer"
            },
            "default": []
          },
          "orderLineId": {
            "type": "string",
            "description": "The id of the OrderLine to replace. Multiple offer configurations may contain the same orderLineId if replacing the OrderLine with multiple offer configurations. In that case, selectedOrderLineIds must also be equal.",
            "examples": [
              "5d3e9d2c-f9ab-4dd0-a735-100886278e0b"
            ]
          },
          "externalReference": {
            "type": "string",
            "description": "External reference to an order line. Only used by external operators to identify order lines created by OfferConfigurations"
          },
          "distributionDetails": {
            "$ref": "#/components/schemas/DistributionDetails"
          },
          "selectableProductIds": {
            "type": "array",
            "description": "A list of ids for selected products. Duplicates are only supported for SupplementProducts which does not modify seating assignments for the PreassignedFareProduct",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "selectedOrderLineIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": [],
            "examples": [
              [
                "5d3e9d2c-f9ab-4dd0-a735-100886278e0b"
              ]
            ]
          },
          "selectedTravellerIds": {
            "type": "array",
            "description": "This field is used to specify which travellers will be included in the use of this offer. It is validated against the travellers identified in the travellerMappings property of the selected Offer, as well as the legal number of UserProfiles per compartment when reserving a group product. When reserving a group product, validation is performed against the valid number of UserProfiles per compartment. When reserving regular products, a number of order lines will be made, corresponding to the number of selectedTravellerIds. Each order line will have one of the selectedTravellerIds.",
            "items": {
              "type": "string"
            },
            "default": []
          }
        },
        "description": "The configuration-holder for an offer configuration"
      },
      "OrderLineIdsAndReservationIds": {
        "title": "OrderLineIdsAndReservationIds",
        "required": [
          "orderId",
          "orderLineIds",
          "replacedByOrderLineIds",
          "reservationIds"
        ],
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "examples": [
              "ABCD1234"
            ]
          },
          "orderLineIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "b0c85195-d932-4cb3-88c8-4674a315954a"
              ]
            ]
          },
          "reservationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "e9dcef93-984c-4b49-a244-7c9fdfb60f6f"
              ]
            ]
          },
          "replacedByOrderLineIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReplacedOrderLineIds"
            },
            "default": []
          }
        },
        "description": "A wrapper that holds the resulting ids for newly created order lines, reservations and possible replacement order lines"
      },
      "ThirdPartyProductConfiguration": {
        "required": [
          "name",
          "price",
          "priceContribution",
          "productRef",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "A human-readable list of names for the product",
            "items": {
              "$ref": "#/components/schemas/TextInLanguage"
            }
          },
          "price": {
            "$ref": "#/components/schemas/PriceWithTax"
          },
          "quantity": {
            "minimum": 1,
            "type": "integer",
            "description": "The amount of equal third party products to add to the order",
            "default": 1
          },
          "parameters": {
            "$ref": "#/components/schemas/Parameters"
          },
          "productRef": {
            "$ref": "#/components/schemas/RefType"
          },
          "authorityId": {
            "type": "string",
            "description": "Owner of the product.",
            "examples": [
              "ENT:Authority:ENT"
            ]
          },
          "customerIds": {
            "type": "array",
            "description": "Entur customer ids that will be linked to the order line created",
            "items": {
              "type": "string",
              "examples": [
                "1234565"
              ]
            },
            "default": []
          },
          "externalReference": {
            "type": "string",
            "description": "External reference to an order line. Only used by external operators to identify order lines created by ThirdPartyProductConfigurations."
          },
          "priceContribution": {
            "$ref": "#/components/schemas/PriceWithTax"
          },
          "clientProvidedData": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "A map of client provided data to be placed on the order line. No validation is performed, and no guarantee can be made about its contents."
          },
          "distributionDetails": {
            "$ref": "#/components/schemas/DistributionDetails"
          },
          "travelSpecification": {
            "$ref": "#/components/schemas/TPPTravelSpecification"
          }
        },
        "description": "The request object used to create a third party product"
      },
      "ReserveThirdPartyProductsRequest": {
        "required": [
          "orderId",
          "thirdPartyProductConfigurations"
        ],
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "description": "The orderId the third party products belongs to.",
            "examples": [
              "ABCD1234"
            ]
          },
          "thirdPartyProductConfigurations": {
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ThirdPartyProductConfiguration"
            }
          }
        },
        "description": "The requested list of third party products to create and add to the order."
      },
      "ReserveThirdPartyProductsResponse": {
        "required": [
          "orderId",
          "orderLineIds"
        ],
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "examples": [
              "ABCD1234"
            ]
          },
          "orderLineIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "717b54f7-b573-42c7-a807-5f0c09c0eb0a"
              ]
            ]
          }
        },
        "description": "The order lines created when reserving third party product on the given order"
      },
      "AddSupplementProductsConfiguration": {
        "title": "AddSupplementProductsConfiguration",
        "required": [
          "offerId",
          "orderLineId",
          "selectedProductsConfiguration"
        ],
        "type": "object",
        "properties": {
          "offerId": {
            "type": "string",
            "description": "The id of the offer that is used",
            "format": "uuid",
            "examples": [
              "5d3e9d2c-f9ab-4dd0-a735-100886278e0b"
            ]
          },
          "customers": {
            "type": "array",
            "description": "Customers with optional entitlement data; used to link travellers to order line and when offers are created with entitlements",
            "items": {
              "$ref": "#/components/schemas/Customer"
            },
            "default": []
          },
          "orderLineId": {
            "type": "string",
            "description": "The id of the order line to add supplement products to",
            "examples": [
              "5d3e9d2c-f9ab-4dd0-a735-100886278e0b"
            ]
          },
          "selectedProductsConfiguration": {
            "type": "array",
            "description": "A list of ids and counts for selected supplement product configurations. Count is only considered for fare products.",
            "items": {
              "$ref": "#/components/schemas/SelectedProductConfiguration"
            },
            "default": []
          }
        },
        "description": "The configuration-holder for an offer configuration"
      }
    },
    "responses": {
      "conflict": {
        "description": "Conflict",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "notFound": {
        "description": "Not Found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "forbidden": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "badRequest": {
        "description": "Bad Request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "internalServerError": {
        "description": "Internal Server Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      }
    },
    "parameters": {
      "dciHeader": {
        "name": "Entur-Distribution-Channel",
        "in": "header",
        "description": "A header containing the distribution channel ID.",
        "required": true,
        "style": "simple",
        "explode": false,
        "schema": {
          "type": "string"
        }
      },
      "posHeader": {
        "name": "Entur-Pos",
        "in": "header",
        "description": "Point-of-sale identifier.",
        "required": true,
        "style": "simple",
        "explode": false,
        "schema": {
          "type": "string"
        }
      },
      "ET-Client-Name": {
        "in": "header",
        "name": "ET-Client-Name",
        "description": "\nEntur Client Header.\nIt is required that all consumers identify themselves by using this header.\nEntur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.\nThe structure of ET-Client-Name should be: `<company>-<application>` for companies, and `<personal name>-<application>` for individuals.",
        "schema": {
          "type": "string"
        }
      },
      "X-Correlation-Id": {
        "in": "header",
        "name": "X-Correlation-Id",
        "description": "Correlation id",
        "schema": {
          "type": "string"
        }
      }
    }
  }
}