> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bahnexpress.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# List orders

> Returns orders from newest to oldest.



## OpenAPI

````yaml /openapi.yaml get /v2/orders
openapi: 3.1.2
info:
  title: Bahn Customer API
  version: 2.0.0-draft
  summary: Create and follow vehicle transport orders.
  description: |
    Create vehicle transport orders and read their current state.
  contact:
    name: Bahn API support
    email: support@bahnexpress.com
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://sandbox.api.bahnexpress.fi
    description: Customer sandbox
  - url: https://api.bahnexpress.fi
    description: Production
security:
  - oauth2:
      - orders:read
      - orders:write
tags:
  - name: Authentication
    description: Create an access token for the selected environment.
  - name: Prices
    description: Check the current price for a route.
  - name: Orders
    description: Create, read, change, and cancel orders.
  - name: Files
    description: Upload and read order files.
  - name: Inspections
    description: Get vehicle inspection reports.
  - name: Tracking
    description: Get the current location for each order item.
  - name: Reports
    description: Get order report rows.
  - name: Sandbox
    description: Apply deterministic scenarios in the customer sandbox.
  - name: Webhooks
    description: Receive order change events from Bahn.
paths:
  /v2/orders:
    get:
      tags:
        - Orders
      summary: List orders
      description: Returns orders from newest to oldest.
      operationId: listOrders
      parameters:
        - $ref: '#/components/parameters/RequestId'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/PageSize'
        - name: status
          in: query
          description: Return only orders with this status.
          schema:
            $ref: '#/components/schemas/OrderStatus'
        - name: customer_reference
          in: query
          description: Return orders with this exact customer reference.
          schema:
            type: string
            minLength: 1
            maxLength: 255
      responses:
        '200':
          description: The order page.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderPage'
              example:
                data:
                  - id: ord_01k1a2b3c4d5e6f7g8h9j0k1m2
                    ordered_for: null
                    customer_reference: PO-2026-1042
                    status: accepted
                    pickup_readiness: preparing
                    created_at: '2026-07-30T13:00:00Z'
                    updated_at: '2026-07-30T13:00:00Z'
                    primary_vehicle:
                      vin: WBA00000000000001
                      registration_number: null
                    pickup_address: Teollisuuskatu 1, 00510 Helsinki, Finland
                    delivery_address: Hatanpään valtatie 24, 33100 Tampere, Finland
                    actual_pickup_at: null
                    actual_delivery_at: null
                next_cursor: null
                has_more: false
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          $ref: '#/components/responses/ServerError'
      security:
        - oauth2:
            - orders:read
