Skip to content

Boletos

Endpoints to create, query, update, and cancel boletos.

Boleto Status

StatusDescription
draftDraft - boleto created but not registered
registeredRegistered with Nuclea (PCR)
paidPaid by the payer
settledSettled - funds transferred
cancelledCancelled

Create Boleto

Creates a new boleto and registers it on Nuclea's PCR platform.

POST /boletos

Request Body

FieldTypeRequiredDescription
nosso_numerostringYesUnique reference number (11 digits)
amount_centsintegerYesValue in cents (e.g., 10000 = R$ 100.00)
due_datestringYesDue date (YYYY-MM-DD)
payer_documentstringYesPayer's CPF/CNPJ (numbers only)
payer_namestringYesPayer's full name
beneficiary_ispbstringYesBeneficiary's ISPB (8 digits)
beneficiary_namestringYesBeneficiary's name

Value in Cents

The amount_cents field must be sent in cents to avoid precision issues with decimal numbers. For example, R$ 150.50 should be sent as 15050.

Request Example

bash
curl -X POST "https://api.pixconnect.com.br/api/v1/central/boletos" \
  -H "X-API-Key: pk_live_abc123def456" \
  -H "Content-Type: application/json" \
  -d '{
    "boleto": {
      "nosso_numero": "12345678901",
      "amount_cents": 15000,
      "due_date": "2026-03-15",
      "payer_document": "12345678901",
      "payer_name": "Joao Silva Santos",
      "beneficiary_ispb": "02992335",
      "beneficiary_name": "Empresa XYZ Ltda"
    }
  }'
javascript
const response = await fetch(
  "https://api.pixconnect.com.br/api/v1/central/boletos",
  {
    method: "POST",
    headers: {
      "X-API-Key": "pk_live_abc123def456",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      boleto: {
        nosso_numero: "12345678901",
        amount_cents: 15000,
        due_date: "2026-03-15",
        payer_document: "12345678901",
        payer_name: "Joao Silva Santos",
        beneficiary_ispb: "02992335",
        beneficiary_name: "Empresa XYZ Ltda"
      }
    }),
  }
);

const data = await response.json();
console.log(data);
python
import requests

url = "https://api.pixconnect.com.br/api/v1/central/boletos"
headers = {
    "X-API-Key": "pk_live_abc123def456",
    "Content-Type": "application/json"
}
payload = {
    "boleto": {
        "nosso_numero": "12345678901",
        "amount_cents": 15000,
        "due_date": "2026-03-15",
        "payer_document": "12345678901",
        "payer_name": "Joao Silva Santos",
        "beneficiary_ispb": "02992335",
        "beneficiary_name": "Empresa XYZ Ltda"
    }
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())

Success Response

Status: 201 Created

json
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "nosso_numero": "12345678901",
    "barcode": "23793381286000000000000000012345678901500001",
    "linha_digitavel": "23793.38128 60000.000003 00001.234567 8 90150000015000",
    "amount_cents": 15000,
    "due_date": "2026-03-15",
    "payer_document": "12345678901",
    "payer_name": "Joao Silva Santos",
    "beneficiary_ispb": "02992335",
    "beneficiary_name": "Empresa XYZ Ltda",
    "status": "registered",
    "pcr_protocol": "PCR2026021512345678",
    "registered_at": "2026-02-15T10:30:00Z",
    "paid_at": null,
    "cancelled_at": null,
    "inserted_at": "2026-02-15T10:30:00Z",
    "updated_at": "2026-02-15T10:30:00Z"
  },
  "meta": {
    "request_id": "req_abc123def456"
  }
}

Possible Errors

CodeErrorDescription
400BAD_REQUESTboleto field missing from request body
422VALIDATION_ERRORInvalid data (document, date, etc.)
422DUPLICATE_ENTRYnosso_numero already exists

Query Boleto

Retrieves the details of a boleto by its reference number.

GET /boletos/:nosso_numero

URL Parameters

ParameterTypeDescription
nosso_numerostringUnique boleto reference number

Request Example

