Skip to main content

Onsale Gateway 0.1.0

Onsale Gateway

Last updated: 18-Nov-2026
Recent changes: refactor: quotation marks

Endpoints

accommodation-sourcing-partners exposes the following REST API endpoints.

Environment name URL
Prod https://prod.api.tui/partners
Test https://test.api.tui/partners
Method Path Description
POST /v1/change Create a change request (allotment increase or release change).
GET /v1/change/{id} Retrieve the status of a previously created change request.
POST /v1/allocation/_query Query the current allocation data for an accommodation.

All endpoints are versioned with a /v1 path prefix and require authentication (see HTTP Headers).

Common concepts

Change type discriminator

Change request bodies are polymorphic. The type property acts as the discriminator and selects the concrete change shape:

type Meaning
ALLOTMENT Change the allotment (allocation) of a room.
RELEASE Change the release settings of a room.

Markets and contract routing

The markets array identifies the contract a change is applied to. The supported markets, and the combinations that may be sent together, are:

Markets Notes
NL and/or BE May be combined.
DE Must be sent on its own.
UK or SE Exactly one; cannot be combined with each other or with other markets.

Any other combination (for example mixing DE with NL, or sending UK together with SE) is rejected with a validation error: The combination of markets is not allowed.

Accommodation

The accommodation object identifies the hotel. It must resolve to exactly one accommodation in DOD, otherwise the request is rejected with The accommodation cannot be uniquely resolved in DOD.

Field Type Description
code string Accommodation code, e.g. "2108".
source string Source/chain identifier for the accommodation, e.g. "CTUI:RIU".

API methods

POST /v1/change — Allotment change

Sends a change request to increase the allocation of room DBMF in RIU accommodation 2108 by 10 rooms for the travel period 01.04.2026 to 08.04.2026. The optional occupancy attribute selects the suballocation. The markets attribute identifies the contract the change is made on. Only allotmentChangeType: INCREASE is currently supported, and amount must be a positive integer.

Request body:

{
  "type": "ALLOTMENT",
  "accommodation": {
    "code": "2108",
    "source": "CTUI:RIU"
  },
  "markets": [
    "NL"
  ],
  "travelInterval": {
    "startDate": "2026-04-01",
    "endDate": "2026-04-08"
  },
  "rooms": [
    "DBMF"
  ],
  "occupancy": 1,
  "allotmentChangeType": "INCREASE",
  "amount": 10
}

POST /v1/change — Release change

Sends a change request to set the release days of room DBMF in RIU accommodation 2108 to 3 days for the travel period 01.04.2026 to 08.04.2026. The release action is carried in the nested action object. Its type discriminator selects the action:

action.type Description
SET Set the release to a fixed number of days.
BACK_TO_CONTRACT Reset the release back to the contract value (no days).

Request body (SET):

{
  "type": "RELEASE",
  "accommodation": {
    "code": "2108",
    "source": "CTUI:RIU"
  },
  "markets": [
    "NL"
  ],
  "travelInterval": {
    "startDate": "2026-04-01",
    "endDate": "2026-04-08"
  },
  "rooms": [
    "DBMF"
  ],
  "occupancy": 1,
  "action": {
    "type": "SET",
    "days": 3
  }
}

Request body (BACK_TO_CONTRACT):

{
  "type": "RELEASE",
  "accommodation": {
    "code": "2108",
    "source": "CTUI:RIU"
  },
  "markets": [
    "NL"
  ],
  "travelInterval": {
    "startDate": "2026-04-01",
    "endDate": "2026-04-08"
  },
  "rooms": [
    "DBMF"
  ],
  "occupancy": 1,
  "action": {
    "type": "BACK_TO_CONTRACT"
  }
}

Change response

Both POST /v1/change (201 Created) and GET /v1/change/{id} (200 OK) return the change wrapped in an envelope. The execution object reports progress:

  • status: IN_PROGRESS with progress of PROCESSING or WAITING_FOR_APPROVAL
  • status: COMPLETED with completion of ACCEPTED or REJECTED
{
  "messages": [],
  "payload": {
    "type": "ALLOTMENT",
    "id": "a1b2c3d4",
    "accommodation": {
      "code": "2108",
      "source": "CTUI:RIU"
    },
    "execution": {
      "status": "IN_PROGRESS",
      "progress": "WAITING_FOR_APPROVAL"
    }
  }
}

POST /v1/allocation/_query — Query allocation data

Returns the current allocation data for an accommodation, grouped per room and per day. accommodation, markets and travelInterval are required; rooms is optional and narrows the result to the listed room codes.

Request body:

{
  "accommodation": {
    "code": "2108",
    "source": "CTUI:RIU"
  },
  "markets": [
    "NL"
  ],
  "travelInterval": {
    "startDate": "2026-04-01",
    "endDate": "2026-04-08"
  },
  "rooms": [
    "DBMF"
  ]
}

Response (200 OK). Each room reports mainAllocationValuesPerDay keyed by date, and optionally subAllocationValuesPerDay keyed by suballocation then by date:

{
  "messages": [],
  "payload": {
    "accommodation": {
      "code": "2108",
      "source": "CTUI:RIU"
    },
    "travelInterval": {
      "startDate": "2026-04-01",
      "endDate": "2026-04-08"
    },
    "rooms": [
      {
        "roomCode": "DBMF",
        "roomName": "Double Room",
        "mainAllocationValuesPerDay": {
          "2026-04-01": {
            "currentAllotment": 12,
            "contractAllotment": 10,
            "booked": 4,
            "remaining": 8,
            "stopped": false,
            "release": 3,
            "released": false,
            "minStay": 2,
            "maxStay": 14
          }
        }
      }
    ]
  }
}

Per-day allocation values:

Field Type Description
currentAllotment integer Current (calculated) allotment value.
contractAllotment integer Contracted allotment value.
booked integer Number of existing bookings.
remaining integer Remaining allotment taking all bookings into account.
stopped boolean Whether sale is stopped for this day.
release integer Release value in days before travel (main allotment only).
released boolean Whether the release threshold has been reached (main allotment only).
minStay integer Minimum nights stay (main allotment only).
maxStay integer Maximum nights stay (main allotment only).

HTTP Headers

Header Name Value Inbound/Outbound Description
x-correlation-id <your-id> Inbound / Outbound Your unique correlation id, echoed back on the response.
Accept application/json Inbound Requested response media type.
Authorization Bearer <token> Inbound JWT bearer token. All endpoints require authentication.

Error responses

Status Meaning
400 Bad request — validation failed (e.g. invalid market combination, ambiguous accommodation).
401 Unauthorized — missing or invalid token.
403 Forbidden — authenticated but not permitted.
404 Not found — returned by GET /v1/change/{id} when the change id is unknown.

About us

TUI is one of the world’s leading tourism groups. The broad portfolio gathered under the Group umbrella consists of strong tour operators, 1,600 travel agencies and leading online portals, five airlines with around 150 aircraft, over 400 hotels, 16 cruise liners and many incoming agencies in all major holiday destinations around the globe.

 

TUI Group logo

Contact

Login to your account