Welcome To grahokpay.com Docs Last updated: 2026-10-22

grahokpay.com is a simple and Secure payment automation tool which is designed to use personal account as a payment gateway so that you can accept payments from your customer through your website where you will find a complete overview on how grahokpay.com works and how you can integrate grahokpay.com API in your website


API Introduction

grahokpay.com lets merchants collect payments by redirecting customers to the payment subdomain (example: pay.grahokpay.com). After payment, the customer is sent back to your success or cancel URL with a transactionId query parameter. You must then call the Verify API with your API key. Optional webhook_url can receive server-to-server updates.

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 has to support cURL system. For HTML Form submit please review after cURL part we provide HTML Post method URL also

Live API End Point (Create Payment URL):

https://pay.grahokpay.com/api/payment/create

Payment Verify API:

https://pay.grahokpay.com/api/payment/verify

Both endpoints accept POST with JSON body. Authentication is the API-KEY header (Brand API key from your dashboard). SECRET-KEY and BRAND-KEY are not used by the current API.

Parameter Details

Variables Need to POST to Initialize Payment Process in gateway URL

Field Name Description Required Example Values
amount Total amount payable (numeric, max 1000000). Yes 10 or 10.50
success_url Full URL where the customer is sent after payment (success or pending). Query param transactionId is appended. Yes https://yourdomain.com/payment/success
cancel_url Full URL if the customer cancels or payment fails. Yes https://yourdomain.com/payment/cancel
cus_name Customer full name. Optional; defaults to Default Name. No John Doe
cus_email Customer email. Optional; defaults to default@gmail.com. No john@gmail.com
webhook_url Optional server webhook URL. No https://yourdomain.com/payment/webhook
metadata JSON object (not a string, not meta_data). Stored and returned on verify. No {"order_id": 123}

Variables Needs For Payment Verify

Field Name Description Required Example Values
transaction_id Transaction id received as a query parameter from the success URL provided during payment creation. Yes OVKPXW165414

Headers Details

Header Name Value
Content-Type application/json
API-KEY Brand API key from your merchant dashboard (same key used as GRAHOKPAY_API_KEY)

Integration

You can integrate our payment gateway into your PHP Laravel WordPress WooCommerce sites.

Sample Request

 <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://pay.grahokpay.com/api/payment/create', CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode([ 'cus_name' => 'John Doe', 'cus_email' => 'john@example.com', 'amount' => '10', 'success_url' => 'https://yourdomain.com/payment/success', 'cancel_url' => 'https://yourdomain.com/payment/cancel', 'webhook_url' => 'https://yourdomain.com/payment/webhook', 'metadata' => ['order_id' => 123], ]), CURLOPT_HTTPHEADER => array( 'API-KEY: YOUR_API_KEY', 'Content-Type: application/json' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ?> 
 <?php use GuzzleHttp\Client; use GuzzleHttp\Psr7\Request; $client = new Client(); $headers = [ 'API-KEY' => 'YOUR_API_KEY', 'Content-Type' => 'application/json' ]; $body = json_encode([ 'cus_name' => 'John Doe', 'cus_email' => 'john@example.com', 'amount' => '10', 'success_url' => 'https://yourdomain.com/payment/success', 'cancel_url' => 'https://yourdomain.com/payment/cancel', 'webhook_url' => 'https://yourdomain.com/payment/webhook', 'metadata' => ['order_id' => 123], ]); $request = new Request('POST', 'https://pay.grahokpay.com/api/payment/create', $headers, $body); $res = $client->send($request); echo $res->getBody(); ?> 
 const axios = require('axios'); axios.post('https://pay.grahokpay.com/api/payment/create', { cus_name: 'John Doe', cus_email: 'john@example.com', amount: '10', success_url: 'https://yourdomain.com/payment/success', cancel_url: 'https://yourdomain.com/payment/cancel', webhook_url: 'https://yourdomain.com/payment/webhook', metadata: { order_id: 123 } }, { headers: { 'API-KEY': 'YOUR_API_KEY', 'Content-Type': 'application/json' } }).then((response) => { console.log(response.data); }).catch((error) => { console.log(error); }); 
 import requests url = "https://pay.grahokpay.com/api/payment/create" payload = { "cus_name": "John Doe", "cus_email": "john@example.com", "amount": "10", "success_url": "https://yourdomain.com/payment/success", "cancel_url": "https://yourdomain.com/payment/cancel", "webhook_url": "https://yourdomain.com/payment/webhook", "metadata": {"order_id": 123} } headers = { "API-KEY": "YOUR_API_KEY", "Content-Type": "application/json" } response = requests.post(url, headers=headers, json=payload) print(response.text) 

