curl --request POST \
--url https://api.paysurebr.com/v1/pix/payment \
--header 'Content-Type: application/json' \
--header 'ci: <api-key>' \
--data '
{
"external_id": "withdraw-001",
"value_cents": 5000,
"pix_key_type": "cpf",
"pix_key": "12345678900",
"receiver_name": "Maria Souza",
"receiver_document": "12345678900",
"postbackUrl": "https://seu-site.com/webhooks/paysure"
}
'import requests
url = "https://api.paysurebr.com/v1/pix/payment"
payload = {
"external_id": "withdraw-001",
"value_cents": 5000,
"pix_key_type": "cpf",
"pix_key": "12345678900",
"receiver_name": "Maria Souza",
"receiver_document": "12345678900",
"postbackUrl": "https://seu-site.com/webhooks/paysure"
}
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: 'withdraw-001',
value_cents: 5000,
pix_key_type: 'cpf',
pix_key: '12345678900',
receiver_name: 'Maria Souza',
receiver_document: '12345678900',
postbackUrl: 'https://seu-site.com/webhooks/paysure'
})
};
fetch('https://api.paysurebr.com/v1/pix/payment', 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/payment",
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' => 'withdraw-001',
'value_cents' => 5000,
'pix_key_type' => 'cpf',
'pix_key' => '12345678900',
'receiver_name' => 'Maria Souza',
'receiver_document' => '12345678900',
'postbackUrl' => 'https://seu-site.com/webhooks/paysure'
]),
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/payment"
payload := strings.NewReader("{\n \"external_id\": \"withdraw-001\",\n \"value_cents\": 5000,\n \"pix_key_type\": \"cpf\",\n \"pix_key\": \"12345678900\",\n \"receiver_name\": \"Maria Souza\",\n \"receiver_document\": \"12345678900\",\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\"\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/payment")
.header("ci", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"withdraw-001\",\n \"value_cents\": 5000,\n \"pix_key_type\": \"cpf\",\n \"pix_key\": \"12345678900\",\n \"receiver_name\": \"Maria Souza\",\n \"receiver_document\": \"12345678900\",\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paysurebr.com/v1/pix/payment")
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\": \"withdraw-001\",\n \"value_cents\": 5000,\n \"pix_key_type\": \"cpf\",\n \"pix_key\": \"12345678900\",\n \"receiver_name\": \"Maria Souza\",\n \"receiver_document\": \"12345678900\",\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\"\n}"
response = http.request(request)
puts response.read_body{
"cashout": {
"reference_code": "PSR-1234abcd-...",
"external_reference": "withdraw-001",
"status": "processing"
}
}{
"ok": true,
"fractioned": true,
"total_amount_cents": 5000000,
"reason": "Valor acima de R$ 14.000,00 — dividido em 4 saídas.",
"fractions": [
{
"reference_code": "PSR-aaaa1111-...",
"external_reference": "withdraw-001-f1",
"amount_cents": 1250000,
"status": "scheduled"
},
{
"reference_code": "PSR-bbbb2222-...",
"external_reference": "withdraw-001-f2",
"amount_cents": 1250000,
"status": "scheduled"
},
{
"reference_code": "PSR-cccc3333-...",
"external_reference": "withdraw-001-f3",
"amount_cents": 1250000,
"status": "scheduled"
},
{
"reference_code": "PSR-dddd4444-...",
"external_reference": "withdraw-001-f4",
"amount_cents": 1250000,
"status": "scheduled"
}
]
}{
"message": "Invalid credentials or inactive"
}{
"message": "<string>",
"ms": 123
}Pagar PIX via chave
Envia um pagamento PIX para a chave especificada. Wallet do user é debitada imediatamente.
Status final via webhook em postbackUrl. Em caso de falha do provedor, o valor é estornado automaticamente.
Fracionamento automático (se habilitado na sua conta): um saque por chave acima do
teto configurado (padrão R$ 14.000) é dividido em várias saídas menores (cada uma ≤ teto),
enviadas em sequência com um pequeno intervalo. Nesse caso a resposta é HTTP 202 com
fractioned: true e a lista de frações — cada fração é um pagamento independente (com seu
próprio reference_code, external_reference = {seu_external_id}-fN e webhook próprio).
Veja abaixo. O fracionamento não se aplica a pagamento de QR/copia-e-cola.
curl --request POST \
--url https://api.paysurebr.com/v1/pix/payment \
--header 'Content-Type: application/json' \
--header 'ci: <api-key>' \
--data '
{
"external_id": "withdraw-001",
"value_cents": 5000,
"pix_key_type": "cpf",
"pix_key": "12345678900",
"receiver_name": "Maria Souza",
"receiver_document": "12345678900",
"postbackUrl": "https://seu-site.com/webhooks/paysure"
}
'import requests
url = "https://api.paysurebr.com/v1/pix/payment"
payload = {
"external_id": "withdraw-001",
"value_cents": 5000,
"pix_key_type": "cpf",
"pix_key": "12345678900",
"receiver_name": "Maria Souza",
"receiver_document": "12345678900",
"postbackUrl": "https://seu-site.com/webhooks/paysure"
}
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: 'withdraw-001',
value_cents: 5000,
pix_key_type: 'cpf',
pix_key: '12345678900',
receiver_name: 'Maria Souza',
receiver_document: '12345678900',
postbackUrl: 'https://seu-site.com/webhooks/paysure'
})
};
fetch('https://api.paysurebr.com/v1/pix/payment', 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/payment",
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' => 'withdraw-001',
'value_cents' => 5000,
'pix_key_type' => 'cpf',
'pix_key' => '12345678900',
'receiver_name' => 'Maria Souza',
'receiver_document' => '12345678900',
'postbackUrl' => 'https://seu-site.com/webhooks/paysure'
]),
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/payment"
payload := strings.NewReader("{\n \"external_id\": \"withdraw-001\",\n \"value_cents\": 5000,\n \"pix_key_type\": \"cpf\",\n \"pix_key\": \"12345678900\",\n \"receiver_name\": \"Maria Souza\",\n \"receiver_document\": \"12345678900\",\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\"\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/payment")
.header("ci", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"withdraw-001\",\n \"value_cents\": 5000,\n \"pix_key_type\": \"cpf\",\n \"pix_key\": \"12345678900\",\n \"receiver_name\": \"Maria Souza\",\n \"receiver_document\": \"12345678900\",\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paysurebr.com/v1/pix/payment")
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\": \"withdraw-001\",\n \"value_cents\": 5000,\n \"pix_key_type\": \"cpf\",\n \"pix_key\": \"12345678900\",\n \"receiver_name\": \"Maria Souza\",\n \"receiver_document\": \"12345678900\",\n \"postbackUrl\": \"https://seu-site.com/webhooks/paysure\"\n}"
response = http.request(request)
puts response.read_body{
"cashout": {
"reference_code": "PSR-1234abcd-...",
"external_reference": "withdraw-001",
"status": "processing"
}
}{
"ok": true,
"fractioned": true,
"total_amount_cents": 5000000,
"reason": "Valor acima de R$ 14.000,00 — dividido em 4 saídas.",
"fractions": [
{
"reference_code": "PSR-aaaa1111-...",
"external_reference": "withdraw-001-f1",
"amount_cents": 1250000,
"status": "scheduled"
},
{
"reference_code": "PSR-bbbb2222-...",
"external_reference": "withdraw-001-f2",
"amount_cents": 1250000,
"status": "scheduled"
},
{
"reference_code": "PSR-cccc3333-...",
"external_reference": "withdraw-001-f3",
"amount_cents": 1250000,
"status": "scheduled"
},
{
"reference_code": "PSR-dddd4444-...",
"external_reference": "withdraw-001-f4",
"amount_cents": 1250000,
"status": "scheduled"
}
]
}{
"message": "Invalid credentials or inactive"
}{
"message": "<string>",
"ms": 123
}Fluxo
- Você envia a requisição → recebe
HTTP 201comstatus: "processing"e umreference_code. - Mais tarde, enviamos um webhook em
postbackUrlcom o status final:status: "paid"→ pagamento concluído.status: "refunded"→ não foi possível concluir; nenhum ajuste é necessário do seu lado.
external_id deve ser único por transação. Use-o como sua chave de idempotência.Validação de chave PIX
Antes de processar, validamos o formato dapix_key:
- CPF / CNPJ: dígitos verificadores (módulo 11)
- Email: formato válido
- Phone: padrão E.164 (
+55...) - EVP: UUID v4
HTTP 422 imediatamente.
Fracionamento de saques altos
Se a sua conta tiver fracionamento habilitado, um saque por chave acima do teto (padrão R$ 14.000 por saída) é dividido automaticamente em várias saídas menores, cada uma ≤ teto, enviadas em sequência com um pequeno intervalo entre elas. Isso acontece porque o provedor limita o valor de uma única transferência PIX. Em vez de recusar o saque, dividimos pra você — de forma transparente.Você envia 1 saque acima do teto
value_cents: 5000000 (R50.000)comtetodeR 14.000.Recebe HTTP 202 com fractioned: true
201 normal, a resposta traz fractioned: true e a lista de frações
(ex.: 4× R$ 12.500). A soma das frações é exatamente o valor solicitado. O valor
total é debitado da sua wallet na hora (cada fração reserva seu próprio valor + taxa).Cada fração é enviada e liquidada separadamente
reference_code,
external_reference = {seu_external_id}-fN e webhook próprio. Acompanhe cada uma
como um saque normal (scheduled → processing → paid).{
"ok": true,
"fractioned": true,
"total_amount_cents": 5000000,
"reason": "Valor acima de R$ 14.000,00 — dividido em 4 saídas.",
"fractions": [
{ "reference_code": "PSR-aaaa1111-...", "external_reference": "withdraw-001-f1", "amount_cents": 1250000, "status": "scheduled" },
{ "reference_code": "PSR-bbbb2222-...", "external_reference": "withdraw-001-f2", "amount_cents": 1250000, "status": "scheduled" },
{ "reference_code": "PSR-cccc3333-...", "external_reference": "withdraw-001-f3", "amount_cents": 1250000, "status": "scheduled" },
{ "reference_code": "PSR-dddd4444-...", "external_reference": "withdraw-001-f4", "amount_cents": 1250000, "status": "scheduled" }
]
}
- O fracionamento vale só para saque por chave. Pagamento de QR / copia-e-cola acima do
teto é recusado com
HTTP 422(o QR exige o valor exato, não dá pra pagar em pedaços). - O seu limite por transação continua valendo: um saque acima dele é recusado antes de fracionar — o fracionamento não serve pra ultrapassar o seu limite, só pra respeitar o teto do provedor.
- Um retry do mesmo
external_iddevolve as mesmas frações comidempotent: true(não duplica).
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
191x >= 100cpf, cnpj, email, phone, evp 2551913225520Show child attributes
Show child attributes
Response
Pagamento aceito (processando)
Show child attributes
Show child attributes

