Importar nota fiscal.
curl --request POST \
--url https://api.staging.cartaosimples.com.br/integration/v1/order/invoice \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pedidoId": "00000000-0000-0000-0000-000000000000",
"arquivoBase64": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago...",
"nomeArquivo": "nota-fiscal.pdf"
}
'import requests
url = "https://api.staging.cartaosimples.com.br/integration/v1/order/invoice"
payload = {
"pedidoId": "00000000-0000-0000-0000-000000000000",
"arquivoBase64": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago...",
"nomeArquivo": "nota-fiscal.pdf"
}
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({
pedidoId: '00000000-0000-0000-0000-000000000000',
arquivoBase64: 'JVBERi0xLjQKJeLjz9MKMSAwIG9iago...',
nomeArquivo: 'nota-fiscal.pdf'
})
};
fetch('https://api.staging.cartaosimples.com.br/integration/v1/order/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.staging.cartaosimples.com.br/integration/v1/order/invoice",
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([
'pedidoId' => '00000000-0000-0000-0000-000000000000',
'arquivoBase64' => 'JVBERi0xLjQKJeLjz9MKMSAwIG9iago...',
'nomeArquivo' => 'nota-fiscal.pdf'
]),
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.staging.cartaosimples.com.br/integration/v1/order/invoice"
payload := strings.NewReader("{\n \"pedidoId\": \"00000000-0000-0000-0000-000000000000\",\n \"arquivoBase64\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago...\",\n \"nomeArquivo\": \"nota-fiscal.pdf\"\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.staging.cartaosimples.com.br/integration/v1/order/invoice")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pedidoId\": \"00000000-0000-0000-0000-000000000000\",\n \"arquivoBase64\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago...\",\n \"nomeArquivo\": \"nota-fiscal.pdf\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.cartaosimples.com.br/integration/v1/order/invoice")
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 \"pedidoId\": \"00000000-0000-0000-0000-000000000000\",\n \"arquivoBase64\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago...\",\n \"nomeArquivo\": \"nota-fiscal.pdf\"\n}"
response = http.request(request)
puts response.read_body{
"tipo": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"titulo": "Requisição inválida.",
"status": 400,
"detalhe": "O campo 'cpf' é obrigatório.",
"instancia": "/v1/order"
}Pedido
Importar nota fiscal
Importa a nota fiscal de um pedido CDC a partir de um arquivo em base64.
POST
/
v1
/
order
/
invoice
Importar nota fiscal.
curl --request POST \
--url https://api.staging.cartaosimples.com.br/integration/v1/order/invoice \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pedidoId": "00000000-0000-0000-0000-000000000000",
"arquivoBase64": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago...",
"nomeArquivo": "nota-fiscal.pdf"
}
'import requests
url = "https://api.staging.cartaosimples.com.br/integration/v1/order/invoice"
payload = {
"pedidoId": "00000000-0000-0000-0000-000000000000",
"arquivoBase64": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago...",
"nomeArquivo": "nota-fiscal.pdf"
}
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({
pedidoId: '00000000-0000-0000-0000-000000000000',
arquivoBase64: 'JVBERi0xLjQKJeLjz9MKMSAwIG9iago...',
nomeArquivo: 'nota-fiscal.pdf'
})
};
fetch('https://api.staging.cartaosimples.com.br/integration/v1/order/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.staging.cartaosimples.com.br/integration/v1/order/invoice",
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([
'pedidoId' => '00000000-0000-0000-0000-000000000000',
'arquivoBase64' => 'JVBERi0xLjQKJeLjz9MKMSAwIG9iago...',
'nomeArquivo' => 'nota-fiscal.pdf'
]),
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.staging.cartaosimples.com.br/integration/v1/order/invoice"
payload := strings.NewReader("{\n \"pedidoId\": \"00000000-0000-0000-0000-000000000000\",\n \"arquivoBase64\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago...\",\n \"nomeArquivo\": \"nota-fiscal.pdf\"\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.staging.cartaosimples.com.br/integration/v1/order/invoice")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pedidoId\": \"00000000-0000-0000-0000-000000000000\",\n \"arquivoBase64\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago...\",\n \"nomeArquivo\": \"nota-fiscal.pdf\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.cartaosimples.com.br/integration/v1/order/invoice")
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 \"pedidoId\": \"00000000-0000-0000-0000-000000000000\",\n \"arquivoBase64\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago...\",\n \"nomeArquivo\": \"nota-fiscal.pdf\"\n}"
response = http.request(request)
puts response.read_body{
"tipo": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"titulo": "Requisição inválida.",
"status": 400,
"detalhe": "O campo 'cpf' é obrigatório.",
"instancia": "/v1/order"
}Authorizations
Cabeçalho de autenticação Bearer no formato Bearer <token> onde <token> é seu TOKEN de autenticação
Body
application/json
Identificador do pedido.
Example:
"00000000-0000-0000-0000-000000000000"
Conteúdo do arquivo da nota fiscal codificado em base64.
Minimum string length:
1Example:
"JVBERi0xLjQKJeLjz9MKMSAwIG9iago..."
Nome do arquivo com extensão (ex: nota-fiscal.pdf).
Minimum string length:
1Example:
"nota-fiscal.pdf"
Response
OK