Search Payments

Search payments (Payouts)

In this section, you will learn how to search PIX payments (cash-out/payouts) created using the PixToPay API.

Available Endpoints

  • Sandbox: https://sandbox.pixtopay.com.br/v2/withdrawals
  • Production: https://api.pixtopay.com.br/v2/withdrawals

Search payment by ID

Search for a specific payment using the internal ID generated by PixToPay.

Route

GET /v2/withdrawals?id={ID}

Headers

{
  "Authorization": "YOUR_API_KEY"
}

Query Parameters

ParameterTypeRequiredDescription
idintegerYesInternal payment ID generated by PixToPay

Request example

curl --location 'https://sandbox.pixtopay.com.br/v2/withdrawals?id=685' \
--header 'Authorization: API_KEY'

Response 200 - PIX success

{
  "id": 685,
  "transaction_id": "12345678911",
  "name": "Daniel Menegasso",
  "document_number": "00000000000",
  "document_type": "CPF",
  "currency": "BRL",
  "amount": 300,
  "status": 1,
  "bank": {
    "type": "PIX",
    "bank_name": "Banco do Brasil S.A.",
    "ispb": "00000000",
    "account_agency": "1234",
    "account_number": "12345-6"
  },
  "webhook": "https://webhook.site/c154fa95-701c-4bc1-b6e7-a4ba0e0c01c7",
  "created_at": "2021-12-01T14:48:03.000Z",
  "e2e": "E20018183202603051309eFsMqKfpFkv",
  "paid_at": "2021-12-01T14:48:08.000Z",
  "psp_id": "123321"
}

Response Fields

ParameterTypeDescription
idintegerInternal payment ID generated by PixToPay
transaction_idstringUnique transaction identifier on your platform
namestringBeneficiary name
document_numberstringBeneficiary document number
document_typestringDocument type ("CPF" or "CNPJ")
currencystringTransaction currency (always "BRL")
amountnumberPayment amount in reais
statusintegerCurrent payment status (see status table)
bankobjectObject containing bank information
bank.typestringTransfer type ("PIX")
bank.ispbstringBank ISPB
bank.account_agencystringDestination account branch
bank.account_numberstringDestination account number
webhookstringConfigured webhook URL
created_atstringPayment creation date and time
paid_atstringPayment completion date and time (if already processed)

Search payment by transaction_id

Search for a specific payment using your platform's transaction_id.

Route

GET /v2/withdrawals?transaction_id={TRANSACTION_ID}

Headers

{
  "Authorization": "YOUR_API_KEY"
}

Query Parameters

ParameterTypeRequiredDescription
transaction_idstringYesUnique transaction identifier on your platform

Request example

curl --location 'https://sandbox.pixtopay.com.br/v2/withdrawals?transaction_id=12345678911' \
--header 'Authorization: API_KEY'

Response 200 - Success

Returns the same format as search by ID.


Search payments by period

List payments created in a specific period, with optional status filter and pagination.

Route

GET /v2/withdrawals/period

Headers

{
  "Authorization": "YOUR_API_KEY"
}

Query Parameters

ParameterTypeRequiredDescription
startstringYesPeriod start (format: "YYYY-MM-DD HH:MM:SS")
endstringYesPeriod end (format: "YYYY-MM-DD HH:MM:SS")
pageintegerNoPage number (default: 1)
sizeintegerNoRecords per page (maximum: 100)
statusintegerNoFilter by specific status (0, 1, 2, 3, or 4)

Request example

curl --location 'https://sandbox.pixtopay.com.br/v2/withdrawals/period?start=2025-12-09%2021:00:00&end=2025-12-10%2020:59:59&size=100&page=1&status=1' \
--header 'Authorization: API_KEY'

Response 200 - Success

{
  "count_data": 2,
  "page": 1,
  "size": 100,
  "count_pages": 1,
  "data": [
    {
      "id": 123456788,
      "transaction_id": "brand_123456788",
      "name": "John Cena",
      "document_number": "12345678910",
      "document_type": "CPF",
      "currency": "BRL",
      "amount": 150,
      "status": 1,
      "bank": {
        "type": "PIX",
        "ispb": "08561701",
        "account_agency": "1",
        "account_number": "133194936"
      },
      "webhook": "https://webhook.site/bfc4df9d-e4a7-4147-85a8-f61cf1d84f82",
      "created_at": "2025-12-11T02:59:57.000Z",
      "paid_at": "2025-12-11T03:00:00.000Z",
      "e2e": "E09089356202512110259API839d33c0",
      "psp_id": "123456788"
    },
    {
      "id": 123456789,
      "transaction_id": "brand_123456789",
      "name": "John Cena",
      "document_number": "12345678910",
      "document_type": "CPF",
      "currency": "BRL",
      "amount": 60,
      "status": 1,
      "bank": {
        "type": "PIX",
        "ispb": "60746948",
        "account_agency": "6638",
        "account_number": "1326821"
      },
      "webhook": "https://webhook.site/bfc4df9d-e4a7-4147-85a8-f61cf1d84f82",
      "created_at": "2025-12-11T02:59:48.000Z",
      "paid_at": "2025-12-11T02:59:51.000Z",
      "e2e": "E09089356202512110259API00bec24b",
      "psp_id": "100247168"
    }
  ]
}

