Reconciliar com o 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"
}Desfechos e experimentos
Reconciliar com o BI
As linhas atribuídas do período contra o arquivo do seu BI, linha a linha, com o desvio nas linhas que os dois lados conhecem.
POST
/
v1
/
measure
/
reconcile
Reconciliar com o 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"
}Autorizações
sourceKeypersonToken
nia_sk_...
Corpo
application/json
A exportação do BI da empresa para o período, enviada antes (POST /v1/measure/reconcile/uploads), em CSV com cabeçalho: order (o id pelo qual a empresa conhece o objeto), line (opcional), value (em unidades maiores, como a definição assinada o líquida) e currency. É lida uma vez e apagada.
Show child attributes
Show child attributes
Resposta
Resposta de sucesso.
O nosso valor de cada linha contra o do BI, nas linhas que os dois conhecem; linhas que só um lado conhece são contadas à parte e nunca entram no desvio.
|nosso - BI| / BI nas linhas que os dois conhecem.
Required string length:
1 - 512As linhas que mais divergem.
Show child attributes
Show child attributes

