Criar cobrança via boleto
curl --request POST \
--url https://api.ephra.io/v1/boleto \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amountInCents": 10000,
"customer": {
"documentType": "cpf",
"document": "12345678909",
"name": "Maria Silva",
"email": "maria@email.com",
"phone": "+5511999998888",
"billingAddress": {
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>"
}
},
"description": "Pedido #1234",
"postbackUrl": "<string>",
"items": [
{
"title": "Produto A",
"tangible": false,
"quantity": 1,
"amountInCents": 10000,
"shippingAddress": {
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>"
}
}
]
}
'import requests
url = "https://api.ephra.io/v1/boleto"
payload = {
"amountInCents": 10000,
"customer": {
"documentType": "cpf",
"document": "12345678909",
"name": "Maria Silva",
"email": "maria@email.com",
"phone": "+5511999998888",
"billingAddress": {
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>"
}
},
"description": "Pedido #1234",
"postbackUrl": "<string>",
"items": [
{
"title": "Produto A",
"tangible": False,
"quantity": 1,
"amountInCents": 10000,
"shippingAddress": {
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>"
}
}
]
}
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({
amountInCents: 10000,
customer: {
documentType: 'cpf',
document: '12345678909',
name: 'Maria Silva',
email: 'maria@email.com',
phone: '+5511999998888',
billingAddress: {
street: '<string>',
number: '<string>',
neighborhood: '<string>',
city: '<string>',
state: '<string>',
zipCode: '<string>'
}
},
description: 'Pedido #1234',
postbackUrl: '<string>',
items: [
{
title: 'Produto A',
tangible: false,
quantity: 1,
amountInCents: 10000,
shippingAddress: {
street: '<string>',
number: '<string>',
neighborhood: '<string>',
city: '<string>',
state: '<string>',
zipCode: '<string>'
}
}
]
})
};
fetch('https://api.ephra.io/v1/boleto', 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.ephra.io/v1/boleto",
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([
'amountInCents' => 10000,
'customer' => [
'documentType' => 'cpf',
'document' => '12345678909',
'name' => 'Maria Silva',
'email' => 'maria@email.com',
'phone' => '+5511999998888',
'billingAddress' => [
'street' => '<string>',
'number' => '<string>',
'neighborhood' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zipCode' => '<string>'
]
],
'description' => 'Pedido #1234',
'postbackUrl' => '<string>',
'items' => [
[
'title' => 'Produto A',
'tangible' => false,
'quantity' => 1,
'amountInCents' => 10000,
'shippingAddress' => [
'street' => '<string>',
'number' => '<string>',
'neighborhood' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zipCode' => '<string>'
]
]
]
]),
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.ephra.io/v1/boleto"
payload := strings.NewReader("{\n \"amountInCents\": 10000,\n \"customer\": {\n \"documentType\": \"cpf\",\n \"document\": \"12345678909\",\n \"name\": \"Maria Silva\",\n \"email\": \"maria@email.com\",\n \"phone\": \"+5511999998888\",\n \"billingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n },\n \"description\": \"Pedido #1234\",\n \"postbackUrl\": \"<string>\",\n \"items\": [\n {\n \"title\": \"Produto A\",\n \"tangible\": false,\n \"quantity\": 1,\n \"amountInCents\": 10000,\n \"shippingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n }\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.ephra.io/v1/boleto")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountInCents\": 10000,\n \"customer\": {\n \"documentType\": \"cpf\",\n \"document\": \"12345678909\",\n \"name\": \"Maria Silva\",\n \"email\": \"maria@email.com\",\n \"phone\": \"+5511999998888\",\n \"billingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n },\n \"description\": \"Pedido #1234\",\n \"postbackUrl\": \"<string>\",\n \"items\": [\n {\n \"title\": \"Produto A\",\n \"tangible\": false,\n \"quantity\": 1,\n \"amountInCents\": 10000,\n \"shippingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ephra.io/v1/boleto")
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 \"amountInCents\": 10000,\n \"customer\": {\n \"documentType\": \"cpf\",\n \"document\": \"12345678909\",\n \"name\": \"Maria Silva\",\n \"email\": \"maria@email.com\",\n \"phone\": \"+5511999998888\",\n \"billingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n },\n \"description\": \"Pedido #1234\",\n \"postbackUrl\": \"<string>\",\n \"items\": [\n {\n \"title\": \"Produto A\",\n \"tangible\": false,\n \"quantity\": 1,\n \"amountInCents\": 10000,\n \"shippingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Transação criada com sucesso",
"data": {
"id": "clxabc123def456",
"boleto": {
"url": "https://.../boleto/clxabc123def456",
"barcode": "23793381286000782726337000963779410010000025000",
"digitableLine": "23793.38128 60007.827263 37000.963779 4 10010000025000",
"dueAt": "2026-06-10T03:00:00.000Z"
},
"status": "pending",
"fees": 200
}
}{
"statusCode": 400,
"error": "Bad Request",
"message": "Documento inválido para o tipo selecionado"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Token inválido ou expirado"
}Pagamentos
Criar cobrança via boleto
Gera um boleto bancário. A cobrança nasce com status pending; a compensação leva de 1 a 3 dias úteis e é confirmada por webhook.
POST
/
v1
/
boleto
Criar cobrança via boleto
curl --request POST \
--url https://api.ephra.io/v1/boleto \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amountInCents": 10000,
"customer": {
"documentType": "cpf",
"document": "12345678909",
"name": "Maria Silva",
"email": "maria@email.com",
"phone": "+5511999998888",
"billingAddress": {
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>"
}
},
"description": "Pedido #1234",
"postbackUrl": "<string>",
"items": [
{
"title": "Produto A",
"tangible": false,
"quantity": 1,
"amountInCents": 10000,
"shippingAddress": {
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>"
}
}
]
}
'import requests
url = "https://api.ephra.io/v1/boleto"
payload = {
"amountInCents": 10000,
"customer": {
"documentType": "cpf",
"document": "12345678909",
"name": "Maria Silva",
"email": "maria@email.com",
"phone": "+5511999998888",
"billingAddress": {
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>"
}
},
"description": "Pedido #1234",
"postbackUrl": "<string>",
"items": [
{
"title": "Produto A",
"tangible": False,
"quantity": 1,
"amountInCents": 10000,
"shippingAddress": {
"street": "<string>",
"number": "<string>",
"neighborhood": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>"
}
}
]
}
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({
amountInCents: 10000,
customer: {
documentType: 'cpf',
document: '12345678909',
name: 'Maria Silva',
email: 'maria@email.com',
phone: '+5511999998888',
billingAddress: {
street: '<string>',
number: '<string>',
neighborhood: '<string>',
city: '<string>',
state: '<string>',
zipCode: '<string>'
}
},
description: 'Pedido #1234',
postbackUrl: '<string>',
items: [
{
title: 'Produto A',
tangible: false,
quantity: 1,
amountInCents: 10000,
shippingAddress: {
street: '<string>',
number: '<string>',
neighborhood: '<string>',
city: '<string>',
state: '<string>',
zipCode: '<string>'
}
}
]
})
};
fetch('https://api.ephra.io/v1/boleto', 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.ephra.io/v1/boleto",
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([
'amountInCents' => 10000,
'customer' => [
'documentType' => 'cpf',
'document' => '12345678909',
'name' => 'Maria Silva',
'email' => 'maria@email.com',
'phone' => '+5511999998888',
'billingAddress' => [
'street' => '<string>',
'number' => '<string>',
'neighborhood' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zipCode' => '<string>'
]
],
'description' => 'Pedido #1234',
'postbackUrl' => '<string>',
'items' => [
[
'title' => 'Produto A',
'tangible' => false,
'quantity' => 1,
'amountInCents' => 10000,
'shippingAddress' => [
'street' => '<string>',
'number' => '<string>',
'neighborhood' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zipCode' => '<string>'
]
]
]
]),
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.ephra.io/v1/boleto"
payload := strings.NewReader("{\n \"amountInCents\": 10000,\n \"customer\": {\n \"documentType\": \"cpf\",\n \"document\": \"12345678909\",\n \"name\": \"Maria Silva\",\n \"email\": \"maria@email.com\",\n \"phone\": \"+5511999998888\",\n \"billingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n },\n \"description\": \"Pedido #1234\",\n \"postbackUrl\": \"<string>\",\n \"items\": [\n {\n \"title\": \"Produto A\",\n \"tangible\": false,\n \"quantity\": 1,\n \"amountInCents\": 10000,\n \"shippingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n }\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.ephra.io/v1/boleto")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountInCents\": 10000,\n \"customer\": {\n \"documentType\": \"cpf\",\n \"document\": \"12345678909\",\n \"name\": \"Maria Silva\",\n \"email\": \"maria@email.com\",\n \"phone\": \"+5511999998888\",\n \"billingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n },\n \"description\": \"Pedido #1234\",\n \"postbackUrl\": \"<string>\",\n \"items\": [\n {\n \"title\": \"Produto A\",\n \"tangible\": false,\n \"quantity\": 1,\n \"amountInCents\": 10000,\n \"shippingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ephra.io/v1/boleto")
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 \"amountInCents\": 10000,\n \"customer\": {\n \"documentType\": \"cpf\",\n \"document\": \"12345678909\",\n \"name\": \"Maria Silva\",\n \"email\": \"maria@email.com\",\n \"phone\": \"+5511999998888\",\n \"billingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n },\n \"description\": \"Pedido #1234\",\n \"postbackUrl\": \"<string>\",\n \"items\": [\n {\n \"title\": \"Produto A\",\n \"tangible\": false,\n \"quantity\": 1,\n \"amountInCents\": 10000,\n \"shippingAddress\": {\n \"street\": \"<string>\",\n \"number\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zipCode\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Transação criada com sucesso",
"data": {
"id": "clxabc123def456",
"boleto": {
"url": "https://.../boleto/clxabc123def456",
"barcode": "23793381286000782726337000963779410010000025000",
"digitableLine": "23793.38128 60007.827263 37000.963779 4 10010000025000",
"dueAt": "2026-06-10T03:00:00.000Z"
},
"status": "pending",
"fees": 200
}
}{
"statusCode": 400,
"error": "Bad Request",
"message": "Documento inválido para o tipo selecionado"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Token inválido ou expirado"
}Gera um boleto bancário. A resposta traz a linha digitável (
digitableLine), o código de barras (barcode) e uma url para visualização e impressão. A cobrança nasce com status: "pending".
A compensação de boleto leva de 1 a 3 dias úteis. Aguarde o webhook
transaction_paid antes de liberar o pedido.Visão conceitual e prazos em Guias › Boleto.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I
