Criar cobrança PIX (com vencimento)
curl --request POST \
--url https://api.ephra.io/v1/pix/in/cob \
--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"
},
"cob": {
"expirationDate": "2026-10-01",
"daysAfterDueDate": 5,
"fine": {
"type": "percent",
"value": 2
},
"interest": {
"type": "percent",
"basis": "month",
"calendar": "calendar",
"value": 1
}
}
}
'import requests
url = "https://api.ephra.io/v1/pix/in/cob"
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"
},
"cob": {
"expirationDate": "2026-10-01",
"daysAfterDueDate": 5,
"fine": {
"type": "percent",
"value": 2
},
"interest": {
"type": "percent",
"basis": "month",
"calendar": "calendar",
"value": 1
}
}
}
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'
},
cob: {
expirationDate: '2026-10-01',
daysAfterDueDate: 5,
fine: {type: 'percent', value: 2},
interest: {type: 'percent', basis: 'month', calendar: 'calendar', value: 1}
}
})
};
fetch('https://api.ephra.io/v1/pix/in/cob', 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/pix/in/cob",
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'
],
'cob' => [
'expirationDate' => '2026-10-01',
'daysAfterDueDate' => 5,
'fine' => [
'type' => 'percent',
'value' => 2
],
'interest' => [
'type' => 'percent',
'basis' => 'month',
'calendar' => 'calendar',
'value' => 1
]
]
]),
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/pix/in/cob"
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 \"cob\": {\n \"expirationDate\": \"2026-10-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"type\": \"percent\",\n \"value\": 2\n },\n \"interest\": {\n \"type\": \"percent\",\n \"basis\": \"month\",\n \"calendar\": \"calendar\",\n \"value\": 1\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/pix/in/cob")
.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 \"cob\": {\n \"expirationDate\": \"2026-10-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"type\": \"percent\",\n \"value\": 2\n },\n \"interest\": {\n \"type\": \"percent\",\n \"basis\": \"month\",\n \"calendar\": \"calendar\",\n \"value\": 1\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ephra.io/v1/pix/in/cob")
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 \"cob\": {\n \"expirationDate\": \"2026-10-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"type\": \"percent\",\n \"value\": 2\n },\n \"interest\": {\n \"type\": \"percent\",\n \"basis\": \"month\",\n \"calendar\": \"calendar\",\n \"value\": 1\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Transação criada com sucesso",
"data": {
"id": "clxdef456ghi789",
"pix": {
"emv": "00020126580014br.gov.bcb.pix0136a8e3c5d1-7b2f-4e9a-8c3d-1f5e7a9b2c4d5204000053039865802BR5913EPHRA PAGTOS6009SAO PAULO62070503***63041A2B",
"qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5f"
},
"status": "pending",
"fees": 1591
}
}{
"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 PIX (com vencimento)
Gera uma cobrança PIX com data de vencimento, multa, juros e desconto. A cobrança nasce com status pending.
POST
/
v1
/
pix
/
in
/
cob
Criar cobrança PIX (com vencimento)
curl --request POST \
--url https://api.ephra.io/v1/pix/in/cob \
--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"
},
"cob": {
"expirationDate": "2026-10-01",
"daysAfterDueDate": 5,
"fine": {
"type": "percent",
"value": 2
},
"interest": {
"type": "percent",
"basis": "month",
"calendar": "calendar",
"value": 1
}
}
}
'import requests
url = "https://api.ephra.io/v1/pix/in/cob"
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"
},
"cob": {
"expirationDate": "2026-10-01",
"daysAfterDueDate": 5,
"fine": {
"type": "percent",
"value": 2
},
"interest": {
"type": "percent",
"basis": "month",
"calendar": "calendar",
"value": 1
}
}
}
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'
},
cob: {
expirationDate: '2026-10-01',
daysAfterDueDate: 5,
fine: {type: 'percent', value: 2},
interest: {type: 'percent', basis: 'month', calendar: 'calendar', value: 1}
}
})
};
fetch('https://api.ephra.io/v1/pix/in/cob', 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/pix/in/cob",
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'
],
'cob' => [
'expirationDate' => '2026-10-01',
'daysAfterDueDate' => 5,
'fine' => [
'type' => 'percent',
'value' => 2
],
'interest' => [
'type' => 'percent',
'basis' => 'month',
'calendar' => 'calendar',
'value' => 1
]
]
]),
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/pix/in/cob"
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 \"cob\": {\n \"expirationDate\": \"2026-10-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"type\": \"percent\",\n \"value\": 2\n },\n \"interest\": {\n \"type\": \"percent\",\n \"basis\": \"month\",\n \"calendar\": \"calendar\",\n \"value\": 1\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/pix/in/cob")
.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 \"cob\": {\n \"expirationDate\": \"2026-10-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"type\": \"percent\",\n \"value\": 2\n },\n \"interest\": {\n \"type\": \"percent\",\n \"basis\": \"month\",\n \"calendar\": \"calendar\",\n \"value\": 1\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ephra.io/v1/pix/in/cob")
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 \"cob\": {\n \"expirationDate\": \"2026-10-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"type\": \"percent\",\n \"value\": 2\n },\n \"interest\": {\n \"type\": \"percent\",\n \"basis\": \"month\",\n \"calendar\": \"calendar\",\n \"value\": 1\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Transação criada com sucesso",
"data": {
"id": "clxdef456ghi789",
"pix": {
"emv": "00020126580014br.gov.bcb.pix0136a8e3c5d1-7b2f-4e9a-8c3d-1f5e7a9b2c4d5204000053039865802BR5913EPHRA PAGTOS6009SAO PAULO62070503***63041A2B",
"qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5f"
},
"status": "pending",
"fees": 1591
}
}{
"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
Valor em centavos (> 0)
Example:
10000
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Example:
"Pedido #1234"
Recebe webhooks só desta transação
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I
