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.com

Create Endpoint

POST /v1/payment/create

Verify Endpoint

POST /v1/payment/verify

Preferred Auth

zini-api-key

Overview

ZiniPay exposes two external APIs for sandbox testing: Create Invoice and Verify Invoice.

How to get your API key

  1. Login to your sandbox dashboard.
  2. Navigate to the Main Menu.
  3. Select Brands.
  4. Copy your Brand Key / API Key.

Sandbox test API key

sandbox_test_8f4c9a2e7b31

Authentication

Every request must include your API key to authenticate securely.

MethodValueNotes
Preferred headerzini-api-key: sandbox_test_8f4c9a2e7b31Recommended
Also supported headerzinipay-api-key: sandbox_test_8f4c9a2e7b31Supported
Query parameter?apikey=sandbox_test_8f4c9a2e7b31Supported

Endpoints

NameMethodPathPurpose
Create InvoicePOST/v1/payment/createCreate a hosted invoice and return payment_url.
Verify InvoicePOST/v1/payment/verifyVerify 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.

POSThttps://api.zinipay.com/v1/payment/create

Required headers

  • Content-Type: application/json
  • zini-api-key: sandbox_test_8f4c9a2e7b31

Request fields

FieldTypeRequiredDescription
cus_namestringNoCustomer name.
cus_emailstringNoCustomer email.
amountnumberYesInvoice amount, must be greater than 0.
metadataobjectNoJSON metadata up to 1 KB.
redirect_urlstringYesSuccess redirect URL.
cancel_urlstringNoCancel redirect URL.
webhook_urlstringNoWebhook 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.

POSThttps://api.zinipay.com/v1/payment/verify

Request fields

FieldTypeRequiredDescription
invoice_idstringYesInvoice 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

PENDINGCOMPLETEDFAILED

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=true

Recommended merchant flow

  1. 1Create order
  2. 2Create invoice
  3. 3Redirect user
  4. 4Receive callback
  5. 5Verify invoice
  6. 6If completed, mark paid
  7. 7If pending, retry
  8. 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.

Download PDF

Apps and Plugins

ZiniPay provides Android apps, WordPress plugins, SDKs, and ready-made modules to help you integrate faster.

View all modules
Play Store

ZiniPay Play Store App

Experience smoother performance and regular updates from the official Play Store app.

Get on Play Store
v3.0

ZiniPay App v3.0

ZiniPay mobile app v3.0 for Android devices. Default SMS app for nonstop background connection.

Download App
v0

WordPress Plugin v0

Works with partial or advanced WordPress payment integrations for ZiniPay.

Download
API 3.1

WordPress API 3.1 Plugin

Easy integration with WordPress sites using API v3.1 for ZiniPay (Backup Server).

Download
WHMCS

WHMCS Module

Easy integration with WHMCS sites. Add ZiniPay payment gateway to your WHMCS store.

Download
Perfex

Perfex CRM Plugin

Seamlessly accept payments in your Perfex CRM with ZiniPay payment gateway.

Download

Advanced 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.

Two-step verify + confirmDouble-spend protectionMasked sender on verifyAtomic credit deduction

Endpoint Group

/api/trx/*

Best For

Merchant backend verification and secure payment confirmation

Open transaction docs