Gerar cobrança Pix a partir do link
curl --request POST \
--url https://v4pay-api.vercel.app/checkout/link/{slug}/pay \
--header 'Content-Type: application/json' \
--data '
{
"customer_name": "Maria Silva",
"customer_email": "maria@email.com",
"customer_cpf": "123.456.789-00",
"customer_phone": "(11) 91234-5678",
"coupon_code": "BEMVINDO10"
}
'import requests
url = "https://v4pay-api.vercel.app/checkout/link/{slug}/pay"
payload = {
"customer_name": "Maria Silva",
"customer_email": "maria@email.com",
"customer_cpf": "123.456.789-00",
"customer_phone": "(11) 91234-5678",
"coupon_code": "BEMVINDO10"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
customer_name: 'Maria Silva',
customer_email: 'maria@email.com',
customer_cpf: '123.456.789-00',
customer_phone: '(11) 91234-5678',
coupon_code: 'BEMVINDO10'
})
};
fetch('https://v4pay-api.vercel.app/checkout/link/{slug}/pay', 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/checkout/link/{slug}/pay",
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([
'customer_name' => 'Maria Silva',
'customer_email' => 'maria@email.com',
'customer_cpf' => '123.456.789-00',
'customer_phone' => '(11) 91234-5678',
'coupon_code' => 'BEMVINDO10'
]),
CURLOPT_HTTPHEADER => [
"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/checkout/link/{slug}/pay"
payload := strings.NewReader("{\n \"customer_name\": \"Maria Silva\",\n \"customer_email\": \"maria@email.com\",\n \"customer_cpf\": \"123.456.789-00\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"coupon_code\": \"BEMVINDO10\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/checkout/link/{slug}/pay")
.header("Content-Type", "application/json")
.body("{\n \"customer_name\": \"Maria Silva\",\n \"customer_email\": \"maria@email.com\",\n \"customer_cpf\": \"123.456.789-00\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"coupon_code\": \"BEMVINDO10\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/checkout/link/{slug}/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_name\": \"Maria Silva\",\n \"customer_email\": \"maria@email.com\",\n \"customer_cpf\": \"123.456.789-00\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"coupon_code\": \"BEMVINDO10\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"txid": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}Checkout (público)
Gerar cobrança Pix a partir do link
Rota pública (com limite por IP): emite a cobrança Pix com o valor do link e retorna o txid para abrir o checkout (/checkout/:txid).
POST
/
checkout
/
link
/
{slug}
/
pay
Gerar cobrança Pix a partir do link
curl --request POST \
--url https://v4pay-api.vercel.app/checkout/link/{slug}/pay \
--header 'Content-Type: application/json' \
--data '
{
"customer_name": "Maria Silva",
"customer_email": "maria@email.com",
"customer_cpf": "123.456.789-00",
"customer_phone": "(11) 91234-5678",
"coupon_code": "BEMVINDO10"
}
'import requests
url = "https://v4pay-api.vercel.app/checkout/link/{slug}/pay"
payload = {
"customer_name": "Maria Silva",
"customer_email": "maria@email.com",
"customer_cpf": "123.456.789-00",
"customer_phone": "(11) 91234-5678",
"coupon_code": "BEMVINDO10"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
customer_name: 'Maria Silva',
customer_email: 'maria@email.com',
customer_cpf: '123.456.789-00',
customer_phone: '(11) 91234-5678',
coupon_code: 'BEMVINDO10'
})
};
fetch('https://v4pay-api.vercel.app/checkout/link/{slug}/pay', 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/checkout/link/{slug}/pay",
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([
'customer_name' => 'Maria Silva',
'customer_email' => 'maria@email.com',
'customer_cpf' => '123.456.789-00',
'customer_phone' => '(11) 91234-5678',
'coupon_code' => 'BEMVINDO10'
]),
CURLOPT_HTTPHEADER => [
"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/checkout/link/{slug}/pay"
payload := strings.NewReader("{\n \"customer_name\": \"Maria Silva\",\n \"customer_email\": \"maria@email.com\",\n \"customer_cpf\": \"123.456.789-00\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"coupon_code\": \"BEMVINDO10\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/checkout/link/{slug}/pay")
.header("Content-Type", "application/json")
.body("{\n \"customer_name\": \"Maria Silva\",\n \"customer_email\": \"maria@email.com\",\n \"customer_cpf\": \"123.456.789-00\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"coupon_code\": \"BEMVINDO10\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/checkout/link/{slug}/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_name\": \"Maria Silva\",\n \"customer_email\": \"maria@email.com\",\n \"customer_cpf\": \"123.456.789-00\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"coupon_code\": \"BEMVINDO10\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"txid": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}Path Parameters
Body
application/json
Example:
"Maria Silva"
Example:
"maria@email.com"
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.
Example:
"123.456.789-00"
Example:
"(11) 91234-5678"
Cupom a aplicar — revalidado no servidor.
Example:
"BEMVINDO10"
Response
Cobrança criada; use o txid no checkout.
Show child attributes
Show child attributes