Cobrar agora
curl --request POST \
--url https://v4pay-api.vercel.app/subscriptions/{id}/charge \
--header 'Authorization: Bearer <token>'import requests
url = "https://v4pay-api.vercel.app/subscriptions/{id}/charge"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v4pay-api.vercel.app/subscriptions/{id}/charge', 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/subscriptions/{id}/charge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://v4pay-api.vercel.app/subscriptions/{id}/charge"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/subscriptions/{id}/charge")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/subscriptions/{id}/charge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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"
}{
"error": {
"message": "<string>"
}
}Assinaturas
Cobrar agora
Gera imediatamente a cobrança Pix desta assinatura (mesmo motor do cron). Falha se a assinatura não estiver ativa, não tiver CPF ou já houver uma cobrança pendente válida.
POST
/
subscriptions
/
{id}
/
charge
Cobrar agora
curl --request POST \
--url https://v4pay-api.vercel.app/subscriptions/{id}/charge \
--header 'Authorization: Bearer <token>'import requests
url = "https://v4pay-api.vercel.app/subscriptions/{id}/charge"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v4pay-api.vercel.app/subscriptions/{id}/charge', 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/subscriptions/{id}/charge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://v4pay-api.vercel.app/subscriptions/{id}/charge"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/subscriptions/{id}/charge")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/subscriptions/{id}/charge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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"
}{
"error": {
"message": "<string>"
}
}