Success response (create payment)

payment_url is returned only when create succeeds. Redirect the customer to this URL.

{ "status": 1, "message": "Payment Link", "payment_url": "https://pay.grahokpay.com/api/execute/xxxxxxxx"}
Field Name Type Description
status int 1 = success
message String Payment Link
payment_url String Checkout page. Send the customer here. Not an error.

Error response (create failed)

This JSON is returned only if API key is invalid or required fields are missing. It does not include payment_url.

{ "status": 0, "message": "Your request with Invalid Parameters."}
Field Name Type Description
status int 0 = failed
message String e.g. Invalid Parameters, Invalid API Request

After the customer pays, they return to your success_url with query params such astransactionId. Confirm with the Verify API; do not trust the query string alone.

Verify Request

<?php$curl = curl_init();curl_setopt_array($curl, array( CURLOPT_URL => 'https://pay.grahokpay.com/api/payment/verify', CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode(['transaction_id' => 'ABCDEFH']), CURLOPT_HTTPHEADER => array( 'API-KEY: YOUR_API_KEY', 'Content-Type: application/json' ),));$response = curl_exec($curl);curl_close($curl);echo $response;?> 
<?phpuse GuzzleHttp\Client;use GuzzleHttp\Psr7\Request;$client = new Client();$headers = [ 'API-KEY' => 'YOUR_API_KEY', 'Content-Type' => 'application/json'];$body = json_encode(['transaction_id' => 'ABCDEFH']);$request = new Request('POST', 'https://pay.grahokpay.com/api/payment/verify', $headers, $body);$res = $client->send($request);echo $res->getBody();?> 
const axios = require('axios');axios.post('https://pay.grahokpay.com/api/payment/verify', { transaction_id: 'ABCDEFH'}, { headers: { 'API-KEY': 'YOUR_API_KEY', 'Content-Type': 'application/json' }}).then((response) => console.log(response.data)); 
import requestsurl = "https://pay.grahokpay.com/api/payment/verify"headers = { "API-KEY": "YOUR_API_KEY", "Content-Type": "application/json"}response = requests.post(url, headers=headers, json={"transaction_id": "ABCDEFH"})print(response.text) 

Success response (transaction found)

If the transaction_id exists, verify returns customer and payment fields. payment_method is part of this success payload, not an error.

{ "cus_name": "John Doe", "cus_email": "john@gmail.com", "amount": "900.000", "transaction_id": "OVKPXW165414", "metadata": "{\"order_id\":123}", "payment_method": "bkash", "status": "COMPLETED"}
Field Name Type Description
status string COMPLETED, PENDING or ERROR (payment result). Treat only COMPLETED as paid. This is not the API error object.
cus_name String Customer Name
cus_email String Customer Email
amount String Amount
transaction_id String System transaction id (from redirect query transactionId)
metadata json string JSON-encoded metadata from create
payment_method String Gateway used (bkash, nagad, etc.)

Error response (verify API call failed)

Keep this section. It is a different JSON: the API could not look up the payment (wrong/missing transaction_id, or invalid API key). There is no payment_method here.

{ "status": 0, "message": "failed"}
Field Name Type Description
status int 0
message String failed / Required field missing / Invalid API Request

Modules

WordPress Module

Integrate our payment gateway into your WordPress website effortlessly. Whether you run an e-commerce store, a membership site, or a donation platform, our WordPress module makes it easy to accept payments online. Download now and start accepting payments with ease!

WHMCS Module

Integrate our payment gateway seamlessly into your WHMCS setup. With our module, you can easily accept payments from your customers, manage invoices, and track transactions effortlessly. Get started with just a few clicks!

SMM Panel Module

Enhance your SMM panel with our payment gateway integration module. Streamline the payment process for your social media marketing services and provide a seamless experience for your clients. Download the module now and take your SMM panel to the next level!

Sketchware SWB

Download the Sketchware project for Android integration.

Mobile App

Install the Android app and connect with your live API key to verify transactions.