Listar cobranças
curl --request GET \
--url https://v4pay-api.vercel.app/charges/list \
--header 'Authorization: Bearer <token>'import requests
url = "https://v4pay-api.vercel.app/charges/list"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v4pay-api.vercel.app/charges/list', 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/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/charges/list"
req, _ := http.NewRequest("GET", 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.get("https://v4pay-api.vercel.app/charges/list")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/charges/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.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": "Token JWT ou chave de API ausente"
}Cobranças
Listar cobranças
Lista as cobranças do usuário autenticado.
GET
/
charges
/
list
Listar cobranças
curl --request GET \
--url https://v4pay-api.vercel.app/charges/list \
--header 'Authorization: Bearer <token>'import requests
url = "https://v4pay-api.vercel.app/charges/list"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v4pay-api.vercel.app/charges/list', 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/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/charges/list"
req, _ := http.NewRequest("GET", 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.get("https://v4pay-api.vercel.app/charges/list")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v4pay-api.vercel.app/charges/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.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": "Token JWT ou chave de API ausente"
}