All examples in this section use the sandbox URLs
(
https://checkout-api.sandbox.z2pay.com for the API and https://pay.sandbox.z2pay.com for the
page). In production, switch to https://checkout-api.z2pay.com and https://pay.z2pay.com.What you do NOT need to implement
Payment page (UI)
The checkout interface is ours — responsive and branded with your identity.
Card tokenization (PCI)
Sensitive card data never touches your server.
PIX, boleto, and installments
All payment method logic is handled by us.
Routing between acquirers
Just register the gateway once in the dashboard.
Typical use cases
- Online store — create a
CheckoutSessionper order and redirect the customer. - Shareable payment link (Instagram bio, post, WhatsApp) — create a
CheckoutLink(persistent template) and share the URL. Each click generates a newCheckoutSession. - Individual charge — call
/checkout/charges(quick ad-hoc sale) and send the URL directly via WhatsApp or email. - Marketplace — use
splitsto automatically distribute the amount among multiple recipients.
Core concepts
CheckoutLink (persistent template) — chk_
CheckoutLink (persistent template) — chk_
A reusable billing template. You define it once (items, price, methods, branding) and share
the URL as many times as you want — each buyer access generates an independent
CheckoutSession.
IDs start with chk_.When to use: broadcasting a product/service, a “storefront” link for an Instagram bio,
a landing page, etc.CheckoutSession (purchase instance) — cs_
CheckoutSession (purchase instance) — cs_
A concrete purchase attempt. It has a frozen amount (snapshot of the Link at creation time),
a buyer (partial or complete), and a state that progresses:
created → opened →
paying → paid. IDs start with cs_ (48 hex chars = 192 bits of entropy, safe to expose
in URLs).Immutable snapshot
Immutable snapshot
When a Session is created from a Link, all data (items, price, splits, branding,
methods) is copied. Editing the Link afterwards does not affect already-created Sessions.
This ensures that what the buyer saw at the time of payment is exactly what they pay.
Ad-hoc Session / Charge
Ad-hoc Session / Charge
You are not required to create a Link first — you can create an “ad-hoc” Session (without a
linkId), with all configuration inline. Useful for one-off or custom charges. Charges are
a shortcut for this same flow, with a filtered listing that shows only Sessions without a
linkId.Tenant and prefixed IDs
Tenant and prefixed IDs
Every credential is tied to a tenant (your seller account). Listings are automatically
filtered by tenant — you never see resources from another seller. IDs follow the prefix pattern:
chk_ (Link), cs_ (Session), ci_ (item), cmed_ (media), rec_ (recipient for splits).Endpoint map
All seller requests use thex-api-key header. See Authentication.
Seller resources (authenticated)
| Method | Route | Resource | What it does |
|---|---|---|---|
POST | /checkout/links | Link | Creates a billing template |
GET | /checkout/links | Link | Lists templates (paginated) |
GET | /checkout/links/{id} | Link | Retrieves a template by ID |
PUT | /checkout/links/{id} | Link | Updates a template |
DELETE | /checkout/links/{id} | Link | Archives (soft-delete) a template |
POST | /checkout/sessions | Session | Creates a Session (from a Link or ad-hoc) |
GET | /checkout/sessions | Session | Lists Sessions (paginated) |
GET | /checkout/sessions/{id} | Session | Retrieves a Session by ID |
GET | /checkout/charges | Charge | Lists quick sales (ad-hoc Sessions) |
POST | /checkout/charges | Charge | Creates a quick ad-hoc sale |
GET | /checkout/charges/{id} | Charge | Retrieves a quick sale by ID |
POST | /checkout/charges/{id}/cancel | Charge | Cancels a quick sale |
Public endpoints (consumed by the buyer’s browser)
| Method | Route | What it does |
|---|---|---|
GET | /public/checkout/{id} | Retrieves the public config to render the page |
POST | /public/checkout/{id}/opened | Marks the Session as “opened by the buyer” |
POST | /public/checkout/{id}/confirm | Confirms payment (tokenId + buyer data) |
You typically do not call the public endpoints — they are called by the Z2Pay payment page.
They are documented in Buyer (public page) for transparency purposes,
or in case you want to build a custom checkout on top of our API.
Quickstart
In 3 steps, from zero to your first payment.Share the URL
The returned
url (https://pay.sandbox.z2pay.com/c/chk_abc123...) is the payment link. It can be
shared through any channel. Every time someone opens the link, a new CheckoutSession is
materialized automatically.Receive webhooks
Every relevant change (Session created, payment approved, etc.) triggers a webhook to the URL
configured in the dashboard. See Webhooks for the complete catalog of
checkout events.
Session states (summary)
See also
Checkout Links
Create and manage reusable billing templates.
Checkout Sessions
Purchase instances, states, and immutable snapshots.
Charges (quick sale)
Individual ad-hoc charge, without a Link.
Buyer (public page)
The endpoints consumed by the payment page.
Quickstart
Receive an end-to-end test payment.
Test cards
Approval and decline scenarios in the sandbox.

