SDK
import { createVoyantConnectClient } from "@voyant-travel/connect-sdk";
const connect = createVoyantConnectClient({ apiKey: process.env.VOYANT_API_KEY });
const result = await connect.connections.create("<operatorId>", {
"supplierName": "Viking Cruises",
"providerKey": "viking",
"market": "US",
"credentials": {},
"metadata": {}
});curl --request POST \
--url https://api.voyant.travel/connect/v1/operators/<operatorId>/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"supplierName": "Viking Cruises",
"providerKey": "viking",
"market": "US",
"credentials": {},
"metadata": {}
}'const response = await fetch("https://api.voyant.travel/connect/v1/operators/<operatorId>/connections", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
body: JSON.stringify({
"supplierName": "Viking Cruises",
"providerKey": "viking",
"market": "US",
"credentials": {},
"metadata": {}
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.voyant.travel/connect/v1/operators/<operatorId>/connections",
headers={
"Authorization": "Bearer <token>"
},
json={
"supplierName": "Viking Cruises",
"providerKey": "viking",
"market": "US",
"credentials": {},
"metadata": {}
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/connect/v1/operators/{operatorId}/connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'supplierName' => 'Viking Cruises',
'providerKey' => 'viking',
'market' => 'US',
'commercialClassification' => 'private_external',
'credentials' => [
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voyant.travel/connect/v1/operators/{operatorId}/connections"
payload := strings.NewReader("{\n \"supplierName\": \"Viking Cruises\",\n \"providerKey\": \"viking\",\n \"market\": \"US\",\n \"commercialClassification\": \"private_external\",\n \"credentials\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.voyant.travel/connect/v1/operators/{operatorId}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"supplierName\": \"Viking Cruises\",\n \"providerKey\": \"viking\",\n \"market\": \"US\",\n \"commercialClassification\": \"private_external\",\n \"credentials\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/connect/v1/operators/{operatorId}/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"supplierName\": \"Viking Cruises\",\n \"providerKey\": \"viking\",\n \"market\": \"US\",\n \"commercialClassification\": \"private_external\",\n \"credentials\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"operatorId": "<string>",
"supplierName": "<string>",
"status": "pending",
"commercialClassification": "network",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"providerKey": "<string>",
"providerRegistrationId": "<string>",
"market": "US",
"webhookSigningSecretLast4": "<string>",
"metadata": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}Connections
Create a connection
Creates a supplier connection for the operator. Credentials are validated against the provider before the connection becomes active. Requires a *:write scope.
POST
/
connect
/
v1
/
operators
/
{operatorId}
/
connections
SDK
import { createVoyantConnectClient } from "@voyant-travel/connect-sdk";
const connect = createVoyantConnectClient({ apiKey: process.env.VOYANT_API_KEY });
const result = await connect.connections.create("<operatorId>", {
"supplierName": "Viking Cruises",
"providerKey": "viking",
"market": "US",
"credentials": {},
"metadata": {}
});curl --request POST \
--url https://api.voyant.travel/connect/v1/operators/<operatorId>/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"supplierName": "Viking Cruises",
"providerKey": "viking",
"market": "US",
"credentials": {},
"metadata": {}
}'const response = await fetch("https://api.voyant.travel/connect/v1/operators/<operatorId>/connections", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
body: JSON.stringify({
"supplierName": "Viking Cruises",
"providerKey": "viking",
"market": "US",
"credentials": {},
"metadata": {}
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.voyant.travel/connect/v1/operators/<operatorId>/connections",
headers={
"Authorization": "Bearer <token>"
},
json={
"supplierName": "Viking Cruises",
"providerKey": "viking",
"market": "US",
"credentials": {},
"metadata": {}
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/connect/v1/operators/{operatorId}/connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'supplierName' => 'Viking Cruises',
'providerKey' => 'viking',
'market' => 'US',
'commercialClassification' => 'private_external',
'credentials' => [
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voyant.travel/connect/v1/operators/{operatorId}/connections"
payload := strings.NewReader("{\n \"supplierName\": \"Viking Cruises\",\n \"providerKey\": \"viking\",\n \"market\": \"US\",\n \"commercialClassification\": \"private_external\",\n \"credentials\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.voyant.travel/connect/v1/operators/{operatorId}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"supplierName\": \"Viking Cruises\",\n \"providerKey\": \"viking\",\n \"market\": \"US\",\n \"commercialClassification\": \"private_external\",\n \"credentials\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/connect/v1/operators/{operatorId}/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"supplierName\": \"Viking Cruises\",\n \"providerKey\": \"viking\",\n \"market\": \"US\",\n \"commercialClassification\": \"private_external\",\n \"credentials\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"operatorId": "<string>",
"supplierName": "<string>",
"status": "pending",
"commercialClassification": "network",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"providerKey": "<string>",
"providerRegistrationId": "<string>",
"market": "US",
"webhookSigningSecretLast4": "<string>",
"metadata": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}Authorizations
Provide either a static platform API key or an OAuth2 access token (from /connect/v1/oauth/token) as Authorization: Bearer <token>. Scopes are connect:* (e.g. connect:bookings:write).
Path Parameters
Operator id.
Body
application/json
Example:
"Viking Cruises"
Example:
"viking"
Example:
"US"
Defaults to private_external. Network and native_network may only be set by trusted internal provisioning for eligible published operators.
Available options:
network, native_network, private_external Provider-specific credentials, validated before activation.
Response
A connection.
Available options:
pending, active, paused, errored Who owns and approves distribution for this connection. Set at creation (or via staff promote). Not inferred from the provider auth model.
Available options:
network, native_network, private_external Example:
"US"
⌘I