curl --request POST \
--url https://api.econpay.com.br/payments/order \
--header 'Authorization: Bearer SEU_TOKEN_JWT' \
--header 'Content-Type: application/json' \
--data '{
"access_token": "SEU_ACCESS_TOKEN",
"customer": {
"name": "João da Silva",
"email": "[email protected]",
"document": "12345678900",
"phone": {
"country_code": "55",
"area_code": "11",
"number": "999999999"
}
},
"items": [{
"name": "Produto Teste",
"quantity": 1,
"price": 10000
}],
"payment": {
"type": "pix",
"installments": 1
},
"shipping": {
"name": "Digital",
"price": 0
},
"subtotal": 10000,
"total": 10000
}'
curl --request POST \
--url https://api.econpay.com.br/payments/order \
--header 'Authorization: Bearer SEU_TOKEN_JWT' \
--header 'Content-Type: application/json' \
--data '{
"access_token": "SEU_ACCESS_TOKEN",
"customer": {
"name": "Maria Santos",
"email": "[email protected]",
"document": "98765432100",
"phone": {
"country_code": "55",
"area_code": "11",
"number": "988888888"
}
},
"items": [{
"name": "Produto Premium",
"quantity": 1,
"price": 30000
}],
"payment": {
"type": "invoice",
"installments": 1
},
"shipping": {
"name": "Sedex",
"price": 1500
},
"subtotal": 30000,
"total": 31500
}'
const response = await fetch('https://api.econpay.com.br/payments/order', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
access_token: 'SEU_ACCESS_TOKEN',
customer: {
name: 'João da Silva',
email: '[email protected]',
document: '12345678900',
phone: {
country_code: '55',
area_code: '11',
number: '999999999'
}
},
items: [{
name: 'Produto Teste',
quantity: 1,
price: 10000 // R$ 100,00
}],
payment: {
type: 'pix',
installments: 1
},
shipping: {
name: 'Digital',
price: 0
},
subtotal: 10000,
total: 10000
})
});
const payment = await response.json();
if (payment.success) {
console.log('Pagamento criado:', payment.transaction.order_number);
if (payment.transaction.payment_type === 'pix') {
console.log('QR Code:', payment.transaction.pix_qr_code);
// Exibir QR Code para o cliente
}
}
import requests
response = requests.post(
'https://api.econpay.com.br/payments/order',
headers={
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
},
json={
'access_token': 'SEU_ACCESS_TOKEN',
'customer': {
'name': 'João da Silva',
'email': '[email protected]',
'document': '12345678900',
'phone': {
'country_code': '55',
'area_code': '11',
'number': '999999999'
}
},
'items': [{
'name': 'Produto Teste',
'quantity': 1,
'price': 10000 # R$ 100,00
}],
'payment': {
'type': 'pix',
'installments': 1
},
'shipping': {
'name': 'Digital',
'price': 0
},
'subtotal': 10000,
'total': 10000
}
)
payment = response.json()
if payment['success']:
print(f"Pagamento criado: {payment['transaction']['order_number']}")
if payment['transaction']['payment_type'] == 'pix':
print(f"QR Code: {payment['transaction']['pix_qr_code']}")
{
"success": true,
"transaction": {
"id": 123,
"order_number": "ORD-20240122-123456",
"status": "PENDING",
"amount": 10000,
"payment_type": "pix",
"pix_qr_code": "00020126580014br.gov.bcb.pix...",
"pix_qr_code_url": "https://api.econpay.com.br/qrcode/123.png",
"created_at": "2024-01-22T10:30:00Z"
}
}
{
"success": true,
"transaction": {
"id": 124,
"order_number": "ORD-20240122-123457",
"status": "PENDING",
"amount": 31500,
"payment_type": "invoice",
"boleto_url": "https://api.econpay.com.br/boleto/124.pdf",
"boleto_barcode": "34191.79001 01043.510047 91020.150008 1 82880000030000",
"created_at": "2024-01-22T10:35:00Z"
}
}
{
"success": false,
"message": "Valor mínimo não atingido",
"error": "O valor mínimo para transações é R$ 5,00. Valor enviado: R$ 2,00"
}
{
"success": false,
"message": "Dados de pagamento inválidos",
"error": "Campo 'customer.email' é obrigatório"
}
{
"success": false,
"message": "Access token inválido",
"error": "Token não encontrado ou inativo"
}
Pagamentos
POST /payments/order
Criar um novo pagamento (PIX ou Boleto)
POST
/
payments
/
order
curl --request POST \
--url https://api.econpay.com.br/payments/order \
--header 'Authorization: Bearer SEU_TOKEN_JWT' \
--header 'Content-Type: application/json' \
--data '{
"access_token": "SEU_ACCESS_TOKEN",
"customer": {
"name": "João da Silva",
"email": "[email protected]",
"document": "12345678900",
"phone": {
"country_code": "55",
"area_code": "11",
"number": "999999999"
}
},
"items": [{
"name": "Produto Teste",
"quantity": 1,
"price": 10000
}],
"payment": {
"type": "pix",
"installments": 1
},
"shipping": {
"name": "Digital",
"price": 0
},
"subtotal": 10000,
"total": 10000
}'
curl --request POST \
--url https://api.econpay.com.br/payments/order \
--header 'Authorization: Bearer SEU_TOKEN_JWT' \
--header 'Content-Type: application/json' \
--data '{
"access_token": "SEU_ACCESS_TOKEN",
"customer": {
"name": "Maria Santos",
"email": "[email protected]",
"document": "98765432100",
"phone": {
"country_code": "55",
"area_code": "11",
"number": "988888888"
}
},
"items": [{
"name": "Produto Premium",
"quantity": 1,
"price": 30000
}],
"payment": {
"type": "invoice",
"installments": 1
},
"shipping": {
"name": "Sedex",
"price": 1500
},
"subtotal": 30000,
"total": 31500
}'
const response = await fetch('https://api.econpay.com.br/payments/order', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
access_token: 'SEU_ACCESS_TOKEN',
customer: {
name: 'João da Silva',
email: '[email protected]',
document: '12345678900',
phone: {
country_code: '55',
area_code: '11',
number: '999999999'
}
},
items: [{
name: 'Produto Teste',
quantity: 1,
price: 10000 // R$ 100,00
}],
payment: {
type: 'pix',
installments: 1
},
shipping: {
name: 'Digital',
price: 0
},
subtotal: 10000,
total: 10000
})
});
const payment = await response.json();
if (payment.success) {
console.log('Pagamento criado:', payment.transaction.order_number);
if (payment.transaction.payment_type === 'pix') {
console.log('QR Code:', payment.transaction.pix_qr_code);
// Exibir QR Code para o cliente
}
}
import requests
response = requests.post(
'https://api.econpay.com.br/payments/order',
headers={
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
},
json={
'access_token': 'SEU_ACCESS_TOKEN',
'customer': {
'name': 'João da Silva',
'email': '[email protected]',
'document': '12345678900',
'phone': {
'country_code': '55',
'area_code': '11',
'number': '999999999'
}
},
'items': [{
'name': 'Produto Teste',
'quantity': 1,
'price': 10000 # R$ 100,00
}],
'payment': {
'type': 'pix',
'installments': 1
},
'shipping': {
'name': 'Digital',
'price': 0
},
'subtotal': 10000,
'total': 10000
}
)
payment = response.json()
if payment['success']:
print(f"Pagamento criado: {payment['transaction']['order_number']}")
if payment['transaction']['payment_type'] == 'pix':
print(f"QR Code: {payment['transaction']['pix_qr_code']}")
{
"success": true,
"transaction": {
"id": 123,
"order_number": "ORD-20240122-123456",
"status": "PENDING",
"amount": 10000,
"payment_type": "pix",
"pix_qr_code": "00020126580014br.gov.bcb.pix...",
"pix_qr_code_url": "https://api.econpay.com.br/qrcode/123.png",
"created_at": "2024-01-22T10:30:00Z"
}
}
{
"success": true,
"transaction": {
"id": 124,
"order_number": "ORD-20240122-123457",
"status": "PENDING",
"amount": 31500,
"payment_type": "invoice",
"boleto_url": "https://api.econpay.com.br/boleto/124.pdf",
"boleto_barcode": "34191.79001 01043.510047 91020.150008 1 82880000030000",
"created_at": "2024-01-22T10:35:00Z"
}
}
{
"success": false,
"message": "Valor mínimo não atingido",
"error": "O valor mínimo para transações é R$ 5,00. Valor enviado: R$ 2,00"
}
{
"success": false,
"message": "Dados de pagamento inválidos",
"error": "Campo 'customer.email' é obrigatório"
}
{
"success": false,
"message": "Access token inválido",
"error": "Token não encontrado ou inativo"
}
Descrição
Endpoint unificado para processar pagamentos. Suporta os seguintes métodos de pagamento:- PIX - Pagamento instantâneo com QR Code
- Boleto - Boleto bancário registrado
Valor Mínimo: R$ 5,00 (500 centavos). Valores menores serão rejeitados.
Valores em Centavos: Todos os valores monetários devem ser enviados em centavos. R$ 100,00 = 10000 centavos.
Headers
string
required
Bearer token JWT obtido no login
Request Body
string
required
Token de acesso do estabelecimento (obtido no dashboard)
string
ID do link de pagamento (opcional)
object
required
Dados do cliente
Show properties
Show properties
string
required
Nome completo do cliente
string
required
Email do cliente
string
required
CPF ou CNPJ (apenas números)
string
Endereço IP do cliente (recomendado para antifraude)
object
required
array
required
object
required
object
required
number
required
Subtotal em centavos (soma dos itens)
number
required
Total em centavos (subtotal + frete)
array
Participantes do split (opcional, para divisão de valores)
Show properties
Show properties
string
required
Access token do participante
string
required
Tipo:
PRIMARY ou SECONDARYstring
required
Tipo de divisão:
PERCENTAGE ou FIXEDboolean
required
Se este participante paga as taxas
boolean
required
Se desconta do valor bruto
number
required
Valor em centavos (FIXED) ou porcentagem em centavos (PERCENTAGE)
Response
boolean
Indica se a operação foi bem-sucedida
object
Show properties
Show properties
number
ID da transação
string
Número do pedido (único)
string
Status da transação:
PENDING, APPROVED, FAILEDnumber
Valor em centavos
string
Tipo de pagamento usado
string
String do QR Code PIX (apenas para PIX)
string
URL da imagem do QR Code (apenas para PIX)
string
URL do boleto (apenas para boleto)
string
Código de barras do boleto (apenas para boleto)
string
Data de criação (ISO 8601)
curl --request POST \
--url https://api.econpay.com.br/payments/order \
--header 'Authorization: Bearer SEU_TOKEN_JWT' \
--header 'Content-Type: application/json' \
--data '{
"access_token": "SEU_ACCESS_TOKEN",
"customer": {
"name": "João da Silva",
"email": "[email protected]",
"document": "12345678900",
"phone": {
"country_code": "55",
"area_code": "11",
"number": "999999999"
}
},
"items": [{
"name": "Produto Teste",
"quantity": 1,
"price": 10000
}],
"payment": {
"type": "pix",
"installments": 1
},
"shipping": {
"name": "Digital",
"price": 0
},
"subtotal": 10000,
"total": 10000
}'
curl --request POST \
--url https://api.econpay.com.br/payments/order \
--header 'Authorization: Bearer SEU_TOKEN_JWT' \
--header 'Content-Type: application/json' \
--data '{
"access_token": "SEU_ACCESS_TOKEN",
"customer": {
"name": "Maria Santos",
"email": "[email protected]",
"document": "98765432100",
"phone": {
"country_code": "55",
"area_code": "11",
"number": "988888888"
}
},
"items": [{
"name": "Produto Premium",
"quantity": 1,
"price": 30000
}],
"payment": {
"type": "invoice",
"installments": 1
},
"shipping": {
"name": "Sedex",
"price": 1500
},
"subtotal": 30000,
"total": 31500
}'
const response = await fetch('https://api.econpay.com.br/payments/order', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
access_token: 'SEU_ACCESS_TOKEN',
customer: {
name: 'João da Silva',
email: '[email protected]',
document: '12345678900',
phone: {
country_code: '55',
area_code: '11',
number: '999999999'
}
},
items: [{
name: 'Produto Teste',
quantity: 1,
price: 10000 // R$ 100,00
}],
payment: {
type: 'pix',
installments: 1
},
shipping: {
name: 'Digital',
price: 0
},
subtotal: 10000,
total: 10000
})
});
const payment = await response.json();
if (payment.success) {
console.log('Pagamento criado:', payment.transaction.order_number);
if (payment.transaction.payment_type === 'pix') {
console.log('QR Code:', payment.transaction.pix_qr_code);
// Exibir QR Code para o cliente
}
}
import requests
response = requests.post(
'https://api.econpay.com.br/payments/order',
headers={
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
},
json={
'access_token': 'SEU_ACCESS_TOKEN',
'customer': {
'name': 'João da Silva',
'email': '[email protected]',
'document': '12345678900',
'phone': {
'country_code': '55',
'area_code': '11',
'number': '999999999'
}
},
'items': [{
'name': 'Produto Teste',
'quantity': 1,
'price': 10000 # R$ 100,00
}],
'payment': {
'type': 'pix',
'installments': 1
},
'shipping': {
'name': 'Digital',
'price': 0
},
'subtotal': 10000,
'total': 10000
}
)
payment = response.json()
if payment['success']:
print(f"Pagamento criado: {payment['transaction']['order_number']}")
if payment['transaction']['payment_type'] == 'pix':
print(f"QR Code: {payment['transaction']['pix_qr_code']}")
{
"success": true,
"transaction": {
"id": 123,
"order_number": "ORD-20240122-123456",
"status": "PENDING",
"amount": 10000,
"payment_type": "pix",
"pix_qr_code": "00020126580014br.gov.bcb.pix...",
"pix_qr_code_url": "https://api.econpay.com.br/qrcode/123.png",
"created_at": "2024-01-22T10:30:00Z"
}
}
{
"success": true,
"transaction": {
"id": 124,
"order_number": "ORD-20240122-123457",
"status": "PENDING",
"amount": 31500,
"payment_type": "invoice",
"boleto_url": "https://api.econpay.com.br/boleto/124.pdf",
"boleto_barcode": "34191.79001 01043.510047 91020.150008 1 82880000030000",
"created_at": "2024-01-22T10:35:00Z"
}
}
{
"success": false,
"message": "Valor mínimo não atingido",
"error": "O valor mínimo para transações é R$ 5,00. Valor enviado: R$ 2,00"
}
{
"success": false,
"message": "Dados de pagamento inválidos",
"error": "Campo 'customer.email' é obrigatório"
}
{
"success": false,
"message": "Access token inválido",
"error": "Token não encontrado ou inativo"
}
Métodos de Pagamento
- PIX
- Boleto
Pagamento PIX
- Aprovação instantânea (geralmente em segundos)
- QR Code válido por 30 minutos
- Disponível 24/7
- Sem taxas para o cliente final
pix_qr_code: String EMV do QR Codepix_qr_code_url: URL da imagem do QR Code
PENDING: Aguardando pagamentoAPPROVED: Pago (webhook enviado)
Boleto Bancário
- Vencimento configurável
- Registro automático
- Código de barras e linha digitável
boleto_url: URL do PDF do boletoboleto_barcode: Código de barrasboleto_digitable_line: Linha digitável
PENDING: Aguardando pagamentoAPPROVED: Pago (webhook enviado)
Próximos Passos
Reembolso
Processar estornos
Webhooks
Receber notificações
Listar Transações
Consultar pagamentos
Erros
Códigos de erro