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": 49900,
"description": "Pedido #1234 — Curso de Tráfego Pago",
"customer": {
"name": "Mariana Ribeiro Alves",
"email": "mariana.alves@exemplo.com.br",
"documentType": "cpf",
"document": "39053344705"
}
}
'import requests
url = "https://api.ephra.io/v1/boleto"
payload = {
"amountInCents": 49900,
"description": "Pedido #1234 — Curso de Tráfego Pago",
"customer": {
"name": "Mariana Ribeiro Alves",
"email": "mariana.alves@exemplo.com.br",
"documentType": "cpf",
"document": "39053344705"
}
}
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: 49900,
description: 'Pedido #1234 — Curso de Tráfego Pago',
customer: {
name: 'Mariana Ribeiro Alves',
email: 'mariana.alves@exemplo.com.br',
documentType: 'cpf',
document: '39053344705'
}
})
};
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' => 49900,
'description' => 'Pedido #1234 — Curso de Tráfego Pago',
'customer' => [
'name' => 'Mariana Ribeiro Alves',
'email' => 'mariana.alves@exemplo.com.br',
'documentType' => 'cpf',
'document' => '39053344705'
]
]),
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\": 49900,\n \"description\": \"Pedido #1234 — Curso de Tráfego Pago\",\n \"customer\": {\n \"name\": \"Mariana Ribeiro Alves\",\n \"email\": \"mariana.alves@exemplo.com.br\",\n \"documentType\": \"cpf\",\n \"document\": \"39053344705\"\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\": 49900,\n \"description\": \"Pedido #1234 — Curso de Tráfego Pago\",\n \"customer\": {\n \"name\": \"Mariana Ribeiro Alves\",\n \"email\": \"mariana.alves@exemplo.com.br\",\n \"documentType\": \"cpf\",\n \"document\": \"39053344705\"\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\": 49900,\n \"description\": \"Pedido #1234 — Curso de Tráfego Pago\",\n \"customer\": {\n \"name\": \"Mariana Ribeiro Alves\",\n \"email\": \"mariana.alves@exemplo.com.br\",\n \"documentType\": \"cpf\",\n \"document\": \"39053344705\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Transação criada com sucesso",
"data": {
"id": "clxjkl012mno345",
"boleto": {
"url": "https://api.ephra.io/boleto/clxjkl012mno345",
"barcode": "23793381286000782726337000963779410010000049900",
"digitableLine": "23793.38128 60007.827263 37000.963779 4 10010000049900",
"dueAt": "2026-10-01T03:00:00.000Z"
},
"status": "pending",
"fees": 299
}
}{
"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
deprecated
DESCONTINUADO — a Ephra não emite mais cobranças em boleto: o motor de pagamentos atual não cria nem liquida esse trilho. Documentado apenas para entender vendas antigas. Para receber, use PIX ou cartão.
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": 49900,
"description": "Pedido #1234 — Curso de Tráfego Pago",
"customer": {
"name": "Mariana Ribeiro Alves",
"email": "mariana.alves@exemplo.com.br",
"documentType": "cpf",
"document": "39053344705"
}
}
'import requests
url = "https://api.ephra.io/v1/boleto"
payload = {
"amountInCents": 49900,
"description": "Pedido #1234 — Curso de Tráfego Pago",
"customer": {
"name": "Mariana Ribeiro Alves",
"email": "mariana.alves@exemplo.com.br",
"documentType": "cpf",
"document": "39053344705"
}
}
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: 49900,
description: 'Pedido #1234 — Curso de Tráfego Pago',
customer: {
name: 'Mariana Ribeiro Alves',
email: 'mariana.alves@exemplo.com.br',
documentType: 'cpf',
document: '39053344705'
}
})
};
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' => 49900,
'description' => 'Pedido #1234 — Curso de Tráfego Pago',
'customer' => [
'name' => 'Mariana Ribeiro Alves',
'email' => 'mariana.alves@exemplo.com.br',
'documentType' => 'cpf',
'document' => '39053344705'
]
]),
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\": 49900,\n \"description\": \"Pedido #1234 — Curso de Tráfego Pago\",\n \"customer\": {\n \"name\": \"Mariana Ribeiro Alves\",\n \"email\": \"mariana.alves@exemplo.com.br\",\n \"documentType\": \"cpf\",\n \"document\": \"39053344705\"\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\": 49900,\n \"description\": \"Pedido #1234 — Curso de Tráfego Pago\",\n \"customer\": {\n \"name\": \"Mariana Ribeiro Alves\",\n \"email\": \"mariana.alves@exemplo.com.br\",\n \"documentType\": \"cpf\",\n \"document\": \"39053344705\"\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\": 49900,\n \"description\": \"Pedido #1234 — Curso de Tráfego Pago\",\n \"customer\": {\n \"name\": \"Mariana Ribeiro Alves\",\n \"email\": \"mariana.alves@exemplo.com.br\",\n \"documentType\": \"cpf\",\n \"document\": \"39053344705\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Transação criada com sucesso",
"data": {
"id": "clxjkl012mno345",
"boleto": {
"url": "https://api.ephra.io/boleto/clxjkl012mno345",
"barcode": "23793381286000782726337000963779410010000049900",
"digitableLine": "23793.38128 60007.827263 37000.963779 4 10010000049900",
"dueAt": "2026-10-01T03:00:00.000Z"
},
"status": "pending",
"fees": 299
}
}{
"statusCode": 400,
"error": "Bad Request",
"message": "Documento inválido para o tipo selecionado"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Token inválido ou expirado"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I
