Skip to main content
GET
https://api.sandbox.wepayout.com.br
/
v2
/
account
/
{merchantId}
/
statement
Get Statement
curl --request GET \
  --url https://api.sandbox.wepayout.com.br/v2/account/{merchantId}/statement \
  --header 'Authorization: Bearer <token>'
[
  {
    "id": 12345,
    "entity": "payin",
    "entity_id": 67890,
    "impact_balance": "available",
    "category": {
      "id": 1,
      "name": "PIX Payment"
    },
    "amount": 100.50,
    "available_balance": 1500.00,
    "balance": 1500.00,
    "reserve_balance": 0.00,
    "invoice": "INV-12345",
    "description": "Payment received",
    "occurrence_at": "2024-01-15T10:30:00-03:00",
    "created_at": "2024-01-15T10:30:00-03:00"
  },
  {
    "id": 12346,
    "entity": "payin",
    "entity_id": 67890,
    "impact_balance": "available",
    "category": {
      "id": 8,
      "name": "PIX Fee"
    },
    "amount": -2.50,
    "available_balance": 1497.50,
    "balance": 1497.50,
    "reserve_balance": 0.00,
    "invoice": null,
    "description": "PIX transaction fee",
    "occurrence_at": "2024-01-15T10:30:00-03:00",
    "created_at": "2024-01-15T10:30:00-03:00"
  }
]

Path Parameters

merchantId
string
required
Merchant ID

Query Parameters

category_id
string
Filter by transaction category IDs (comma-separated integers)Example: 1,8,9 (PIX Payment, PIX Fee, Boleto Fee)
created_after
string
Filter statements created after this date (YYYY-MM-DD)Example: 2024-01-01Note: Either created_after/created_before OR occurrence_after/occurrence_before is required
created_before
string
Filter statements created before this date (YYYY-MM-DD)Example: 2024-01-31
occurrence_after
string
Filter statements by occurrence date after this date (YYYY-MM-DD)Example: 2024-01-01Note: Either created_after/created_before OR occurrence_after/occurrence_before is required
occurrence_before
string
Filter statements by occurrence date before this date (YYYY-MM-DD)Example: 2024-01-31
id
string
Filter by specific statement ID
entity
string
Filter by entity type (e.g., payin, payout)
use_for_billing
string
Filter statements used for billing
recipient_id
string
Filter by recipient ID
currency
string
Filter by currency codeAllowed values: USD, AUD, EUR, BRL, GBP, CAD, CHF
page
integer
Page number
per_page
integer
Quantity of items per page

Response Headers

x-next-page
string
Next page number
x-page
string
Current page number
x-per-page
string
Total items per page
x-prev-page
string
Previous page number
x-total
string
Total count of records
x-value
string
Boolean indicating if results exist
x-total-pages
string
Total pages

Response Body

array
array
Array of statement entries
[
  {
    "id": 12345,
    "entity": "payin",
    "entity_id": 67890,
    "impact_balance": "available",
    "category": {
      "id": 1,
      "name": "PIX Payment"
    },
    "amount": 100.50,
    "available_balance": 1500.00,
    "balance": 1500.00,
    "reserve_balance": 0.00,
    "invoice": "INV-12345",
    "description": "Payment received",
    "occurrence_at": "2024-01-15T10:30:00-03:00",
    "created_at": "2024-01-15T10:30:00-03:00"
  },
  {
    "id": 12346,
    "entity": "payin",
    "entity_id": 67890,
    "impact_balance": "available",
    "category": {
      "id": 8,
      "name": "PIX Fee"
    },
    "amount": -2.50,
    "available_balance": 1497.50,
    "balance": 1497.50,
    "reserve_balance": 0.00,
    "invoice": null,
    "description": "PIX transaction fee",
    "occurrence_at": "2024-01-15T10:30:00-03:00",
    "created_at": "2024-01-15T10:30:00-03:00"
  }
]

Transaction Categories

The statement includes various transaction categories. Use the category ID when filtering:
IDNameDescription
1PIX PaymentPIX payment received
2PIX ReversalPIX payment reversal
3TED PaymentTED transfer payment
4TED ReversalTED transfer reversal
5Transfer Between WE AccountsInternal transfers between WE accounts
6TransferGeneral transfers
7Boleto PaymentBoleto payment received
8PIX FeePIX transaction fee
9Boleto FeeBoleto transaction fee
10TED FeeTED transfer fee
11Merchant Note SettlementSettlement entry
12Merchant Note TaxTax entry
13Merchant Note GenericGeneric merchant note
14Transfer FeeTransfer transaction fee
15OthersOther transactions
16Rolling ReserveRolling reserve
17Credit Card TransactionCredit card payment
18Credit Card FeeCredit card fee
51Merchant Note Judicial FreezeJudicial freeze
52PIX RefundPIX refund
53MarkupMarkup fee
54Current BalanceCurrent balance
Example: To filter PIX-related transactions (payments and fees), use: ?category_id=1,8

