Get the variance report of a replenishment
curl --request GET \
--url https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report', 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://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"product_id": 9002,
"expected_quantity": 24,
"box_sku": "SKU-BOX-BLUE",
"received_quantity": 24,
"lot_id": 4101,
"variance": 0
},
{
"product_id": 9002,
"expected_quantity": 24,
"box_sku": "SKU-BOX-BLUE",
"received_quantity": 20,
"lot_id": 4102,
"variance": -4
},
{
"product_id": 9004,
"expected_quantity": 10,
"box_sku": "SKU-BOX-RED",
"received_quantity": 0,
"lot_id": null,
"variance": -10
}
]Replenishments
Get the variance report of a replenishment
Compares, per declared lot, the quantity you announced with the quantity the warehouse actually
received. Available only for replenishments that declared expected quantities per lot, either
through products[].lots on creation or derived from an attached NF-e (see attach-invoice).
- By default the replenishment must be
COMPLETED. Sendignore_not_completed=trueto read a partial report while receiving is still in progress. varianceisreceived_quantity - expected_quantity: negative means units are missing, positive means more units than announced were received.- A declared lot that was never matched to a received lot is reported with
lot_id: null,received_quantity: 0and a variance equal to minus its expected quantity.
GET
/
replenishments
/
{replenishment_id}
/
variance-report
Get the variance report of a replenishment
curl --request GET \
--url https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report', 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://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cubbo.com/v1/replenishments/{replenishment_id}/variance-report")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"product_id": 9002,
"expected_quantity": 24,
"box_sku": "SKU-BOX-BLUE",
"received_quantity": 24,
"lot_id": 4101,
"variance": 0
},
{
"product_id": 9002,
"expected_quantity": 24,
"box_sku": "SKU-BOX-BLUE",
"received_quantity": 20,
"lot_id": 4102,
"variance": -4
},
{
"product_id": 9004,
"expected_quantity": 10,
"box_sku": "SKU-BOX-RED",
"received_quantity": 0,
"lot_id": null,
"variance": -10
}
]Authorizations
Query Parameters
Response
One row per declared lot