Skip to main content
The PagouAi/examples repository is a practical, runnable companion to these docs. Every core v2 flow is implemented in seven languages using an idiomatic HTTP client with as few dependencies as possible — it is not an SDK and not framework-specific, so the same patterns translate across stacks. Each guide here links to the exact example directory and file that implements it, and every example links back to its guide and API reference operation. Use the docs to understand a flow, then jump to working code you can clone and run against the sandbox.

Browse by flow

Payments

Pix + QR, vouchers, card via Payment Element, 3DS, full and partial refunds, cursor pagination.

Checkout Links

Create a checkout link and store the returned public URL identifier.

Customers & Subscriptions

Create or reuse a customer, then create, retrieve and cancel a subscription.

Transfers (Pix Out)

Create, retrieve and reconcile a transfer; cancel when the status allows.

Webhooks

Real handlers for the transaction, subscription and transfer event families.

Languages

Every flow above is implemented in each of these languages. Open a language directory for its README.md, .env.example and per-flow subdirectories. The TypeScript reference additionally ships an @pagouai/api-sdk variant alongside the raw-HTTP one.

How to run

1

Get a sandbox token

Sign in to your dashboard and create a sandbox API token. Sandbox and production tokens are separate — keep them that way.
2

Pick a language and flow

Open a language directory and read its README.md, then open the flow subdirectory (for example typescript/payments/).
3

Configure the environment

Copy .env.example to .env in that language directory and set your sandbox token. The base URL defaults to https://api.sandbox.pagou.ai.
4

Run a flow

Each flow README documents a single run command, the input payload, the relevant response, and the expected error and recovery path.

Coverage and security

  • The coverage matrix is the single source of truth for what each language implements.
  • No example ever accepts a PAN or CVV at the backend — card data flows only through the Payment Element to a pgct_* token. API keys are server-side only, fixtures are synthetic, and logs redact secrets.
The repository is in beta while the docs Examples area rolls out and owner teams are assigned. The flows themselves are complete, tested and runnable today.