Criar uma nova cobrança
curl --request POST \
--url https://v4pay-api.vercel.app/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 150.75,
"description": "Assinatura Mensal",
"customer_name": "Maria da Silva",
"customer_email": "maria@cliente.com",
"expires_at": "2026-09-30T23:59:59Z",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_cpf": "12345678901",
"customer_phone": "(11) 91234-5678",
"due_date": "2023-11-07T05:31:56Z",
"txid": "<string>"
}
'import requests
url = "https://v4pay-api.vercel.app/charges"
payload = {
"amount": 150.75,
"description": "Assinatura Mensal",
"customer_name": "Maria da Silva",
"customer_email": "maria@cliente.com",
"expires_at": "2026-09-30T23:59:59Z",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_cpf": "12345678901",
"customer_phone": "(11) 91234-5678",
"due_date": "2023-11-07T05:31:56Z",
"txid": "<string>"
}
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: 150.75,
description: 'Assinatura Mensal',
customer_name: 'Maria da Silva',
customer_email: 'maria@cliente.com',
expires_at: '2026-09-30T23:59:59Z',
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer_cpf: '12345678901',
customer_phone: '(11) 91234-5678',
due_date: '2023-11-07T05:31:56Z',
txid: '<string>'
})
};
fetch('https://v4pay-api.vercel.app/charges', 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/charges",
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' => 150.75,
'description' => 'Assinatura Mensal',
'customer_name' => 'Maria da Silva',
'customer_email' => 'maria@cliente.com',
'expires_at' => '2026-09-30T23:59:59Z',
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer_cpf' => '12345678901',
'customer_phone' => '(11) 91234-5678',
'due_date' => '2023-11-07T05:31:56Z',
'txid' => '<string>'
]),
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/charges"
payload := strings.NewReader("{\n \"amount\": 150.75,\n \"description\": \"Assinatura Mensal\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_cpf\": \"12345678901\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"txid\": \"<string>\"\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/charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 150.75,\n \"description\": \"Assinatura Mensal\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_cpf\": \"12345678901\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"txid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/charges")
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\": 150.75,\n \"description\": \"Assinatura Mensal\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_cpf\": \"12345678901\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"txid\": \"<string>\"\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"
}
}{
"error": {
"message": "<string>"
}
}{
"error": "Token JWT ou chave de API ausente"
}Cobranças
Criar uma nova cobrança
Registra uma cobrança (sem emissão de Pix — para Pix use POST /pix).
POST
/
charges
Criar uma nova cobrança
curl --request POST \
--url https://v4pay-api.vercel.app/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 150.75,
"description": "Assinatura Mensal",
"customer_name": "Maria da Silva",
"customer_email": "maria@cliente.com",
"expires_at": "2026-09-30T23:59:59Z",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_cpf": "12345678901",
"customer_phone": "(11) 91234-5678",
"due_date": "2023-11-07T05:31:56Z",
"txid": "<string>"
}
'import requests
url = "https://v4pay-api.vercel.app/charges"
payload = {
"amount": 150.75,
"description": "Assinatura Mensal",
"customer_name": "Maria da Silva",
"customer_email": "maria@cliente.com",
"expires_at": "2026-09-30T23:59:59Z",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_cpf": "12345678901",
"customer_phone": "(11) 91234-5678",
"due_date": "2023-11-07T05:31:56Z",
"txid": "<string>"
}
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: 150.75,
description: 'Assinatura Mensal',
customer_name: 'Maria da Silva',
customer_email: 'maria@cliente.com',
expires_at: '2026-09-30T23:59:59Z',
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer_cpf: '12345678901',
customer_phone: '(11) 91234-5678',
due_date: '2023-11-07T05:31:56Z',
txid: '<string>'
})
};
fetch('https://v4pay-api.vercel.app/charges', 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/charges",
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' => 150.75,
'description' => 'Assinatura Mensal',
'customer_name' => 'Maria da Silva',
'customer_email' => 'maria@cliente.com',
'expires_at' => '2026-09-30T23:59:59Z',
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer_cpf' => '12345678901',
'customer_phone' => '(11) 91234-5678',
'due_date' => '2023-11-07T05:31:56Z',
'txid' => '<string>'
]),
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/charges"
payload := strings.NewReader("{\n \"amount\": 150.75,\n \"description\": \"Assinatura Mensal\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_cpf\": \"12345678901\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"txid\": \"<string>\"\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/charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 150.75,\n \"description\": \"Assinatura Mensal\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_cpf\": \"12345678901\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"txid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/charges")
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\": 150.75,\n \"description\": \"Assinatura Mensal\",\n \"customer_name\": \"Maria da Silva\",\n \"customer_email\": \"maria@cliente.com\",\n \"expires_at\": \"2026-09-30T23:59:59Z\",\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer_cpf\": \"12345678901\",\n \"customer_phone\": \"(11) 91234-5678\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"txid\": \"<string>\"\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"
}
}{
"error": {
"message": "<string>"
}
}{
"error": "Token JWT ou chave de API ausente"
}Authorizations
Token JWT obtido em /auth/login, enviado no cabeçalho Authorization no formato Bearer <token>.
Body
application/json
Dados para a criação de uma cobrança.
Valor da cobrança em reais.
Example:
150.75
Example:
"Assinatura Mensal"
Example:
"Maria da Silva"
Example:
"maria@cliente.com"
Example:
"2026-09-30T23:59:59Z"
ID de um cliente já cadastrado (opcional).
Example:
"12345678901"
Example:
"(11) 91234-5678"
Identificador da transação (gerado automaticamente se omitido).
Response
Cobrança criada com sucesso.
Objeto representando uma cobrança (com ou sem Pix emitido).
Show child attributes
Show child attributes