Give AI coding agents the right Pagou docs context before they generate integration code.
Copy this prompt into any AI coding agent:
Pagou AI Context
You are a senior engineer building a production Pagou integration.Sources of truth:- Fast docs: https://developer.pagou.ai/llms.txt- Full docs: https://developer.pagou.ai/llms-full.txt- OpenAPI v2: https://developer.pagou.ai/api-reference/openapi-v2.json- Base URLs: https://api.pagou.ai and https://api.sandbox.pagou.aiRules:- Keep Pagou secret keys server-side only. Use env vars.- Validate endpoints, fields, statuses, and webhook shapes against OpenAPI before coding.- Do not invent undocumented endpoints, fields, or flows.- Amounts in API v2 are in cents.- Always include external_ref and idempotency on writes.- Use Payment Element / SDK v3 for cards. Send only pgct_ tokens to the backend.- Implement real webhooks, deduplicate by top-level event id, and process async.- Route payments by event=transaction + data.event_type.- Route subscriptions by event=subscription + data.event_type.- Route transfers by top-level type.- Fulfill orders, access, and payout state only from webhook-confirmed or server-reconciled state.- Use GET polling only for reconciliation, support, or recovery. Never use polling as the main integration flow.
## Pagou Integration- Sources of truth: https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json- Keep Pagou secret keys server-side only and use env vars- Validate endpoints, fields, statuses, and webhooks against OpenAPI; do not invent undocumented fields- Amounts in API v2 are in cents- Always include external_ref and idempotency on writes- Use Payment Element / SDK v3 for cards and send only pgct_ tokens to the backend- Implement real webhooks, deduplicate by top-level id, process async, and avoid polling as the main flow- Fulfill orders, subscriptions, and transfers only from webhook-confirmed or server-reconciled state
## Pagou Integration- Sources of truth: https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json- Keep Pagou secret keys server-side only and use env vars- Validate endpoints, fields, statuses, and webhooks against OpenAPI; do not invent undocumented fields- Amounts in API v2 are in cents- Always include external_ref and idempotency on writes- Use Payment Element / SDK v3 for cards and send only pgct_ tokens to the backend- Implement real webhooks, deduplicate by top-level id, process async, and avoid polling as the main flow- Fulfill orders, subscriptions, and transfers only from webhook-confirmed or server-reconciled state
Or run with inline context:
codex "Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json. Build Pix checkout with backend-only Pagou calls, external_ref, webhook endpoint, event dedupe, and GET only for reconciliation."
Add to .cursorrules in project root:
## Pagou Integration- Sources of truth: https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json- Keep Pagou secret keys server-side only and use env vars- Validate endpoints, fields, statuses, and webhooks against OpenAPI; do not invent undocumented fields- Amounts in API v2 are in cents- Always include external_ref and idempotency on writes- Use Payment Element / SDK v3 for cards and send only pgct_ tokens to the backend- Implement real webhooks, deduplicate by top-level id, process async, and avoid polling as the main flow- Fulfill orders, subscriptions, and transfers only from webhook-confirmed or server-reconciled state
Paste the Pagou AI Context prompt above at the start of your chat, then ask your question. Require the agent to implement real webhooks, deduplicate events, keep secrets server-side, and avoid polling as the primary integration flow.If the agent can’t fetch URLs, paste the relevant section from llms-full.txt directly.
Start with this as your first message. It is strict on backend boundaries, webhooks, and documented API fields:
Lovable Pagou Integration Prompt
You are a senior engineer building a production Pagou integration inside Lovable.Use only these Pagou sources of truth:- Full docs: https://developer.pagou.ai/llms-full.txt- OpenAPI v2: https://developer.pagou.ai/api-reference/openapi-v2.json- Production base URL: https://api.pagou.ai- Sandbox base URL: https://api.sandbox.pagou.aiScope:- Customers: create, list, and retrieve customers- Transactions: Pix, voucher/local payment, card payment, list, retrieve, and refund- Subscriptions: create, list, retrieve, update, and cancel recurring billing by card or Pix Automático- Transfers: Pix Out creation, list, retrieve, and cancellation- Webhooks: payment, subscription, and transfer events- Frontend card flow: Payment Element / SDK v3 for secure tokenizationNon-negotiable rules:- Never expose a Pagou secret API token in the browser.- All Pagou API calls must run from a backend route, server function, or secure server action.- Use environment variables for credentials and base URL.- Use sandbox first. Keep the production switch configuration-only.- Use Payment Element / SDK v3 for card collection. Send only the `pgct_` token to the backend.- Never handle raw card numbers.- Amounts in Pagou API v2 are in cents. Example: BRL 49.00 = `4900`.- Always send a deterministic `external_ref` for creates and sensitive writes.- Use idempotency for creates, refunds, subscription actions, and transfers.- Do not invent endpoints, fields, statuses, or webhook shapes. Validate against OpenAPI first.Webhook-first architecture:- Implement a real webhook endpoint, not only polling.- Return `2xx` quickly from the webhook endpoint.- Do not run slow application work before responding to the webhook.- Persist or enqueue the payload, then process it asynchronously.- Deduplicate by the top-level webhook `id`.- Payment events use `event: "transaction"` and the concrete event in `data.event_type`.- Subscription events use `event: "subscription"` and the concrete event in `data.event_type`.- Transfer events use the top-level `type`, such as `payout.transferred` or `payout.failed`.- Use GET polling only for reconciliation, support screens, or recovery after an uncertain state. Do not use polling as the main integration flow.Fulfillment and state:- Never fulfill an order from a browser success message alone.- Fulfill Pix, voucher, and card orders only after `transaction.paid` or a reconciled paid state.- For cards, handle `next_action` / 3DS when returned.- For voucher/local payments, instructions may arrive in the create response or later by webhook.- For subscriptions, use webhooks for created, started, renewed, updated, canceled, payment_failed, past_due, trial_will_end, and chargeback_received events.- For transfers, use resource status for operational state and webhook events for transitions.Error handling:- 4xx: fix the request or permissions. Do not retry automatically.- 409: reconcile the existing resource before creating another one.- 429, 5xx, timeout: retry with exponential backoff and jitter only when the write is idempotent.- Always log `requestId` when the API returns it.- Show safe user messages. Do not expose implementation details or secrets.When generating code:1. Create a clear frontend + backend/server-function architecture.2. Keep all Pagou secrets server-side.3. Implement the webhook endpoint and event deduplication.4. Use webhook-confirmed or server-reconciled state for final business actions.5. Include required environment variables.6. Cite the endpoint used for each flow.7. Validate request and response fields against the OpenAPI.8. If a behavior is not documented, say it is not documented and suggest contacting Pagou support with the `requestId`.Build: [describe the app and the Pagou flows you need]
Replace [describe your app] with what you want to build.
Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.jsonBuild a Pix checkout flow:1. Backend/server function only: POST /v2/transactions with method=pix, amount in cents, and external_ref2. Frontend: display only buyer-facing Pix fields returned by the backend3. Webhook: implement POST /webhooks/pagou, deduplicate by top-level id, route event=transaction by data.event_type4. Fulfillment: update the order only after transaction.paid or a reconciled paid state5. Reconciliation: use GET /v2/transactions/{id} only for recovery/support, not as the main flowUse env vars for API keys. Never expose Pagou credentials in frontend. Validate all fields against OpenAPI.
Card checkout
Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.jsonBuild a card checkout flow:1. Frontend: load Payment Element from https://js.pagou.ai/payments/v3.js and mount hosted card fields2. On submit: call elements.submit(), then send only the pgct_ token to the backend3. Backend/server function only: POST /v2/transactions with method=credit_card, amount in cents, token, installments, and external_ref4. 3DS: if the backend response has next_action, continue the challenge through the SDK flow5. Webhook: route event=transaction by data.event_type and update order state only after webhook or server reconciliation6. Reconciliation: use GET /v2/transactions/{id} only after uncertain browser/network stateUse env vars for API keys. Never expose secrets or handle raw card numbers. Validate all fields against OpenAPI.
Checkout link
Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.jsonBuild a checkout link flow (Pagou-hosted checkout — no card handling on your side):1. Backend/server function only: POST /v2/checkout-links with an Authorization: Bearer <API key>2. Body — products: { "currency": "BRL", "title": "<order>", "products": [{ "external_id": "<your id>", "name": "<name>", "price": <cents>, "quantity": <n> }] }3. Body — value-only: { "currency": "BRL", "amount": <cents> }. Send EITHER products OR amount, never both.4. external_id is your own product id; re-sending the same id updates that product (no duplicates).5. Response is { "data": { "url": "<checkout url>" } } — redirect the buyer to data.url.6. Fulfillment: update the order only after the transaction webhook (event=transaction, data.event_type) confirms payment — not on redirect.Prices/amount are integers in cents. Keep the API key server-side (env var), never in the browser. Validate all fields against OpenAPI.
Subscription billing
Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.jsonBuild a subscription billing flow:1. Backend/server function only: create or retrieve the customer with /v2/customers2. Frontend: use Payment Element in subscription mode and send only the pgct_ token to the backend3. Backend: POST /v2/subscriptions with customer_id, token, amount in cents, interval, interval_count, external_ref/metadata if needed For Pix Automático instead: skip step 2, send payment_method "pix_automatic" without token, and show the returned authorization.qr_code to the payer4. Webhook: implement POST /webhooks/pagou, deduplicate by top-level id, route event=subscription by data.event_type5. State: grant or remove access from subscription status and subscription webhooks, not browser state6. Reconciliation: use GET /v2/subscriptions/{id} only for recovery/support or uncertain stateHandle subscription.created, subscription.started, subscription.renewed, subscription.updated, subscription.canceled, subscription.payment_failed, subscription.past_due, subscription.unpaid, subscription.trial_will_end, and subscription.chargeback_received.Use env vars for API keys. Never expose Pagou credentials in frontend. Validate all fields against OpenAPI.
Webhook handler
Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.jsonBuild a webhook endpoint:1. POST /webhooks/pagou - accept JSON body and return 200 with {"received": true} quickly2. Persist or enqueue the raw payload before async processing3. Deduplicate by top-level "id" field (same event can be sent multiple times)4. Route payment events by event=transaction and data.event_type5. Route subscription events by event=subscription and data.event_type6. Route transfer events by top-level type, such as payout.transferred, payout.failed, payout.rejected, payout.canceled7. Run slow application work in a background job, not before the HTTP responseStore processed event IDs to prevent duplicate processing. Do not use polling as the primary state update path.
Pix payout
Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.jsonBuild a Pix Out transfer flow:1. Backend/server function only: POST /v2/transfers with recipient Pix data, amount in cents, and external_ref2. Webhook: route transfer events by top-level type, including payout.transferred, payout.failed, payout.rejected, and payout.canceled3. State: update payout status from webhook/resource status, not frontend polling4. Reconciliation: use GET /v2/transfers/{id} only if webhook processing is delayed or uncertain5. Cancellation: POST /v2/transfers/{id}/cancel only when the current resource status allows itUse env vars for API keys. Never expose Pagou credentials in frontend. Validate all fields against OpenAPI.
{"docsConfig":{"theme":"sequoia","$schema":"https://mintlify.com/docs.json","name":"Pagou Developer Docs","description":"Integrate payments, subscriptions, payouts, webhooks, and frontend card flows with Pagou.ai API.","colors":{"primary":"#198754","light":"#07C983","dark":"#198754"},"logo":{"light":"https://mintcdn.com/pagouai/G-8AHDSd0H3lSbe_/logo/logo-long.webp?fit=max\u0026auto=format\u0026n=G-8AHDSd0H3lSbe_\u0026q=85\u0026s=f29ebde8b8d8c96183843fc8bc58e508","dark":"https://mintcdn.com/pagouai/G-8AHDSd0H3lSbe_/logo/logo-long-dark.webp?fit=max\u0026auto=format\u0026n=G-8AHDSd0H3lSbe_\u0026q=85\u0026s=838f22bb8beb6e11ce9c45d0e3dba402"},"favicon":"https://mintcdn.com/pagouai/G-8AHDSd0H3lSbe_/logo/logo-short.webp?fit=max\u0026auto=format\u0026n=G-8AHDSd0H3lSbe_\u0026q=85\u0026s=38c30337b736500dd5c2667b1820ba19","background":{"decoration":"windows"},"navbar":{"links":[{"icon":"bot","href":"/start-here/ai-integration","label":"Integrate with AI"},{"icon":"activity","href":"https://status.pagou.ai","label":"Status"},{"icon":"arrow-up-right","href":"https://pagou.ai","label":"Pagou.ai"}]},"footer":{},"fonts":{"family":"Google Sans"},"icons":{"library":"lucide"},"integrations":{"intercom":{"appId":"uhg6tri7"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"AI Integration","icon":"bot","href":"/start-here/ai-integration"},{"anchor":"API status","href":"https://status.pagou.ai"},{"anchor":"GitHub","href":"https://github.com/pagouai"}]},"languages":[{"language":"en","default":true,"href":""},{"language":"pt-BR","href":"pt"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"pagouai","hasAudioNarration":false,"actualSubdomain":"pagouai","customDomains":["developer.pagou.ai"],"gitSource":{"type":"github","owner":"pagouai","repo":"gateway-backend","deployBranch":"main","contentDirectory":"packages/docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6af1daa1b3969014b8f297a3","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"en","tag":"API Reference","count":37},{"language":"pt-BR","tag":"Referência API","count":37},{"language":"en","tag":"Payments","count":15},{"language":"pt-BR","tag":"Pagamentos","count":15},{"language":"en","tag":"Subscriptions","count":13},{"language":"en","tag":"Start Here","count":13},{"language":"pt-BR","tag":"Assinaturas","count":13},{"language":"pt-BR","tag":"Comece Aqui","count":13},{"language":"en","tag":"Webhooks","count":12},{"language":"pt-BR","tag":"Webhooks","count":12},{"language":"pt-BR","tag":"Transferências","count":10},{"language":"en","tag":"Legacy v1","count":9},{"language":"en","tag":"Front-end","count":9},{"language":"pt-BR","tag":"Legado v1","count":9},{"language":"pt-BR","tag":"Frontend","count":9},{"language":"en","tag":"Transactions","count":8},{"language":"pt-BR","tag":"Transações","count":8},{"language":"en","tag":"Resources","count":7},{"language":"en","tag":"Examples","count":7},{"language":"pt-BR","tag":"Recursos","count":7}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":":root{--pagou-ink: #0f172a;--pagou-mint: #07c983;--pagou-emerald: #16a34a;--pagou-forest: #14532d;--pagou-sand: #f8fafc;--pagou-border: rgba(15, 23, 42, 0.08)}.hero-shell{background:radial-gradient(circle at 18% 12%, rgba(7, 201, 131, 0.16), transparent 26%),\n\t\tradial-gradient(circle at 88% 10%, rgba(25, 135, 84, 0.12), transparent 22%),\n\t\tradial-gradient(circle at 50% 100%, rgba(22, 163, 74, 0.16), transparent 36%),\n\t\tlinear-gradient(180deg, rgba(8, 18, 14, 0.98) 0%, rgba(4, 12, 10, 0.96) 100%);border:1px solid rgba(52, 211, 153, 0.16);border-radius:28px;box-shadow:0 24px 80px rgba(2, 6, 23, 0.42);overflow:hidden;padding:2.4rem;position:relative}.hero-shell::after{background:radial-gradient(circle at 20% 100%, rgba(8, 201, 131, 0.12), transparent 26%),\n\t\tradial-gradient(circle at 70% 100%, rgba(163, 230, 53, 0.12), transparent 24%);bottom:-18%;content:\"\";height:54%;left:-6%;position:absolute;right:-6%}.hero-content{position:relative;z-index:1}.hero-kicker{color:#7ee7b8;font-size:0.8rem;font-weight:700;letter-spacing:0.14em;text-transform:uppercase}.hero-grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit, minmax(220px, 1fr))}.hero-panel{background:rgba(11, 24, 20, 0.76);border:1px solid rgba(52, 211, 153, 0.16);border-radius:18px;padding:1rem;backdrop-filter:blur(16px);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.03)}.hero-shell h1,.hero-shell p,.hero-shell strong{color:rgba(241, 245, 249, 0.96)}.home-section{margin-top:2.4rem}.checklist-band{background:linear-gradient(90deg, rgba(20, 83, 45, 0.95), rgba(22, 163, 74, 0.92));border-radius:22px;color:white;padding:1.25rem 1.5rem}.checklist-band strong,.checklist-band code{color:white}.doc-note-grid{display:grid;gap:0.8rem;grid-template-columns:repeat(auto-fit, minmax(180px, 1fr))}.doc-note{background:linear-gradient(180deg, rgba(7, 201, 131, 0.08), rgba(22, 163, 74, 0.02));border:1px solid rgba(7, 201, 131, 0.16);border-radius:18px;padding:1rem}.legacy-banner{background:linear-gradient(90deg, rgba(127, 29, 29, 0.08), rgba(180, 83, 9, 0.08));border:1px solid rgba(180, 83, 9, 0.18);border-radius:18px;padding:1rem 1.1rem}.status-table strong{color:var(--pagou-ink)}"}],"page":{"pagePath":"start-here/ai-integration","slug":"/start-here/ai-integration","pageMetadata":{"title":"AI-Assisted Integration","icon":"bot","sidebarTitle":"AI-Assisted Integration","description":"Give AI coding agents the right Pagou docs context before they generate integration code.","href":"/start-here/ai-integration"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Give AI coding agents the right Pagou docs context before they generate integration code.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,Card,CardGroup,CodeBlock,Heading,Tab,Tabs}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Copy this prompt into any AI coding agent:`}),`\n`,_jsx(CodeBlock,{filename:`Pagou AI Context`,numberOfLines:`22`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`22`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`You are a senior engineer building a production Pagou integration.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Sources of truth:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Fast docs: https://developer.pagou.ai/llms.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Full docs: https://developer.pagou.ai/llms-full.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- OpenAPI v2: https://developer.pagou.ai/api-reference/openapi-v2.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Base URLs: https://api.pagou.ai and https://api.sandbox.pagou.ai`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Rules:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Keep Pagou secret keys server-side only. Use env vars.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Validate endpoints, fields, statuses, and webhook shapes against OpenAPI before coding.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Do not invent undocumented endpoints, fields, or flows.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Amounts in API v2 are in cents.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Always include external_ref and idempotency on writes.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Use Payment Element / SDK v3 for cards. Send only pgct_ tokens to the backend.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Implement real webhooks, deduplicate by top-level event id, and process async.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Route payments by event=transaction + data.event_type.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Route subscriptions by event=subscription + data.event_type.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Route transfers by top-level type.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Fulfill orders, access, and payout state only from webhook-confirmed or server-reconciled state.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Use GET polling only for reconciliation, support, or recovery. Never use polling as the main integration flow.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`docs-reference`,children:`Docs reference`}),`\n`,_jsxs(CardGroup,{cols:3,children:[_jsx(Card,{title:`Fast routing`,icon:`list`,href:`https://developer.pagou.ai/llms.txt`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`llms.txt`}),` — find the right page quickly`]})}),_jsx(Card,{title:`Full context`,icon:`file-text`,href:`https://developer.pagou.ai/llms-full.txt`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`llms-full.txt`}),` — complete offline docs`]})}),_jsx(Card,{title:`Schema truth`,icon:`braces`,href:`https://developer.pagou.ai/api-reference/openapi-v2.json`,children:_jsx(_components.p,{children:`OpenAPI — endpoints, fields, webhooks`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`setup-by-agent`,children:`Setup by agent`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Claude Code`,id:`claude-code`,children:[_jsxs(_components.p,{children:[`Add to `,_jsx(_components.code,{children:`CLAUDE.md`}),` in project root:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#569CD6`,\"--shiki-dark-font-weight\":`bold`},children:`## Pagou Integration`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Sources of truth: https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Keep Pagou secret keys server-side only and use env vars`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Validate endpoints, fields, statuses, and webhooks against OpenAPI; do not invent undocumented fields`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Amounts in API v2 are in cents`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Always include external_ref and idempotency on writes`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Use Payment Element / SDK v3 for cards and send only pgct_ tokens to the backend`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Implement real webhooks, deduplicate by top-level id, process async, and avoid polling as the main flow`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Fulfill orders, subscriptions, and transfers only from webhook-confirmed or server-reconciled state`})]}),`\n`]})})}),_jsx(_components.p,{children:_jsx(_components.a,{href:`/start-here/claude-md-template`,children:`Full CLAUDE.md template`})})]}),_jsxs(Tab,{title:`Codex`,id:`codex`,children:[_jsxs(_components.p,{children:[`Add to `,_jsx(_components.code,{children:`AGENTS.md`}),` in project root:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#569CD6`,\"--shiki-dark-font-weight\":`bold`},children:`## Pagou Integration`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Sources of truth: https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Keep Pagou secret keys server-side only and use env vars`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Validate endpoints, fields, statuses, and webhooks against OpenAPI; do not invent undocumented fields`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Amounts in API v2 are in cents`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Always include external_ref and idempotency on writes`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Use Payment Element / SDK v3 for cards and send only pgct_ tokens to the backend`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Implement real webhooks, deduplicate by top-level id, process async, and avoid polling as the main flow`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Fulfill orders, subscriptions, and transfers only from webhook-confirmed or server-reconciled state`})]}),`\n`]})})}),_jsx(_components.p,{children:`Or run with inline context:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`codex`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json. Build Pix checkout with backend-only Pagou calls, external_ref, webhook endpoint, event dedupe, and GET only for reconciliation.\"`})]}),`\n`]})})})]}),_jsxs(Tab,{title:`Cursor`,id:`cursor`,children:[_jsxs(_components.p,{children:[`Add to `,_jsx(_components.code,{children:`.cursorrules`}),` in project root:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#569CD6`,\"--shiki-dark-font-weight\":`bold`},children:`## Pagou Integration`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Sources of truth: https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Keep Pagou secret keys server-side only and use env vars`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Validate endpoints, fields, statuses, and webhooks against OpenAPI; do not invent undocumented fields`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Amounts in API v2 are in cents`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Always include external_ref and idempotency on writes`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Use Payment Element / SDK v3 for cards and send only pgct_ tokens to the backend`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Implement real webhooks, deduplicate by top-level id, process async, and avoid polling as the main flow`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#6796E6`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Fulfill orders, subscriptions, and transfers only from webhook-confirmed or server-reconciled state`})]}),`\n`]})})}),_jsx(_components.p,{children:_jsx(_components.a,{href:`/start-here/cursorrules-template`,children:`Full .cursorrules template`})})]}),_jsxs(Tab,{title:`Copilot / Windsurf`,id:`copilot-%2F-windsurf`,children:[_jsx(_components.p,{children:`Paste the Pagou AI Context prompt above at the start of your chat, then ask your question. Require the agent to implement real webhooks, deduplicate events, keep secrets server-side, and avoid polling as the primary integration flow.`}),_jsxs(_components.p,{children:[`If the agent can’t fetch URLs, paste the relevant section from `,_jsx(_components.a,{href:`https://developer.pagou.ai/llms-full.txt`,children:`llms-full.txt`}),` directly.`]})]}),_jsxs(Tab,{title:`Lovable / Bolt`,id:`lovable-%2F-bolt`,children:[_jsx(_components.p,{children:`Start with this as your first message. It is strict on backend boundaries, webhooks, and documented API fields:`}),_jsx(CodeBlock,{filename:`Lovable Pagou Integration Prompt`,numberOfLines:`66`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`66`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`You are a senior engineer building a production Pagou integration inside Lovable.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Use only these Pagou sources of truth:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Full docs: https://developer.pagou.ai/llms-full.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- OpenAPI v2: https://developer.pagou.ai/api-reference/openapi-v2.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Production base URL: https://api.pagou.ai`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Sandbox base URL: https://api.sandbox.pagou.ai`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Scope:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Customers: create, list, and retrieve customers`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Transactions: Pix, voucher/local payment, card payment, list, retrieve, and refund`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Subscriptions: create, list, retrieve, update, and cancel recurring billing by card or Pix Automático`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Transfers: Pix Out creation, list, retrieve, and cancellation`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Webhooks: payment, subscription, and transfer events`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Frontend card flow: Payment Element / SDK v3 for secure tokenization`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Non-negotiable rules:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Never expose a Pagou secret API token in the browser.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- All Pagou API calls must run from a backend route, server function, or secure server action.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Use environment variables for credentials and base URL.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Use sandbox first. Keep the production switch configuration-only.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Use Payment Element / SDK v3 for card collection. Send only the `pgct_` token to the backend.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Never handle raw card numbers.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Amounts in Pagou API v2 are in cents. Example: BRL 49.00 = `4900`.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Always send a deterministic `external_ref` for creates and sensitive writes.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Use idempotency for creates, refunds, subscription actions, and transfers.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Do not invent endpoints, fields, statuses, or webhook shapes. Validate against OpenAPI first.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Webhook-first architecture:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Implement a real webhook endpoint, not only polling.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Return `2xx` quickly from the webhook endpoint.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Do not run slow application work before responding to the webhook.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Persist or enqueue the payload, then process it asynchronously.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Deduplicate by the top-level webhook `id`.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:'- Payment events use `event: \"transaction\"` and the concrete event in `data.event_type`.'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:'- Subscription events use `event: \"subscription\"` and the concrete event in `data.event_type`.'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Transfer events use the top-level `type`, such as `payout.transferred` or `payout.failed`.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Use GET polling only for reconciliation, support screens, or recovery after an uncertain state. Do not use polling as the main integration flow.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Fulfillment and state:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Never fulfill an order from a browser success message alone.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Fulfill Pix, voucher, and card orders only after `transaction.paid` or a reconciled paid state.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- For cards, handle `next_action` / 3DS when returned.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- For voucher/local payments, instructions may arrive in the create response or later by webhook.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- For subscriptions, use webhooks for created, started, renewed, updated, canceled, payment_failed, past_due, trial_will_end, and chargeback_received events.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- For transfers, use resource status for operational state and webhook events for transitions.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Error handling:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 4xx: fix the request or permissions. Do not retry automatically.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 409: reconcile the existing resource before creating another one.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 429, 5xx, timeout: retry with exponential backoff and jitter only when the write is idempotent.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"- Always log `requestId` when the API returns it.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Show safe user messages. Do not expose implementation details or secrets.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`When generating code:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Create a clear frontend + backend/server-function architecture.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Keep all Pagou secrets server-side.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Implement the webhook endpoint and event deduplication.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. Use webhook-confirmed or server-reconciled state for final business actions.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`5. Include required environment variables.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`6. Cite the endpoint used for each flow.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`7. Validate request and response fields against the OpenAPI.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"8. If a behavior is not documented, say it is not documented and suggest contacting Pagou support with the `requestId`.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Build: [describe the app and the Pagou flows you need]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsxs(_components.p,{children:[`Replace `,_jsx(_components.code,{children:`[describe your app]`}),` with what you want to build.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`one-shot-prompts`,children:`One-shot prompts`}),`\n`,_jsx(_components.p,{children:`Copy any of these directly into your AI agent:`}),`\n`,_jsx(Accordion,{title:`Pix checkout`,id:`pix-checkout`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Build a Pix checkout flow:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Backend/server function only: POST /v2/transactions with method=pix, amount in cents, and external_ref`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Frontend: display only buyer-facing Pix fields returned by the backend`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Webhook: implement POST /webhooks/pagou, deduplicate by top-level id, route event=transaction by data.event_type`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. Fulfillment: update the order only after transaction.paid or a reconciled paid state`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`5. Reconciliation: use GET /v2/transactions/{id} only for recovery/support, not as the main flow`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Use env vars for API keys. Never expose Pagou credentials in frontend. Validate all fields against OpenAPI.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})}),`\n`,_jsx(Accordion,{title:`Card checkout`,id:`card-checkout`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Build a card checkout flow:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Frontend: load Payment Element from https://js.pagou.ai/payments/v3.js and mount hosted card fields`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. On submit: call elements.submit(), then send only the pgct_ token to the backend`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Backend/server function only: POST /v2/transactions with method=credit_card, amount in cents, token, installments, and external_ref`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. 3DS: if the backend response has next_action, continue the challenge through the SDK flow`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`5. Webhook: route event=transaction by data.event_type and update order state only after webhook or server reconciliation`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`6. Reconciliation: use GET /v2/transactions/{id} only after uncertain browser/network state`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Use env vars for API keys. Never expose secrets or handle raw card numbers. Validate all fields against OpenAPI.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})}),`\n`,_jsx(Accordion,{title:`Checkout link`,id:`checkout-link`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Build a checkout link flow (Pagou-hosted checkout — no card handling on your side):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Backend/server function only: POST /v2/checkout-links with an Authorization: Bearer \u003cAPI key>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Body — products: { \"currency\": \"BRL\", \"title\": \"\u003corder>\", \"products\": [{ \"external_id\": \"\u003cyour id>\", \"name\": \"\u003cname>\", \"price\": \u003ccents>, \"quantity\": \u003cn> }] }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Body — value-only: { \"currency\": \"BRL\", \"amount\": \u003ccents> }. Send EITHER products OR amount, never both.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. external_id is your own product id; re-sending the same id updates that product (no duplicates).`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`5. Response is { \"data\": { \"url\": \"\u003ccheckout url>\" } } — redirect the buyer to data.url.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`6. Fulfillment: update the order only after the transaction webhook (event=transaction, data.event_type) confirms payment — not on redirect.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Prices/amount are integers in cents. Keep the API key server-side (env var), never in the browser. Validate all fields against OpenAPI.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})}),`\n`,_jsx(Accordion,{title:`Subscription billing`,id:`subscription-billing`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Build a subscription billing flow:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Backend/server function only: create or retrieve the customer with /v2/customers`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Frontend: use Payment Element in subscription mode and send only the pgct_ token to the backend`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Backend: POST /v2/subscriptions with customer_id, token, amount in cents, interval, interval_count, external_ref/metadata if needed`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` For Pix Automático instead: skip step 2, send payment_method \"pix_automatic\" without token, and show the returned authorization.qr_code to the payer`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. Webhook: implement POST /webhooks/pagou, deduplicate by top-level id, route event=subscription by data.event_type`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`5. State: grant or remove access from subscription status and subscription webhooks, not browser state`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`6. Reconciliation: use GET /v2/subscriptions/{id} only for recovery/support or uncertain state`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Handle subscription.created, subscription.started, subscription.renewed, subscription.updated, subscription.canceled, subscription.payment_failed, subscription.past_due, subscription.unpaid, subscription.trial_will_end, and subscription.chargeback_received.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Use env vars for API keys. Never expose Pagou credentials in frontend. Validate all fields against OpenAPI.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})}),`\n`,_jsx(Accordion,{title:`Webhook handler`,id:`webhook-handler`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Build a webhook endpoint:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. POST /webhooks/pagou - accept JSON body and return 200 with {\"received\": true} quickly`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Persist or enqueue the raw payload before async processing`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. Deduplicate by top-level \"id\" field (same event can be sent multiple times)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. Route payment events by event=transaction and data.event_type`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`5. Route subscription events by event=subscription and data.event_type`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`6. Route transfer events by top-level type, such as payout.transferred, payout.failed, payout.rejected, payout.canceled`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`7. Run slow application work in a background job, not before the HTTP response`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Store processed event IDs to prevent duplicate processing. Do not use polling as the primary state update path.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})}),`\n`,_jsx(Accordion,{title:`Pix payout`,id:`pix-payout`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Read https://developer.pagou.ai/llms-full.txt and https://developer.pagou.ai/api-reference/openapi-v2.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Build a Pix Out transfer flow:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`1. Backend/server function only: POST /v2/transfers with recipient Pix data, amount in cents, and external_ref`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`2. Webhook: route transfer events by top-level type, including payout.transferred, payout.failed, payout.rejected, and payout.canceled`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`3. State: update payout status from webhook/resource status, not frontend polling`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`4. Reconciliation: use GET /v2/transfers/{id} only if webhook processing is delayed or uncertain`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`5. Cancellation: POST /v2/transfers/{id}/cancel only when the current resource status allows it`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Use env vars for API keys. Never expose Pagou credentials in frontend. Validate all fields against OpenAPI.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`tips-for-agents`,children:`Tips for agents`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Security`,icon:`shield`,children:_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Keep API keys server-side only, use env vars`}),`\n`,_jsx(_components.li,{children:`Never log card tokens or Pix keys`}),`\n`,_jsx(_components.li,{children:`Validate webhook source before processing`}),`\n`,_jsx(_components.li,{children:`Use HTTPS everywhere`}),`\n`]})}),_jsx(Card,{title:`Building`,icon:`hammer`,children:_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Test in sandbox first, same code works in prod`}),`\n`,_jsx(_components.li,{children:`Use ngrok to receive webhooks locally`}),`\n`,_jsx(_components.li,{children:`Always send external_ref for idempotency`}),`\n`,_jsx(_components.li,{children:`Reconcile with GET if webhook fails`}),`\n`]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`read-next`,children:`Read next`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/sdks/typescript/quickstart`,children:`TypeScript SDK Quickstart`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/payments/pix/accept-payments`,children:`Accept Pix Payments`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/webhooks/overview`,children:`Webhooks Overview`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"AI-Assisted Integration","icon":"bot","sidebarTitle":"AI-Assisted Integration","description":"Give AI coding agents the right Pagou docs context before they generate integration code.","href":"/start-here/ai-integration"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Docs reference","slug":"docs-reference","depth":2,"children":[]},{"title":"Setup by agent","slug":"setup-by-agent","depth":2,"children":[]},{"title":"One-shot prompts","slug":"one-shot-prompts","depth":2,"children":[]},{"title":"Tips for agents","slug":"tips-for-agents","depth":2,"children":[]},{"title":"Read next","slug":"read-next","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"pagouai","siteName":"Pagou Developer Docs","title":"AI-Assisted Integration - Pagou Developer Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/start-here/ai-integration","matchLevel":0},"pt-BR":{"href":"/pt/start-here/ai-integration","matchLevel":1}}},"lastModified":"2026-11-05T11:30:36.986Z","originalFileLocation":"start-here/ai-integration.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Give AI coding agents the right Pagou docs context before they generate integration code.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Pagou Developer Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pagouai/PlsMSqiZuXJsWwoT/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/pagouai/PlsMSqiZuXJsWwoT/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pagouai/PlsMSqiZuXJsWwoT/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pagouai/PlsMSqiZuXJsWwoT/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pagouai/PlsMSqiZuXJsWwoT/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pagouai/PlsMSqiZuXJsWwoT/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pagouai/PlsMSqiZuXJsWwoT/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pagouai/PlsMSqiZuXJsWwoT/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pagouai/PlsMSqiZuXJsWwoT/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"AI-Assisted Integration - Pagou Developer Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Give AI coding agents the right Pagou docs context before they generate integration code.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Pagou Developer Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developer.pagou.ai/start-here/ai-integration\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://pagouai.mintlify.site/_mintlify/api/og/v2?division=AI-Assisted+Integration\u0026amp;title=AI-Assisted+Integration\u0026amp;description=Give+AI+coding+agents+the+right+Pagou+docs+context+before+they+generate+integration+code.\u0026amp;theme=be5f6b4c2c97766dd572dfce\u0026amp;signature=c1db0f94c9e1072bc28f11ada0e37c230b2ec49a2d8daab2c7ccd6d7423e35a8\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"AI-Assisted Integration - Pagou Developer Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Give AI coding agents the right Pagou docs context before they generate integration code.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://pagouai.mintlify.site/_mintlify/api/og/v2?division=AI-Assisted+Integration\u0026amp;title=AI-Assisted+Integration\u0026amp;description=Give+AI+coding+agents+the+right+Pagou+docs+context+before+they+generate+integration+code.\u0026amp;theme=be5f6b4c2c97766dd572dfce\u0026amp;signature=c1db0f94c9e1072bc28f11ada0e37c230b2ec49a2d8daab2c7ccd6d7423e35a8\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/pagouai/PlsMSqiZuXJsWwoT/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Pagou Developer Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#198754\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developer.pagou.ai/start-here/ai-integration\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/start-here/ai-integration.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://developer.pagou.ai/start-here/ai-integration\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"pt-BR\" href=\"https://developer.pagou.ai/pt/start-here/ai-integration\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://developer.pagou.ai/start-here/ai-integration\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developer.pagou.ai/#organization\",\"name\":\"Pagou Developer Docs\",\"url\":\"https://developer.pagou.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/pagouai/G-8AHDSd0H3lSbe_/logo/logo-long.webp?fit=max\u0026auto=format\u0026n=G-8AHDSd0H3lSbe_\u0026q=85\u0026s=f29ebde8b8d8c96183843fc8bc58e508\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developer.pagou.ai#website\",\"name\":\"Pagou Developer Docs\",\"url\":\"https://developer.pagou.ai\",\"publisher\":{\"@id\":\"https://developer.pagou.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developer.pagou.ai/start-here/ai-integration#webpage\",\"url\":\"https://developer.pagou.ai/start-here/ai-integration\",\"name\":\"AI-Assisted Integration\",\"description\":\"Give AI coding agents the right Pagou docs context before they generate integration code.\",\"dateModified\":\"2026-11-05T11:30:36.986Z\",\"isPartOf\":{\"@id\":\"https://developer.pagou.ai#website\"},\"breadcrumb\":{\"@id\":\"https://developer.pagou.ai/start-here/ai-integration#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developer.pagou.ai/start-here/ai-integration#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Pagou Developer Docs\",\"item\":\"https://developer.pagou.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI-Assisted Integration\",\"item\":\"https://developer.pagou.ai/start-here/ai-integration\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://developer.pagou.ai/start-here/ai-integration#article\",\"headline\":\"AI-Assisted Integration\",\"name\":\"AI-Assisted Integration\",\"description\":\"Give AI coding agents the right Pagou docs context before they generate integration code.\",\"url\":\"https://developer.pagou.ai/start-here/ai-integration\",\"mainEntityOfPage\":{\"@id\":\"https://developer.pagou.ai/start-here/ai-integration#webpage\"},\"dateModified\":\"2026-11-05T11:30:36.986Z\",\"publisher\":{\"@id\":\"https://developer.pagou.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://developer.pagou.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Pagou Developer Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Pagou Developer Docs","nav":{"global":{"anchors":[{"anchor":"AI Integration","icon":"bot","href":"/start-here/ai-integration"},{"anchor":"API status","href":"https://status.pagou.ai"},{"anchor":"GitHub","href":"https://github.com/pagouai"}]},"languages":[{"language":"en","default":true,"tabs":[{"tab":"Start Here","icon":"rocket","groups":[{"group":"Getting Started","pages":[{"title":"Pagou Developer Docs","icon":"house","sidebarTitle":"Home","mode":"wide","href":""},{"title":"Overview","icon":"map","href":"/start-here/overview"},{"title":"Quickstart","icon":"rocket","href":"/start-here/quickstart"},{"title":"Environments","icon":"server","href":"/start-here/environments"},{"title":"Authentication","icon":"key-round","href":"/start-here/authentication"},{"title":"Test Data","icon":"flask-conical","href":"/start-here/test-data"}]},{"group":"Going to Production","pages":[{"title":"Idempotency","icon":"fingerprint","href":"/start-here/idempotency"},{"title":"Errors and Retries","icon":"triangle-alert","href":"/start-here/errors-and-retries"},{"title":"Webhook Fundamentals","icon":"webhook","href":"/start-here/webhooks"},{"title":"Go-live Checklist","icon":"list-checks","description":"Use this production checklist before you switch a Pagou integration from sandbox to live traffic.","href":"/start-here/go-live-checklist"}]},{"group":"AI-Assisted Integration","pages":[{"title":"AI-Assisted Integration","icon":"bot","sidebarTitle":"AI-Assisted Integration","href":"/start-here/ai-integration"},{"title":"CLAUDE.md Template","icon":"file-text","sidebarTitle":"CLAUDE.md Template","description":"Copy this CLAUDE.md file to give Claude Code full context for Pagou integrations.","href":"/start-here/claude-md-template"},{"title":".cursorrules Template","icon":"file-cog","sidebarTitle":".cursorrules Template","href":"/start-here/cursorrules-template"}]}]},{"tab":"Payments","icon":"wallet","pages":[{"title":"Payments","href":"/payments/overview"}]},{"tab":"Subscriptions","icon":"repeat","pages":[{"title":"Subscriptions","href":"/subscriptions/overview"}]},{"tab":"Payouts","icon":"arrow-left-right","pages":[{"title":"Payouts","href":"/payouts/pix-out/overview"}]},{"tab":"Webhooks","icon":"webhook","pages":[{"title":"Webhooks","href":"/webhooks/overview"}]},{"tab":"Front-end","icon":"monitor-smartphone","pages":[{"title":"Front-end","href":"/frontend/payment-element/overview"}]},{"tab":"SDKs","icon":"code-xml","pages":[{"title":"SDKs","href":"/sdks/typescript/quickstart"}]},{"tab":"Examples","icon":"code","pages":[{"title":"Examples","href":"/examples/overview"}]},{"tab":"API Reference","icon":"file-code-2","pages":[{"title":"API Reference","href":"/api-reference/customers/reference"}]},{"tab":"Resources","icon":"library-big","pages":[{"title":"Resources","href":"/changelog"}]}]},{"language":"pt-BR","pages":[{"title":"pt-BR","href":"/pt/start-here/ai-integration"}]}]},"basePath":"","title":"AI-Assisted Integration - Pagou Developer Docs","buildId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","deploymentId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","dynamics":[],"chunks":[]}