Fire Bankingdocs
Integration Guides

Transactions by PIX Key

Overview

The transactions by PIX key endpoints allow you to query the transaction history associated with a specific PIX key (CPF, CNPJ, phone, email, or random EVP key). They are ideal for scenarios such as:

  • Reconciliation by key: verify all receipts for a specific CNPJ or CPF
  • Auditing: audit movements of a PIX key within a period
  • Receipt monitoring: track payments received via a specific key

Compared to the general /api/transactions endpoint, the main difference is the mandatory PIX key filter and the larger maximum size: up to 1000 records per page (vs. 100 on the general endpoint). The query returns at most 1000 results in total -- if the key has more transactions in the period, use type, status, or shorter period filters to narrow down.

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.

Supported PIX Key Types

TypeFormatExample
CPFNumbers only (11 digits)12345678900
CNPJNumbers only (14 digits)12345678000190
PhoneE.164 format with + encoded as %2B%2B5511999999999
EmailValid email addressjoao@example.com
Random key (EVP)UUID v4550e8400-e29b-41d4-a716-446655440000

When using keys with special characters in the URL (such as + in phone numbers), always apply URL encoding. In the code examples, encodeURIComponent (JavaScript) and quote(..., safe="") (Python) handle this automatically.


Endpoint 1: List Transactions by PIX Key

GET /api/pix/transactions/pix-key/{pixKey}

Parameters

ParameterTypeRequiredDefaultDescription
pixKeystringYes (path)--PIX key (URL-encoded)
pageinteger--1Page number
sizeinteger--20Records per page (max. 1000)
statusstring----PENDING, CONFIRMED, or ERROR
typestring----PAYMENT, WITHDRAW, REFUND_IN, or REFUND_OUT
startDatedate--Last 30 daysStart date (ISO 8601)
endDatedate--TodayEnd date (ISO 8601)

The interval between startDate and endDate cannot exceed 31 days. The query returns at most 1000 results -- if there are more transactions in the period, use additional filters (type, status, or shorter periods) to narrow down.

Key with No Results

If the provided pixKey has no transactions in the queried period, the API returns HTTP 200 with empty data:

{
  "data": [],
  "metadata": { "page": 1, "size": 20, "total": 0, "totalPages": 0, "hasNext": false, "hasPrevious": false }
}

Examples

curl -X GET "https://api.public.firebanking.com.br/api/pix/transactions/pix-key/joao%40example.com?status=CONFIRMED&page=1&size=50" \
  -H "Authorization: Bearer your_token_here"
const pixKey = 'joao@example.com';
const params = new URLSearchParams({
  status: 'CONFIRMED',
  page: '1',
  size: '50'
});

const response = await fetch(
  `https://api.public.firebanking.com.br/api/pix/transactions/pix-key/${encodeURIComponent(pixKey)}?${params}`,
  {
    headers: {
      'Authorization': 'Bearer your_token_here'
    }
  }
);

const data = await response.json();
console.log(data);
import requests
from urllib.parse import quote

pix_key = 'joao@example.com'

response = requests.get(
    f'https://api.public.firebanking.com.br/api/pix/transactions/pix-key/{quote(pix_key, safe="")}',
    params={
        'status': 'CONFIRMED',
        'page': 1,
        'size': 50
    },
    headers={
        'Authorization': 'Bearer your_token_here'
    }
)

data = response.json()
print(data)

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": "E00416968202501151030VX5Sx8fIpkY",
      "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": 50,
    "total": 320,
    "totalPages": 7,
    "hasNext": true,
    "hasPrevious": false
  }
}

Pagination

FieldDescription
pageCurrent page
sizeNumber of records per page
totalTotal records found (max. 1000)
totalPagesTotal available pages
hasNextIndicates if there is a next page
hasPreviousIndicates if there is a previous page

To get all results at once, use size=1000. To process in batches, navigate through pages while hasNext is true:

async function getAllTransactions(pixKey, filters = {}) {
  const results = [];
  let page = 1;

  do {
    const params = new URLSearchParams({ ...filters, page, size: 100 });
    const response = await fetch(
      `https://api.public.firebanking.com.br/api/pix/transactions/pix-key/${encodeURIComponent(pixKey)}?${params}`,
      { headers: { 'Authorization': 'Bearer your_token_here' } }
    );
    const { data, metadata } = await response.json();
    results.push(...data);
    if (!metadata.hasNext) break;
    page++;
  } while (true);

  return results;
}