Pagination

The API uses header-based pagination:
// Get first page
const page1 = await getStatement(merchantId, { page: 1, per_page: 50 });

// Check if there are more pages
const nextPage = response.headers.get('x-next-page');
if (nextPage) {
  const page2 = await getStatement(merchantId, { page: nextPage, per_page: 50 });
}

Use Cases

Generate a complete monthly statement for accounting:
async function getMonthlyStatement(merchantId, year, month) {
  const startDate = `${year}-${String(month).padStart(2, '0')}-01`;
  const lastDay = new Date(year, month, 0).getDate();
  const endDate = `${year}-${String(month).padStart(2, '0')}-${String(lastDay).padStart(2, '0')}`;
  
  let allStatements = [];
  let page = 1;
  let hasMore = true;
  
  while (hasMore) {
    const response = await fetch(
      `https://api.wepayments.com/v2/account/${merchantId}/statement?created_after=${startDate}&created_before=${endDate}&page=${page}&per_page=100`,
      {
        headers: {
          'Authorization': 'Bearer YOUR_TOKEN',
          'Accept': 'application/json'
        }
      }
    );
    
    const data = await response.json();
    allStatements = allStatements.concat(data);
    
    const nextPage = response.headers.get('x-next-page');
    hasMore = nextPage !== null && nextPage !== '0';
    page = nextPage;
  }
  
  return allStatements;
}
Retrieve transactions for a specific category:
async function getTransactionsByCategory(merchantId, categoryId, startDate, endDate) {
  const response = await fetch(
    `https://api.wepayments.com/v2/account/${merchantId}/statement?category_id=${categoryId}&created_after=${startDate}&created_before=${endDate}`,
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Accept': 'application/json'
      }
    }
  );
  
  return await response.json();
}

// Get all PIX payment transactions for January 2024
const pixPayments = await getTransactionsByCategory(
  merchantId, 
  1, // PIX Payment category ID
  '2024-01-01',
  '2024-01-31'
);
Calculate total fees paid in a period:
async function calculateTotalFees(merchantId, startDate, endDate) {
  // Fee category IDs: PIX Fee (8), Boleto Fee (9), TED Fee (10), Transfer Fee (14), Credit Card Fee (18)
  const feeCategoryIds = '8,9,10,14,18';
  
  const response = await fetch(
    `https://api.wepayments.com/v2/account/${merchantId}/statement?category_id=${feeCategoryIds}&created_after=${startDate}&created_before=${endDate}&per_page=150`,
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Accept': 'application/json'
      }
    }
  );
  
  const statements = await response.json();
  const totalFees = statements.reduce((sum, s) => sum + Math.abs(s.amount), 0);
  
  return totalFees;
}

// Calculate total fees for January 2024
const fees = await calculateTotalFees(merchantId, '2024-01-01', '2024-01-31');
console.log(`Total fees: ${fees}`);
Export statement data to CSV format:
async function exportStatementToCSV(merchantId, startDate, endDate) {
  const response = await fetch(
    `https://api.wepayments.com/v2/account/${merchantId}/statement?created_after=${startDate}&created_before=${endDate}&per_page=150`,
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Accept': 'application/json'
      }
    }
  );
  
  const statements = await response.json();
  
  const headers = ['Date', 'Occurrence', 'Category', 'Description', 'Amount', 'Balance'];
  const rows = statements.map(s => [
    s.created_at,
    s.occurrence_at,
    s.category.name,
    s.description || '',
    s.amount,
    s.available_balance
  ]);
  
  const csv = [headers, ...rows]
    .map(row => row.join(','))
    .join('\n');
  
  return csv;
}
Monitor balance changes over time:
async function trackBalanceChanges(merchantId, startDate, endDate) {
  const response = await fetch(
    `https://api.wepayments.com/v2/account/${merchantId}/statement?created_after=${startDate}&created_before=${endDate}&per_page=150`,
    {
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Accept': 'application/json'
      }
    }
  );
  
  const statements = await response.json();
  
  const balanceHistory = statements.map(s => ({
    timestamp: s.occurrence_at,
    created_at: s.created_at,
    amount: s.amount,
    available_balance: s.available_balance,
    balance: s.balance,
    category: s.category.name,
    entity: s.entity
  }));
  
  return balanceHistory;
}

Best Practices

Use Pagination: Always implement pagination when retrieving statements to avoid timeouts and memory issues with large datasets. Valid per_page values are: 10, 20, 25, 50, 100, 150.
Date Filters Required: You must provide either created_after/created_before OR occurrence_after/occurrence_before filters. The API will return a 400 error if no date range is specified.
Filter by Multiple Categories: Use comma-separated category IDs to filter multiple transaction types at once. For example: ?category_id=1,8,9 to get PIX payments and all fee types.