Skip to main content
POST
/
v1
/
contexts
/
{contextId}
/
sources
Create a reconciliation source
curl --request POST \
  --url https://matcher.sandbox.lerian.net/v1/contexts/{contextId}/sources \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Primary Bank Account",
  "type": "BANK",
  "side": "LEFT",
  "config": {}
}
'
import requests

url = "https://matcher.sandbox.lerian.net/v1/contexts/{contextId}/sources"

payload = {
"name": "Primary Bank Account",
"type": "BANK",
"side": "LEFT",
"config": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Primary Bank Account', type: 'BANK', side: 'LEFT', config: {}})
};

fetch('https://matcher.sandbox.lerian.net/v1/contexts/{contextId}/sources', 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://matcher.sandbox.lerian.net/v1/contexts/{contextId}/sources",
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' => 'Primary Bank Account',
'type' => 'BANK',
'side' => 'LEFT',
'config' => [

]
]),
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://matcher.sandbox.lerian.net/v1/contexts/{contextId}/sources"

payload := strings.NewReader("{\n \"name\": \"Primary Bank Account\",\n \"type\": \"BANK\",\n \"side\": \"LEFT\",\n \"config\": {}\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://matcher.sandbox.lerian.net/v1/contexts/{contextId}/sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Primary Bank Account\",\n \"type\": \"BANK\",\n \"side\": \"LEFT\",\n \"config\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://matcher.sandbox.lerian.net/v1/contexts/{contextId}/sources")

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 \"name\": \"Primary Bank Account\",\n \"type\": \"BANK\",\n \"side\": \"LEFT\",\n \"config\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "contextId": "<string>",
  "name": "<string>",
  "config": {},
  "createdAt": "<string>",
  "updatedAt": "<string>"
}
{
"code": "MTCH-0001",
"title": "Bad Request",
"message": "context not found",
"error": "<string>",
"details": {}
}
{
"code": "MTCH-0001",
"title": "Bad Request",
"message": "context not found",
"error": "<string>",
"details": {}
}
{
"code": "MTCH-0001",
"title": "Bad Request",
"message": "context not found",
"error": "<string>",
"details": {}
}
{
"code": "MTCH-0001",
"title": "Bad Request",
"message": "context not found",
"error": "<string>",
"details": {}
}
{
"code": "MTCH-0001",
"title": "Bad Request",
"message": "context not found",
"error": "<string>",
"details": {}
}
{
"code": "MTCH-0002",
"title": "Internal Server Error",
"message": "internal server error"
}

Authorizations

Authorization
string
header
required

Bearer token authentication (format: "Bearer {token}")

Headers

X-Request-Id
string

A unique identifier for tracing the request across services.

X-Idempotency-Key
string

Optional idempotency key for safe retries. Also accepts Idempotency-Key as an alternative header name. If the same key is sent again and the original request was already processed, the cached response is returned with X-Idempotency-Replayed: true.

See Retries and idempotency for details.

Path Parameters

contextId
string
required

The unique identifier of the reconciliation context.

Body

application/json

Source creation payload

name
string
required
Required string length: 1 - 50
Example:

"Primary Bank Account"

type
enum<string>
required

Category of data source for reconciliation

Available options:
LEDGER,
BANK,
GATEWAY,
CUSTOM,
FETCHER
Example:

"BANK"

side
enum<string>
required

Side of the reconciliation this source feeds

Available options:
LEFT,
RIGHT
Example:

"LEFT"

config
object

Response

Successfully created source.

The response includes the X-Idempotency-Replayed header.

If the value is false, the request was just processed. If the value is true, the response is a replay of a previously processed request.

See Retries and idempotency for more details.

id
string
contextId
string
name
string
type
enum<string>

Category of data source for reconciliation

Available options:
LEDGER,
BANK,
GATEWAY,
CUSTOM,
FETCHER
side
enum<string>

Side of the reconciliation this source feeds

Available options:
LEFT,
RIGHT
config
object
createdAt
string
updatedAt
string