Endpoint 2: Query Transaction by PIX Key and Identifier

GET /api/pix/transactions/pix-key/{pixKey}/{identifier}

Parameters

ParameterTypeRequiredDescription
pixKeystringYesPIX key (URL-encoded)
identifierstringYesTransaction identifier (URL-encoded)

The identifier is compared simultaneously against three transaction fields:

  • endToEndId -- PIX End-to-End ID (e.g., E00416968202501151030VX5Sx8fIpkY)
  • externalId -- External identifier provided at transaction creation
  • id (numeric) -- Internal Avista transaction ID (only if the value is purely numeric)

In practice there is no ambiguity: each identifier type has a unique format (e2eId starts with E followed by 32 alphanumeric characters; id is purely numeric; externalId is any string).

Examples

curl -X GET "https://api.public.firebanking.com.br/api/pix/transactions/pix-key/joao%40example.com/E00416968202501151030VX5Sx8fIpkY" \
  -H "Authorization: Bearer your_token_here"
curl -X GET "https://api.public.firebanking.com.br/api/pix/transactions/pix-key/joao%40example.com/order-abc123" \
  -H "Authorization: Bearer your_token_here"
const pixKey = 'joao@example.com';
const identifier = 'E00416968202501151030VX5Sx8fIpkY';

const response = await fetch(
  `https://api.public.firebanking.com.br/api/pix/transactions/pix-key/${encodeURIComponent(pixKey)}/${encodeURIComponent(identifier)}`,
  {
    headers: {
      'Authorization': 'Bearer your_token_here'
    }
  }
);

if (response.status === 404) {
  console.log('Transaction not found');
} else {
  const transaction = await response.json();
  console.log(transaction);
}
import requests
from urllib.parse import quote

pix_key = 'joao@example.com'
identifier = 'E00416968202501151030VX5Sx8fIpkY'

response = requests.get(
    f'https://api.public.firebanking.com.br/api/pix/transactions/pix-key/{quote(pix_key, safe="")}/{quote(identifier, safe="")}',
    headers={
        'Authorization': 'Bearer your_token_here'
    }
)

if response.status_code == 404:
    print('Transaction not found')
else:
    transaction = response.json()
    print(transaction)

Response 200 -- Transaction Found

{
  "transactionId": "12345",
  "externalId": "order-abc123",
  "status": "Confirmado",
  "operationType": "Pix in",
  "movementType": "CREDIT",
  "originalAmount": 100.00,
  "feeAmount": 1.00,
  "finalAmount": 99.00,
  "endToEndId": "E00416968202501151030VX5Sx8fIpkY",
  "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"
    }
  }
}

Response 404 -- Not Found

Returned when no transaction matches the provided identifier for the specified pixKey.

{
  "statusCode": 404,
  "message": "Transação não encontrada"
}

Field Mapping

Status

Internal ValueReturned Value
PENDINGPendente
CONFIRMEDConfirmado
ERRORError

Operation Type

Internal ValueReturned ValueDescription
PAYMENTPix inPIX receipt
WITHDRAWPix outPIX payment
REFUND_INRefund inRefund requested (debit)
REFUND_OUTRefund outReversal received (credit)

Movement Type

Operation TypeMovement
Pix inCREDIT
Pix outDEBIT
Refund inDEBIT
Refund outCREDIT

Differences from /api/transactions

Aspect/api/transactions/api/pix/transactions/pix-key/\{pixKey\}
Main filterEntire accountBy specific PIX key
Max. size per page1001000
Max. total resultsNo limit1000
Default startDateLast 31 daysLast 30 days
Non-existent key / no results200 with empty list200 with empty list
Search by externalIdQuery param ?externalId=Path param /\{identifier\}
Search by endToEndIdQuery param ?endToEndId=Path param /\{identifier\}

Use Cases


Error Codes

CodeDescription
400Invalid parameters, reversed dates, or interval exceeds 31 days
401Token not provided or invalid
404Transaction not found (only on the /\{pixKey\}/\{identifier\} endpoint)

Next Steps

On this page