Despegar
This guide walks through creating a channel connection between Channex and Despegar over the API: discovering the adapter, validating the hotel credentials, reading the rooms and rates on both sides, building the mapping, and creating and activating the connection.
A channel connection (a channel) links rate plans of a Channex property to rooms and rates on the OTA side. Once the connection is active, Channex pushes availability, rates and restrictions to Despegar and receives bookings back.
Every OTA has its own API and data model, so the connection settings and the mapping settings differ per channel. The flow below is shared by most channels (Booking.com, Expedia, Agoda, Open Channel–based OTAs and others); the payloads shown are the Despegar ones. Airbnb is the exception — it requires an OAuth authorization step and is covered by a separate guide.
All endpoints require authentication with an API key, sent in the user-api-key header.
The flow at a glance
Get the adapter descriptor — what settings and mapping fields Despegar needs.
Collect the settings from the user and run a test connection.
Get the mapping details — the rooms and rates on the Despegar side.
Collect the Channex side — the property, its room types and rate plans.
Build the mapping structure.
Create the connection.
Activate it.
1. Get the adapter descriptor
Each channel is described by an adapter descriptor: the settings it needs (params) and the per-mapping fields it needs (rate_params).
GET /api/v1/channels/adapter?code=DespegarThe full catalog of adapters is available at GET /api/v1/channels/list.
Response (abridged):
What to read from it:
params— the connection settings to collect from the user. Each entry describes one field:title(English label),type(string,password,integer,boolean,select,switch,hidden),position(ordering for a UI),default,options(forselectandswitchfields) and conditional displayrules.rate_params— the fields each rate plan mapping must carry (step 5), described the same way.
For Despegar, the settings to collect from the user are hotel_id — the Despegar Hotel ID — and the user and password credentials. Keep partner_account at its default channex unless you were told otherwise; the remaining settings have sensible defaults. See the settings reference.
2. Test the connection
Before creating anything, validate the collected settings with a test connection:
channel is the adapter code from the descriptor; settings is the object built from params.
Response:
success: true means the credentials are correct and the hotel is ready for connection on the Despegar side. On failure the response is still 200 OK with success: false — check the success field, not the status code.
3. Get the mapping details
Next, fetch the rooms and rates the hotel exposes on the Despegar side:
The payload is the same as for the test connection:
Response (abridged):
Every channel returns its own mapping-details shape; this one is Despegar's.
pricing_type — the hotel's pricing model, derived from how its rates are charged:
OBP— occupancy-based pricing (rates chargedper_person): each rate carries a price per occupancy option.Standard— per-room pricing (rates chargedper_room): each rate carries one price per room.
rooms — the rooms available for mapping. Each room carries:
id
Room ID on the Despegar side.
title
Room title.
max_children
Maximum number of children the room accepts.
rates
Rates of the room.
Each rate carries:
id
Rate ID on the Despegar side.
title
Rate title.
charge_type
How the rate is charged: per_person (price per occupancy, OBP) or per_room (one price per room, Standard).
max_persons
Maximum number of persons — the room's maximum occupancy for per_person rates, its standard occupancy for per_room rates.
occupancies
Occupancy options of the rate on this room. Present for per_person rates only.
derived_rate_plan_ids
IDs of the rates derived from this rate. Present only for rates that have derived rates.
Rooms that offer no rates are not listed.
Only parent rates are listed. Rates that Despegar derives from another rate do not appear as rates of a room themselves — their IDs are collected in the parent's derived_rate_plan_ids, and when the connection is created or its mappings updated, Channex records known mappings for them automatically, so bookings arriving on a derived rate are allocated to the parent's mapped rate plan.
4. Collect the Channex side
Despegar connections are one-to-one: one connection maps exactly one Channex property to one Despegar hotel. Pick the property to connect, then fetch its room types and rate plans through the options endpoints:
Enable multi_occupancy on the rate plans request: for occupancy-based rate plans it expands each occupancy option into its own entry, which is exactly the granularity Despegar OBP mappings need.
5. Build the mapping structure
The mapping is a list of rate_plans entries, one per (Channex rate plan occupancy → Despegar room/rate/occupancy) pair:
rate_plan_id — the Channex rate plan UUID (from step 4).
settings — the fields declared by rate_params in the adapter descriptor:
room_type_code
Room ID on the Despegar side.
rate_plan_code
Rate ID on the Despegar side.
occupancy
The occupancy option of the Despegar rate this mapping serves. Required for both pricing models — for Standard rates use the rate's max_persons.
pricing_type
The hotel's pricing model — copy it from the mapping details (OBP or Standard).
primary_occ
Whether this mapping is the primary one for its room + rate pair. The primary mapping sends availability and restrictions along with prices; non-primary mappings send prices only.
Mark exactly one mapping of each room + rate pair as primary. For OBP hotels, create one mapping per occupancy option you want to sell; for Standard hotels, a room + rate pair has a single mapping.
A full mapping for one Despegar OBP rate sold at two occupancies:
6. Create the connection
The payload is wrapped in a channel key:
channel
The adapter code from the descriptor.
group_id
UUID of the group the connection belongs to. Required.
title
Connection title. Optional — generated from the channel and property names when omitted.
properties
UUIDs of the connected properties. One property for Despegar.
settings
The connection settings built from params — the same object the test connection validated.
rate_plans
The mapping structure from step 5. Optional — mappings can also be added later by updating the connection.
The response is 201 Created with the channel connection resource (abridged):
Note that the connection starts disabled: is_active in the create payload has no effect — a new connection is always created with is_active: false. Activation is a separate, explicit step.
Only one connection per Despegar hotel_id is allowed on Channex.
7. Activate the connection
No payload. Activation requires the connection to have at least one property and at least one rate plan mapping; activating starts the synchronization — Channex pushes the full current availability, rates and restrictions to Despegar and begins receiving bookings.
The counterpart is POST /api/v1/channels/{channel_id}/deactivate, which stops the synchronization but keeps the connection and its mappings.
Updating a connection
The payload has the same shape as for create (wrapped in channel). Two rules matter:
channelcannot be changed — a different adapter code is rejected.rate_plans, when present, replaces the whole mapping set. A stored mapping missing from the list is removed, and a mapping sent withsettings: nullis removed as well. Omitrate_plansentirely to keep the stored mappings.
Deleting a connection
An active connection must be deactivated first. Deleting removes the connection and all its mappings; bookings received through it are kept.
Actions
The Despegar adapter declares no connection actions — actions is empty on the descriptor and on every Despegar connection.
Despegar settings reference
The full set of connection settings for Despegar:
partner_account
The partner account Channex connects to Despegar under: channex or pxsol. Default channex.
hotel_id
The Despegar Hotel ID. Required.
user
The Despegar username. Required.
password
The Despegar password. Required.
min_stay_type
How the minimum stay restriction is applied: Arrival (counted from the arrival date) or Through (applied to every stayed-through date). Default Arrival.
email
The email address the notifications go to.
send_email_notifications
When true, Channex sends a notification about each booking.
booking_amount_settings
Which amount is recorded as the booking total: Total Amount (the full amount the guest pays) or Hotel Payout (the amount Despegar pays out to the hotel). Default Total Amount.
Last updated