List returns that still need an inbound NF-e (Brazil)
curl --request GET \
--url https://api.cubbo.com/v1/returns/awaiting-invoice \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cubbo.com/v1/returns/awaiting-invoice"
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/returns/awaiting-invoice', 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/returns/awaiting-invoice",
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/returns/awaiting-invoice"
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/returns/awaiting-invoice")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cubbo.com/v1/returns/awaiting-invoice")
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{
"returns": [
{
"id": 98765,
"return_type": "RETURNED_BY_CARRIER",
"replenishment_id": 77001,
"related_sale_invoice": {
"invoice_key": "00000000000000000000000000000000000000000000"
},
"returned_order": {
"id": 445566,
"channel_order_id": "1000123",
"order_number": "ORD-0001",
"integration_details": {
"marketplace": "MERCADOLIBRE"
}
}
}
],
"meta": {
"current_page": 1,
"next_page": null,
"prev_page": null,
"total_pages": 1,
"first_page": true,
"last_page": true,
"per_page": 10,
"total_count": 1
}
}Returns
List returns that still need an inbound NF-e (Brazil)
Brazil only. In Brazil, goods entering Cubbo’s warehouse must be covered by an electronic
invoice (NF-e, Nota Fiscal Eletrônica). When a returned order is received and is being put
away, your store must issue the inbound NF-e for the return (and, when applicable, for the
stock re-entry) and attach it with POST /returns/{return_id}/attach-invoice. This endpoint
lists the returns of a store that are waiting for that document, newest first, so you can
poll it and issue the missing invoices.
A return is listed when all of the following hold:
- its received stock is being put away (the reception has reached the put-away stage),
- the original order has an approved sale (or donation) NF-e, whose access key is given in
related_sale_invoiceso you can reference it on the inbound invoice, and - it is still missing an approved, processing, contingency or pre-approved NF-e for either the return itself or its stock re-entry.
GET
/
returns
/
awaiting-invoice
List returns that still need an inbound NF-e (Brazil)
curl --request GET \
--url https://api.cubbo.com/v1/returns/awaiting-invoice \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cubbo.com/v1/returns/awaiting-invoice"
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/returns/awaiting-invoice', 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/returns/awaiting-invoice",
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/returns/awaiting-invoice"
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/returns/awaiting-invoice")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cubbo.com/v1/returns/awaiting-invoice")
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{
"returns": [
{
"id": 98765,
"return_type": "RETURNED_BY_CARRIER",
"replenishment_id": 77001,
"related_sale_invoice": {
"invoice_key": "00000000000000000000000000000000000000000000"
},
"returned_order": {
"id": 445566,
"channel_order_id": "1000123",
"order_number": "ORD-0001",
"integration_details": {
"marketplace": "MERCADOLIBRE"
}
}
}
],
"meta": {
"current_page": 1,
"next_page": null,
"prev_page": null,
"total_pages": 1,
"first_page": true,
"last_page": true,
"per_page": 10,
"total_count": 1
}
}