openapi: 3.2.0 info: title: Entur Inventory Client API version: 2026.09.0 contact: name: Entur Team Varelager description: 'Operations tagged Inventory Client across 2 of this provider''s published API definitions: entur-inventory-openapi.json, entur-inventory-openapi.yml. Each path carries the servers of the definition it was published in.' servers: - url: https://api.entur.io/inventory security: - bearer-key: [] tags: - name: Inventory Client paths: /v1/reservations/{reservationId}/reservation-lines: parameters: - $ref: '#/components/parameters/ET-Client-Name' - $ref: '#/components/parameters/X-Correlation-Id' put: tags: - Inventory Client summary: Update all reservation lines description: Update all reservation lines on a reservation operationId: updateReservationLines parameters: - name: reservationId in: path description: Id of the reservation to update lines on required: true style: simple explode: false schema: type: integer format: int64 requestBody: content: application/json: schema: type: array description: List of updated reservation line specifications items: $ref: '#/components/schemas/UpdatedReservationLine' example: - id: 1 productId: ENT:Product:1 amount: 2 status: CONFIRMED required: true responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/ReservationLineResponseV1' example: - id: 1 productId: ENT:Product:1 amount: 2 created: '2024-01-01T10:00:00Z' changed: '2024-01-01T10:00:00Z' status: CONFIRMED post: tags: - Inventory Client summary: Add reservation line to reservation description: Add a reservation line to an existing reservation. operationId: addReservationLine parameters: - name: reservationId in: path description: Id of the reservation to add lines to required: true style: simple explode: false schema: type: integer format: int64 requestBody: content: application/json: schema: $ref: '#/components/schemas/ReservationLine' example: productId: ENT:Product:1 amount: 2 status: CONFIRMED required: true responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/ReservationLineResponseV1' example: id: 1 productId: ENT:Product:1 amount: 2 created: '2024-01-01T10:00:00Z' changed: '2024-01-01T10:00:00Z' status: CONFIRMED servers: - url: https://api.entur.io/inventory /v1/reservations/{reservationId}/reservation-lines/{reservationLineId}: parameters: - $ref: '#/components/parameters/ET-Client-Name' - $ref: '#/components/parameters/X-Correlation-Id' put: tags: - Inventory Client summary: Update reservation line description: Update a single reservation line operationId: updateReservationLine parameters: - name: reservationId in: path description: Id of the reservation to update a reservation line on. required: true style: simple explode: false schema: type: integer format: int64 - name: reservationLineId in: path description: Id of the reservation line to update. required: true style: simple explode: false schema: type: integer format: int64 requestBody: content: application/json: schema: $ref: '#/components/schemas/ReservationLine' required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ReservationLineResponseV1' servers: - url: https://api.entur.io/inventory /v1/stock/query: parameters: - $ref: '#/components/parameters/ET-Client-Name' - $ref: '#/components/parameters/X-Correlation-Id' post: tags: - Inventory Client summary: Get available stock for a tripPattern description: Calculates available stock between a set of stopPlaces on separate DatedServiceJourneys operationId: multiStockQuery requestBody: content: application/json: schema: type: array items: $ref: '#/components/schemas/StockQuery' required: true responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/MultiStockResponse' servers: - url: https://api.entur.io/inventory /v1/reservations: parameters: - $ref: '#/components/parameters/ET-Client-Name' - $ref: '#/components/parameters/X-Correlation-Id' get: tags: - Inventory Client summary: Get reservations description: Retrieves all registered reservations for an original dated service journey operationId: getReservationsByDeparture parameters: - name: datedServiceJourney in: query description: The original dated service journey to find reservations for. required: true style: form explode: true schema: type: string - name: createdAfter in: query description: Created after required: false style: form explode: true schema: type: string format: date-time example: '2019-10-09T11:57:02Z' - name: changedAfter in: query description: Changed after required: false style: form explode: true schema: type: string format: date-time example: '2019-10-09T11:57:02Z' - name: origin in: query description: origin required: false style: form explode: true schema: type: string example: Oslo - name: destination in: query description: destination required: false style: form explode: true schema: type: string example: Bergen - name: product in: query description: product required: false style: form explode: true schema: type: string example: Minipris:Shadow - name: status in: query description: status required: false style: form explode: true schema: type: string enum: - DRAFT - CONFIRMED - EXPIRED - CANCELLED - DRAFT_CANCELLATION - CONFIRMED_CANCELLATION - RELEASING example: CONFIRMED - name: excludeInactiveReservations in: query description: Exclude reservations that are not DRAFT nor CONFIRMED, defaults to false required: false style: form explode: true schema: type: boolean default: false example: true responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/ReservationResponseV1' post: tags: - Inventory Client summary: Reserve stock description: Reserves some amount of stock for use operationId: createReservation parameters: - name: ownerOrganisationId in: query description: Not applicable for Partners/operators. Used to filter between operator organisations required: false style: form explode: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/Reservation' required: true responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/ReservationResponseV1' servers: - url: https://api.entur.io/inventory /v1/reservations/batch: parameters: - $ref: '#/components/parameters/ET-Client-Name' - $ref: '#/components/parameters/X-Correlation-Id' post: tags: - Inventory Client summary: Reserve stock for multiple legs description: Reserves some amount of stock for use operationId: createMultiReservation parameters: - name: ownerOrganisationId in: query description: Not applicable for Partners/operators. Used to filter between operator organisations required: false style: form explode: true schema: type: string requestBody: content: application/json: schema: type: array items: $ref: '#/components/schemas/Reservation' required: true responses: '201': description: Created content: application/json: schema: type: array items: $ref: '#/components/schemas/ReservationResponseV1' servers: - url: https://api.entur.io/inventory /v1/stock: parameters: - $ref: '#/components/parameters/ET-Client-Name' - $ref: '#/components/parameters/X-Correlation-Id' get: tags: - Inventory Client summary: Get available stock description: Calculates available stock between two stops of a dated service journey operationId: stockForJourney parameters: - name: datedServiceJourney in: query required: true style: form explode: true schema: type: string - name: origin in: query required: true style: form explode: true schema: type: string - name: destination in: query required: true style: form explode: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/StockResponseV1' servers: - url: https://api.entur.io/inventory /v1/reservations/{id}: parameters: - $ref: '#/components/parameters/ET-Client-Name' - $ref: '#/components/parameters/X-Correlation-Id' get: tags: - Inventory Client summary: Get reservation by id description: Retrieves a registered reservation. operationId: getReservation parameters: - name: id in: path description: Id of the reservation to get required: true style: simple explode: false schema: type: integer format: int64 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ReservationResponseV1' servers: - url: https://api.entur.io/inventory components: schemas: ReservationLine: type: object description: Updated spec of reservation line properties: productId: type: string amount: type: integer format: int32 status: type: string enum: - DRAFT - CONFIRMED - EXPIRED - CANCELLED - DRAFT_CANCELLATION - CONFIRMED_CANCELLATION - RELEASING required: - amount - productId - status SimpleProductResponseV1: allOf: - $ref: '#/components/schemas/StockComponentResponseV1' - type: object properties: products: type: array items: type: string leftInQuota: type: integer format: int32 required: - leftInQuota - products ProductCollectionResponseV1: allOf: - $ref: '#/components/schemas/NestingComponentResponseV1' - type: object properties: selectionRule: type: string enum: - COMBINED - SINGLE consumptionRule: type: string enum: - DIRECT - BY_PRIORITY directionRule: type: string enum: - FROM_RIGHT - FROM_LEFT components: type: array items: oneOf: - $ref: '#/components/schemas/ProductCollectionResponseV1' - $ref: '#/components/schemas/ProductResponseV1' required: - aggregatedAvailability - components - consumptionRule - directionRule - nestingGroup - priority - selectionRule MultiStockResponse: type: object properties: origin: type: string destination: type: string spannedDatedServiceJourneys: type: array items: type: string reservableStock: type: array items: oneOf: - $ref: '#/components/schemas/NestingComponentResponseV1' - $ref: '#/components/schemas/SimpleProductResponseV1' - $ref: '#/components/schemas/ProductCollectionResponseV1' - $ref: '#/components/schemas/ProductResponseV1' required: - destination - origin - reservableStock - spannedDatedServiceJourneys StockResponseV1: type: object properties: datedServiceJourney: type: string origin: type: string destination: type: string organisationId: type: string stock: type: array items: oneOf: - $ref: '#/components/schemas/NestingComponentResponseV1' - $ref: '#/components/schemas/SimpleProductResponseV1' - $ref: '#/components/schemas/ProductCollectionResponseV1' - $ref: '#/components/schemas/ProductResponseV1' required: - datedServiceJourney - destination - organisationId - origin - stock UpdatedReservationLine: type: object description: ' Updated reservation line specification' properties: id: type: integer format: int64 productId: type: string amount: type: integer format: int32 status: type: string enum: - DRAFT - CONFIRMED - EXPIRED - CANCELLED - DRAFT_CANCELLATION - CONFIRMED_CANCELLATION - RELEASING required: - amount - id - productId - status StockQuery: type: object properties: datedServiceJourney: type: string origin: type: string destination: type: string required: - datedServiceJourney - destination - origin Reservation: type: object description: Specifies what should be reserved, in what quantity, and across what distance properties: origin: type: string destination: type: string datedServiceJourneyId: type: string orderId: type: string reservationLines: type: array items: $ref: '#/components/schemas/ReservationLine' required: - datedServiceJourneyId - destination - origin - reservationLines StockComponentResponseV1: {} ReservationResponseV1: type: object properties: id: type: integer format: int64 origin: type: string destination: type: string datedServiceJourney: type: string created: type: string format: date-time changed: type: string format: date-time createdBy: type: string orderId: type: string reservationLines: type: array items: $ref: '#/components/schemas/ReservationLineResponseV1' required: - changed - created - createdBy - datedServiceJourney - destination - id - origin - reservationLines ProductResponseV1: allOf: - $ref: '#/components/schemas/NestingComponentResponseV1' - type: object properties: id: type: integer format: int32 products: type: array items: type: string leftInQuota: type: integer format: int32 purchaseWindowStart: type: string format: date-time purchaseWindowStop: type: string format: date-time closedBy: type: array items: type: integer format: int32 required: - aggregatedAvailability - closedBy - id - leftInQuota - nestingGroup - priority - products ReservationLineResponseV1: type: object properties: id: type: integer format: int64 productId: type: string amount: type: integer format: int32 created: type: string format: date-time changed: type: string format: date-time status: type: string enum: - DRAFT - CONFIRMED - EXPIRED - CANCELLED - DRAFT_CANCELLATION - CONFIRMED_CANCELLATION - RELEASING required: - amount - changed - created - id - productId - status NestingComponentResponseV1: allOf: - $ref: '#/components/schemas/StockComponentResponseV1' - type: object properties: aggregatedAvailability: type: integer format: int32 nestingGroup: type: string priority: type: integer format: int32 required: - aggregatedAvailability - nestingGroup - priority parameters: X-Correlation-Id: name: X-Correlation-Id in: header description: Correlation id required: false style: simple explode: false schema: type: string ET-Client-Name: name: ET-Client-Name in: header description: 'Entur Client Header. It is required that all consumers identify themselves by using this header. Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers. The structure of ET-Client-Name should be: `-`.' required: false style: simple explode: false schema: type: string securitySchemes: bearer-key: type: http scheme: Bearer bearerFormat: jwt x-refined-from: - entur-inventory-openapi.json - entur-inventory-openapi.yml