# For AIs (LLMs) (/en/docs/conta-digital/for-ai)

<QuickLinks>
  <QuickLink href="https://docs.payzu.com.br/conta-digital/llms.txt" title="llms.txt (index)" />

  <QuickLink href="https://docs.payzu.com.br/conta-digital/llms-full.txt" title="llms-full.txt (everything)" />

  <QuickLink href="https://docs.payzu.com.br/conta-digital-openapi.json" title="OpenAPI JSON" />
</QuickLinks>

Paste one of the URLs below into the chat or load the file into the AI's context.

<CopyAIPrompt />

<Callout type="warn">
  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.
</Callout>

## Endpoints for AIs [#endpoints-for-ais]

| URL                                                                                     | What it has                                                                                        |
| --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| [`/conta-digital/llms.txt`](https://docs.payzu.com.br/conta-digital/llms.txt)           | Index with the link and the description of each Digital Account page.                              |
| [`/conta-digital/llms-full.txt`](https://docs.payzu.com.br/conta-digital/llms-full.txt) | The whole Digital Account documentation in a single file.                                          |
| [`/llms.txt`](https://docs.payzu.com.br/llms.txt)                                       | Index of all PayZu products.                                                                       |
| [`/llms-full.txt`](https://docs.payzu.com.br/llms-full.txt)                             | The whole documentation of all PayZu products.                                                     |
| [`/conta-digital-openapi.json`](https://docs.payzu.com.br/conta-digital-openapi.json)   | OpenAPI 3.1 specification of the Digital Account: routes, scopes, fields, examples and rejections. |
| [`/api-scalar-conta-digital`](https://docs.payzu.com.br/api-scalar-conta-digital)       | The OpenAPI in Scalar, in an interactive version.                                                  |
| [`/api-swagger-conta-digital`](https://docs.payzu.com.br/api-swagger-conta-digital)     | The OpenAPI in Swagger UI.                                                                         |

## Per page [#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 [#use-cases]

### Quick question in ChatGPT/Claude [#quick-question-in-chatgptclaude]

```text
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 [#cursor--copilot-in-the-editor]

Create a `.cursorrules` or `.github/copilot-instructions.md` file in your repository:

```text
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.json
```

### Assistant with the OpenAPI [#assistant-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`.