Search Transactions
Overview
The transaction search endpoint allows you to query the PIX transaction history of your account with various filters and pagination. Data is returned in a user-friendly format, with statuses and types translated to Portuguese and amounts in BRL.
Authentication
This endpoint requires a valid Bearer token in the Authorization header:
Authorization: Bearer <your_token>The token must be obtained through the Generate Token endpoint.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
size | integer | Records per page (default: 20, maximum: 100) |
status | string | Filter by status: PENDING, CONFIRMED, ERROR |
type | string | Filter by type: PAYMENT, WITHDRAW, REFUND_IN, REFUND_OUT |
startDate | date | Start date (ISO 8601). Default: last 31 days |
endDate | date | End date (ISO 8601). Default: today |
externalId | string | Filter by your external identifier |
endToEndId | string | Filter by PIX End-to-End ID |
The interval between startDate and endDate cannot exceed 31 days.
Field Mapping
Status
Internal statuses are translated to the public format:
| Internal Value | Returned Value |
|---|---|
PENDING | Pendente |
CONFIRMED | Confirmado |
ERROR | Error |
Operation Type
Transaction types are translated to Portuguese:
| Internal Value | Returned Value | Description |
|---|---|---|
PAYMENT | Pix in | PIX receipt |
WITHDRAW | Pix out | PIX payment |
REFUND_IN | Refund in | Refund requested (debit) |
REFUND_OUT | Refund out | Reversal received (credit) |
Movement Type
Indicates whether the transaction is an inflow or outflow in the account:
| Operation Type | Movement |
|---|---|
Pix in | CREDIT |
Pix out | DEBIT |
Refund in | DEBIT |
Refund out | CREDIT |
Amounts
All monetary values are returned in BRL with 2 decimal places:
originalAmount: Original transaction amountfeeAmount: Applied feefinalAmount: Final amount (original +/- fee)
Document Masking
For security, counterpart documents are masked:
- CPF:
123.456.789-00->***.456.789-** - CNPJ:
12.345.678/0001-90->**.345.678/****-**
Usage Examples
Search all confirmed transactions
curl -X GET "https://api.ntxpay.com/api/transactions?status=CONFIRMED&page=1&size=10" \
-H "Authorization: Bearer your_token_here"const response = await fetch(
'https://api.ntxpay.com/api/transactions?status=CONFIRMED&page=1&size=10',
{
headers: {
'Authorization': 'Bearer your_token_here'
}
}
);
const data = await response.json();
console.log(data);import requests
response = requests.get(
'https://api.ntxpay.com/api/transactions',
params={
'status': 'CONFIRMED',
'page': 1,
'size': 10
},
headers={
'Authorization': 'Bearer your_token_here'
}
)
data = response.json()
print(data)Search transactions by period
curl -X GET "https://api.ntxpay.com/api/transactions?startDate=2025-01-01&endDate=2025-01-15&type=PAYMENT" \
-H "Authorization: Bearer your_token_here"const params = new URLSearchParams({
startDate: '2025-01-01',
endDate: '2025-01-15',
type: 'PAYMENT'
});
const response = await fetch(
`https://api.ntxpay.com/api/transactions?${params}`,
{
headers: {
'Authorization': 'Bearer your_token_here'
}
}
);Search by specific identifier
# By externalId (your identifier)
curl -X GET "https://api.ntxpay.com/api/transactions?externalId=order-12345" \
-H "Authorization: Bearer your_token_here"
# By endToEndId (PIX ID)
curl -X GET "https://api.ntxpay.com/api/transactions?endToEndId=E12345678901234567890123456789012" \
-H "Authorization: Bearer your_token_here"Response Example
{
"data": [
{
"transactionId": "12345",
"externalId": "order-abc123",
"status": "Confirmado",
"operationType": "Pix in",
"movementType": "CREDIT",
"originalAmount": 100.00,
"feeAmount": 1.00,
"finalAmount": 99.00,
"endToEndId": "E12345678901234567890123456789012",
"createdAt": "2025-01-15T10:30:00.000Z",
"processedAt": "2025-01-15T10:30:05.000Z",
"counterpart": {
"name": "João Silva",
"document": "***.456.789-**",
"bank": {
"bankISPB": "00000000",
"bankName": "Banco do Brasil",
"bankCode": "001",
"accountBranch": "0001",
"accountNumber": "123456-7"
}
}
}
],
"metadata": {
"page": 1,
"size": 20,
"total": 150,
"totalPages": 8,
"hasNext": true,
"hasPrevious": false
}
}Pagination
The response includes pagination metadata to facilitate navigation:
| Field | Description |
|---|---|
page | Current page |
size | Number of records per page |
total | Total records found |
totalPages | Total available pages |
hasNext | Indicates if there is a next page |
hasPrevious | Indicates if there is a previous page |
Navigating between pages
// First page
const page1 = await fetchTransactions({ page: 1, size: 20 });
if (page1.metadata.hasNext) {
// Next page
const page2 = await fetchTransactions({ page: 2, size: 20 });
}Common Use Cases
Error Codes
| Code | Description |
|---|---|
400 | Invalid parameters or date interval exceeds 31 days |
401 | Token not provided or invalid |