Create or update a PSP connection (BYOK)
curl --request POST \
--url http://localhost:8081/v1/connections \
--header 'Content-Type: application/json' \
--header 'X-Org-Id: <x-org-id>' \
--header 'X-Reevit-Key: <api-key>' \
--data '
{
"credentials": {},
"id": "<string>",
"mode": "live",
"status": "active",
"capabilities": {},
"routing_hints": {
"country_preference": [
"<string>"
],
"method_bias": {},
"fallback_only": true
},
"labels": [
"<string>"
],
"workflow_id": "<string>"
}
'import requests
url = "http://localhost:8081/v1/connections"
payload = {
"credentials": {},
"id": "<string>",
"mode": "live",
"status": "active",
"capabilities": {},
"routing_hints": {
"country_preference": ["<string>"],
"method_bias": {},
"fallback_only": True
},
"labels": ["<string>"],
"workflow_id": "<string>"
}
headers = {
"X-Org-Id": "<x-org-id>",
"X-Reevit-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Org-Id': '<x-org-id>',
'X-Reevit-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
credentials: {},
id: '<string>',
mode: 'live',
status: 'active',
capabilities: {},
routing_hints: {country_preference: ['<string>'], method_bias: {}, fallback_only: true},
labels: ['<string>'],
workflow_id: '<string>'
})
};
fetch('http://localhost:8081/v1/connections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8081",
CURLOPT_URL => "http://localhost:8081/v1/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([
'credentials' => [
],
'id' => '<string>',
'mode' => 'live',
'status' => 'active',
'capabilities' => [
],
'routing_hints' => [
'country_preference' => [
'<string>'
],
'method_bias' => [
],
'fallback_only' => true
],
'labels' => [
'<string>'
],
'workflow_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Org-Id: <x-org-id>",
"X-Reevit-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 := "http://localhost:8081/v1/connections"
payload := strings.NewReader("{\n \"credentials\": {},\n \"id\": \"<string>\",\n \"mode\": \"live\",\n \"status\": \"active\",\n \"capabilities\": {},\n \"routing_hints\": {\n \"country_preference\": [\n \"<string>\"\n ],\n \"method_bias\": {},\n \"fallback_only\": true\n },\n \"labels\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Org-Id", "<x-org-id>")
req.Header.Add("X-Reevit-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("http://localhost:8081/v1/connections")
.header("X-Org-Id", "<x-org-id>")
.header("X-Reevit-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"credentials\": {},\n \"id\": \"<string>\",\n \"mode\": \"live\",\n \"status\": \"active\",\n \"capabilities\": {},\n \"routing_hints\": {\n \"country_preference\": [\n \"<string>\"\n ],\n \"method_bias\": {},\n \"fallback_only\": true\n },\n \"labels\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8081/v1/connections")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-Org-Id"] = '<x-org-id>'
request["X-Reevit-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentials\": {},\n \"id\": \"<string>\",\n \"mode\": \"live\",\n \"status\": \"active\",\n \"capabilities\": {},\n \"routing_hints\": {\n \"country_preference\": [\n \"<string>\"\n ],\n \"method_bias\": {},\n \"fallback_only\": true\n },\n \"labels\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"provider": "<string>",
"mode": "<string>",
"status": "<string>",
"capabilities": {},
"routing_hints": {
"country_preference": [
"<string>"
],
"method_bias": {},
"fallback_only": true
},
"labels": [
"<string>"
],
"workflow_id": "<string>",
"fee_structure": {
"percentage": 123,
"fixed": 123,
"per_method": {},
"per_currency": {}
},
"total_calls": 123,
"successful_calls": 123,
"failed_calls": 123,
"total_latency_ms": 123,
"last_success_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"health_score": 123,
"health_status": "<string>",
"last_validated_at": "2023-11-07T05:31:56Z",
"last_validation_status": "<string>",
"last_validation_error": "<string>",
"validation_failures": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "invalid_request",
"code": "email_required",
"message": "email is required",
"details": {
"metric": "workflow_executions",
"used": "2000",
"limit": "2000",
"reset": "2025-01-01T00:00:00Z"
}
}{
"error": "invalid_request",
"code": "email_required",
"message": "email is required",
"details": {
"metric": "workflow_executions",
"used": "2000",
"limit": "2000",
"reset": "2025-01-01T00:00:00Z"
}
}Connections
Create or update a PSP connection (BYOK)
POST
/
v1
/
connections
Create or update a PSP connection (BYOK)
curl --request POST \
--url http://localhost:8081/v1/connections \
--header 'Content-Type: application/json' \
--header 'X-Org-Id: <x-org-id>' \
--header 'X-Reevit-Key: <api-key>' \
--data '
{
"credentials": {},
"id": "<string>",
"mode": "live",
"status": "active",
"capabilities": {},
"routing_hints": {
"country_preference": [
"<string>"
],
"method_bias": {},
"fallback_only": true
},
"labels": [
"<string>"
],
"workflow_id": "<string>"
}
'import requests
url = "http://localhost:8081/v1/connections"
payload = {
"credentials": {},
"id": "<string>",
"mode": "live",
"status": "active",
"capabilities": {},
"routing_hints": {
"country_preference": ["<string>"],
"method_bias": {},
"fallback_only": True
},
"labels": ["<string>"],
"workflow_id": "<string>"
}
headers = {
"X-Org-Id": "<x-org-id>",
"X-Reevit-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Org-Id': '<x-org-id>',
'X-Reevit-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
credentials: {},
id: '<string>',
mode: 'live',
status: 'active',
capabilities: {},
routing_hints: {country_preference: ['<string>'], method_bias: {}, fallback_only: true},
labels: ['<string>'],
workflow_id: '<string>'
})
};
fetch('http://localhost:8081/v1/connections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8081",
CURLOPT_URL => "http://localhost:8081/v1/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([
'credentials' => [
],
'id' => '<string>',
'mode' => 'live',
'status' => 'active',
'capabilities' => [
],
'routing_hints' => [
'country_preference' => [
'<string>'
],
'method_bias' => [
],
'fallback_only' => true
],
'labels' => [
'<string>'
],
'workflow_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Org-Id: <x-org-id>",
"X-Reevit-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 := "http://localhost:8081/v1/connections"
payload := strings.NewReader("{\n \"credentials\": {},\n \"id\": \"<string>\",\n \"mode\": \"live\",\n \"status\": \"active\",\n \"capabilities\": {},\n \"routing_hints\": {\n \"country_preference\": [\n \"<string>\"\n ],\n \"method_bias\": {},\n \"fallback_only\": true\n },\n \"labels\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Org-Id", "<x-org-id>")
req.Header.Add("X-Reevit-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("http://localhost:8081/v1/connections")
.header("X-Org-Id", "<x-org-id>")
.header("X-Reevit-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"credentials\": {},\n \"id\": \"<string>\",\n \"mode\": \"live\",\n \"status\": \"active\",\n \"capabilities\": {},\n \"routing_hints\": {\n \"country_preference\": [\n \"<string>\"\n ],\n \"method_bias\": {},\n \"fallback_only\": true\n },\n \"labels\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8081/v1/connections")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["X-Org-Id"] = '<x-org-id>'
request["X-Reevit-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentials\": {},\n \"id\": \"<string>\",\n \"mode\": \"live\",\n \"status\": \"active\",\n \"capabilities\": {},\n \"routing_hints\": {\n \"country_preference\": [\n \"<string>\"\n ],\n \"method_bias\": {},\n \"fallback_only\": true\n },\n \"labels\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"provider": "<string>",
"mode": "<string>",
"status": "<string>",
"capabilities": {},
"routing_hints": {
"country_preference": [
"<string>"
],
"method_bias": {},
"fallback_only": true
},
"labels": [
"<string>"
],
"workflow_id": "<string>",
"fee_structure": {
"percentage": 123,
"fixed": 123,
"per_method": {},
"per_currency": {}
},
"total_calls": 123,
"successful_calls": 123,
"failed_calls": 123,
"total_latency_ms": 123,
"last_success_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"health_score": 123,
"health_status": "<string>",
"last_validated_at": "2023-11-07T05:31:56Z",
"last_validation_status": "<string>",
"last_validation_error": "<string>",
"validation_failures": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "invalid_request",
"code": "email_required",
"message": "email is required",
"details": {
"metric": "workflow_executions",
"used": "2000",
"limit": "2000",
"reset": "2025-01-01T00:00:00Z"
}
}{
"error": "invalid_request",
"code": "email_required",
"message": "email is required",
"details": {
"metric": "workflow_executions",
"used": "2000",
"limit": "2000",
"reset": "2025-01-01T00:00:00Z"
}
}Authorizations
API key for server-to-server authentication
Headers
Organization identifier for multi-tenancy
Idempotency key for safe retries
Body
application/json
Available options:
paystack, hubtel, flutterwave, monnify, mpesa, pawapay, moolre, stripe Available options:
sandbox, live Available options:
active, inactive Show child attributes
Show child attributes
Up to 20 lowercase labels (letters, numbers, -, _)
Optional workflow invoked for payments routed through this connection
Response
Created
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Result of the PSP account-name verification check run after credential validation. unknown — check has not run yet or the PSP does not support it. match — the merchant's registered name matches the PSP account name. mismatch — the names do not match; the connection may still be usable but should be reviewed.
Available options:
unknown, match, mismatch ⌘I