Response Fields

ParameterTypeDescription
count_dataintegerTotal payments found
pageintegerCurrent page
sizeintegerRecords per page
count_pagesintegerTotal pages
dataarrayArray of payments found

Response 400 - Invalid size

{
  "type": "ValidationError",
  "message": "size must be less than or equal to 100"
}

Response 400 - Invalid date

{
  "type": "ValidationError",
  "message": "start date must be less than end date"
}

Search payments by customer

List all payments made to a specific customer using the document number.

Route

GET /v2/withdrawals/customer?document_number={DOCUMENT_NUMBER}

Headers

{
  "Authorization": "YOUR_API_KEY"
}

Query Parameters

ParameterTypeRequiredDescription
document_numberstringYesBeneficiary document number (CPF or CNPJ)

Request example

curl --location 'https://sandbox.pixtopay.com.br/v2/withdrawals/customer?document_number=12345678900' \
--header 'Authorization: API_KEY'

Response 200 - Success

{
  "data": [
    {
      "id": 685,
      "transaction_id": "12345678911",
      "name": "Daniel Menegasso",
      "document_number": "12345678900",
      "document_type": "CPF",
      "currency": "BRL",
      "amount": 300,
      "status": 1,
      "bank": {
        "type": "PIX",
        "ispb": "00000000",
        "account_agency": "1234",
        "account_number": "12345-6"
      },
      "created_at": "2021-12-01T14:48:03.000Z",
      "paid_at": "2021-12-01T14:48:08.000Z"
    },
  ],
  "total": 1
}

Response Fields

ParameterTypeDescription
dataarrayArray of payments found
totalintegerTotal payments found for the customer

Response 400 - Invalid document

{
  "type": "ValidationError",
  "message": "document_number is invalid"
}

Response 404 - No payments found

{
  "message": "No withdrawals found for this customer"
}

Payment Statuses

Payment statuses are represented by integers:

StatusDescription
0Payment created, awaiting processing
1Payment approved / completed
2Payment canceled
3Payment rejected
4Payment processing

Important Notes

  • Unique IDs: Both id and transaction_id are unique and can be used for lookup
  • Full history: Customer search returns the full payment history
  • Webhook: Using webhooks is recommended for automatic status updates
  • Cache: Data may have a short delay (a few seconds) after creation

Search payments by period (CSV)

List payments in a specific period in CSV format; this export includes all payments and all statuses, without pagination.

Route

GET /v2/withdrawals/period/csv

Headers

{
  "Authorization": "YOUR_API_KEY"
}

Query Parameters

ParameterTypeRequiredDescription
startstringYesPeriod start (format: "YYYY-MM-DD HH:MM:SS")
endstringYesPeriod end (format: "YYYY-MM-DD HH:MM:SS")

Request example

curl --location 'https://sandbox.pixtopay.com.br/v2/withdrawals/period/csv?start=2025-12-09%2021:00:00&end=2025-12-10%2020:59:59' \
--header 'Authorization: API_KEY'

Response 200 - Success

id,transaction_id,name,document_number,document_type,currency,amount,status,bank_type,bank_name,bank_code,account_agency,account_number,webhook,created_at,paid_at,e2e,psp_id,provider
99451160,brand_7348442,"John Cooper",12345678910,CPF,BRL,200,1,PIX,"NU PAGAMENTOS S.A. - INSTITUIÇÃO DE PAGAMENTO",18236120,1,123456,"https://api-brand.brand.com/webhook",2025-11-30T20:59:54.000Z,2025-12-01T00:00:01.000Z,E200181832025113023597KWFHMmLqtD,4808268973604864,STARKBANK
99451156,brand_7348440,"Bob Dylan",12345678910,CPF,BRL,100,1,PIX,"NU PAGAMENTOS - IP",18236120,1,987654321,"https://api-brand.brand.com/webhook",2025-11-30T20:59:48.000Z,2025-11-30T23:59:52.000Z,E09089356202511302359API37fdec9d,99451156,EFIPAY
...

Response 400 - Invalid date

{
  "type": "ValidationError",
  "message": "start date must be less than end date"
}

Payment Statuses

Payment statuses are represented by integers:

StatusDescription
0Payment created, awaiting processing
1Payment approved / completed
2Payment rejected
3Payment refunded