#Channels
A channel is a place that sells your rooms: an OTA, a wholesaler, a metasearch. A channel connection ties one property to one channel with a set of credentials. Antero Connect keeps each connection in step with your availability and prices, takes its bookings, and tells you honestly how it is doing.
Which channels can I connect? The channel list is set by what Antero Connect has an adapter for, and grows. The simulator (
channel_code: "sim") behaves like a real channel in every way these calls care about, including its failures, so you can build and test a whole integration against it today. Which live channels are open to your account is shown in the panel when you connect one.
#Connect one
export CHANNEL_MANAGER=https://api.anteromas.com # the address of your Channel Manager service
export KEY=cm_prod_ab12cd34_0123456789abcdef0123456789abcdef # your API key
curl -s -X POST "$CHANNEL_MANAGER/v1/properties/$PROPERTY_ID/channel-connections" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: conn-sim-1" \
-d @- <<EOF
{
"channel_code": "sim",
"name": "Practice channel",
"sandbox": true,
"remote_property_id": "DEMO-HOTEL",
"credentials": {
"api_key": "demo"
}
}
EOFimport os
import requests
CHANNEL_MANAGER = os.environ["CHANNEL_MANAGER"] # the address of your Channel Manager service
KEY = os.environ["KEY"] # your API key
r = requests.post(
f"{CHANNEL_MANAGER}/v1/properties/{PROPERTY_ID}/channel-connections",
headers={"Authorization": f"Bearer {KEY}", "Idempotency-Key": "conn-sim-1"},
json={
"channel_code": "sim",
"name": "Practice channel",
"sandbox": True,
"remote_property_id": "DEMO-HOTEL",
"credentials": {
"api_key": "demo",
},
},
)
r.raise_for_status()
print(r.status_code, r.text)// Node.js 18 or newer (fetch is built in); save as a .mjs file
const CHANNEL_MANAGER = process.env.CHANNEL_MANAGER; // the address of your Channel Manager service
const KEY = process.env.KEY; // your API key
let r; // the last answer
r = await fetch(`${CHANNEL_MANAGER}/v1/properties/${PROPERTY_ID}/channel-connections`, {
method: "POST",
headers: { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json", "Idempotency-Key": "conn-sim-1" },
body: JSON.stringify({
channel_code: "sim",
name: "Practice channel",
sandbox: true,
remote_property_id: "DEMO-HOTEL",
credentials: {
api_key: "demo",
},
}),
});
if (!r.ok) throw new Error(await r.text());
console.log(r.status, await r.text());<?php
$CHANNEL_MANAGER = getenv("CHANNEL_MANAGER"); // the address of your Channel Manager service
$KEY = getenv("KEY"); // your API key
$ch = curl_init("{$CHANNEL_MANAGER}/v1/properties/{$PROPERTY_ID}/channel-connections");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer {$KEY}", "Content-Type: application/json", "Idempotency-Key: conn-sim-1"],
CURLOPT_POSTFIELDS => json_encode([
"channel_code" => "sim",
"name" => "Practice channel",
"sandbox" => true,
"remote_property_id" => "DEMO-HOTEL",
"credentials" => [
"api_key" => "demo",
],
]),
]);
$out = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status >= 400) { throw new RuntimeException($out); }
echo $status, " ", $out, "\n";sandboxdefaults totrue. A connection to a live channel must say"sandbox": false, on purpose. The flag cannot be changed afterwards, so a test connection can never touch a live channel.credentialsare write-only: they are stored encrypted, and never returned. You see onlyhas_credentialsand acredentials_fingerprintthat changes when they do.PATCHwith new credentials replaces them entirely.remote_property_idis the property's id at the channel.
#The path to live
| Step | Call | What you learn |
|---|---|---|
| 1. Test | POST /v1/channel-connections/{id}/test | connected, credentials_rejected, property_not_found, channel_unreachable, rate_limited, unsupported or channel_error, in plain words, with the rooms and rates found and how long the channel took. Always answers 200: read status. |
| 2. See what the channel has | GET …/remote-catalog | the channel's own rooms and rates (409 catalog_not_supported if the channel cannot list them) |
| 3. Match | GET …/mapping-suggestions then PUT …/mappings | suggestions by name, each with a confidence (high or medium); PUT replaces all mappings atomically |
| 4. Switch on | PATCH /v1/channel-connections/{id} with {"status": "active"} | the connection starts sending. paused stops it |
| 5. Watch | GET …/sync-status, GET …/health | see below |
Mappings are one to one in both directions: a room type maps to one channel room, and a channel room to one room type (the same for rates). Only mapped rooms and rates are sent. A booking for a channel room that is not mapped becomes a pending booking and a decision on the board; map the room and it completes by itself.
#What has been sent
For each room type and day, Antero Connect wants a value at the channel. GET …/sync-status says how far each connection is from there. A cell goes through three states:
| State | Meaning |
|---|---|
| wanted | Antero Connect wants it, and has not sent it yet |
| sent | the channel answered OK (in_sync) |
| proven | Antero Connect read the channel back and it holds the value (confirmed) |
unverified cells are waiting to be read back. Antero Connect reads back about every day and compares; a difference is healed by sending the cell again, and recorded.
GET …/health is one word per connection:
healthy | working |
degraded | working, with something to look at: a failed call, a rate limit, cells the channel keeps refusing or does not keep |
down | three failed calls in a row, or failing with nothing succeeding |
auth_failed | the channel rejects the credentials; fix them with PATCH |
#When the channel differs
GET …/reconciliation/diffs: each field of each day found different at the channel by a read-back, and whether it washealed, is still open, ormissing(the channel did not show the day).POST …/reconciliation/diffs/{diff_id}/ignore: accept that the channel differs on purpose. Antero Connect stops re-sending that cell until its wanted value changes. Recorded in the audit log.POST …/full-sync: forget what the channel has accepted and proven, send everything again, and read it back. (The full sync that runs by itself every day is lighter: for a channel that can be read, it reads every cell first and sends again only what differs, so it does not spend the channel's rate limit on what is already right. A channel that cannot be read gets everything again.) Use it after a long outage or when you do not trust the channel's state.GET …/reconciliation/runs: the history of checks and full syncs.
#What a channel can do
Channels differ. GET …/capabilities says what a channel claims, what Antero Connect measured by probing it, and what Antero Connect relies on. A claim a measurement disproves is dropped. POST …/probe measures again at the next pass. Rate limits are measured too: Antero Connect keeps to what the channel really accepts, and spreads its calls.
#Bookings from a channel
Two ways bookings reach Antero Connect, and both can be on at once:
- The channel posts them to you.
POST …/webhookgives a token; hand the channel/hooks/<token>. See Webhooks. - Antero Connect asks the channel. Channels that offer a list of bookings are asked automatically every few minutes as a safety net;
POST …/pullasks now.
Then check that nothing was missed: POST …/audits asks the channel what it holds for arrivals in a range of days (both days included, at most 367) and compares it with Antero Connect. Each booking ends matched, repaired (Antero Connect had missed it and now has it) or orphan (the channel has it and Antero Connect cannot place it, so a person decides). GET …/audits/{id} has the findings.
GET …/inbound-messages is the archive of what the channel sent, with card data removed. A message Antero Connect could not read yet is kept with the reason, not dropped.
#Closing rooms at a channel
Pushing available: 0 closes a room type everywhere. To close it at one OTA of a channel (a channel can front several), or to know the channel really did it, use a closure:
curl -s -X POST "$CHANNEL_MANAGER/v1/properties/$PROPERTY_ID/closures" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: close-dlx-mar" \
-d @- <<EOF
{
"room_type_id": "$ROOM_TYPE_ID",
"connection_id": "$CONNECTION_ID",
"sub_channel": "agoda",
"date_from": "2027-03-20",
"date_to": "2027-03-22"
}
EOFr = requests.post(
f"{CHANNEL_MANAGER}/v1/properties/{PROPERTY_ID}/closures",
headers={"Authorization": f"Bearer {KEY}", "Idempotency-Key": "close-dlx-mar"},
json={
"room_type_id": f"{ROOM_TYPE_ID}",
"connection_id": f"{CONNECTION_ID}",
"sub_channel": "agoda",
"date_from": "2027-03-20",
"date_to": "2027-03-22",
},
)
r.raise_for_status()
print(r.status_code, r.text)r = await fetch(`${CHANNEL_MANAGER}/v1/properties/${PROPERTY_ID}/closures`, {
method: "POST",
headers: { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json", "Idempotency-Key": "close-dlx-mar" },
body: JSON.stringify({
room_type_id: `${ROOM_TYPE_ID}`,
connection_id: `${CONNECTION_ID}`,
sub_channel: "agoda",
date_from: "2027-03-20",
date_to: "2027-03-22",
}),
});
if (!r.ok) throw new Error(await r.text());
console.log(r.status, await r.text());$ch = curl_init("{$CHANNEL_MANAGER}/v1/properties/{$PROPERTY_ID}/closures");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer {$KEY}", "Content-Type: application/json", "Idempotency-Key: close-dlx-mar"],
CURLOPT_POSTFIELDS => json_encode([
"room_type_id" => "{$ROOM_TYPE_ID}",
"connection_id" => "{$CONNECTION_ID}",
"sub_channel" => "agoda",
"date_from" => "2027-03-20",
"date_to" => "2027-03-22",
]),
]);
$out = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status >= 400) { throw new RuntimeException($out); }
echo $status, " ", $out, "\n";A closure is your intent; Antero Connect sends it, reads the channel back, and reports its status honestly: pending, sent, proven, disputed (the channel answered OK and did not keep it), blocked, expired or lifted. Leave sub_channel out to close every OTA the channel can reach; unreachable_sub_channels lists those that stay open. A channel that cannot do what you ask answers 409 with alternatives, such as set_availability_zero or close_all:
{"error": {"code": "closure_not_supported_for_ota", "message": "This channel can only close every OTA at once, not a single one.", "alternatives": ["close_all"]}}DELETE /v1/closures/{id} lifts one (opens the days again). GET …/closure-diffs lists days that were closed and found open (someone changed them at the channel); Antero Connect closes them again.
#Things that need a person
Antero Connect does not guess. A booking it cannot place, a channel that went quiet, credentials that stopped working: each appears on the decision board (GET /v1/properties/{id}/decisions) with the actions that settle it, and closes by itself when its cause goes away. GET …/status gives one verdict per property (alive, anything stuck, what needs attention).