List Charge
curl --request GET \
--url https://api.sandbox.wepayout.com.br/v2/payin/payments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.wepayout.com.br/v2/payin/payments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.wepayout.com.br/v2/payin/payments', 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://api.sandbox.wepayout.com.br/v2/payin/payments",
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://api.sandbox.wepayout.com.br/v2/payin/payments"
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://api.sandbox.wepayout.com.br/v2/payin/payments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/payin/payments")
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": 32457,
"merchant": {
"id": 1234,
"name": "Merchant Name"
},
"hash": "885fc0a0fb0e678b82a998daafbc081cbb03c1c862f8e57d580b3b7af152cf47",
"payment_page": "https://pagar.sandbox.wepayout.co/?hash=885fc0a0fb0e678b82a998daafbc081cbb03c1c862f8e57d580b3b7af152cf47",
"our_number": "20230",
"invoice": "YOUR-CODE1234",
"notification_url": "https://client.callback.com/notify-payin",
"payment_method": "pix",
"amount": 5000,
"paid_amount": 5000,
"refunded_amount": 0,
"description": "Esse Pix é referente ao pedido 123 na loja abcd",
"created_at": "2024-06-12T23:04:24.000000Z",
"updated_at": "2024-06-12T23:04:27.000000Z",
"buyer": {
"name": "Buyer Name",
"email": "buyer-email@wepayments.com.br",
"document": {
"type": "CPF",
"number": "34960826312"
}
},
"status": {
"id": 4,
"name": "Pago"
}
}
],
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"per_page": 15,
"to": 15,
"total": 73
},
"links": {
"first": "https://api.sandbox.wepayout.com.br/v2/payin/payments?page=1",
"last": "https://api.sandbox.wepayout.com.br/v2/payin/payments?page=5",
"prev": null,
"next": "https://api.sandbox.wepayout.com.br/v2/payin/payments?page=2"
}
}
Charge
List Charge
List all charges with optional filters
GET
/
v2
/
payin
/
payments
List Charge
curl --request GET \
--url https://api.sandbox.wepayout.com.br/v2/payin/payments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.wepayout.com.br/v2/payin/payments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.wepayout.com.br/v2/payin/payments', 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://api.sandbox.wepayout.com.br/v2/payin/payments",
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://api.sandbox.wepayout.com.br/v2/payin/payments"
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://api.sandbox.wepayout.com.br/v2/payin/payments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/payin/payments")
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": 32457,
"merchant": {
"id": 1234,
"name": "Merchant Name"
},
"hash": "885fc0a0fb0e678b82a998daafbc081cbb03c1c862f8e57d580b3b7af152cf47",
"payment_page": "https://pagar.sandbox.wepayout.co/?hash=885fc0a0fb0e678b82a998daafbc081cbb03c1c862f8e57d580b3b7af152cf47",
"our_number": "20230",
"invoice": "YOUR-CODE1234",
"notification_url": "https://client.callback.com/notify-payin",
"payment_method": "pix",
"amount": 5000,
"paid_amount": 5000,
"refunded_amount": 0,
"description": "Esse Pix é referente ao pedido 123 na loja abcd",
"created_at": "2024-06-12T23:04:24.000000Z",
"updated_at": "2024-06-12T23:04:27.000000Z",
"buyer": {
"name": "Buyer Name",
"email": "buyer-email@wepayments.com.br",
"document": {
"type": "CPF",
"number": "34960826312"
}
},
"status": {
"id": 4,
"name": "Pago"
}
}
],
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"per_page": 15,
"to": 15,
"total": 73
},
"links": {
"first": "https://api.sandbox.wepayout.com.br/v2/payin/payments?page=1",
"last": "https://api.sandbox.wepayout.com.br/v2/payin/payments?page=5",
"prev": null,
"next": "https://api.sandbox.wepayout.com.br/v2/payin/payments?page=2"
}
}
List Charge
List all charges with optional filters.Query Parameters
integer
Merchant id of the account that is creating the payin.Min:
2, Max: 10000string
Your identification number.Max length:
255 charactersstring
Payment method used in the payin.Allowed values:
pix, boletointeger
Filter by status ID.
string
Filter charges created after this date. Format:
YYYY-MM-DDstring
Filter charges created before this date. Format:
YYYY-MM-DDstring
Filter charges updated after this date. Format:
YYYY-MM-DDstring
Filter charges updated before this date. Format:
YYYY-MM-DDinteger
Page number for pagination.Default:
1integer
Number of items per page.Default:
15, Max: 100string
Field to sort by.Allowed values:
id, created_at, updated_at, amountDefault: idstring
Sort order.Allowed values:
asc, descDefault: descResponse
Returns an array of charge objects with pagination metadata.array
Array of charge objects.
Show Charge Object
Show Charge Object
integer
WEpayment’s auto generated id.
object
Merchant object.
string
WEpayments auto generated hash.
string
The WEpayments payment page URL.
string
The bank identification number.
string
Your identification number.
string
The url where we will submit the callbacks.
string
Payment method:
pix or boleto.integer
The payin total amount in cents.
integer
The total amount of the payin paid.
integer
Amount refunded from this charge.
string
Instructions displayed to the user.
object
The person you are charging object.
object
Final Beneficiary object.
object
Pix QRCode specific instructions (when payment_method is pix).
object
Boleto specific instructions (when payment_method is boleto).
object
Status object.
array
Status History object.
object
Sub status object.
array
Refund object.
string
Cash-in created date.
string
Cash-in update date.
object
object
Request Example
curl --request GET \
--url '"https://api.sandbox.wepayout.com.br/v2/payin/payments?page=1&per_page=15"' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 123'
curl --request GET \
--url 'https://api.sandbox.wepayout.com.br/v2/payin/payments?invoice=YOUR-CODE1234' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 123'
curl --request GET \
--url 'https://api.sandbox.wepayout.com.br/v2/payin/payments?type_payin=pix' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 123'
curl --request GET \
--url 'https://api.sandbox.wepayout.com.br/v2/payin/payments?created_after=2024-01-01&created_before=2024-12-31' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 123'
const params = new URLSearchParams({
page: 1,
per_page: 15,
type_payin: 'pix',
order_by: 'created_at',
sort: 'desc'
});
const response = await fetch(`https://api.sandbox.wepayout.com.br/v2/payin/payments?${params}`, {
method: 'GET',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer 123'
}
});
const data = await response.json();
console.log(`Total charges: ${data.meta.total}`);
console.log(`Current page: ${data.meta.current_page} of ${data.meta.last_page}`);
console.log('Charges:', data.data);
import requests
params = {
'page': 1,
'per_page': 15,
'type_payin': 'pix',
'order_by': 'created_at',
'sort': 'desc'
}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer 123'
}
response = requests.get(
'https://api.sandbox.wepayout.com.br/v2/payin/payments',
params=params,
headers=headers
)
data = response.json()
print(f"Total charges: {data['meta']['total']}")
print(f"Current page: {data['meta']['current_page']} of {data['meta']['last_page']}")
print('Charges:', data['data'])
{
"data": [
{
"id": 32457,
"merchant": {
"id": 1234,
"name": "Merchant Name"
},
"hash": "885fc0a0fb0e678b82a998daafbc081cbb03c1c862f8e57d580b3b7af152cf47",
"payment_page": "https://pagar.sandbox.wepayout.co/?hash=885fc0a0fb0e678b82a998daafbc081cbb03c1c862f8e57d580b3b7af152cf47",
"our_number": "20230",
"invoice": "YOUR-CODE1234",
"notification_url": "https://client.callback.com/notify-payin",
"payment_method": "pix",
"amount": 5000,
"paid_amount": 5000,
"refunded_amount": 0,
"description": "Esse Pix é referente ao pedido 123 na loja abcd",
"created_at": "2024-06-12T23:04:24.000000Z",
"updated_at": "2024-06-12T23:04:27.000000Z",
"buyer": {
"name": "Buyer Name",
"email": "buyer-email@wepayments.com.br",
"document": {
"type": "CPF",
"number": "34960826312"
}
},
"status": {
"id": 4,
"name": "Pago"
}
}
],
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"per_page": 15,
"to": 15,
"total": 73
},
"links": {
"first": "https://api.sandbox.wepayout.com.br/v2/payin/payments?page=1",
"last": "https://api.sandbox.wepayout.com.br/v2/payin/payments?page=5",
"prev": null,
"next": "https://api.sandbox.wepayout.com.br/v2/payin/payments?page=2"
}
}
Use Cases
List All Charges
List All Charges
Retrieve all charges with pagination:
async function getAllCharges(page = 1, perPage = 15) {
const response = await fetch(
`https://api.sandbox.wepayout.com.br/v2/payin/payments?page=${page}&per_page=${perPage}`,
{
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Accept': 'application/json'
}
}
);
return await response.json();
}
Filter by Status
Filter by Status
Get charges by specific status:
async function getChargesByStatus(statusId) {
const response = await fetch(
`https://api.sandbox.wepayout.com.br/v2/payin/payments?status_id=${statusId}`,
{
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Accept': 'application/json'
}
}
);
return await response.json();
}
// Get paid charges (status_id = 4)
const paidCharges = await getChargesByStatus(4);
Search by Invoice
Search by Invoice
Find a specific charge by invoice number:
async function findChargeByInvoice(invoice) {
const response = await fetch(
`https://api.sandbox.wepayout.com.br/v2/payin/payments?invoice=${invoice}`,
{
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Accept': 'application/json'
}
}
);
const data = await response.json();
return data.data[0]; // Return first match
}
Date Range Report
Date Range Report
Generate a report for a specific date range:
async function getChargesReport(startDate, endDate) {
const params = new URLSearchParams({
created_after: startDate,
created_before: endDate,
per_page: 100,
order_by: 'created_at',
sort: 'asc'
});
const response = await fetch(
`https://api.sandbox.wepayout.com.br/v2/payin/payments?${params}`,
{
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Accept': 'application/json'
}
}
);
return await response.json();
}
// Get charges from January 2024
const report = await getChargesReport('2024-01-01', '2024-01-31');
Pagination Handler
Pagination Handler
Handle pagination to retrieve all charges:
async function getAllChargesWithPagination() {
let allCharges = [];
let currentPage = 1;
let hasMorePages = true;
while (hasMorePages) {
const response = await fetch(
`https://api.sandbox.wepayout.com.br/v2/payin/payments?page=${currentPage}&per_page=100`,
{
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Accept': 'application/json'
}
}
);
const data = await response.json();
allCharges = allCharges.concat(data.data);
hasMorePages = data.meta.current_page < data.meta.last_page;
currentPage++;
}
return allCharges;
}
Status IDs
Common status IDs for filtering:| ID | Status Name | Description |
|---|---|---|
| 1 | Criado | Charge created |
| 2 | Processando | Processing |
| 3 | Aguardando Pagamento | Awaiting payment |
| 4 | Pago | Paid |
| 5 | Cancelado | Cancelled |
| 6 | Expirado | Expired |
| 7 | Rejeitado | Rejected |
| 8 | Estornado | Refunded |
Best Practices
Pagination: Always use pagination when listing charges to avoid performance issues. The default page size is 15, with a maximum of 100 items per page.
Date Filters: When using date range filters, ensure the range is not too large to avoid timeouts. For large date ranges, consider breaking them into smaller chunks.
Caching: Consider caching the results for frequently accessed pages to reduce API calls and improve performance.
Was this page helpful?
⌘I