bash
curl -X GET "https://api.pixconnect.com.br/api/v1/central/boletos/12345678901" \
  -H "X-API-Key: pk_live_abc123def456" \
  -H "Content-Type: application/json"
javascript
const nossoNumero = "12345678901";
const response = await fetch(
  `https://api.pixconnect.com.br/api/v1/central/boletos/${nossoNumero}`,
  {
    method: "GET",
    headers: {
      "X-API-Key": "pk_live_abc123def456",
      "Content-Type": "application/json",
    },
  }
);

const data = await response.json();
console.log(data);
python
import requests

nosso_numero = "12345678901"
url = f"https://api.pixconnect.com.br/api/v1/central/boletos/{nosso_numero}"
headers = {
    "X-API-Key": "pk_live_abc123def456",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
print(response.json())

Success Response

Status: 200 OK

json
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "nosso_numero": "12345678901",
    "barcode": "23793381286000000000000000012345678901500001",
    "linha_digitavel": "23793.38128 60000.000003 00001.234567 8 90150000015000",
    "amount_cents": 15000,
    "due_date": "2026-03-15",
    "payer_document": "12345678901",
    "payer_name": "Joao Silva Santos",
    "beneficiary_ispb": "02992335",
    "beneficiary_name": "Empresa XYZ Ltda",
    "status": "registered",
    "pcr_protocol": "PCR2026021512345678",
    "registered_at": "2026-02-15T10:30:00Z",
    "paid_at": null,
    "cancelled_at": null,
    "inserted_at": "2026-02-15T10:30:00Z",
    "updated_at": "2026-02-15T10:30:00Z"
  },
  "meta": {
    "request_id": "req_abc123def456"
  }
}

Possible Errors

CodeErrorDescription
404NOT_FOUNDBoleto not found

Update Boleto

Updates the data of a boleto. Only boletos with draft status can be updated.

PATCH /boletos/:nosso_numero

URL Parameters

ParameterTypeDescription
nosso_numerostringUnique boleto reference number

Request Body

FieldTypeDescription
amount_centsintegerNew value in cents
due_datestringNew due date (YYYY-MM-DD)
payer_documentstringNew payer CPF/CNPJ
payer_namestringNew payer name

Status Restriction

Only boletos with draft status can be updated. Boletos already registered with Nuclea cannot be modified.

Request Example

bash
curl -X PATCH "https://api.pixconnect.com.br/api/v1/central/boletos/12345678901" \
  -H "X-API-Key: pk_live_abc123def456" \
  -H "Content-Type: application/json" \
  -d '{
    "boleto": {
      "amount_cents": 20000,
      "due_date": "2026-03-20"
    }
  }'
javascript
const nossoNumero = "12345678901";
const response = await fetch(
  `https://api.pixconnect.com.br/api/v1/central/boletos/${nossoNumero}`,
  {
    method: "PATCH",
    headers: {
      "X-API-Key": "pk_live_abc123def456",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      boleto: {
        amount_cents: 20000,
        due_date: "2026-03-20"
      }
    }),
  }
);

const data = await response.json();
console.log(data);
python
import requests

nosso_numero = "12345678901"
url = f"https://api.pixconnect.com.br/api/v1/central/boletos/{nosso_numero}"
headers = {
    "X-API-Key": "pk_live_abc123def456",
    "Content-Type": "application/json"
}
payload = {
    "boleto": {
        "amount_cents": 20000,
        "due_date": "2026-03-20"
    }
}

response = requests.patch(url, headers=headers, json=payload)
print(response.json())

Success Response

Status: 200 OK

json
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "nosso_numero": "12345678901",
    "amount_cents": 20000,
    "due_date": "2026-03-20",
    "status": "draft",
    // ... other fields
  },
  "meta": {
    "request_id": "req_abc123def456"
  }
}

Possible Errors

CodeErrorDescription
400BAD_REQUESTboleto field missing from request body
404NOT_FOUNDBoleto not found
422INVALID_STATUSBoleto is not in draft status
422VALIDATION_ERRORInvalid data

Cancel Boleto

Cancels an existing boleto.

