Enviar Certificado A1
curl --request POST \
--url https://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form arquivo=@example-file \
--form 'senha=<string>'import requests
url = "https://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado"
files = { "arquivo": ("example-file", open("example-file", "rb")) }
payload = { "senha": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('arquivo', '<string>');
form.append('senha', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado', 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://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"arquivo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"senha\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"arquivo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"senha\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"arquivo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"senha\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"arquivo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"senha\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"cnpj": "12345678000195",
"criado_em": "2026-11-11T21:00:00Z",
"id": "a2b4c6d8-1e3f-4a5b-8c7d-9e0f1a2b3c4d",
"valido_ate": "2027-04-28T12:00:00Z"
}Prestadores
Enviar Certificado A1
Envia o Certificado A1 do Prestador (multipart/form-data). Ele assina as DPS e autentica na Sefin.
- O CNPJ é lido do Certificado (campo ICP-Brasil
2.16.76.1.3.3, ou o CNRAZAO SOCIAL:CNPJ) e tem de ser o do Prestador; senão,cnpj_divergente. - Recusa Certificado vencido ou que não abre com a senha.
- Substitui o Certificado ativo; o Prestador fica
ativo.
curl -X POST https://notasx-api.fly.dev/v1/prestadores/{id}/certificado \
-H "Authorization: Bearer nx_..." -F arquivo=@certificado.pfx -F senha='...'
POST
/
v1
/
prestadores
/
{prestador_id}
/
certificado
Enviar Certificado A1
curl --request POST \
--url https://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form arquivo=@example-file \
--form 'senha=<string>'import requests
url = "https://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado"
files = { "arquivo": ("example-file", open("example-file", "rb")) }
payload = { "senha": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('arquivo', '<string>');
form.append('senha', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado', 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://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"arquivo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"senha\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"arquivo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"senha\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"arquivo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"senha\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://notasx-api.fly.dev/v1/prestadores/{prestador_id}/certificado")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"arquivo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"senha\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"cnpj": "12345678000195",
"criado_em": "2026-11-11T21:00:00Z",
"id": "a2b4c6d8-1e3f-4a5b-8c7d-9e0f1a2b3c4d",
"valido_ate": "2027-04-28T12:00:00Z"
}Authorizations
Authorization: Bearer nx_... com uma Chave de API, ou o JWT de sessão do painel (Supabase Auth). As duas credenciais representam a mesma Conta.
Path Parameters
Id do Prestador, devolvido no cadastro.
Body
multipart/form-data
Response
Successful Response