Skip to main content
POST
/
api
/
v1
/
core
/
routing
/
resolve
Resolve payment routing
curl --request POST \
  --url https://spi.sandbox.lerian.net/api/v1/core/routing/resolve \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 123,
  "senderISPB": "<string>"
}
'
import requests

url = "https://spi.sandbox.lerian.net/api/v1/core/routing/resolve"

payload = {
"amount": 123,
"senderISPB": "<string>"
}
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({amount: 123, senderISPB: '<string>'})
};

fetch('https://spi.sandbox.lerian.net/api/v1/core/routing/resolve', 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://spi.sandbox.lerian.net/api/v1/core/routing/resolve",
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([
'amount' => 123,
'senderISPB' => '<string>'
]),
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://spi.sandbox.lerian.net/api/v1/core/routing/resolve"

payload := strings.NewReader("{\n \"amount\": 123,\n \"senderISPB\": \"<string>\"\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://spi.sandbox.lerian.net/api/v1/core/routing/resolve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"senderISPB\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://spi.sandbox.lerian.net/api/v1/core/routing/resolve")

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 \"amount\": 123,\n \"senderISPB\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "isDirect": true,
  "quotaValidatedAmount": 123,
  "indirectISPB": "<string>",
  "sponsorISPB": "<string>"
}
{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}

Authorizations

Authorization
string
header
required

JWT bearer token issued by the identity provider.

Body

application/json
amount
integer<int64>
required

Transaction amount in centavos (BRL minor units) to validate against quota; must be greater than zero.

Example:

15000

senderISPB
string
required

ISPB of the sending participant whose routing is being resolved, exactly 8 numeric digits.

Example:

"12345678"

Response

OK

isDirect
boolean
required

True when the sender connects directly to BACEN; false when routed through a sponsor.

Example:

false

quotaValidatedAmount
integer<int64>
required

Amount in centavos (BRL minor units) validated against the indirect participant's quota.

Example:

15000

indirectISPB
string

ISPB of the indirect participant being routed through the sponsor (8 numeric digits); empty for direct participants.

Example:

"12345678"

sponsorISPB
string

ISPB of the sponsor participant routing the payment (8 numeric digits); empty for direct participants.

Example:

"87654321"