Skip to main content
The PagFinance API is a multi-tenant B2B payments API: crypto cash-out to PIX and boleto (offramp), PIX cash-in to crypto (onramp), payment links, price quotes, and KYC/KYB onboarding. It is a machine-to-machine HTTP API consumed by your backend.
Every partner and every user is isolated. All reads and writes are scoped to the authenticated principal (the partner behind the API key or HMAC signature, and the end user behind a JWT). You never pass a partner id or user id in the body to switch tenants.

Base URL

Every versioned endpoint lives under /api/v1.
Calls to /api/* without a version are redirected to /api/v1/* (301 on GET, 308 on POST, PATCH, and DELETE). Inbound provider webhooks live outside /api (for example /webhooks/bank) and are not part of the partner surface.

Environments

There is no separate sandbox host. Test mode is activated by configuration on your credentials: outbound PIX payout runs in dry-run (the intent is recorded but no real PIX is sent), and the KYC provider accepts test documents. Sandbox credentials (partner id, API key or HMAC secret, the expected x-app-* values, and test CPF/CNPJ numbers for the approved and rejected scenarios) are provisioned by our team.

Request sandbox access

Contact the integration team to receive your partner credentials and test data.

Authentication

The API has three layers of authentication. See Authentication for the full detail.

Partner: API key (recommended)

Authorization: Bearer sk_live_<hex>. Sent directly, no signing. Used on the partner routes (/auth/token, /users/*, /partners/*).

Partner: HMAC-SHA256 (legacy)

Authorization: HMAC-SHA256 partnerId=...,timestamp=...,nonce=...,signature=.... Per-request signature. Accepted on the same routes as the API key.

End user: JWT

Authorization: Bearer <token>. Issued by POST /api/v1/auth/token for a user; required on cash-out, cash-in, and receipts.

Public routes

No auth: GET /getAssetPrice, GET /accepted-cryptos, POST /validate-code, health checks, and public payment-link resolution.

Response envelopes

Successful responses use a success envelope with the payload under data. Errors return success: false with an error message and, in some cases, a code.

Rate limits

On overflow the API returns 429 with { success: false, error, retryAfter }. Respect retryAfter with exponential backoff and size your client with a 10 to 15 second timeout.

Common errors

validation error
Malformed request or a missing required field. The error message describes the problem.
unauthenticated
Missing, expired, or invalid credentials (API key, HMAC signature, or JWT). The response is generic and does not reveal whether the principal exists.
forbidden
The principal is not allowed: a suspended or revoked partner, an IP outside the allowlist, a blocked user, or an operation that requires approved KYC (kycStatus === APPROVED).
not found
The resource does not exist (for example a user, intent, or receipt).
concurrency
A concurrent operation is already in progress for the same resource (for example a second cashout/intent for the same quoteId, or an Idempotency-Key still being processed).
rate limit
Rate limit exceeded. Wait retryAfter seconds before retrying.
internal error
Unexpected server error. The response carries a requestId for support.
provider not configured
A dependent provider is not configured on this instance (for example the KYC provider). Returned at call time.

Reference structure

The endpoints are grouped by resource:

Authentication

Partner API key, HMAC-SHA256, and end-user JWT issuance.

Crypto settlement

Supported chains, the live asset catalog, memo reconciliation, and the cash-out state machine.

Endpoints

Browse the live API groups in the sidebar (Users, Partners, KYC, Prices, Cash-out, Cash-in, Receipts, Links). Each endpoint has an interactive playground generated from the OpenAPI spec.

BRLP

BRLP withdraw (Mode B) and the BRL pricing layer.

KYC

Document lookup and full onboarding sessions.

Webhooks

Outbound event notifications, registration, and signature.