Criar Cobrança
curl --request POST \
--url https://api.visepag.com/v1/payins \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"amount": 123,
"description": "<string>",
"customerName": "<string>",
"customerDocument": "<string>",
"customerEmail": "<string>"
}
'import requests
url = "https://api.visepag.com/v1/payins"
payload = {
"amount": 123,
"description": "<string>",
"customerName": "<string>",
"customerDocument": "<string>",
"customerEmail": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
amount: 123,
description: '<string>',
customerName: '<string>',
customerDocument: '<string>',
customerEmail: '<string>'
})
};
fetch('https://api.visepag.com/v1/payins', 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.visepag.com/v1/payins",
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' => 123,
'description' => '<string>',
'customerName' => '<string>',
'customerDocument' => '<string>',
'customerEmail' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.visepag.com/v1/payins"
payload := strings.NewReader("{\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customerName\": \"<string>\",\n \"customerDocument\": \"<string>\",\n \"customerEmail\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.visepag.com/v1/payins")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customerName\": \"<string>\",\n \"customerDocument\": \"<string>\",\n \"customerEmail\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.visepag.com/v1/payins")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customerName\": \"<string>\",\n \"customerDocument\": \"<string>\",\n \"customerEmail\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "54e2b712-aca0-4230-b69a-d6dd8542c925",
"status": "pending",
"method": "pix",
"amount": 1000,
"platformFee": 70,
"description": "Pedido #1234",
"customerName": "João Silva",
"customerDocument": "52998224725",
"customerEmail": "[email protected]",
"pixCopy": "00020101021226...",
"pixQrCode": "data:image/png;base64,iVBORw0KGgo...",
"createdAt": "2026-09-12T23:59:59Z",
"paidAt": null,
"expiresAt": "2026-09-13T23:59:59Z",
"currency": "brl",
"livemode": true
}
Cobranças
Criar Cobrança
Cria uma nova cobrança PIX
POST
/
payins
Criar Cobrança
curl --request POST \
--url https://api.visepag.com/v1/payins \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"amount": 123,
"description": "<string>",
"customerName": "<string>",
"customerDocument": "<string>",
"customerEmail": "<string>"
}
'import requests
url = "https://api.visepag.com/v1/payins"
payload = {
"amount": 123,
"description": "<string>",
"customerName": "<string>",
"customerDocument": "<string>",
"customerEmail": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
amount: 123,
description: '<string>',
customerName: '<string>',
customerDocument: '<string>',
customerEmail: '<string>'
})
};
fetch('https://api.visepag.com/v1/payins', 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.visepag.com/v1/payins",
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' => 123,
'description' => '<string>',
'customerName' => '<string>',
'customerDocument' => '<string>',
'customerEmail' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.visepag.com/v1/payins"
payload := strings.NewReader("{\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customerName\": \"<string>\",\n \"customerDocument\": \"<string>\",\n \"customerEmail\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.visepag.com/v1/payins")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customerName\": \"<string>\",\n \"customerDocument\": \"<string>\",\n \"customerEmail\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.visepag.com/v1/payins")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"amount\": 123,\n \"description\": \"<string>\",\n \"customerName\": \"<string>\",\n \"customerDocument\": \"<string>\",\n \"customerEmail\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "54e2b712-aca0-4230-b69a-d6dd8542c925",
"status": "pending",
"method": "pix",
"amount": 1000,
"platformFee": 70,
"description": "Pedido #1234",
"customerName": "João Silva",
"customerDocument": "52998224725",
"customerEmail": "[email protected]",
"pixCopy": "00020101021226...",
"pixQrCode": "data:image/png;base64,iVBORw0KGgo...",
"createdAt": "2026-09-12T23:59:59Z",
"paidAt": null,
"expiresAt": "2026-09-13T23:59:59Z",
"currency": "brl",
"livemode": true
}
Descrição
Cria uma cobrança PIX. A VisePag gera o UUID da cobrança no backend e devolve no campoid. A cobrança vale 24 horas.
O campo
amount é sempre enviado e devolvido em centavos. Por exemplo, 1000 = R$ 10,00.Headers
Bearer token de autenticação. Formato:
Bearer YOUR_API_KEYBody
Valor em centavos. O mínimo é
500 (R5,00)eomaˊximo<code>10000000</code>(R 100.000,00).PIX
Requisição
curl -X POST https://api.visepag.com/v1/payins \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000,
"description": "Pedido #1234",
"customerName": "João Silva",
"customerDocument": "52998224725",
"customerEmail": "[email protected]"
}'
const response = await fetch('https://api.visepag.com/v1/payins', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 1000,
description: 'Pedido #1234',
customerName: 'João Silva',
customerDocument: '52998224725',
customerEmail: '[email protected]'
})
});
const charge = await response.json();
Resposta 201 Created
Status da cobrança. Na criação,
pending. Veja Status.{
"id": "54e2b712-aca0-4230-b69a-d6dd8542c925",
"status": "pending",
"method": "pix",
"amount": 1000,
"platformFee": 70,
"description": "Pedido #1234",
"customerName": "João Silva",
"customerDocument": "52998224725",
"customerEmail": "[email protected]",
"pixCopy": "00020101021226...",
"pixQrCode": "data:image/png;base64,iVBORw0KGgo...",
"createdAt": "2026-09-12T23:59:59Z",
"paidAt": null,
"expiresAt": "2026-09-13T23:59:59Z",
"currency": "brl",
"livemode": true
}
Erros
| Status | Código | Descrição |
|---|---|---|
| 400 | invalid_amount | amount deve ser um inteiro positivo em centavos |
| 400 | description_required | description é obrigatória |
| 400 | customer_name_required | customerName é obrigatório |
| 400 | customer_document_required | customerDocument é obrigatório |
| 400 | invalid_customer_document | CPF ou CNPJ inválido |
| 400 | invalid_customer_email | E-mail inválido |
| 401 | missing_authorization | Header Authorization ausente |
| 401 | invalid_api_key | Chave de API inválida |
| 422 | amount_below_minimum | Valor abaixo de R$ 5,00 |
| 429 | rate_limit_exceeded | Limite de 60 requisições/minuto excedido |
| 502 | provider_rejected | A adquirente recusou a cobrança |
| 502 | charge_creation_uncertain | A adquirente não confirmou a criação |
| 503 | provider_unavailable | Adquirente indisponível no momento |