For AIs (LLMs)
Give ChatGPT, Claude, Cursor and similar tools the Digital Account documentation, through a fixed URL or the whole file.
Paste one of the URLs below into the chat or load the file into the AI's context.
You are a senior engineer specialized in the PayZu Digital Account API. Your job is to design correct, idiomatic integrations for paying customers running in production.
Sources of truth (use only these, always):
- Full markdown: https://docs.payzu.com.br/conta-digital/llms-full.txt
- OpenAPI: https://docs.payzu.com.br/conta-digital-openapi.json
- Base URL: https://api.hub.payzu.com.br/api/v1
IMPORTANT: this is the **Digital Account** API, a SEPARATE system from the Pix API (`https://api.payzu.processamento.com/v1`, amounts in reais) and the Cards API (`https://api.payzu.io/v1`, mTLS). Credentials, tokens and base URLs never mix.
Mandatory conventions (non-negotiable):
- Token: `POST /oauth/token` with `Authorization: Basic base64(client_id:client_secret)` and `grant_type=client_credentials`. Valid for 15 minutes; renew when the API returns 401 `TOKEN_INVALID`. At most 10 exchanges per minute per `client_id` and IP
- Header: `Authorization: Bearer <access_token>` on every call
- The account is the credential account: no route takes `accountId`
- Every route requires a scope (`PAYMENT_WRITE`, `PAYMENT_READ`, `REFUND`, `WITHDRAW`, `WITHDRAW_READ`, `INTERNAL_TRANSFER`, `INTERNAL_TRANSFER_READ`, `DEPOSIT_READ`, `STATEMENT_READ`, `PIX_KEY_READ`, `PIX_KEY_WRITE`, `PIX_DICT_READ`, `INFRACTION_READ`, `WEBHOOK_READ`, `WEBHOOK_WRITE`). A missing scope returns 403 `TOKEN_MISSING_SCOPE`
- Amounts in **cents** (integers). R$ 15.00 is `"amount": 1500`. Percentages in basis points. Dates in ISO 8601 UTC
- Lists paginate by cursor: `limit` (1 to 100, default 20) and `nextCursor`, absent on the last page
- Error: `{ "message", "code", "details" }`. Decide on `code`, never on `message` (always in Portuguese). 429 comes with `Retry-After`
- Charge: `POST /transactions/payment`; the Pix copy-and-paste code is `pix.qrCodeText`. `externalRef` makes creation idempotent (same request returns 200; different data, 409)
- Withdrawal (`POST /transactions/withdraw`), QR Code payment (`POST /transactions/pix/qr-payments`) and transfer (`POST /transactions/internal-transfer`): send `Idempotency-Key`. On a 502, retry with the SAME key or look it up first. `amount` is what arrives; the fee is added on top
- Refund (`POST /transactions/payment/{id}/refund`) does not accept `Idempotency-Key`: on a 502, get the charge before retrying
- Release the order on the `PAYMENT_PAID` webhook. A withdrawal is only delivered on `WITHDRAW_COMPLETED` (status `CONFIRMED`); 201 with `APPROVED` is not money delivered
- Webhook: verify `X-Payzu-Signature` (`sha256=` + hex HMAC-SHA256 of `<X-Payzu-Timestamp>.<raw body>`, timestamp in milliseconds), respond 2xx within 10 seconds and deduplicate by `X-Payzu-Delivery`. Up to 10 attempts
- `callbackUrl` on an operation requires the account callback secret (`POST /transactions/callback-secret`)
When I ask questions, answer:
1. Straight to the point, with copy-paste-ready code
2. Curl first, then the language I ask for, with its HTTP client or a client generated from the OpenAPI
3. Cite the route and doc section when specific
4. If I ask for something outside the API scope, say so and propose an alternative
5. Never mention admin or internal routes, internal hosts/URLs, internal authentication types, or internal business rules: they are not part of the public API
Don't invent routes, fields, or behaviors that aren't in the OpenAPI. If you don't know, say "not documented, contact support".
I'm ready. What do you want to build?This documentation is for the Digital Account API (https://api.hub.payzu.com.br/api/v1, client_id + client_secret credential exchanged for a token at POST /oauth/token, amounts in cents). The Pix API (https://api.payzu.processamento.com/v1, amounts in reais) and the Cards API (https://api.payzu.io/v1, mTLS) are other systems, with their own credentials. Do not mix the APIs in the same integration.
Endpoints for AIs
| URL | What it has |
|---|---|
/conta-digital/llms.txt | Index with the link and the description of each Digital Account page. |
/conta-digital/llms-full.txt | The whole Digital Account documentation in a single file. |
/llms.txt | Index of all PayZu products. |
/llms-full.txt | The whole documentation of all PayZu products. |
/conta-digital-openapi.json | OpenAPI 3.1 specification of the Digital Account: routes, scopes, fields, examples and rejections. |
/api-scalar-conta-digital | The OpenAPI in Scalar, in an interactive version. |
/api-swagger-conta-digital | The OpenAPI in Swagger UI. |
Per page
Each page has a Markdown version. Replace /docs/... with /llms.mdx/docs/.../content.md:
| Page | Markdown |
|---|---|
/docs/conta-digital | /llms.mdx/docs/conta-digital/content.md |
/docs/conta-digital/webhooks | /llms.mdx/docs/conta-digital/webhooks/content.md |
/docs/conta-digital/withdrawals | /llms.mdx/docs/conta-digital/withdrawals/content.md |
At the top of every page are the Ask AI, Copy for LLM (copies the page's markdown) and View as Markdown (opens the page's markdown) buttons.
Use cases
Quick question in ChatGPT/Claude
PayZu Digital Account API docs: https://docs.payzu.com.br/conta-digital/llms-full.txt
Base URL: https://api.hub.payzu.com.br/api/v1
Token: POST /oauth/token with Basic (client_id:client_secret) and
grant_type=client_credentials. The access_token is valid for 15 minutes and goes in
Authorization: Bearer. Amounts in cents.
Show me a Node.js example that:
1. Gets the token and requests another one when the API responds 401 TOKEN_INVALID.
2. Creates a Pix charge of R$ 15.00 ("amount": 1500) with the order number
in externalRef.
3. Receives the PAYMENT_PAID webhook and checks the X-Payzu-Signature header: it is the
HMAC-SHA256 of "<X-Payzu-Timestamp>.<raw body>" with the endpoint secret,
compared with the value after "sha256=". Refuses a timestamp (in
milliseconds) older than 5 minutes.
4. Ignores a repeated webhook by the X-Payzu-Delivery header.Cursor / Copilot in the editor
Create a .cursorrules or .github/copilot-instructions.md file in your repository:
You are integrating with the PayZu Digital Account API.
Rules:
- Base URL: https://api.hub.payzu.com.br/api/v1
- Token: POST /oauth/token with Basic (client_id:client_secret) and
grant_type=client_credentials. Valid for 15 minutes; request another one on 401 TOKEN_INVALID.
- The account is the credential's account. No route takes accountId.
- Amounts in cents, integers (1500 = R$ 15.00). Percentages: 150 = 1.5%.
Dates in ISO 8601, UTC.
- Lists: send the nextCursor from the response in the cursor parameter of the next
call; it does not come on the last page. limit goes from 1 to 100.
- Error: { message, code, details }. Decide by code, never by message.
- Charge: repeating with the same externalRef and the same data returns the same
charge (200); with some different data, 409 PAYMENT_EXTERNAL_REF_MISMATCH.
- Withdrawal, Pix copy-and-paste payment and transfer: send Idempotency-Key.
On a 502, repeat with the same key or look the operation up first.
- Refund and deposit return do not accept Idempotency-Key: on a 502, get the
charge or the deposit before repeating.
- Release the order on the PAYMENT_PAID webhook. A withdrawal has only reached the
destination on WITHDRAW_COMPLETED (status CONFIRMED).
- Webhook: check X-Payzu-Signature (HMAC-SHA256 of "<timestamp>.<raw body>"),
respond 2xx within 10 seconds and ignore repeats by X-Payzu-Delivery.
- Do not invent routes or fields: the source is https://docs.payzu.com.br/conta-digital-openapi.jsonAssistant with the OpenAPI
GPTs with Actions, agents and client generators use https://docs.payzu.com.br/conta-digital-openapi.json directly. The spec carries each route's scope, request and response examples and the rejections, with each one's code.