Pular para o conteúdo principal
POST
/
v1
/
boletos
Emitir um boleto
curl --request POST \
  --url https://payments.sandbox.lerian.net/v1/boletos \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '
{
  "amount": "<string>",
  "discount": {
    "amount": "<string>",
    "limitDate": "<string>",
    "type": "<string>"
  },
  "dueDate": "<string>",
  "fine": {
    "amount": "<string>",
    "type": "<string>"
  },
  "guarantor": {
    "address": {
      "city": "<string>",
      "complement": "<string>",
      "neighborhood": "<string>",
      "number": "<string>",
      "state": "<string>",
      "street": "<string>",
      "zipCode": "<string>"
    },
    "document": "<string>",
    "name": "<string>"
  },
  "instructions": "<string>",
  "interest": {
    "amount": "<string>",
    "type": "<string>"
  },
  "midazAccountId": "<string>",
  "payer": {
    "address": {
      "city": "<string>",
      "complement": "<string>",
      "neighborhood": "<string>",
      "number": "<string>",
      "state": "<string>",
      "street": "<string>",
      "zipCode": "<string>"
    },
    "document": "<string>",
    "name": "<string>"
  },
  "type": "<string>"
}
'
import requests

url = "https://payments.sandbox.lerian.net/v1/boletos"

payload = {
"amount": "<string>",
"discount": {
"amount": "<string>",
"limitDate": "<string>",
"type": "<string>"
},
"dueDate": "<string>",
"fine": {
"amount": "<string>",
"type": "<string>"
},
"guarantor": {
"address": {
"city": "<string>",
"complement": "<string>",
"neighborhood": "<string>",
"number": "<string>",
"state": "<string>",
"street": "<string>",
"zipCode": "<string>"
},
"document": "<string>",
"name": "<string>"
},
"instructions": "<string>",
"interest": {
"amount": "<string>",
"type": "<string>"
},
"midazAccountId": "<string>",
"payer": {
"address": {
"city": "<string>",
"complement": "<string>",
"neighborhood": "<string>",
"number": "<string>",
"state": "<string>",
"street": "<string>",
"zipCode": "<string>"
},
"document": "<string>",
"name": "<string>"
},
"type": "<string>"
}
headers = {
"X-Organization-Id": "<x-organization-id>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {
'X-Organization-Id': '<x-organization-id>',
'Idempotency-Key': '<idempotency-key>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '<string>',
discount: {amount: '<string>', limitDate: '<string>', type: '<string>'},
dueDate: '<string>',
fine: {amount: '<string>', type: '<string>'},
guarantor: {
address: {
city: '<string>',
complement: '<string>',
neighborhood: '<string>',
number: '<string>',
state: '<string>',
street: '<string>',
zipCode: '<string>'
},
document: '<string>',
name: '<string>'
},
instructions: '<string>',
interest: {amount: '<string>', type: '<string>'},
midazAccountId: '<string>',
payer: {
address: {
city: '<string>',
complement: '<string>',
neighborhood: '<string>',
number: '<string>',
state: '<string>',
street: '<string>',
zipCode: '<string>'
},
document: '<string>',
name: '<string>'
},
type: '<string>'
})
};

fetch('https://payments.sandbox.lerian.net/v1/boletos', 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://payments.sandbox.lerian.net/v1/boletos",
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([
'amount' => '<string>',
'discount' => [
'amount' => '<string>',
'limitDate' => '<string>',
'type' => '<string>'
],
'dueDate' => '<string>',
'fine' => [
'amount' => '<string>',
'type' => '<string>'
],
'guarantor' => [
'address' => [
'city' => '<string>',
'complement' => '<string>',
'neighborhood' => '<string>',
'number' => '<string>',
'state' => '<string>',
'street' => '<string>',
'zipCode' => '<string>'
],
'document' => '<string>',
'name' => '<string>'
],
'instructions' => '<string>',
'interest' => [
'amount' => '<string>',
'type' => '<string>'
],
'midazAccountId' => '<string>',
'payer' => [
'address' => [
'city' => '<string>',
'complement' => '<string>',
'neighborhood' => '<string>',
'number' => '<string>',
'state' => '<string>',
'street' => '<string>',
'zipCode' => '<string>'
],
'document' => '<string>',
'name' => '<string>'
],
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Organization-Id: <x-organization-id>"
],
]);

