Provision the store's fiscal account (Brazil)
curl --request POST \
--url https://api.cubbo.com/v1/store/fiscal-account \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cnpj": "00.000.000/0001-91",
"legal_name": "Partner Store SP LTDA",
"trade_name": "Partner Store",
"state_registration": "123456789",
"tax_regime": "SIMPLES_NACIONAL",
"unit_type": "matriz",
"email": "fiscal@example.com",
"address": {
"zip_code": "01310-100",
"street": "Av. Paulista",
"number": "1000",
"complement": "Sala 1",
"neighborhood": "Bela Vista",
"city": "Sao Paulo",
"state": "SP"
}
}
'import requests
url = "https://api.cubbo.com/v1/store/fiscal-account"
payload = {
"cnpj": "00.000.000/0001-91",
"legal_name": "Partner Store SP LTDA",
"trade_name": "Partner Store",
"state_registration": "123456789",
"tax_regime": "SIMPLES_NACIONAL",
"unit_type": "matriz",
"email": "fiscal@example.com",
"address": {
"zip_code": "01310-100",
"street": "Av. Paulista",
"number": "1000",
"complement": "Sala 1",
"neighborhood": "Bela Vista",
"city": "Sao Paulo",
"state": "SP"
}
}
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({
cnpj: '00.000.000/0001-91',
legal_name: 'Partner Store SP LTDA',
trade_name: 'Partner Store',
state_registration: '123456789',
tax_regime: 'SIMPLES_NACIONAL',
unit_type: 'matriz',
email: 'fiscal@example.com',
address: {
zip_code: '01310-100',
street: 'Av. Paulista',
number: '1000',
complement: 'Sala 1',
neighborhood: 'Bela Vista',
city: 'Sao Paulo',
state: 'SP'
}
})
};
fetch('https://api.cubbo.com/v1/store/fiscal-account', 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/store/fiscal-account",
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([
'cnpj' => '00.000.000/0001-91',
'legal_name' => 'Partner Store SP LTDA',
'trade_name' => 'Partner Store',
'state_registration' => '123456789',
'tax_regime' => 'SIMPLES_NACIONAL',
'unit_type' => 'matriz',
'email' => 'fiscal@example.com',
'address' => [
'zip_code' => '01310-100',
'street' => 'Av. Paulista',
'number' => '1000',
'complement' => 'Sala 1',
'neighborhood' => 'Bela Vista',
'city' => 'Sao Paulo',
'state' => 'SP'
]
]),
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://api.cubbo.com/v1/store/fiscal-account"
payload := strings.NewReader("{\n \"cnpj\": \"00.000.000/0001-91\",\n \"legal_name\": \"Partner Store SP LTDA\",\n \"trade_name\": \"Partner Store\",\n \"state_registration\": \"123456789\",\n \"tax_regime\": \"SIMPLES_NACIONAL\",\n \"unit_type\": \"matriz\",\n \"email\": \"fiscal@example.com\",\n \"address\": {\n \"zip_code\": \"01310-100\",\n \"street\": \"Av. Paulista\",\n \"number\": \"1000\",\n \"complement\": \"Sala 1\",\n \"neighborhood\": \"Bela Vista\",\n \"city\": \"Sao Paulo\",\n \"state\": \"SP\"\n }\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://api.cubbo.com/v1/store/fiscal-account")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cnpj\": \"00.000.000/0001-91\",\n \"legal_name\": \"Partner Store SP LTDA\",\n \"trade_name\": \"Partner Store\",\n \"state_registration\": \"123456789\",\n \"tax_regime\": \"SIMPLES_NACIONAL\",\n \"unit_type\": \"matriz\",\n \"email\": \"fiscal@example.com\",\n \"address\": {\n \"zip_code\": \"01310-100\",\n \"street\": \"Av. Paulista\",\n \"number\": \"1000\",\n \"complement\": \"Sala 1\",\n \"neighborhood\": \"Bela Vista\",\n \"city\": \"Sao Paulo\",\n \"state\": \"SP\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cubbo.com/v1/store/fiscal-account")
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 \"cnpj\": \"00.000.000/0001-91\",\n \"legal_name\": \"Partner Store SP LTDA\",\n \"trade_name\": \"Partner Store\",\n \"state_registration\": \"123456789\",\n \"tax_regime\": \"SIMPLES_NACIONAL\",\n \"unit_type\": \"matriz\",\n \"email\": \"fiscal@example.com\",\n \"address\": {\n \"zip_code\": \"01310-100\",\n \"street\": \"Av. Paulista\",\n \"number\": \"1000\",\n \"complement\": \"Sala 1\",\n \"neighborhood\": \"Bela Vista\",\n \"city\": \"Sao Paulo\",\n \"state\": \"SP\"\n }\n}"
response = http.request(request)
puts response.read_body{
"store_id": 4821,
"fiscal_account": {
"status": "created",
"cnpj": "00.000.000/0001-91",
"legal_name": "Partner Store SP LTDA",
"tax_regime": "SIMPLES_NACIONAL",
"mirrored_fields": [
"tax_id",
"tax_company_name",
"tax_state_registration",
"tax_regime",
"tax_address",
"tax_address_number",
"tax_address_neighborhood",
"tax_city",
"tax_zipcode",
"state"
],
"skipped_fields": [],
"mirror_error": null
}
}Stores
Provision the store's fiscal account (Brazil)
Brazil only. Creates the store’s electronic invoicing account and registers its company data so the store can later upload a digital certificate and issue NF-e (Nota Fiscal Eletronica, the Brazilian electronic invoice). The store is derived from the credential used to obtain the token; no store id is accepted.
- Idempotent: if the store already has a fiscal account, the account is not created
again; the company data is re-sent and
statuscomes back asupdatedinstead ofcreated. Retrying after a partial failure is safe. - The company data is also copied onto the store’s own fiscal fields (the ones
PATCH /storeedits), but only where they are still blank.mirrored_fieldslists what was written;skipped_fieldslists what already had a value and was left alone. cnpjandtax_regimeare identity fields: if the store already holds a different value for either (from an earlier call or fromPATCH /store), the request is rejected instead of overwriting it. Resubmitting the same value is not a conflict. For this reason, call this endpoint before setting those fields throughPATCH /store.address.statemust be a two-letter Brazilian UF code; it is validated before the account is created.- The CNPJ (Cadastro Nacional da Pessoa Juridica, the Brazilian company tax id) is accepted with or without punctuation and stored on the store as digits only.
- Provider credentials are never returned.
POST
/
store
/
fiscal-account
Provision the store's fiscal account (Brazil)
curl --request POST \
--url https://api.cubbo.com/v1/store/fiscal-account \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cnpj": "00.000.000/0001-91",
"legal_name": "Partner Store SP LTDA",
"trade_name": "Partner Store",
"state_registration": "123456789",
"tax_regime": "SIMPLES_NACIONAL",
"unit_type": "matriz",
"email": "fiscal@example.com",
"address": {
"zip_code": "01310-100",
"street": "Av. Paulista",
"number": "1000",
"complement": "Sala 1",
"neighborhood": "Bela Vista",
"city": "Sao Paulo",
"state": "SP"
}
}
'import requests
url = "https://api.cubbo.com/v1/store/fiscal-account"
payload = {
"cnpj": "00.000.000/0001-91",
"legal_name": "Partner Store SP LTDA",
"trade_name": "Partner Store",
"state_registration": "123456789",
"tax_regime": "SIMPLES_NACIONAL",
"unit_type": "matriz",
"email": "fiscal@example.com",
"address": {
"zip_code": "01310-100",
"street": "Av. Paulista",
"number": "1000",
"complement": "Sala 1",
"neighborhood": "Bela Vista",
"city": "Sao Paulo",
"state": "SP"
}
}
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({
cnpj: '00.000.000/0001-91',
legal_name: 'Partner Store SP LTDA',
trade_name: 'Partner Store',
state_registration: '123456789',
tax_regime: 'SIMPLES_NACIONAL',
unit_type: 'matriz',
email: 'fiscal@example.com',
address: {
zip_code: '01310-100',
street: 'Av. Paulista',
number: '1000',
complement: 'Sala 1',
neighborhood: 'Bela Vista',
city: 'Sao Paulo',
state: 'SP'
}
})
};
fetch('https://api.cubbo.com/v1/store/fiscal-account', 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/store/fiscal-account",
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([
'cnpj' => '00.000.000/0001-91',
'legal_name' => 'Partner Store SP LTDA',
'trade_name' => 'Partner Store',
'state_registration' => '123456789',
'tax_regime' => 'SIMPLES_NACIONAL',
'unit_type' => 'matriz',
'email' => 'fiscal@example.com',
'address' => [
'zip_code' => '01310-100',
'street' => 'Av. Paulista',
'number' => '1000',
'complement' => 'Sala 1',
'neighborhood' => 'Bela Vista',
'city' => 'Sao Paulo',
'state' => 'SP'
]
]),
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://api.cubbo.com/v1/store/fiscal-account"
payload := strings.NewReader("{\n \"cnpj\": \"00.000.000/0001-91\",\n \"legal_name\": \"Partner Store SP LTDA\",\n \"trade_name\": \"Partner Store\",\n \"state_registration\": \"123456789\",\n \"tax_regime\": \"SIMPLES_NACIONAL\",\n \"unit_type\": \"matriz\",\n \"email\": \"fiscal@example.com\",\n \"address\": {\n \"zip_code\": \"01310-100\",\n \"street\": \"Av. Paulista\",\n \"number\": \"1000\",\n \"complement\": \"Sala 1\",\n \"neighborhood\": \"Bela Vista\",\n \"city\": \"Sao Paulo\",\n \"state\": \"SP\"\n }\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://api.cubbo.com/v1/store/fiscal-account")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cnpj\": \"00.000.000/0001-91\",\n \"legal_name\": \"Partner Store SP LTDA\",\n \"trade_name\": \"Partner Store\",\n \"state_registration\": \"123456789\",\n \"tax_regime\": \"SIMPLES_NACIONAL\",\n \"unit_type\": \"matriz\",\n \"email\": \"fiscal@example.com\",\n \"address\": {\n \"zip_code\": \"01310-100\",\n \"street\": \"Av. Paulista\",\n \"number\": \"1000\",\n \"complement\": \"Sala 1\",\n \"neighborhood\": \"Bela Vista\",\n \"city\": \"Sao Paulo\",\n \"state\": \"SP\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cubbo.com/v1/store/fiscal-account")
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 \"cnpj\": \"00.000.000/0001-91\",\n \"legal_name\": \"Partner Store SP LTDA\",\n \"trade_name\": \"Partner Store\",\n \"state_registration\": \"123456789\",\n \"tax_regime\": \"SIMPLES_NACIONAL\",\n \"unit_type\": \"matriz\",\n \"email\": \"fiscal@example.com\",\n \"address\": {\n \"zip_code\": \"01310-100\",\n \"street\": \"Av. Paulista\",\n \"number\": \"1000\",\n \"complement\": \"Sala 1\",\n \"neighborhood\": \"Bela Vista\",\n \"city\": \"Sao Paulo\",\n \"state\": \"SP\"\n }\n}"
response = http.request(request)
puts response.read_body{
"store_id": 4821,
"fiscal_account": {
"status": "created",
"cnpj": "00.000.000/0001-91",
"legal_name": "Partner Store SP LTDA",
"tax_regime": "SIMPLES_NACIONAL",
"mirrored_fields": [
"tax_id",
"tax_company_name",
"tax_state_registration",
"tax_regime",
"tax_address",
"tax_address_number",
"tax_address_neighborhood",
"tax_city",
"tax_zipcode",
"state"
],
"skipped_fields": [],
"mirror_error": null
}
}Authorizations
Body
application/json