ZentraPay Developer Hub

Build fast, secure, and reliable payment experiences with our modern redirect API. ZentraPay provides a clean, simple, and scalable workflow for global payments.

Fast Integration

Accept payments with a single API call and redirect flow.

Bank-Level Security

Encryption, signed webhooks, and secure token validation.

Multi-Currency

Support for crypto, fiat, wallets, and bank transfer.

Authentication

Each request to ZentraPay requires your API Key. Never expose your secret key on the frontend.

Authorization: Bearer YOUR_SECRET_API_KEY

Store your API key in environment variables:

NEXT_PUBLIC_ZENTRAPAY_KEY=your_public_key
ZENTRAPAY_SECRET_KEY=your_secret_key

Redirect Payment Flow

1

Client requests payment

2

Backend sends request to NOWPayments

3

NOWPayments returns invoice_url

4

Customer is redirected to checkout

5

NOWPayments processes the payment

6

Webhook notifies ZentraPay backend

7

ZentraPay updates your system

Create Payment Request

POST /api/create

{
  "amount": 100,
  "currency": "usd",
  "description": "Test Payment",
  "success_url": "https://yourdomain.com/success",
  "cancel_url": "https://yourdomain.com/cancel"
}

Frontend Redirect Example

const res = await fetch("/api/create", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    amount: 50,
    currency: "usd",
    description: "Card Payment",
  }),
});

const data = await res.json();
window.location.href = data.invoice_url;

SDK & Client Libraries

Integrate ZentraPay using any environment:

npm install zentrapay-sdk
import ZentraPay from "zentrapay-sdk";

const client = new ZentraPay("YOUR_SECRET_API_KEY");

const payment = await client.createPayment({
  amount: 100,
  currency: "usd",
  description: "Example Order",
});

console.log(payment.invoice_url);

Webhooks

Webhooks notify your server when a payment succeeds, fails, or expires.

POST /webhook

{
  "payment_id": "0821s-12ab",
  "status": "finished",
  "amount": 100,
  "currency": "usd"
}

Error Handling

Standard error responses look like this:

{
  "error": true,
  "message": "Invalid API key"
}

Rate Limits

You can make up to 600 requests/minute.
Contact support for higher limits.