Reconcile with the BI
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/measure/reconcile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": {
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"format": "csv"
},
"since": "2023-12-25",
"until": "2023-12-25"
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/measure/reconcile"
payload = {
"file": {
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"format": "csv"
},
"since": "2023-12-25",
"until": "2023-12-25"
}
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({
file: {upload_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', format: 'csv'},
since: '2023-12-25',
until: '2023-12-25'
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/measure/reconcile', 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://{space}.{region}.api.niadra.com/v1/measure/reconcile",
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([
'file' => [
'upload_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'format' => 'csv'
],
'since' => '2023-12-25',
'until' => '2023-12-25'
]),
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://{space}.{region}.api.niadra.com/v1/measure/reconcile"
payload := strings.NewReader("{\n \"file\": {\n \"upload_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"format\": \"csv\"\n },\n \"since\": \"2023-12-25\",\n \"until\": \"2023-12-25\"\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://{space}.{region}.api.niadra.com/v1/measure/reconcile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file\": {\n \"upload_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"format\": \"csv\"\n },\n \"since\": \"2023-12-25\",\n \"until\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/measure/reconcile")
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 \"file\": {\n \"upload_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"format\": \"csv\"\n },\n \"since\": \"2023-12-25\",\n \"until\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"bi_minor": 123,
"deviation": 123,
"matched": 123,
"only_bi": 123,
"only_ours": 123,
"ours_minor": 123,
"report_id": "<string>",
"tolerance": 123,
"within_tolerance": true,
"currency": "<string>",
"worst": [
{
"bi_minor": 123,
"line": "<string>",
"order": "<string>",
"ours_minor": 123
}
]
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Outcomes and experiments
Reconcile with the BI
The period’s attributed lines against your BI file, line by line, with the deviation on the lines both sides know.
POST
/
v1
/
measure
/
reconcile
Reconcile with the BI
curl --request POST \
--url https://{space}.{region}.api.niadra.com/v1/measure/reconcile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": {
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"format": "csv"
},
"since": "2023-12-25",
"until": "2023-12-25"
}
'import requests
url = "https://{space}.{region}.api.niadra.com/v1/measure/reconcile"
payload = {
"file": {
"upload_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"format": "csv"
},
"since": "2023-12-25",
"until": "2023-12-25"
}
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({
file: {upload_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', format: 'csv'},
since: '2023-12-25',
until: '2023-12-25'
})
};
fetch('https://{space}.{region}.api.niadra.com/v1/measure/reconcile', 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://{space}.{region}.api.niadra.com/v1/measure/reconcile",
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([
'file' => [
'upload_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'format' => 'csv'
],
'since' => '2023-12-25',
'until' => '2023-12-25'
]),
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://{space}.{region}.api.niadra.com/v1/measure/reconcile"
payload := strings.NewReader("{\n \"file\": {\n \"upload_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"format\": \"csv\"\n },\n \"since\": \"2023-12-25\",\n \"until\": \"2023-12-25\"\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://{space}.{region}.api.niadra.com/v1/measure/reconcile")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file\": {\n \"upload_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"format\": \"csv\"\n },\n \"since\": \"2023-12-25\",\n \"until\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{space}.{region}.api.niadra.com/v1/measure/reconcile")
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 \"file\": {\n \"upload_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"format\": \"csv\"\n },\n \"since\": \"2023-12-25\",\n \"until\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"bi_minor": 123,
"deviation": 123,
"matched": 123,
"only_bi": 123,
"only_ours": 123,
"ours_minor": 123,
"report_id": "<string>",
"tolerance": 123,
"within_tolerance": true,
"currency": "<string>",
"worst": [
{
"bi_minor": 123,
"line": "<string>",
"order": "<string>",
"ours_minor": 123
}
]
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"request_id": "<string>",
"type": "about:blank"
}Authorizations
sourceKeypersonToken
nia_sk_...
Body
application/json
The company's BI export for the period, uploaded first (POST /v1/measure/reconcile/uploads), as CSV
with a header: order (the id the company knows the object by), line (optional), value (in major
units, as the signed definition nets it) and currency. It is read once and deleted.
Show child attributes
Show child attributes
Response
Successful Response
Our value of each line against the BI's, on the lines both know; lines only one side knows are counted apart and never enter the deviation.
|ours - BI| / BI on the lines both know.
Required string length:
1 - 512The lines that differ most.
Show child attributes
Show child attributes