$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://payments.sandbox.lerian.net/v1/boletos"

payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"discount\": {\n \"amount\": \"<string>\",\n \"limitDate\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"dueDate\": \"<string>\",\n \"fine\": {\n \"amount\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"guarantor\": {\n \"address\": {\n \"city\": \"<string>\",\n \"complement\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"number\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zipCode\": \"<string>\"\n },\n \"document\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"instructions\": \"<string>\",\n \"interest\": {\n \"amount\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"midazAccountId\": \"<string>\",\n \"payer\": {\n \"address\": {\n \"city\": \"<string>\",\n \"complement\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"number\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zipCode\": \"<string>\"\n },\n \"document\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"type\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Organization-Id", "<x-organization-id>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "<api-key>")
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://payments.sandbox.lerian.net/v1/boletos")
.header("X-Organization-Id", "<x-organization-id>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"discount\": {\n \"amount\": \"<string>\",\n \"limitDate\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"dueDate\": \"<string>\",\n \"fine\": {\n \"amount\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"guarantor\": {\n \"address\": {\n \"city\": \"<string>\",\n \"complement\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"number\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zipCode\": \"<string>\"\n },\n \"document\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"instructions\": \"<string>\",\n \"interest\": {\n \"amount\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"midazAccountId\": \"<string>\",\n \"payer\": {\n \"address\": {\n \"city\": \"<string>\",\n \"complement\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"number\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zipCode\": \"<string>\"\n },\n \"document\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"type\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://payments.sandbox.lerian.net/v1/boletos")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"<string>\",\n \"discount\": {\n \"amount\": \"<string>\",\n \"limitDate\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"dueDate\": \"<string>\",\n \"fine\": {\n \"amount\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"guarantor\": {\n \"address\": {\n \"city\": \"<string>\",\n \"complement\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"number\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zipCode\": \"<string>\"\n },\n \"document\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"instructions\": \"<string>\",\n \"interest\": {\n \"amount\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"midazAccountId\": \"<string>\",\n \"payer\": {\n \"address\": {\n \"city\": \"<string>\",\n \"complement\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"number\": \"<string>\",\n \"state\": \"<string>\",\n \"street\": \"<string>\",\n \"zipCode\": \"<string>\"\n },\n \"document\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"type\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "amount": "<string>",
  "barcode": "<string>",
  "createdAt": "<string>",
  "digitableLine": "<string>",
  "discount": {
    "amount": "<string>",
    "limitDate": "<string>",
    "type": "<string>"
  },
  "dueDate": "<string>",
  "fine": {
    "amount": "<string>",
    "type": "<string>"
  },
  "id": "<string>",
  "instructions": "<string>",
  "interest": {
    "amount": "<string>",
    "type": "<string>"
  },
  "providerId": "<string>",
  "qrCode": "<string>",
  "status": "<string>",
  "type": "<string>"
}
{
"code": "PBP-0001",
"details": {},
"message": "dueDate must be in YYYY-MM-DD format",
"title": "Bad Request"
}
{
"code": "PBP-0001",
"details": {},
"message": "dueDate must be in YYYY-MM-DD format",
"title": "Bad Request"
}
{
"code": "PBP-0001",
"details": {},
"message": "dueDate must be in YYYY-MM-DD format",
"title": "Bad Request"
}
{
"code": "PBP-0001",
"details": {},
"message": "dueDate must be in YYYY-MM-DD format",
"title": "Bad Request"
}
{
"code": "PBP-0001",
"details": {},
"message": "dueDate must be in YYYY-MM-DD format",
"title": "Bad Request"
}

Autorizações

Authorization
string
header
obrigatório

Bearer token authentication (format: "Bearer {token}")

Cabeçalhos

X-Organization-Id
string
obrigatório

Tenant organization ID

Idempotency-Key
string
obrigatório

Idempotency key (UUID v4 or v7)

Corpo

application/json

Boleto creation payload

amount
string
discount
object
dueDate
string
fine
object
guarantor
object
instructions
string
interest
object
midazAccountId
string
payer
object
type
string

Resposta

Created

amount
string
barcode
string
createdAt
string
digitableLine
string
discount
object
dueDate
string
fine
object
id
string
instructions
string
interest
object
providerId
string
qrCode
string
status
string
type
string