API Documentation

Integrate the AnonimousPay to your system simply and quickly

Base URL: https://pagpay.co/api/v1

Introduction

The API AnonimousPay allows you to integrate PIX and Credit Card payments into your system in a simple and secure way.

Features

  • Complete RESTful API
  • Authentication via Token Bearer
  • Real-time webhooks
  • Responses in JSON

Get API Credentials

To use the API, you need to generate an API key in the system dashboard.

Step 1: Access the API Keys page

In the system panel, access the section "API Key" in the side menu.

Go to API Keys →

Step 2: Generate a new key

Click on "Generate New Key" and give a descriptive name (e.g. "Main Site", "Mobile App").

⚠️ Important: Copy and save the token immediately, as it will only be displayed once!

Step 3: Configure on your system

Add the generated token to your website/application settings. The token will have the format:

nxp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

PIX Integration (Payments)

Create PIX payments and receive real-time notifications when payment is confirmed.

Endpoint

POST https://pagpay.co/api/v1/payments/pix

Parameters

Field Type Mandatory Description
amount float Yes Valor do pagamento (mínimo: R$ 0,01)
payer_name string Yes Payer's full name
payer_email string Yes Payer email
payer_cpf string Yes Payer's CPF (maximum 14 characters)
description string No Payment description

Success Response (201)

{
  "success": true,
  "data": {
    "transaction_uuid": "550e8400-e29b-41d4-a716-446655440000",
    "amount": 100.00,
    "fee": 4.00,
    "amount_net": 96.00,
    "status": "pending",
    "qr_code": "00020126580014BR.GOV.BCB.PIX...",
    "pix_code": "00020126580014BR.GOV.BCB.PIX...",
    "pix_key": "00020126580014BR.GOV.BCB.PIX...",
    "expires_at": "2024-11-26T12:30:00Z",
    "expires_in_seconds": 300
  }
}

Cashout - Withdrawals via PIX

Create withdrawals via PIX to transfer the user's account balance to a PIX key.

Important: For automatic withdrawals to work, you need to: 1. Set withdrawal mode to "Automatic" when creating API credential 2. Add your server IP in the API settings 3. The user must be approved (KYC) and have withdrawals unlocked

Endpoint

POST https://pagpay.co/api/v1/cashout/pix

Consult the withdrawal result using GET https://pagpay.co/api/v1/cashout/pix/{id}. O id is returned on creation.

Parameters

Field Type Mandatory Description
amount float Yes Valor total a debitar (mínimo: R$ 10,00). A taxa é calculada e descontada desse valor.
pix_key_type string Yes Exact type: cpf, cnpj, email, phone or evp
pix_key string Yes Destination PIX key (CPF, Email, Telephone or Random Key)

Success Response

{
  "success": true,
  "message": "Saque criado e processado automaticamente.",
  "withdrawal": {
    "id": 123,
    "amount": 95.00,
    "amount_gross": 100.00,
    "fee": 5.00,
    "status": "processing",
    "pix_key": "+5511987654321",
    "pix_key_type": "phone"
  }
}

Consult Transactions

List and filter your account transactions or search for a specific transaction.

List Transactions

GET https://pagpay.co/api/v1/transactions

Parameters (Query String)

Field Type Mandatory Description
status string No Filter by status (pending, completed, failed, etc.)
type string No Filter by type (pix, credit, withdrawal)
start_date string (YYYY-MM-DD) No Filter start date
end_date string (YYYY-MM-DD) No Filter end date
per_page integer No Items per page (default: 20)

Success Response

