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": 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>"
}
},
"cob": {
"expirationDate": "2026-07-01",
"daysAfterDueDate": 5,
"fine": {
"value": 2
},
"interest": {
"value": 1
},
"discount": {},
"rebate": {
"value": 123
}
},
"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/pix/in/cob"
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>"
}
},
"cob": {
"expirationDate": "2026-07-01",
"daysAfterDueDate": 5,
"fine": { "value": 2 },
"interest": { "value": 1 },
"discount": {},
"rebate": { "value": 123 }
},
"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>'
}
},
cob: {
expirationDate: '2026-07-01',
daysAfterDueDate: 5,
fine: {value: 2},
interest: {value: 1},
discount: {},
rebate: {value: 123}
},
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/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' => 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>'
]
],
'cob' => [
'expirationDate' => '2026-07-01',
'daysAfterDueDate' => 5,
'fine' => [
'value' => 2
],
'interest' => [
'value' => 1
],
'discount' => [
],
'rebate' => [
'value' => 123
]
],
'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/pix/in/cob"
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 \"cob\": {\n \"expirationDate\": \"2026-07-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"value\": 2\n },\n \"interest\": {\n \"value\": 1\n },\n \"discount\": {},\n \"rebate\": {\n \"value\": 123\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/pix/in/cob")
.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 \"cob\": {\n \"expirationDate\": \"2026-07-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"value\": 2\n },\n \"interest\": {\n \"value\": 1\n },\n \"discount\": {},\n \"rebate\": {\n \"value\": 123\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/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\": 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 \"cob\": {\n \"expirationDate\": \"2026-07-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"value\": 2\n },\n \"interest\": {\n \"value\": 1\n },\n \"discount\": {},\n \"rebate\": {\n \"value\": 123\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",
"pix": {
"emv": "00020126580014br.gov.bcb.pix...6304ABCD",
"qrCode": "data:image/png;base64,iVBORw0KG..."
},
"status": "pending",
"fees": 150
}
}{
"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": 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>"
}
},
"cob": {
"expirationDate": "2026-07-01",
"daysAfterDueDate": 5,
"fine": {
"value": 2
},
"interest": {
"value": 1
},
"discount": {},
"rebate": {
"value": 123
}
},
"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/pix/in/cob"
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>"
}
},
"cob": {
"expirationDate": "2026-07-01",
"daysAfterDueDate": 5,
"fine": { "value": 2 },
"interest": { "value": 1 },
"discount": {},
"rebate": { "value": 123 }
},
"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>'
}
},
cob: {
expirationDate: '2026-07-01',
daysAfterDueDate: 5,
fine: {value: 2},
interest: {value: 1},
discount: {},
rebate: {value: 123}
},
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/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' => 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>'
]
],
'cob' => [
'expirationDate' => '2026-07-01',
'daysAfterDueDate' => 5,
'fine' => [
'value' => 2
],
'interest' => [
'value' => 1
],
'discount' => [
],
'rebate' => [
'value' => 123
]
],
'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/pix/in/cob"
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 \"cob\": {\n \"expirationDate\": \"2026-07-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"value\": 2\n },\n \"interest\": {\n \"value\": 1\n },\n \"discount\": {},\n \"rebate\": {\n \"value\": 123\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/pix/in/cob")
.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 \"cob\": {\n \"expirationDate\": \"2026-07-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"value\": 2\n },\n \"interest\": {\n \"value\": 1\n },\n \"discount\": {},\n \"rebate\": {\n \"value\": 123\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/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\": 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 \"cob\": {\n \"expirationDate\": \"2026-07-01\",\n \"daysAfterDueDate\": 5,\n \"fine\": {\n \"value\": 2\n },\n \"interest\": {\n \"value\": 1\n },\n \"discount\": {},\n \"rebate\": {\n \"value\": 123\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",
"pix": {
"emv": "00020126580014br.gov.bcb.pix...6304ABCD",
"qrCode": "data:image/png;base64,iVBORw0KG..."
},
"status": "pending",
"fees": 150
}
}{
"statusCode": 400,
"error": "Bad Request",
"message": "Documento inválido para o tipo selecionado"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Token inválido ou expirado"
}Gera uma cobrança PIX com data de vencimento, multa, juros e desconto — ideal para faturas. Aceita os mesmos campos do QR Code imediato, mais o objeto
cob. A cobrança nasce com status: "pending".
Visão conceitual em Guias › Pagamentos PIX.
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
