SJ

SJ API

SJ API as documented publicly: 17 operations. Contract generated from the documentation by API Evangelist (2026-10-15); not the provider's own document.

Operations 17

POST /$TENANT_ID/oauth2/v2.0/token POST /$TENANT_ID/oauth2/v2.0/token #
GET /Booking Quick Start Guide for SJ Reseller API #
POST /Booking Quick Start Guide for SJ Reseller API #
POST /Offers Quick Start Guide for SJ Reseller API #
GET /availabilities GET /availabilities can be called in an offer or booking context to retrieve seat availability. #
GET /availabilities/{availabilitieid} GET /availabilities/place-map returns seat‑map information for a booking and reservation. #
GET /booking GET /booking retrieves a booking, including any provisional fulfillmentId. #
POST /booking POST /booking creates a provisional booking with required externalRef and passenger information. #
GET /bookings/{bookingid} GET /bookings/{bookingId} returns the booking details, including fulfillmentId. #
POST /bookings/{bookingid}/fulfillment POST /bookings/{bookingId}/fulfillment creates a fulfillment for a booking (asynchronous, returns 202). #
POST /contacts/{contactid} Search for an SJ customer by e-mail address. #
POST /exchange-offers POST /exchange-offers creates an exchange offer for a booking. #
PATCH /exchange-operations Optional, does not change any states #
POST /exchange-operations POST /exchange-operations creates a provisional exchange operation and new provisional booking parts. #
GET /fulfillments/{fulfillmentid} GET /fulfillments/{fulfillmentId} retrieves fulfillment details such as control number and Aztec code. #
POST /offers Quick Start Guide for SJ Reseller API #
PATCH /passenger PATCH /passenger updates passenger details in a provisional booking. #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/sj-se:sj-se-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

sj-se-openapi-generated.yml Raw ↑
openapi: 3.1.0
info:
  title: SJ API
  version: '2026-10-15'
  description: 'GENERATED FROM DOCUMENTATION by API Evangelist on 2026-10-15: 17 operation(s) read from 3 public documentation page(s) (each operation
    names its page in x-source). This is not the provider''s published contract; SJ has published no machine-readable contract that the pipeline
    could find. Engine: local.'
  x-evidence-tiers:
    code-example: 1
    documentation: 16
    pages-with-code: 1
    pages-read: 3
  x-generated-from: documentation
  x-provenance: generated
  x-authored-by: API Evangelist
  x-generated: '2026-10-15'
  x-generator: generate-contract-from-docs.py
  x-engine: local
  x-sources:
  - https://developer.sj.se/apis/reseller-api/get-started
  - https://developer.sj.se/apis/reseller-api/reference-documentation
  - https://developer.sj.se/apis/customer-api/reference-documentation