components:
  parameters:
    RequestId:
      name: X-Request-Id
      in: header
      required: false
      description: A caller-supplied request identifier for support.
      schema:
        type: string
        minLength: 1
        maxLength: 255
    Cursor:
      name: cursor
      in: query
      description: The opaque cursor from the previous response.
      schema:
        type: string
    PageSize:
      name: page_size
      in: query
      description: The number of resources to return.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 50
  schemas:
    OrderStatus:
      type: string
      description: >
        Overall order state derived from all vehicles.

        accepted means no vehicle is in transit; in_transit means transport is
        underway;

        delivered means every required vehicle is delivered; cancelled means the
        order was cancelled.
      enum:
        - accepted
        - in_transit
        - delivered
        - cancelled
    OrderPage:
      description: Cursor-paginated list of order summaries.
      type: object
      additionalProperties: false
      required:
        - data
        - next_cursor
        - has_more
      properties:
        data:
          type: array
          description: Orders in this page.
          items:
            $ref: '#/components/schemas/OrderListItem'
        next_cursor:
          type:
            - string
            - 'null'
          description: Opaque cursor for the next page, or null after the final page.
        has_more:
          type: boolean
          description: Whether another page is available.
    OrderListItem:
      description: Compact order summary for list and search views.
      type: object
      additionalProperties: false
      required:
        - id
        - ordered_for
        - customer_reference
        - status
        - pickup_readiness
        - created_at
        - updated_at
        - primary_vehicle
        - pickup_address
        - delivery_address
        - actual_pickup_at
        - actual_delivery_at
      properties:
        id:
          $ref: '#/components/schemas/OrderId'
          description: Stable Bahn order ID.
        ordered_for:
          $ref: '#/components/schemas/NullableOrderedFor'
          description: Represented business, or null for a direct customer order.
        customer_reference:
          type:
            - string
            - 'null'
          description: Customer reference supplied with the order.
        status:
          $ref: '#/components/schemas/OrderStatus'
          description: Current overall order state.
        pickup_readiness:
          $ref: '#/components/schemas/PickupReadiness'
          description: Current seller readiness for pickup.
        created_at:
          type: string
          format: date-time
          description: Time when Bahn accepted the order.
        updated_at:
          type: string
          format: date-time
          description: Time when Bahn last updated the order.
        primary_vehicle:
          type: object
          description: Identifiers for the primary vehicle.
          additionalProperties: false
          required:
            - vin
            - registration_number
          properties:
            vin:
              type:
                - string
                - 'null'
              description: Primary vehicle VIN, when available.
            registration_number:
              type:
                - string
                - 'null'
              description: Primary vehicle registration number, when available.
        pickup_address:
          type: string
          description: Human-readable pickup address for list display.
        delivery_address:
          type: string
          description: Human-readable delivery address for list display.
        actual_pickup_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Actual primary-vehicle pickup time, or null before pickup.
        actual_delivery_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Actual primary-vehicle delivery time, or null before delivery.
    Problem:
      description: A machine-readable API error in RFC 9457 problem-details format.
      type: object
      additionalProperties: false
      required:
        - type
        - title
        - status
        - code
        - instance
        - request_id
      properties:
        type:
          type: string
          format: uri
          description: A stable URI for the problem type.
        title:
          type: string
          description: A short problem summary.
        status:
          type: integer
          minimum: 400
          maximum: 599
          description: The HTTP status code returned with this problem.
        code:
          $ref: '#/components/schemas/ProblemCode'
          description: Stable code for application logic and retry decisions.
        detail:
          type: string
          description: A human-readable explanation of this occurrence.
        instance:
          type: string
          description: The request path that produced the problem.
        request_id:
          type: string
          description: Request identifier to include when you contact Bahn support.
        errors:
          type: array
          description: >-
            Field-level validation errors, when the problem concerns request
            input.
          items:
            $ref: '#/components/schemas/FieldError'
    OrderId:
      type: string
      pattern: ^ord_[a-z0-9]+$
      description: Stable Bahn order identifier used in every order resource path.
    NullableOrderedFor:
      description: >-
        Represented business, or null when the order belongs to the direct API
        customer.
      oneOf:
        - $ref: '#/components/schemas/OrderedFor'
        - type: 'null'
    PickupReadiness:
      type: string
      description: >-
        pending before Bahn can confirm pickup availability, preparing while
        confirmation is possible, and confirmed after Bahn confirms it.
      enum:
        - pending
        - preparing
        - confirmed
    ProblemCode:
      type: string
      description: A stable machine code for client decisions.
      enum:
        - validation_error
        - authentication_failed
        - permission_denied
        - resource_not_found
        - idempotency_conflict
        - revision_conflict
        - order_not_cancellable
        - order_not_updateable
        - business_rule_violation
        - ordered_for_required
        - ordered_for_not_allowed
        - ordered_for_customer_not_found
        - file_too_large
        - request_too_large
        - scenario_not_allowed
        - internal_error
    FieldError:
      description: One invalid request field.
      type: object
      additionalProperties: false
      required:
        - path
        - code
        - message
      properties:
        path:
          type: string
          description: Dot-separated path to the invalid field.
        code:
          type: string
          description: Stable validation code for this field error.
        message:
          type: string
          description: Human-readable reason why the field is invalid.
    OrderedFor:
      description: Business represented by a platform ordering channel.
      type: object
      additionalProperties: false
      required:
        - country_code
        - business_id
      properties:
        country_code:
          type: string
          pattern: ^[A-Z]{2}$
          description: The ISO 3166-1 alpha-2 country code of the Bahn customer.
        business_id:
          type: string
          minLength: 1
          maxLength: 100
          description: The official business ID of the Bahn customer.
  responses:
    BadRequest:
      description: The request syntax or shape is invalid.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://api.bahnexpress.fi/problems/validation-error
            title: The request is invalid.
            status: 400
            code: validation_error
            detail: One or more fields are invalid.
            instance: /v2/orders
            request_id: req_01k1a2b3c4d5e6f7g8h9j0k1m2
            errors:
              - path: items.0.vin
                code: invalid_length
                message: The VIN must contain 17 characters.
    Unauthorized:
      description: Authentication failed.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Forbidden:
      description: The token lacks the required scope or customer access.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    ServerError:
      description: Bahn could not complete the request.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth 2.0 client credentials.
      flows:
        clientCredentials:
          tokenUrl: /oauth2/token
          scopes:
            orders:read: Read customer orders.
            orders:write: Check prices, upload files, and change customer orders.
            reports:read: Read customer order reports.
            test:write: Apply customer sandbox scenarios.

````