Prefer a direct API integration (submitting the payment straight through the API)? Check out
Transactions after finishing this guide.
Prerequisites
- A Z2Pay account with access to the test environment (sandbox). See Environments.
- Your sandbox API key (
z2_chk_sk_...orz2_psp_sk_...). See Authentication.
Create a checkout link
A Checkout Link is a reusable billing template. Every time someone opens the URL, a new
purchase (Session) is created.Response (
201):Open the URL and pay with a test card
Open the returned
url in your browser. You will see Z2Pay’s hosted payment page.Use the generator below to create a valid card number that will be approved:→ Generate a test cardFill in:- Number: the generated card (scenario “Approved”).
- Expiry: any future date, e.g.
12/30. - CVV: any value, e.g.
123. - Name / buyer details: any valid value.
Confirm the payment
After the payment, look up the transaction via the API. The Response (
referenceCode/id appears in
webhooks and in the checkout response.200):status: "paid" — payment approved in the sandbox. 🎉(Recommended) Receive webhooks
In production you don’t poll for status — you receive a notification on every status change.
Register a webhook and listen for events such as See Webhooks for the full event catalog and instructions on how to
validate the signature.
transaction.paid:Next steps
Test cards and scenarios
Every card that passes and every card that fails, with a built-in generator.
Direct API (Transactions)
Create and process payments without the hosted checkout.
Subscriptions
Recurring billing, plans, and invoices.
Payment splits
Divide a payment amount among multiple recipients.

