ZiniPay Documentation

Introduction to ZiniPay

ZiniPay is a simple and secure payment automation tool designed to use personal accounts as a payment automation, allowing you to accept payments from customers through your website. This documentation provides a complete overview of how ZiniPay works and how you can integrate the ZiniPay API into your website.

API Introduction

ZiniPay Payment Automation enables Merchants to receive money from their customers by temporarily redirecting them to ZiNiPay.com. The gateway connects multiple payment terminals including card systems, mobile financial systems, and local and international wallets. After the payment is complete, the customer is returned to the merchant's site, and seconds later the Merchant receives notification about the payment along with the details of the transaction.

API Operation

REST APIs are supported in two environments. Use the Sandbox environment for testing purposes, then move to the live environment for production processing. When testing, generate an order URL with your test credentials to make calls to the Sandbox URIs. When you're set to go live, use the live credentials assigned to your new signature key to generate a live order URL to be used with the live URIs. Your server must support the cURL system.

Live API End Point (For Create Payment URL):

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

Create Payment Examples

The following examples show how to create a payment request with the ZiniPay API in various programming languages.

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.zinipay.com/v1/payment/create',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"redirect_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","webhook_url":"yourdomain.com/webhook","metadata":{"phone":"016****"},"amount":"10"}',
  CURLOPT_HTTPHEADER => array(
   'zini-api-key': 'YOUR_BRAND_API_KEY',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

Response Example

{
  "status": true,
  "message": "Payment URL generated successfully",
  "payment_url": "https://secure.zinipay.com/payment/abc123xyz456"
}

Required Parameters

ParameterDescriptionRequiredExample
amountThe payment amount in your currency (must be a positive number)Yes10.00
redirect_urlURL where customer will be redirected after successful paymentYeshttps://yourdomain.com/success
cancel_urlURL where customer will be redirected after cancellationYeshttps://yourdomain.com/cancel
cus_nameName of the customerOptionalJohn Doe
cus_emailEmail address of the customer (must be valid email format)Yes[email protected]
metadataExtra data (JSON format). Maximum size 1KB.Optional{"orderId": "12345"}
return_typeResponse return type (e.g., POST, GET)OptionalPOST
val_idValidation ID (if already generated in a previous step)Optionalval_123456
webhook_urlWebhook endpoint to receive payment status updatesYeshttps://yourdomain.com/webhook

Verify Payment

After a payment is completed, you might want to verify its status. ZiniPay provides an API endpoint to verify payment status using the transaction ID.

Payment Verify API:

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

Variables Needed For Payment Verification

Field NameDescriptionRequiredExample Values
val_idTransaction ID received as a query parameter from the success URL provided during payment creation.NoOVKPXW165414
invoiceIdTransaction ID received as a query parameter from the success URL provided during payment creation.Yes553ca0ac-28c0-41f7-adc0-6243710b1e1b
<?php
// Verify Payment Example
$apiKey = "YOUR_API_KEY";

// Initialize cURL session
$ch = curl_init();

// Transaction ID received from success URL
$invoiceId = $_GET['invoiceId']; 

// Prepare data for API request
$data = [
    'invoiceId' => $invoiceId,
    'apiKey' => $apiKey
];

// Configure cURL request
curl_setopt($ch, CURLOPT_URL, 'https://api.zinipay.com/v1/payment/verify');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'zini-api-key': 'YOUR_BRAND_API_KEY',
]);

// Execute request and get response
$response = curl_exec($ch);
curl_close($ch);

// Process the response
$paymentData = json_decode($response, true);

if ($paymentData && isset($paymentData['status']) && $paymentData['status'] === 'success') {
    // Payment is verified, process order
    echo "Payment verified successfully!";
    echo "Transaction ID: " . $paymentData['data']['transactionId'];
    echo "Amount: " . $paymentData['data']['amount'];
    // Update your database, fulfill the order, etc.
} else {
    // Payment verification failed
    echo "Payment verification failed: " . ($paymentData['message'] ?? 'Unknown error');
}
?>

Response Example

{
    "transaction_id": "OVKPXW135414",
    "invoiceId": "553ca0ac-28c0-41f7-adc0-6243910b1e1b",
    "amount": "900.00",
    "currency": "USD",
    "paymentMethod": "bkash",
    "status": "COMPLETED",
    "customerName": "John Doe",
    "customerEmail": "[email protected]",
    "metadata": {
      "orderId": "ORD-12345",
      "productId": "PROD-567"
    },
    "createdAt": "2023-09-15T14:23:45Z"
}

