curl --request POST \
--url https://v4pay-api.vercel.app/pix \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 100.5,
"description": "Pagamento do pedido #123",
"customer_name": "Maria da Silva",
"customer_email": "maria@cliente.com",
"customer_cpf": "12345678901",
"expires_at": "2026-09-30T23:59:59Z",
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"novo_cliente": true,
"coupon_code": "BEMVINDO10",
"success_url": "<string>",
"cancel_url": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_phone": "(11) 91234-5678"
}
'import requests
url = "https://v4pay-api.vercel.app/pix"
payload = {
"amount": 100.5,
"description": "Pagamento do pedido #123",
"customer_name": "Maria da Silva",
"customer_email": "maria@cliente.com",
"customer_cpf": "12345678901",
"expires_at": "2026-09-30T23:59:59Z",
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"novo_cliente": True,
"coupon_code": "BEMVINDO10",
"success_url": "<string>",
"cancel_url": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_phone": "(11) 91234-5678"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 100.5,
description: 'Pagamento do pedido #123',
customer_name: 'Maria da Silva',
customer_email: 'maria@cliente.com',
customer_cpf: '12345678901',
expires_at: '2026-09-30T23:59:59Z',
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
novo_cliente: true,
coupon_code: 'BEMVINDO10',
success_url: '<string>',
cancel_url: '<string>',
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer_phone: '(11) 91234-5678'
})
};
fetch('https://v4pay-api.vercel.app/pix', 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://v4pay-api.vercel.app/pix",
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' => 100.5,
'description' => 'Pagamento do pedido #123',
'customer_name' => 'Maria da Silva',
'customer_email' => 'maria@cliente.com',
'customer_cpf' => '12345678901',
'expires_at' => '2026-09-30T23:59:59Z',
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'novo_cliente' => true,
'coupon_code' => 'BEMVINDO10',
'success_url' => '<string>',
'cancel_url' => '<string>',
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer_phone' => '(11) 91234-5678'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://v4pay-api.vercel.app/pix"
payload := strings.NewReader("{\n \"amount\": 100.5,\n \"description\": \"Pagamento do pedido #123\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"customer_cpf\": \"12345678901\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"novo_cliente\": true,\n \"coupon_code\": \"BEMVINDO10\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_phone\": \"(11) 91234-5678\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://v4pay-api.vercel.app/pix")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 100.5,\n \"description\": \"Pagamento do pedido #123\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"customer_cpf\": \"12345678901\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"novo_cliente\": true,\n \"coupon_code\": \"BEMVINDO10\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_phone\": \"(11) 91234-5678\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/pix")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 100.5,\n \"description\": \"Pagamento do pedido #123\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"customer_cpf\": \"12345678901\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"novo_cliente\": true,\n \"coupon_code\": \"BEMVINDO10\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_phone\": \"(11) 91234-5678\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"txid": "9f3a1c2b4d5e6f708192a3b4c5d6e7f8",
"description": "Pagamento do pedido #123",
"amount": 150.75,
"customer_name": "<string>",
"customer_email": "jsmith@example.com",
"customer_cpf": "<string>",
"customer_phone": "<string>",
"product_id": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z",
"pix_code": "00020126...5913NOME_RECEBEDOR6009SAO PAULO62070503***6304ABCD",
"qr_code_url": "data:image/png;base64,iVBORw0KGgoAAA...",
"status": "pending",
"end_to_end_id": "<string>",
"paid_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
},
"aviso": "<string>"
}{
"error": {
"message": "<string>",
"codigo": "VALOR_MINIMO",
"valor_minimo": 5
}
}{
"error": "Token JWT ou chave de API ausente"
}{
"error": {
"message": "<string>",
"codigo": "SUBCONTA_INEXISTENTE",
"aprovacao": {
"aprovada": true,
"conferida": true,
"geral": "PENDING",
"dados_comerciais": "PENDING",
"conta_bancaria": "PENDING",
"documentos": "PENDING",
"conferida_em": "2023-11-07T05:31:56Z",
"link_documentos": "<string>",
"link_documentos_qr": "<string>",
"motivos_recusa": "<string>"
}
}
}{
"error": {
"message": "<string>"
}
}Emitir cobrança Pix
Cria a cobrança na conta de recebimento do lojista (com split da taxa do V4 Pay), salva no banco e devolve o código “copia e cola” e a imagem do QR Code (base64). O status inicial é pending e muda para paid automaticamente quando o pagamento é confirmado.
curl --request POST \
--url https://v4pay-api.vercel.app/pix \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 100.5,
"description": "Pagamento do pedido #123",
"customer_name": "Maria da Silva",
"customer_email": "maria@cliente.com",
"customer_cpf": "12345678901",
"expires_at": "2026-09-30T23:59:59Z",
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"novo_cliente": true,
"coupon_code": "BEMVINDO10",
"success_url": "<string>",
"cancel_url": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_phone": "(11) 91234-5678"
}
'import requests
url = "https://v4pay-api.vercel.app/pix"
payload = {
"amount": 100.5,
"description": "Pagamento do pedido #123",
"customer_name": "Maria da Silva",
"customer_email": "maria@cliente.com",
"customer_cpf": "12345678901",
"expires_at": "2026-09-30T23:59:59Z",
"product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"novo_cliente": True,
"coupon_code": "BEMVINDO10",
"success_url": "<string>",
"cancel_url": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_phone": "(11) 91234-5678"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 100.5,
description: 'Pagamento do pedido #123',
customer_name: 'Maria da Silva',
customer_email: 'maria@cliente.com',
customer_cpf: '12345678901',
expires_at: '2026-09-30T23:59:59Z',
product_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
novo_cliente: true,
coupon_code: 'BEMVINDO10',
success_url: '<string>',
cancel_url: '<string>',
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer_phone: '(11) 91234-5678'
})
};
fetch('https://v4pay-api.vercel.app/pix', 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://v4pay-api.vercel.app/pix",
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' => 100.5,
'description' => 'Pagamento do pedido #123',
'customer_name' => 'Maria da Silva',
'customer_email' => 'maria@cliente.com',
'customer_cpf' => '12345678901',
'expires_at' => '2026-09-30T23:59:59Z',
'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'novo_cliente' => true,
'coupon_code' => 'BEMVINDO10',
'success_url' => '<string>',
'cancel_url' => '<string>',
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer_phone' => '(11) 91234-5678'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://v4pay-api.vercel.app/pix"
payload := strings.NewReader("{\n \"amount\": 100.5,\n \"description\": \"Pagamento do pedido #123\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"customer_cpf\": \"12345678901\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"novo_cliente\": true,\n \"coupon_code\": \"BEMVINDO10\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_phone\": \"(11) 91234-5678\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://v4pay-api.vercel.app/pix")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 100.5,\n \"description\": \"Pagamento do pedido #123\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"customer_cpf\": \"12345678901\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"novo_cliente\": true,\n \"coupon_code\": \"BEMVINDO10\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_phone\": \"(11) 91234-5678\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/pix")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 100.5,\n \"description\": \"Pagamento do pedido #123\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"customer_cpf\": \"12345678901\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"product_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"novo_cliente\": true,\n \"coupon_code\": \"BEMVINDO10\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_phone\": \"(11) 91234-5678\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"txid": "9f3a1c2b4d5e6f708192a3b4c5d6e7f8",
"description": "Pagamento do pedido #123",
"amount": 150.75,
"customer_name": "<string>",
"customer_email": "jsmith@example.com",
"customer_cpf": "<string>",
"customer_phone": "<string>",
"product_id": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z",
"pix_code": "00020126...5913NOME_RECEBEDOR6009SAO PAULO62070503***6304ABCD",
"qr_code_url": "data:image/png;base64,iVBORw0KGgoAAA...",
"status": "pending",
"end_to_end_id": "<string>",
"paid_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
},
"aviso": "<string>"
}{
"error": {
"message": "<string>",
"codigo": "VALOR_MINIMO",
"valor_minimo": 5
}
}{
"error": "Token JWT ou chave de API ausente"
}{
"error": {
"message": "<string>",
"codigo": "SUBCONTA_INEXISTENTE",
"aprovacao": {
"aprovada": true,
"conferida": true,
"geral": "PENDING",
"dados_comerciais": "PENDING",
"conta_bancaria": "PENDING",
"documentos": "PENDING",
"conferida_em": "2023-11-07T05:31:56Z",
"link_documentos": "<string>",
"link_documentos_qr": "<string>",
"motivos_recusa": "<string>"
}
}
}{
"error": {
"message": "<string>"
}
}Authorizations
Token JWT obtido em /auth/login, enviado no cabeçalho Authorization no formato Bearer <token>.
Body
Dados para emissão de uma cobrança Pix, em dois modos. MODO MANUAL (sem product_id): amount, description e os dados do pagador são obrigatórios como listado em required. MODO PRODUTO (com product_id): o valor é calculado NO SERVIDOR — amount enviado é IGNORADO (vale o preço do produto, menos o cupom); description enviada vale, senão o nome do produto; expires_at tem padrão de 24 horas; o pagador vem de customer_id OU dos campos inline (novo_cliente: true também o cadastra em clientes). Um produto por cobrança, quantidade 1, só Pix.
Valor da cobrança em reais. Mínimo R$ 5,00: abaixo disso a API devolve 400 com codigo: VALOR_MINIMO, antes de chamar o motor de pagamentos.
x >= 5100.5
Mensagem exibida ao pagador.
140"Pagamento do pedido #123"
"Maria da Silva"
"maria@cliente.com"
Documento do pagador, obrigatório no Pix — CPF (11 dígitos) ou CNPJ (14), com dígitos verificadores validados; aceita formatado ou só números — a API guarda só os dígitos.
"12345678901"
"2026-09-30T23:59:59Z"
Liga o MODO PRODUTO — produto ATIVO do lojista (404 se não existir ou estiver inativo). O preço da cobrança passa a ser o dele.
Só no modo produto, sem customer_id — true cadastra o pagador em clientes e liga o customer_id na cobrança; ausente/false, a cobrança é avulsa.
Só no modo produto — cupom do lojista aplicado sobre o preço, com as mesmas regras e erros da validação do checkout (400; abaixo de R$ 5,00, codigo: VALOR_MINIMO).
"BEMVINDO10"
Só no modo produto — para onde o checkout manda o pagador após pagar. URL http(s) validada (400 fora disso); vazio limpa.
Só no modo produto — o "voltar" do checkout. Mesma validação da success_url.
ID de um cliente já cadastrado (opcional; no modo produto, tem precedência sobre os campos inline e carrega nome/e-mail/documento/telefone do cadastro).
"(11) 91234-5678"
Response
Cobrança Pix emitida com sucesso.