curl --request POST \
--url https://api.paybridge.dev/v1/payments \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"amount": 10,
"credentialId": "<string>",
"ruleSetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "Pagamento do pedido #123",
"externalId": "pedido-123",
"payer": {
"name": "João Silva",
"document": "12345678900",
"email": "joao@exemplo.com.br",
"phone": "11999999999"
},
"expirationMinutes": 30,
"metadata": {
"orderId": "123",
"source": "mobile"
}
}
'import requests
url = "https://api.paybridge.dev/v1/payments"
payload = {
"amount": 10,
"credentialId": "<string>",
"ruleSetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "Pagamento do pedido #123",
"externalId": "pedido-123",
"payer": {
"name": "João Silva",
"document": "12345678900",
"email": "joao@exemplo.com.br",
"phone": "11999999999"
},
"expirationMinutes": 30,
"metadata": {
"orderId": "123",
"source": "mobile"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 10,
credentialId: '<string>',
ruleSetId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: 'Pagamento do pedido #123',
externalId: 'pedido-123',
payer: {
name: 'João Silva',
document: '12345678900',
email: 'joao@exemplo.com.br',
phone: '11999999999'
},
expirationMinutes: 30,
metadata: {orderId: '123', source: 'mobile'}
})
};
fetch('https://api.paybridge.dev/v1/payments', 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.paybridge.dev/v1/payments",
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([
'amount' => 10,
'credentialId' => '<string>',
'ruleSetId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => 'Pagamento do pedido #123',
'externalId' => 'pedido-123',
'payer' => [
'name' => 'João Silva',
'document' => '12345678900',
'email' => 'joao@exemplo.com.br',
'phone' => '11999999999'
],
'expirationMinutes' => 30,
'metadata' => [
'orderId' => '123',
'source' => 'mobile'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.paybridge.dev/v1/payments"
payload := strings.NewReader("{\n \"amount\": 10,\n \"credentialId\": \"<string>\",\n \"ruleSetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"Pagamento do pedido #123\",\n \"externalId\": \"pedido-123\",\n \"payer\": {\n \"name\": \"João Silva\",\n \"document\": \"12345678900\",\n \"email\": \"joao@exemplo.com.br\",\n \"phone\": \"11999999999\"\n },\n \"expirationMinutes\": 30,\n \"metadata\": {\n \"orderId\": \"123\",\n \"source\": \"mobile\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.paybridge.dev/v1/payments")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10,\n \"credentialId\": \"<string>\",\n \"ruleSetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"Pagamento do pedido #123\",\n \"externalId\": \"pedido-123\",\n \"payer\": {\n \"name\": \"João Silva\",\n \"document\": \"12345678900\",\n \"email\": \"joao@exemplo.com.br\",\n \"phone\": \"11999999999\"\n },\n \"expirationMinutes\": 30,\n \"metadata\": {\n \"orderId\": \"123\",\n \"source\": \"mobile\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridge.dev/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10,\n \"credentialId\": \"<string>\",\n \"ruleSetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"Pagamento do pedido #123\",\n \"externalId\": \"pedido-123\",\n \"payer\": {\n \"name\": \"João Silva\",\n \"document\": \"12345678900\",\n \"email\": \"joao@exemplo.com.br\",\n \"phone\": \"11999999999\"\n },\n \"expirationMinutes\": 30,\n \"metadata\": {\n \"orderId\": \"123\",\n \"source\": \"mobile\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"amount": 123,
"currency": "<string>",
"status": "<string>",
"provider": "<string>",
"pixCopyPaste": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"pixQrCodeBase64": "<string>",
"isTest": true,
"metadata": {
"orderId": "123",
"source": "mobile"
}
}{
"statusCode": 400,
"error": "BadRequest",
"message": "amount must be greater than or equal to 1",
"timestamp": "2026-01-21T22:00:00.000Z"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid or missing API Key",
"timestamp": "2026-01-21T22:00:00.000Z"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "API Key does not have permission for this operation",
"timestamp": "2026-01-21T22:00:00.000Z"
}{
"statusCode": 500,
"error": "InternalError",
"message": "An unexpected error occurred",
"timestamp": "2026-01-21T22:00:00.000Z",
"traceId": "2771463d58840c8e116dc6dda1e1e5d0"
}Criar Pagamento
Cria um novo pagamento PIX. O pagamento será processado através do PSP configurado e um código PIX será gerado.
Autenticação: Requer uma API Key válida no header X-API-Key.
Modo de Teste: Se você usar uma API Key de teste (pk_test_*), o pagamento será processado em modo sandbox sem transações reais.
Modo de Produção: Se você usar uma API Key de produção (pk_live_*), cobranças reais serão criadas no PSP.
Roteamento de Credenciais
Existem 3 modos para selecionar a credencial usada no pagamento:
credentialIdfornecido → Usa a credencial especificada diretamente (ignora regras do rule set).ruleSetIdfornecido → Usa o rule set para selecionar a credencial com base nas regras configuradas (faixa de preço → credencial padrão → fallbacks).- Nenhum fornecido → Usa a credencial padrão da organização (modo legado).
curl --request POST \
--url https://api.paybridge.dev/v1/payments \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"amount": 10,
"credentialId": "<string>",
"ruleSetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "Pagamento do pedido #123",
"externalId": "pedido-123",
"payer": {
"name": "João Silva",
"document": "12345678900",
"email": "joao@exemplo.com.br",
"phone": "11999999999"
},
"expirationMinutes": 30,
"metadata": {
"orderId": "123",
"source": "mobile"
}
}
'import requests
url = "https://api.paybridge.dev/v1/payments"
payload = {
"amount": 10,
"credentialId": "<string>",
"ruleSetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "Pagamento do pedido #123",
"externalId": "pedido-123",
"payer": {
"name": "João Silva",
"document": "12345678900",
"email": "joao@exemplo.com.br",
"phone": "11999999999"
},
"expirationMinutes": 30,
"metadata": {
"orderId": "123",
"source": "mobile"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 10,
credentialId: '<string>',
ruleSetId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: 'Pagamento do pedido #123',
externalId: 'pedido-123',
payer: {
name: 'João Silva',
document: '12345678900',
email: 'joao@exemplo.com.br',
phone: '11999999999'
},
expirationMinutes: 30,
metadata: {orderId: '123', source: 'mobile'}
})
};
fetch('https://api.paybridge.dev/v1/payments', 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.paybridge.dev/v1/payments",
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([
'amount' => 10,
'credentialId' => '<string>',
'ruleSetId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => 'Pagamento do pedido #123',
'externalId' => 'pedido-123',
'payer' => [
'name' => 'João Silva',
'document' => '12345678900',
'email' => 'joao@exemplo.com.br',
'phone' => '11999999999'
],
'expirationMinutes' => 30,
'metadata' => [
'orderId' => '123',
'source' => 'mobile'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.paybridge.dev/v1/payments"
payload := strings.NewReader("{\n \"amount\": 10,\n \"credentialId\": \"<string>\",\n \"ruleSetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"Pagamento do pedido #123\",\n \"externalId\": \"pedido-123\",\n \"payer\": {\n \"name\": \"João Silva\",\n \"document\": \"12345678900\",\n \"email\": \"joao@exemplo.com.br\",\n \"phone\": \"11999999999\"\n },\n \"expirationMinutes\": 30,\n \"metadata\": {\n \"orderId\": \"123\",\n \"source\": \"mobile\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.paybridge.dev/v1/payments")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10,\n \"credentialId\": \"<string>\",\n \"ruleSetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"Pagamento do pedido #123\",\n \"externalId\": \"pedido-123\",\n \"payer\": {\n \"name\": \"João Silva\",\n \"document\": \"12345678900\",\n \"email\": \"joao@exemplo.com.br\",\n \"phone\": \"11999999999\"\n },\n \"expirationMinutes\": 30,\n \"metadata\": {\n \"orderId\": \"123\",\n \"source\": \"mobile\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridge.dev/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10,\n \"credentialId\": \"<string>\",\n \"ruleSetId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"Pagamento do pedido #123\",\n \"externalId\": \"pedido-123\",\n \"payer\": {\n \"name\": \"João Silva\",\n \"document\": \"12345678900\",\n \"email\": \"joao@exemplo.com.br\",\n \"phone\": \"11999999999\"\n },\n \"expirationMinutes\": 30,\n \"metadata\": {\n \"orderId\": \"123\",\n \"source\": \"mobile\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"amount": 123,
"currency": "<string>",
"status": "<string>",
"provider": "<string>",
"pixCopyPaste": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"pixQrCodeBase64": "<string>",
"isTest": true,
"metadata": {
"orderId": "123",
"source": "mobile"
}
}{
"statusCode": 400,
"error": "BadRequest",
"message": "amount must be greater than or equal to 1",
"timestamp": "2026-01-21T22:00:00.000Z"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid or missing API Key",
"timestamp": "2026-01-21T22:00:00.000Z"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "API Key does not have permission for this operation",
"timestamp": "2026-01-21T22:00:00.000Z"
}{
"statusCode": 500,
"error": "InternalError",
"message": "An unexpected error occurred",
"timestamp": "2026-01-21T22:00:00.000Z",
"traceId": "2771463d58840c8e116dc6dda1e1e5d0"
}Autorizações
API Key para autenticação (pk_live_* ou pk_test_*)
Corpo
Valor em BRL (ex: 10.00 para R$ 10,00)
10
ID da credencial a ser usada para este pagamento. Se fornecido, ignora as regras do rule set. Se nem credentialId nem ruleSetId forem fornecidos, a credencial padrão será usada.
ID do Rule Set para roteamento de credenciais. Quando fornecido, as regras do rule set serão usadas para selecionar a credencial primária e fallbacks. Se não fornecido, a credencial padrão será usada.
Descrição do pagamento
"Pagamento do pedido #123"
ID de referência externa
"pedido-123"
Show child attributes
Show child attributes
Tempo de expiração em minutos
x >= 5Metadados customizados (objeto JSON)
{ "orderId": "123", "source": "mobile" }
Resposta
Pagamento criado com sucesso
ID único do pagamento
Valor do pagamento
Moeda (BRL)
Status do pagamento
Provedor de pagamento
Código PIX copia e cola
Data de expiração
Data de criação
QR Code em Base64
Se é um pagamento de teste/sandbox
Metadados customizados
{ "orderId": "123", "source": "mobile" }