Switch to dark mode

Corporate Codes

A company with a negotiated rate has a corporate agreement code from the operator. Attach the code to the passengers, and the operator prices the journey on the agreement. Like a travel card, the code affects the price, so you send it both when you get offers and when you create the booking. It can't be changed afterward.

Pricing with a corporate code

Add codes to passengers in the corporateCodes field of PassengerPlaceholderInput. Each entry has the agreement code, as the operator issued it, and the operator it belongs to, as an Operator.code such as aaop_sj. Send the codes everywhere you send passengers: to journeyOffer and combinedJourneyOffer when you price, and to createBooking.

To find an operator's code, read operator { code } on the segments of a journeys result. A journey can have several operators, as in the example below, so a code may apply to some parts of it and not to others. See Reading What Was Applied.

Example: Find the operators on a journey

query Journeys {
  journeys(
    origin: { uid: "XPORaKED" }
    destination: { uid: "mqpeTG30" }
    date: "2026-12-23"
  ) {
    id
    itinerary {
      ... on SegmentCollection {
        segments {
          origin {
            name
          }
          destination {
            name
          }
          operator {
            code
            name
          }
        }
      }
    }
  }
}
{
  "data": {
    "journeys": [
      {
        "id": "f35437ab-6e57-439d-8b34-2c2eb42e640f",
        "itinerary": [
          {
            "segments": [
              {
                "origin": { "name": "Stockholm Central" },
                "destination": { "name": "Linköping" },
                "operator": { "code": "aaop_sj", "name": "SJ" }
              },
              {
                "origin": { "name": "Linköping Fjärrbussterminal" },
                "destination": { "name": "Göteborg Nils Ericsonterminal" },
                "operator": { "code": "aaop_vy", "name": "Vy" }
              }
            ]
          }
        ]
      }
    ]
  }
}

All passengers in a search or booking must have the same codes. Passengers on different agreements fail with CORPORATE_CODES_MIXED, so search and book them separately. A code with an operator we don't know fails with CORPORATE_CODE_OPERATOR_UNKNOWN.

Send the same codes when you create the booking as when you priced it. The passengers are compared on their codes, as well as on their type, age and travel cards. If the codes differ from the offer's, the booking fails with PASSENGER_MISMATCH.

Example: Get offers with a corporate code

subscription GetJourneyOffer {
  journeyOffer(
    journeyId: "af6f8ccb-0a4f-4fec-a21c-6f20c30bf2af"
    passengers: [
      {
        type: ADULT
        corporateCodes: [{ code: "977516", operator: "aaop_sj" }]
      }
    ]
  ) {
    status
    itinerary {
      ... on SegmentCollection {
        offers {
          id
          price {
            amount
            currency
          }
          parts {
            ... on AdmissionPart {
              flexibility
              comfortClass
              appliedCorporateCodes {
                code
                operator {
                  code
                }
              }
            }
            ... on ReservationPart {
              flexibility
              comfortClass
              appliedCorporateCodes {
                code
                operator {
                  code
                }
              }
            }
          }
        }
      }
    }
  }
}
{
  "data": {
    "journeyOffer": {
      "status": "SUCCESS",
      "itinerary": [
        {
          "offers": [
            {
              "id": "offer_s1p0j7q0j7q18624v5j6n15751",
              "price": { "amount": 18900, "currency": "SEK" },
              "parts": [
                {
                  "flexibility": "NON_FLEX",
                  "comfortClass": "2nd",
                  "appliedCorporateCodes": [
                    { "code": "977516", "operator": { "code": "aaop_sj" } }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  }
}

Reading what was applied

Every AdmissionPart and ReservationPart has appliedCorporateCodes: the codes the operator applied to that part, as the operator reported them. The list is empty when none applied. If a code you sent isn't in it, the code gave no discount on that part. On a journey with one offer per operator, a code can apply to one operator's parts and not to another's.

The field is on the offers you price, on a booking's offers, and on an order's JourneyOrderItem.offer.parts. The codes you sent for a passenger are returned as corporateCodes on that passenger, on both bookings and orders.

Corporate codes are fixed at creation

A booking is priced on its passengers' codes, so they can't change once the booking exists. Leave corporateCodes out when updating passengers. To book on a different agreement, price the journey again with the right codes and create a new booking from that offer.

Sending the codes a passenger already has is accepted and changes nothing, whatever order they are in. Anything else fails with CORPORATE_CODES_IMMUTABLE, and none of the passenger changes in the call are saved. null is read as an empty list, not as leaving the field out, so it counts as a change for a passenger who has codes.

json
{
  "errors": [
    {
      "message": "Corporate codes can't be changed on an existing booking. Search again with the right codes and create a new booking.",
      "extensions": {
        "code": "CORPORATE_CODES_IMMUTABLE"
      }
    }
  ]
}

Next steps

Travel Cards
Discount cards and rail passes, which work the same way.
Getting Offers
How offers and passengers work in general.
Error Codes
The errors a booking can raise.