DELETE /boletos/:nosso_numero

URL Parameters

ParameterTypeDescription
nosso_numerostringUnique boleto reference number

Cancellation

Boletos that are already paid or settled cannot be cancelled. Cancellation is irreversible.

Request Example

bash
curl -X DELETE "https://api.pixconnect.com.br/api/v1/central/boletos/12345678901" \
  -H "X-API-Key: pk_live_abc123def456" \
  -H "Content-Type: application/json"
javascript
const nossoNumero = "12345678901";
const response = await fetch(
  `https://api.pixconnect.com.br/api/v1/central/boletos/${nossoNumero}`,
  {
    method: "DELETE",
    headers: {
      "X-API-Key": "pk_live_abc123def456",
      "Content-Type": "application/json",
    },
  }
);

const data = await response.json();
console.log(data);
python
import requests

nosso_numero = "12345678901"
url = f"https://api.pixconnect.com.br/api/v1/central/boletos/{nosso_numero}"
headers = {
    "X-API-Key": "pk_live_abc123def456",
    "Content-Type": "application/json"
}

response = requests.delete(url, headers=headers)
print(response.json())

Success Response

Status: 200 OK

json
{
  "success": true,
  "data": {
    "nosso_numero": "12345678901",
    "status": "cancelled",
    "cancelled_at": "2026-02-15T14:30:00Z"
  },
  "meta": {
    "request_id": "req_abc123def456"
  }
}

Possible Errors

CodeErrorDescription
404NOT_FOUNDBoleto not found
422INVALID_STATUSBoleto already paid or settled

Mark as Paid

Marks a boleto as paid. This endpoint is used when payment was confirmed externally.

POST /boletos/:nosso_numero/pay

URL Parameters

ParameterTypeDescription
nosso_numerostringUnique boleto reference number

Webhook

When marking a boleto as paid, a boleto.paid webhook is automatically sent to the configured URL.

Request Example

bash
curl -X POST "https://api.pixconnect.com.br/api/v1/central/boletos/12345678901/pay" \
  -H "X-API-Key: pk_live_abc123def456" \
  -H "Content-Type: application/json"
javascript
const nossoNumero = "12345678901";
const response = await fetch(
  `https://api.pixconnect.com.br/api/v1/central/boletos/${nossoNumero}/pay`,
  {
    method: "POST",
    headers: {
      "X-API-Key": "pk_live_abc123def456",
      "Content-Type": "application/json",
    },
  }
);

const data = await response.json();
console.log(data);
python
import requests

nosso_numero = "12345678901"
url = f"https://api.pixconnect.com.br/api/v1/central/boletos/{nosso_numero}/pay"
headers = {
    "X-API-Key": "pk_live_abc123def456",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)
print(response.json())

Success Response

Status: 200 OK

json
{
  "success": true,
  "data": {
    "nosso_numero": "12345678901",
    "status": "paid",
    "paid_at": "2026-02-15T16:45:00Z"
  },
  "meta": {
    "request_id": "req_abc123def456"
  }
}

Possible Errors

CodeErrorDescription
404NOT_FOUNDBoleto not found
422INVALID_STATUSBoleto already paid, settled, or cancelled

Boleto Fields

Returned Fields

FieldTypeDescription
iduuidUnique boleto identifier
nosso_numerostringReference number (11 digits)
barcodestringBarcode (44 digits)
linha_digitavelstringTypeable line (47 formatted digits)
amount_centsintegerValue in cents
due_datedateDue date
payer_documentstringPayer's CPF/CNPJ
payer_namestringPayer's name
beneficiary_ispbstringBeneficiary's ISPB
beneficiary_namestringBeneficiary's name
statusstringCurrent boleto status
pcr_protocolstringPCR registration protocol (when registered)
registered_atdatetimeDate/time of Nuclea registration
paid_atdatetimeDate/time of payment
cancelled_atdatetimeDate/time of cancellation
inserted_atdatetimeDate/time of creation
updated_atdatetimeDate/time of last update

Next Steps

Documentação da API FluxiQ NPC