curl --request POST \
--url https://api.paysurebr.com/v1/pix/qrcode \
--header 'Content-Type: application/json' \
--header 'ci: <api-key>' \
--data '
{
"external_id": "order-12345",
"value_cents": 10000,
"postbackUrl": "https://seu-site.com/webhooks/paysure",
"generator_name": "João da Silva",
"generator_document": "12345678900",
"description": "Pedido #12345",
"expiration_seconds": 3600,
"splits": [
{
"clientId": "parceiro1",
"value": 5
}
]
}
'import requests
url = "https://api.paysurebr.com/v1/pix/qrcode"
payload = {
"external_id": "order-12345",
"value_cents": 10000,
"postbackUrl": "https://seu-site.com/webhooks/paysure",
"generator_name": "João da Silva",
"generator_document": "12345678900",
"description": "Pedido #12345",
"expiration_seconds": 3600,
"splits": [
{
"clientId": "parceiro1",
"value": 5
}
]
}
headers = {
"ci": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {ci: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: 'order-12345',
value_cents: 10000,
postbackUrl: 'https://seu-site.com/webhooks/paysure',
generator_name: 'João da Silva',
generator_document: '12345678900',
description: 'Pedido #12345',
expiration_seconds: 3600,
splits: [{clientId: 'parceiro1', value: 5}]
})
};
fetch('https://api.paysurebr.com/v1/pix/qrcode', 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.paysurebr.com/v1/pix/qrcode",
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([
'external_id' => 'order-12345',
'value_cents' => 10000,
'postbackUrl' => 'https://seu-site.com/webhooks/paysure',
'generator_name' => 'João da Silva',
'generator_document' => '12345678900',
'description' => 'Pedido #12345',
'expiration_seconds' => 3600,
'splits' => [
[
'clientId' => 'parceiro1',
'value' => 5
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ci: <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.paysurebr.com/v1/pix/qrcode"
payload := strings.NewReader("{\n \"external_id\": \"order-12345\",\n \"value_cents\": 10000,\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\",\n \"generator_name\": \"João da Silva\",\n \"generator_document\": \"12345678900\",\n \"description\": \"Pedido #12345\",\n \"expiration_seconds\": 3600,\n \"splits\": [\n {\n \"clientId\": \"parceiro1\",\n \"value\": 5\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ci", "<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.paysurebr.com/v1/pix/qrcode")
.header("ci", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"order-12345\",\n \"value_cents\": 10000,\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\",\n \"generator_name\": \"João da Silva\",\n \"generator_document\": \"12345678900\",\n \"description\": \"Pedido #12345\",\n \"expiration_seconds\": 3600,\n \"splits\": [\n {\n \"clientId\": \"parceiro1\",\n \"value\": 5\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paysurebr.com/v1/pix/qrcode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ci"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"order-12345\",\n \"value_cents\": 10000,\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\",\n \"generator_name\": \"João da Silva\",\n \"generator_document\": \"12345678900\",\n \"description\": \"Pedido #12345\",\n \"expiration_seconds\": 3600,\n \"splits\": [\n {\n \"clientId\": \"parceiro1\",\n \"value\": 5\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"qrcode": {
"reference_code": "PSR-9c8f7a1e-4d2b-4e6a-8c9f-1a2b3c4d5e6f",
"external_reference": "order-12345",
"content": "00020126580014br.gov.bcb.pix..."
}
}{
"message": "Invalid credentials or inactive"
}{
"message": "<string>",
"ms": 123
}Gerar QR Code PIX
Cria uma nova cobrança PIX e retorna o BR Code (copia-e-cola) que o pagador usa.
Quando o pagador efetua o pagamento, enviamos um webhook para postbackUrl com status paid.
curl --request POST \
--url https://api.paysurebr.com/v1/pix/qrcode \
--header 'Content-Type: application/json' \
--header 'ci: <api-key>' \
--data '
{
"external_id": "order-12345",
"value_cents": 10000,
"postbackUrl": "https://seu-site.com/webhooks/paysure",
"generator_name": "João da Silva",
"generator_document": "12345678900",
"description": "Pedido #12345",
"expiration_seconds": 3600,
"splits": [
{
"clientId": "parceiro1",
"value": 5
}
]
}
'import requests
url = "https://api.paysurebr.com/v1/pix/qrcode"
payload = {
"external_id": "order-12345",
"value_cents": 10000,
"postbackUrl": "https://seu-site.com/webhooks/paysure",
"generator_name": "João da Silva",
"generator_document": "12345678900",
"description": "Pedido #12345",
"expiration_seconds": 3600,
"splits": [
{
"clientId": "parceiro1",
"value": 5
}
]
}
headers = {
"ci": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {ci: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: 'order-12345',
value_cents: 10000,
postbackUrl: 'https://seu-site.com/webhooks/paysure',
generator_name: 'João da Silva',
generator_document: '12345678900',
description: 'Pedido #12345',
expiration_seconds: 3600,
splits: [{clientId: 'parceiro1', value: 5}]
})
};
fetch('https://api.paysurebr.com/v1/pix/qrcode', 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.paysurebr.com/v1/pix/qrcode",
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([
'external_id' => 'order-12345',
'value_cents' => 10000,
'postbackUrl' => 'https://seu-site.com/webhooks/paysure',
'generator_name' => 'João da Silva',
'generator_document' => '12345678900',
'description' => 'Pedido #12345',
'expiration_seconds' => 3600,
'splits' => [
[
'clientId' => 'parceiro1',
'value' => 5
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ci: <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.paysurebr.com/v1/pix/qrcode"
payload := strings.NewReader("{\n \"external_id\": \"order-12345\",\n \"value_cents\": 10000,\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\",\n \"generator_name\": \"João da Silva\",\n \"generator_document\": \"12345678900\",\n \"description\": \"Pedido #12345\",\n \"expiration_seconds\": 3600,\n \"splits\": [\n {\n \"clientId\": \"parceiro1\",\n \"value\": 5\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ci", "<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.paysurebr.com/v1/pix/qrcode")
.header("ci", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"order-12345\",\n \"value_cents\": 10000,\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\",\n \"generator_name\": \"João da Silva\",\n \"generator_document\": \"12345678900\",\n \"description\": \"Pedido #12345\",\n \"expiration_seconds\": 3600,\n \"splits\": [\n {\n \"clientId\": \"parceiro1\",\n \"value\": 5\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paysurebr.com/v1/pix/qrcode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ci"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_id\": \"order-12345\",\n \"value_cents\": 10000,\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\",\n \"generator_name\": \"João da Silva\",\n \"generator_document\": \"12345678900\",\n \"description\": \"Pedido #12345\",\n \"expiration_seconds\": 3600,\n \"splits\": [\n {\n \"clientId\": \"parceiro1\",\n \"value\": 5\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"qrcode": {
"reference_code": "PSR-9c8f7a1e-4d2b-4e6a-8c9f-1a2b3c4d5e6f",
"external_reference": "order-12345",
"content": "00020126580014br.gov.bcb.pix..."
}
}{
"message": "Invalid credentials or inactive"
}{
"message": "<string>",
"ms": 123
}Fluxo completo
Você faz POST /v1/pix/qrcode
external_id, value_cents, postbackUrl e dados opcionais do pagador.Recebe HTTP 201 com BR Code
qrcode.content (BR Code copia-e-cola) pra gerar o QR visual no seu frontend.Cliente paga via app do banco dele
Paysure envia webhook com status paid
postbackUrl com cashin.status = "paid". Credite o produto/serviço no seu sistema.Authorizations
Autenticação por par client-credentials. Envie dois headers em toda requisição:
ci: client_id (público)cs: client_secret (privado — nunca exponha no frontend)
Gere as credenciais no painel da Paysure em API Keys. Você pode ter múltiplas chaves ativas.
Body
Seu identificador único da transação. Use idempotência.
191Valor em centavos (R$ 1,00 = 100).
x >= 100URL HTTPS para receber webhook quando o pagamento for confirmado.
Nome do pagador (cliente final). Opcional.
191CPF ou CNPJ do pagador. Opcional.
3225510Show child attributes
Show child attributes
Tempo de expiração do QR Code, em segundos (TTL). Opcional — se omitido, usa 3600 (1 hora). Mínimo 60s, máximo 86400s (24h). Após expirar, o QR não pode mais ser pago.
60 <= x <= 86400Response
Cobrança criada
Show child attributes
Show child attributes