servers:
- url: https://login.microsoftonline.com
paths:
  /$TENANT_ID/oauth2/v2.0/token:
    post:
      operationId: post_TENANT_ID_oauth2_v2_0_token
      tags:
      - Tenant Id
      summary: POST /$TENANT_ID/oauth2/v2.0/token
      x-source: https://developer.sj.se/apis/reseller-api/get-started
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: code-example
        language: curl
        snippet: "curl Example request-response (cUrl) curl -X POST \"https://login.microsoftonline.com/$TENANT_ID/oauth2/v2.0/token\"  -d \"\
          client_id=$CLIENT_ID\"  -d \"grant_type=$GRANT_TYPE\"  -d \"client_secret=$CLIENT_SECRET\"  -d \"scope=$SCOPE\"  Response \n{ \n \"\
          token_type\": \"Bearer\", \n \"expires_in\": 3599, \n \"ext_expires_in\": 3599, \n \"access_token\": <JWT_TOKEN> \n} Requestor header\
          \ Each sales channel connected to the Re"
  /Booking:
    get:
      operationId: get_Booking
      tags:
      - Booking
      summary: Quick Start Guide for SJ Reseller API
      x-source: https://developer.sj.se/apis/reseller-api/get-started
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBookingResponse'
      x-evidence:
        kind: documentation
    post:
      operationId: post_Booking
      tags:
      - Booking
      summary: Quick Start Guide for SJ Reseller API
      x-source: https://developer.sj.se/apis/reseller-api/get-started
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostBookingRequest'
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /Offers:
    post:
      operationId: post_Offers
      tags:
      - Offers
      summary: Quick Start Guide for SJ Reseller API
      x-source: https://developer.sj.se/apis/reseller-api/get-started
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostOffersRequest'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostOffersResponse'
      x-evidence:
        kind: documentation
  /availabilities:
    get:
      operationId: get_availabilities
      tags:
      - Availabilities
      summary: GET /availabilities can be called in an offer or booking context to retrieve seat availability.
      x-source: https://developer.sj.se/apis/reseller-api/reference-documentation
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /availabilities/{availabilitieid}:
    get:
      operationId: get_availabilities_availabilitieid
      tags:
      - Availabilities
      summary: GET /availabilities/place-map returns seat‑map information for a booking and reservation.
      x-source: https://developer.sj.se/apis/reseller-api/reference-documentation
      parameters:
      - name: availabilitieid
        in: path
        required: true
        schema:
          type: string
      - name: bookingId
        in: query
        required: true
        schema:
          type: string
        description: Identifier of the booking.
      - name: reservationId
        in: query
        required: true
        schema:
          type: string
        description: Identifier of the reservation.
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
        collapsed_from: 2 example path(s) differing only at availabilitieId
  /booking:
    get:
      operationId: get_booking
      tags:
      - Booking
      summary: GET /booking retrieves a booking, including any provisional fulfillmentId.
      x-source: https://developer.sj.se/apis/reseller-api/reference-documentation
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBookingResponse2'
      x-evidence:
        kind: documentation
    post:
      operationId: post_booking
      tags:
      - Booking
      summary: POST /booking creates a provisional booking with required externalRef and passenger information.
      x-source: https://developer.sj.se/apis/reseller-api/reference-documentation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostBookingRequest2'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostBookingResponse'
      x-evidence:
        kind: documentation
  /bookings/{bookingid}:
    get:
      operationId: get_bookings_bookingid
      tags:
      - Bookings
      summary: GET /bookings/{bookingId} returns the booking details, including fulfillmentId.
      x-source: https://developer.sj.se/apis/reseller-api/reference-documentation
      parameters:
      - name: bookingid
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBookingsBookingidResponse'
      x-evidence:
        kind: documentation
  /bookings/{bookingid}/fulfillment:
    post:
      operationId: post_bookings_bookingid_fulfillment
      tags:
      - Bookings
      summary: POST /bookings/{bookingId}/fulfillment creates a fulfillment for a booking (asynchronous, returns 202).
      x-source: https://developer.sj.se/apis/reseller-api/reference-documentation
      parameters:
      - name: bookingid
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /contacts/{contactid}:
    post:
      operationId: post_contacts_contactid
      tags:
      - Contacts
      summary: Search for an SJ customer by e-mail address.
      x-source: https://developer.sj.se/apis/customer-api/reference-documentation
      parameters:
      - name: contactid
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostContactsContactidRequest'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostContactsContactidResponse'
      x-evidence:
        kind: documentation
        collapsed_from: 3 example path(s) differing only at contactId
  /exchange-offers:
    post:
      operationId: post_exchange_offers
      tags:
      - Exchange Offers
      summary: POST /exchange-offers creates an exchange offer for a booking.
      x-source: https://developer.sj.se/apis/reseller-api/reference-documentation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostExchangeOffersRequest'
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /exchange-operations:
    patch:
      operationId: patch_exchange_operations
      tags:
      - Exchange Operations
      summary: Optional, does not change any states
      x-source: https://developer.sj.se/apis/reseller-api/reference-documentation
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
    post:
      operationId: post_exchange_operations
      tags:
      - Exchange Operations
      summary: POST /exchange-operations creates a provisional exchange operation and new provisional booking parts.
      x-source: https://developer.sj.se/apis/reseller-api/reference-documentation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostExchangeOperationsRequest'
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /fulfillments/{fulfillmentid}:
    get:
      operationId: get_fulfillments_fulfillmentid
      tags:
      - Fulfillments
      summary: GET /fulfillments/{fulfillmentId} retrieves fulfillment details such as control number and Aztec code.
      x-source: https://developer.sj.se/apis/reseller-api/reference-documentation
      parameters:
      - name: fulfillmentid
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetFulfillmentsFulfillmentidResponse'
      x-evidence:
        kind: documentation
  /offers:
    post:
      operationId: post_offers
      tags:
      - Offers
      summary: Quick Start Guide for SJ Reseller API
      x-source: https://developer.sj.se/apis/reseller-api/get-started
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostOffersRequest2'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostOffersResponse2'
      x-evidence:
        kind: documentation
  /passenger:
    patch:
      operationId: patch_passenger
      tags:
      - Passenger
      summary: PATCH /passenger updates passenger details in a provisional booking.
      x-source: https://developer.sj.se/apis/reseller-api/reference-documentation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchPassengerRequest'
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
components:
  schemas:
    GetBookingResponse:
      type: object
      properties:
        booking:
          type: object
          description: Complete booking information with tickets
    PostBookingRequest:
      type: object
      properties:
        externalRef:
          type: string
          description: Client‑side booking reference
        purchaser:
          type: object
          description: Purchaser details
        offers:
          type: array
          description: Selected offer IDs and passenger references
        passengerSpecifications:
          type: array
          description: Passenger data for the booking
        embed:
          type: array
          description: Embedding options, e.g., "ALL"
      required:
      - externalRef
      - purchaser
      - offers
      - passengerSpecifications
    PostOffersRequest:
      type: object
      properties:
        tripSpecifications:
          type: array
          description: List of trips to get offers for
        offerSearchCriteria:
          type: object
          description: Search criteria such as currency
        anonymousPassengerSpecifications:
          type: array
          description: Passenger data needed for pricing
        embed:
          type: array
          description: Embedding options, e.g., "ALL"
      required:
      - tripSpecifications
      - offerSearchCriteria
      - anonymousPassengerSpecifications
    PostOffersResponse:
      type: object
      properties:
        offers:
          type: array
          description: List of offer objects
    GetBookingResponse2:
      type: object
      properties:
        booking.id:
          type: string
          description: Booking identifier.
        booking.fulfillmentId:
          type: string
          description: Identifier of the fulfillment (if present).
    PostBookingRequest2:
      type: object
      properties:
        bookingrequest.externalRef:
          type: string
          description: Unique booking reference in the caller’s system.
        passenger:
          type: string
          description: Passenger information (firstName, lastName, optional email/phone).
        placeSelection:
          type: string
          description: Place selection for seat/compartment.
      required:
      - bookingrequest.externalRef
      - passenger
    PostBookingResponse:
      type: object
      properties:
        booking.id:
          type: string
          description: Booking identifier.
        booking.bookingCode:
          type: string
          description: Same value as booking.id.
    GetBookingsBookingidResponse:
      type: object
      properties:
        booking.id:
          type: string
          description: Booking identifier.
        booking.fulfillmentId:
          type: string
          description: Identifier of the fulfillment.
    PostContactsContactidRequest:
      type: object
      properties:
        email:
          type: string
          description: Must be URL encoded
      required:
      - email
    PostContactsContactidResponse:
      type: object
      properties:
        '200':
          type: string
          description: A Customer object (see schema definitions)
        '404':
          type: string
          description: There is no SJ customer with this email address.
    PostExchangeOffersRequest:
      type: object
      properties:
        exchangeOffer:
          type: string
          description: Details of the exchange request, including fulfillments to exchange.
      required:
      - exchangeOffer
    PostExchangeOperationsRequest:
      type: object
      properties:
        exchangeOperation:
          type: string
          description: Details of the exchange operation.
      required:
      - exchangeOperation
    GetFulfillmentsFulfillmentidResponse:
      type: object
      properties:
        fulfillment.controlNumber:
          type: string
          description: Ticket number.
        fulfillment.aztecCode:
          type: string
          description: Base64 string of the Aztec code.
    PostOffersRequest2:
      type: object
      properties:
        tripSpecifications:
          type: array
          description: List of trips to get offers for
        offerSearchCriteria:
          type: object
          description: Search criteria such as currency
        anonymousPassengerSpecifications:
          type: array
          description: Passenger data needed for pricing
        embed:
          type: array
          description: Embedding options, e.g., "ALL"
      required:
      - tripSpecifications
      - offerSearchCriteria
      - anonymousPassengerSpecifications
    PostOffersResponse2:
      type: object
      properties:
        offers:
          type: array
          description: List of offer objects
    PatchPassengerRequest:
      type: object
      properties:
        passenger.id:
          type: string
          description: Identifier of the passenger to patch.
        passenger:
          type: string
          description: Complete passenger details (firstName, lastName, optional age, cards).
      required:
      - passenger.id
      - passenger
tags:
- name: Availabilities
- name: Booking
- name: Bookings
- name: Contacts
- name: Exchange Offers
- name: Exchange Operations
- name: Fulfillments
- name: Offers
- name: Passenger
- name: Tenant Id