{
  "success": true,
  "data": [
    {
      "uuid": "550e8400-e29b-41d4-a716-446655440000",
      "amount_gross": 100.00,
      "amount_net": 96.00,
      "fee": 4.00,
      "type": "pix",
      "status": "completed",
      "gateway_provider": "pluggou",
      "external_id": "TXN_123456789",
      "description": "Depósito via PIX - API",
      "created_at": "2024-01-20T10:30:00Z",
      "updated_at": "2024-01-20T10:35:00Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "last_page": 5,
    "per_page": 20,
    "total": 100
  }
}

Search Specific Transaction

GET https://pagpay.co/api/v1/transactions/{uuid}

Webhooks (Notifications)

Receive automatic notifications in your system whenever the status of a transaction changes.

Configuration

Configure the webhook URL in your API Key on the system panel.

  1. Access the section "API Key" in the side menu
  2. Create a new API key or edit an existing one
  3. Fill in the field "Webhook URL" with your server URL
  4. Save changes

⚠️ Important: The URL must be public and accessible via HTTP/HTTPS to receive notifications.

Triggered Events

Event Description
transaction.completed Triggered when the payment is confirmed (paid) and the balance is credited.
transaction.failed Triggered when payment fails, expires or is cancelled.
withdrawal.completed Triggered when a withdrawal is completed successfully.

Payload Example (JSON)

The system will send a request POST to your URL with the following body:

{
  "event": "transaction.completed",
  "created_at": "2024-01-20T10:30:00Z",
  "data": {
    "transaction_id": "550e8400-e29b-41d4-a716-446655440000",
    "external_id": "TXN_123456789",
    "amount_gross": 150.00,
    "amount_net": 145.50,
    "fee": 4.50,
    "status": "completed",
    "gateway_provider": "pluggou",
    "paid_at": "2024-01-20T10:35:00Z"
  }
}

Payload Fields

Field Type Description
event string Name of the triggered event
created_at string (ISO 8601) Webhook creation timestamp
data.transaction_id string (UUID) Unique UUID of the transaction in the system
data.external_id string Transaction ID on external gateway
data.amount_gross float Gross transaction value
data.amount_net float Net value (after fees)
data.fee float Amount of fee charged
data.status string Transaction status (completed, failed, etc.)
data.gateway_provider string Gateway name (misticpay)
data.paid_at string (ISO 8601) Payment confirmation timestamp

Expected Response

Your server should respond with HTTP status 200 OK to confirm receipt. Otherwise, the system will try to resend the notification.

Security

To validate that the webhook actually came from the system, you can:

  • Check source IP (if available)
  • Validate the payload structure
  • Confirm the transaction_id by consulting the API

Example in PHP

Example of creating a PIX payment using Guzzle.

<?php

$client = new \GuzzleHttp\Client();

$response = $client->post('https://pagpay.co/api/v1/payments/pix', [
    'headers' => [
        'Authorization' => 'Bearer SEU_TOKEN',
        'X-Client-ID' => 'SEU_CLIENT_ID',
        'Accept' => 'application/json',
    ],
    'json' => [
        'amount' => 100.00,
        'payer_name' => 'João Silva',
        'payer_email' => '[email protected]',
        'payer_cpf' => '12345678900',
        'description' => 'Pagamento de Teste'
    ]
]);

$body = json_decode($response->getBody(), true);
print_r($body);

Example in Python

Example using the requests library.

import requests

url = "https://pagpay.co/api/v1/payments/pix"

payload = {
    "amount": 100.00,
    "payer_name": "João Silva",
    "payer_email": "[email protected]",
    "payer_cpf": "12345678900",
    "description": "Pagamento de Teste"
}

headers = {
    "Authorization": "Bearer SEU_TOKEN",
    "X-Client-ID": "SEU_CLIENT_ID",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())

Example in JavaScript

Example using fetch API.

const url = "https://pagpay.co/api/v1/payments/pix";

const payload = {
    amount: 100.00,
    payer_name: "João Silva",
    payer_email: "[email protected]",
    payer_cpf: "12345678900",
    description: "Pagamento de Teste"
};

const headers = {
    "Authorization": "Bearer SEU_TOKEN",
    "X-Client-ID": "SEU_CLIENT_ID",
    "Content-Type": "application/json"
};

fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));

cURL example

curl -X POST "https://pagpay.co/api/v1/payments/pix" \
  -H "Authorization: Bearer SEU_TOKEN" \
  -H "X-Client-ID: SEU_CLIENT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 100.00,
    "payer_name": "João Silva",
    "payer_email": "[email protected]",
    "payer_cpf": "12345678900",
    "description": "Pagamento de Teste"
  }'

Error Codes

List of possible HTTP status codes returned by the API.

Code Meaning Description
200 OK Request processed successfully.
201 Created Resource created successfully (e.g. new payment).
400 Bad Request Invalid data sent in the request. Check the fields.
401 Unauthorized Invalid or not provided token.
403 Forbidden Access denied to the requested resource.
404 Not Found Resource not found (e.g. non-existent transaction).
422 Unprocessable Entity Validation error (e.g. invalid email, insufficient balance).
500 Internal Server Error Internal server error. Please try again later.

API de saque USDT · BEP20

Use o token e o Client ID da API do AnonimousPay. Os valores são em reais: o saldo é debitado em BRL e o líquido é convertido para USDT pela MisticPay. Conta aprovada e saldo disponível são necessários. Saques automáticos exigem IP permitido na credencial.

GET /api/v1/cashout/usdt/quote?amount=100 · Consulta cotação e estimativa, sem criar saque.

POST /api/v1/cashout/usdt · Solicita saque para uma carteira BNB Smart Chain (BEP20).

{"amount":100,"wallet":"0x1111111111111111111111111111111111111111","request_id":"550e8400-e29b-41d4-a716-446655440000"}

Envie um UUID único em request_id para cada saque. Repita o mesmo identificador e os mesmos dados se perder a resposta: o pedido já registrado será retornado, sem novo débito. Reutilizar o identificador com outros dados retorna 409.

O valor para conversão deve ficar entre R$ 20 e R$ 15.000 após a taxa AnonimousPay. Taxas e cotação do adquirente afetam o USDT recebido. A estimativa não é garantia de cotação final.

GET /api/v1/cashout/usdt/{id} · Consulta o próprio saque. O status processing significa que está aguardando confirmação; paid ou completed indica confirmação do adquirente.

Acompanhamento do envio

GET /api/v1/cashout/usdt/{id} retorna withdrawal.tracking: stage, label, message, transaction_hash, explorer_url, provider_status, last_checked_at e wallet_credit_confirmed (null: sem confirmação da carteira de destino). O status original de withdrawal.status continua disponível.

Etapas: awaiting_approval, processing, hash_available, provider_completed, failed e cancelled. Hash disponível indica que o provedor informou um TxID, sem afirmar confirmação na blockchain. provider_completed é a conclusão informada pelo adquirente; não comprova crédito pela corretora.

transaction_hash e explorer_url são null enquanto o provedor não fornecer um hash válido. O identificador interno do saque não é um TxID. Consulte o link BscScan para acompanhar a rede. A API não recebe confirmação interna de crédito da Binance.

A consulta retorna sync.state: fresh, updated, pending_submission, busy ou unavailable. Consultas ao provedor são limitadas a uma por saque a cada 30 segundos; falhas preservam o último estado confirmado. Nunca repita POST para consultar o envio: use GET. Respostas não incluem credenciais nem o payload privado do adquirente.