Routing - Create
curl --request POST \
--url https://api.test.switch.vaultera.co/routing \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"algorithm": {
"type": "single",
"data": {
"merchant_connector_id": "<string>"
}
},
"profile_id": "<string>"
}
'import requests
url = "https://api.test.switch.vaultera.co/routing"
payload = {
"name": "<string>",
"description": "<string>",
"algorithm": {
"type": "single",
"data": { "merchant_connector_id": "<string>" }
},
"profile_id": "<string>"
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
algorithm: {type: 'single', data: {merchant_connector_id: '<string>'}},
profile_id: '<string>'
})
};
fetch('https://api.test.switch.vaultera.co/routing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.test.switch.vaultera.co/routing",
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([
'name' => '<string>',
'description' => '<string>',
'algorithm' => [
'type' => 'single',
'data' => [
'merchant_connector_id' => '<string>'
]
],
'profile_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$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.test.switch.vaultera.co/routing"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"algorithm\": {\n \"type\": \"single\",\n \"data\": {\n \"merchant_connector_id\": \"<string>\"\n }\n },\n \"profile_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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.test.switch.vaultera.co/routing")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"algorithm\": {\n \"type\": \"single\",\n \"data\": {\n \"merchant_connector_id\": \"<string>\"\n }\n },\n \"profile_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.test.switch.vaultera.co/routing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"algorithm\": {\n \"type\": \"single\",\n \"data\": {\n \"merchant_connector_id\": \"<string>\"\n }\n },\n \"profile_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"profile_id": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": 123,
"modified_at": 123
}Routing - Create
Create a routing config
POST
/
routing
Routing - Create
curl --request POST \
--url https://api.test.switch.vaultera.co/routing \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"algorithm": {
"type": "single",
"data": {
"merchant_connector_id": "<string>"
}
},
"profile_id": "<string>"
}
'import requests
url = "https://api.test.switch.vaultera.co/routing"
payload = {
"name": "<string>",
"description": "<string>",
"algorithm": {
"type": "single",
"data": { "merchant_connector_id": "<string>" }
},
"profile_id": "<string>"
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
algorithm: {type: 'single', data: {merchant_connector_id: '<string>'}},
profile_id: '<string>'
})
};
fetch('https://api.test.switch.vaultera.co/routing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.test.switch.vaultera.co/routing",
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([
'name' => '<string>',
'description' => '<string>',
'algorithm' => [
'type' => 'single',
'data' => [
'merchant_connector_id' => '<string>'
]
],
'profile_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$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.test.switch.vaultera.co/routing"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"algorithm\": {\n \"type\": \"single\",\n \"data\": {\n \"merchant_connector_id\": \"<string>\"\n }\n },\n \"profile_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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.test.switch.vaultera.co/routing")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"algorithm\": {\n \"type\": \"single\",\n \"data\": {\n \"merchant_connector_id\": \"<string>\"\n }\n },\n \"profile_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.test.switch.vaultera.co/routing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"algorithm\": {\n \"type\": \"single\",\n \"data\": {\n \"merchant_connector_id\": \"<string>\"\n }\n },\n \"profile_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"profile_id": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": 123,
"modified_at": 123
}Authorizations
Use the API key created under your merchant account from the Vaultera Switch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.
Body
application/json
Response
Routing config created
Available options:
single, priority, volume_split, advanced, dynamic Available options:
payment, payout ⌘I