ZiniPay Sandbox
Create invoices & verify status
This documentation covers the essential Create Invoice and Verify Invoice endpoints for merchant and partner developers. Follow the instructions to test transactions securely.
Base URL
https://api.zinipay.comCreate Endpoint
POST /v1/payment/createVerify Endpoint
POST /v1/payment/verifyPreferred Auth
zini-api-keyOverview
ZiniPay exposes two external APIs for sandbox testing: Create Invoice and Verify Invoice.
How to get your API key
- Login to your sandbox dashboard.
- Navigate to the Main Menu.
- Select Brands.
- Copy your Brand Key / API Key.
Sandbox test API key
sandbox_test_8f4c9a2e7b31Authentication
Every request must include your API key to authenticate securely.
| Method | Value | Notes |
|---|---|---|
Preferred header | zini-api-key: sandbox_test_8f4c9a2e7b31 | Recommended |
Also supported header | zinipay-api-key: sandbox_test_8f4c9a2e7b31 | Supported |
Query parameter | ?apikey=sandbox_test_8f4c9a2e7b31 | Supported |
Endpoints
| Name | Method | Path | Purpose |
|---|---|---|---|
Create Invoice | POST | /v1/payment/create | Create a hosted invoice and return payment_url. |
Verify Invoice | POST | /v1/payment/verify | Verify invoice payment status. |
Common rules
- Set Content-Type to application/json.
- Every request must include an API key.
- Only active brands are allowed.
- redirect_url domain must match the brand website domain.
- amount must be greater than 0.
- metadata must be valid JSON and stay within 1 KB.
Create Invoice
Create a hosted invoice and receive the secure payment URL to redirect your customers.
https://api.zinipay.com/v1/payment/createRequired headers
Content-Type: application/jsonzini-api-key: sandbox_test_8f4c9a2e7b31
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
cus_name | string | No | Customer name. |
cus_email | string | No | Customer email. |
amount | number | Yes | Invoice amount, must be greater than 0. |
metadata | object | No | JSON metadata up to 1 KB. |
redirect_url | string | Yes | Success redirect URL. |
cancel_url | string | No | Cancel redirect URL. |
webhook_url | string | No | Webhook callback URL. |
Request examples
curl -X POST "https://api.zinipay.com/v1/payment/create" \
-H "Content-Type: application/json" \
-H "zini-api-key: sandbox_test_8f4c9a2e7b31" \
-d '{
"cus_name": "John Doe",
"cus_email": "[email protected]",
"amount": 1200,
"metadata": {
"order_id": "ORD-1001",
"customer_id": "CUS-9001"
},
"redirect_url": "https://merchant.com/payment/success",
"cancel_url": "https://merchant.com/payment/cancel",
"webhook_url": "https://merchant.com/api/zinipay/webhook"
}'Success response
{
"status": true,
"message": "Invoice created successfully.",
"payment_url": "https://secure.zinipay.com/payment/INVOICE_ID"
}Verify Invoice
Verify the latest payment status directly from your backend before processing the order.
https://api.zinipay.com/v1/payment/verifyRequest fields
| Field | Type | Required | Description |
|---|---|---|---|
invoice_id | string | Yes | Invoice reference to verify. |
Request examples
curl -X POST "https://api.zinipay.com/v1/payment/verify" \
-H "Content-Type: application/json" \
-H "zini-api-key: sandbox_test_8f4c9a2e7b31" \
-d '{
"invoice_id": "INVOICE_ID"
}'Success response
{
"cus_name": "John Doe",
"cus_email": "[email protected]",
"amount": 1200,
"invoice_id": "INVOICE_ID",
"payment_method": "bkash",
"transaction_id": "TXN123456789",
"status": "COMPLETED"
}Status values
Recommendation
Always verify the invoice from your backend using this endpoint before fulfilling any order, delivering digital services, or sending a "Received Payment" notification.
Webhook Callback Flow
If webhook_url is sent during invoice creation, ZiniPay will automatically call it after a successful payment update.
Webhook payload
JSON Body / Query
{
"invoice_id": "INVOICE_ID",
"status": "true"
}Query parameter style
https://merchant.com/api/zinipay/webhook?invoice_id=INVOICE_ID&status=trueRecommended merchant flow
- 1Create order
- 2Create invoice
- 3Redirect user
- 4Receive callback
- 5Verify invoice
- 6If completed, mark paid
- 7If pending, retry
- 8If failed, cancel order
Production Checklist
Before deploying to your live environment, verify these final steps to ensure a smooth transition.
API key stored in environment variables
HTTPS enabled
Redirect domain matched
Backend verification added
Logging enabled
Webhook secured
Need the original PDF?
Download the full API documentation for offline use and sharing.
Apps and Plugins
ZiniPay provides Android apps, WordPress plugins, SDKs, and ready-made modules to help you integrate faster.
ZiniPay Play Store App
Experience smoother performance and regular updates from the official Play Store app.
Get on Play StoreZiniPay App v3.0
ZiniPay mobile app v3.0 for Android devices. Default SMS app for nonstop background connection.
Download AppWordPress Plugin v0
Works with partial or advanced WordPress payment integrations for ZiniPay.
DownloadWordPress API 3.1 Plugin
Easy integration with WordPress sites using API v3.1 for ZiniPay (Backup Server).
DownloadWHMCS Module
Easy integration with WHMCS sites. Add ZiniPay payment gateway to your WHMCS store.
DownloadPerfex CRM Plugin
Seamlessly accept payments in your Perfex CRM with ZiniPay payment gateway.
DownloadAdvanced APIBeta
Transaction Verification API
Need backend-side payment verification with masked sender data, credit deduction, and irreversible confirmation? Use our advanced two-step transaction verification flow.
Endpoint Group
/api/trx/*Best For
Merchant backend verification and secure payment confirmation