Skip to main content
Use this endpoint to create a hosted checkout link from your backend or a no-code/AI tool, the same way you create transactions. The API key selects the authenticated account, and the response contains the final checkout URL.

Happy path

  1. Call POST /v2/checkout-links with your API key.
  2. Send either products[] (referenced by your own external_id) or a value-only amount.
  3. Pagou upserts each product by external_id, builds the link, and attaches the account’s active payment methods plus any eligible order bump / upsell automatically.
  4. Use the returned data.url — it already carries your custom domain when one is active.

Authentication

Send your secret API key as a Bearer token (same key used for transactions):
The x-api-key: YOUR_API_KEY header is also accepted.

Products by external_id (upsert)

Each item in products[] is keyed by external_id — your own identifier for the product. Pagou upserts that identifier within the authenticated account on every call:
  • First time: creates the product in your catalog (origin = api).
  • Next times: reuses the same product and updates its name/price/fields from the payload (reviving it if it was archived). It never duplicates.
external_id is the only product identifier your integration needs to send.
Prices are integers in cents (7990 = R$ 79.90). Re-sending the same external_id overwrites the product’s name, price, description and image from the payload, so always send the full product state you want.

Example request — products

Omit products and send amount (in cents) to generate a quick, value-only link. title is optional — when absent it is auto-generated.
Send either products or amount — not both, and not neither.

Example response

Request fields

Common error

Status 422 — neither amount nor products was provided (or both were):

Use with AI

Paste this into Claude Code, Cursor, Codex, Copilot, Lovable, Bolt, or any AI coding agent:

Notes

  • Payment methods come from the account’s enabled methods — you don’t pass them.
  • Order bumps and upsells eligible for the products are attached automatically.
  • Custom domain is applied to the returned URL when the account has one active.
  • Out of scope (v1): product variants by external_id, subscriptions/recurring, and updating or listing links via the API.

Next steps

Runnable examples

See working, testable code for this flow in the Checkout Links examples — runnable in seven languages against the sandbox.