API Reference

Comprehensive documentation of all available ZiniPay API endpoints.

Payment Endpoints

  • POST/v1/payment/create
  • POST/v1/payment/verify

WordPress & WooCommerce Integration

ZiniPay offers a seamless integration with WordPress and WooCommerce, allowing you to accept payments in Bangladesh through bKash, Nagad, and Rocket with a simple plugin installation. Our automatic payment automation solution works with both merchant and personal accounts.

Features of ZiniPay WordPress Plugin

bKash Integration

Accept payments through bKash personal or merchant accounts with automatic transaction verification.

Nagad Integration

Process payments via Nagad personal accounts with automated payment confirmation.

Rocket Payment Automation

Accept Rocket payments through our automated system without manual verification.

WooCommerce Compatible

Fully compatible with WooCommerce for seamless e-commerce integration.

Installation Guide

1

Download the Plugin

Download the latest version of the ZiniPay WordPress plugin from the link above.

2

Install the Plugin

Login to your WordPress admin dashboard. Go to Plugins - Add New - Upload Plugin. Choose the downloaded ZIP file and click "Install Now".

3

Activate the Plugin

After installation, click "Activate Plugin" to enable ZiniPay on your WordPress site.

4

Configure Settings

Go to WooCommerce - Settings - Payments. Find "ZiniPay" and click "Manage". Enter your ZiniPay API credentials and customize settings according to your needs.

5

Enable Payment Methods

Choose which payment methods to enable (bKash, Nagad, Rocket) and save your settings.

Configuration Options

OptionDescriptionExample
Enable/DisableEnable ZiNiPayChecked (yes/no)
TitleThis controls the title which the user sees during checkout.ZiNiPay Gateway
DescriptionThis controls the description which the user sees during checkout.Pay securely with Bkash, Nagad, Rocket, and all BD gateways via ZiNiPay.
Enter API Keyzinipay dashboard theke brand toiri korar por jei api key paben seta use hobe.zp_api_abc123xyz789
Enter USD RateThe conversion rate from USD to BDT.120
Enable/Disable Digital productenable thakle order direct complete hobe and digital product delivery hobe. and off thakle physical product er jonno order in progress thakbe and apni delivery kore order complete korben.Checked (yes/no)

Benefits of Using ZiniPay with WordPress

No Merchant Account Required - Use personal bKash, Nagad, or Rocket accounts for accepting payments.

Automatic Payment Verification - No need to manually check transactions; our system automatically verifies payments.

Easy Customer Experience - Seamless checkout process with clear payment instructions.

Automatic Order Status Updates - Orders automatically transition from "Pending" to "Processing" upon successful payment.

Important Note

Make sure to configure IPN (Instant Payment Notification) URL in your ZiniPay dashboard to match your WordPress site's URL. This ensures automatic payment verification works correctly.

Tools & SDKs

ZiniPay provides various tools and SDKs to help you integrate faster.

WordPress Plugin

Easy integration with WordPress sites. Add ZiniPay payment automation to your WooCommerce store.

Download (v1.5)

WordPress Plugin API 3

Integration using ZiniPay API 3 for your WooCommerce store.

Download (API 3.1)

WordPress Plugin v0

Work with partial or advanced payment options using older version of ZiniPay WordPress plugin.

Download (v0)

WHMCS Module

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

Download

PerfexCRM Module

Easy integration with PerfexCRM. Add ZiniPay payment gateway to your PerfexCRM dashboard.

Download

SMM Panel Module v1

Integration for old version of social media management panels.

Download (v1)

SMM Panel Module v2

Integration for new version of social media management panels.

Download (v2)

ZiniPay Laravel SDK

Includes example codes, controllers, and ready-to-use components.

Download SDK (ZIP)

ZiniPay PHP Library

A lightweight PHP library with ready-to-use functions, API handlers, and payment verification examples.

Download (ZIP)

ZiniPay JavaScript

A simple JavaScript starter kit with ready-to-use API requests, payment link creation, and verification examples for frontend integration.

Download (ZIP)
Please download app or apk from Dashboard