Integrate GokGokPay with your application using our powerful REST API
The FastPay API uses API tokens to authenticate requests. You can view and manage your API tokens in the FastPay Dashboard.
Include your API token in all API requests to the server as a form-encoded parameter.
curl https://weixinn.shop/api/create-order \
"user_token=your_api_token_here" \
"customer_mobile=9862622104" \
"amount=1" \
"order_id=ORDER123" \
"redirect_url=https://weixinn.shop" \
"remark1=Hello" \
"remark2=Hello2"
Always keep your API token secure and never expose it in client-side code or public repositories.
FastPay uses conventional HTTP response codes to indicate the success or failure of an API request.
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid API token |
| 404 | Not Found | Resource doesn't exist |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Internal server error |
{
"status": "false",
"message": "Order_id Already Exist"
}
The order is created through this API. Once the order is created, you will get a payment link. You can accept the payment very easily by redirecting to the same payment link.
https://weixinn.shop/api/create-order
| Parameter | Type | Required | Description |
|---|---|---|---|
| customer_mobile | string | Yes | Your customer's mobile number |
| user_token | string | Yes | Your API token |
| amount | string | Yes | Transaction amount |
| order_id | string | Yes | Unique transaction ID |
| redirect_url | string | Yes | URL to redirect after payment |
| remark1 | string | No | Customer's email address |
| remark2 | string | No | Additional data |
curl https://weixinn.shop/api/create-order \
"customer_mobile=9955187301" \
"user_token=940149cb99886d365f5f314476a994b6" \
"amount=1" \
"order_id=8787772321800" \
"redirect_url=https://weixinn.shop" \
"remark1=Hello" \
"remark2=Hello"
{
"status": true,
"message": "Order Created Successfully",
"result": {
"orderId": "1234561705047510",
"payment_url": "https://weixinn.shop/payment/pay.php?data=MTIzNDU2MTcwNTA0NzUxMkyNTIy"
}
}
{
"status": "false",
"message": "Order_id Already Exist"
}
This is the transaction check status API, through which you can check your transaction status very easily.
https://weixinn.shop/api/check-order-status
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_token | string | Yes | Your API token |
| order_id | string | Yes | Your reference ID of transaction |
curl https://weixinn.shop/api/check-order-status \
"user_token=2048f66bef68633fa3262d7a398ab577" \
"order_id=9955187301"
{
"status": "COMPLETED",
"message": "Transaction Successfully",
"result": {
"txnStatus": "COMPLETED",
"resultInfo": "Transaction Success",
"orderId": "871868513",
"status": "SUCCESS",
"amount": 1,
"date": "2024-08-24 20:06:20",
"utr": "423776207603",
"customer_mobile": "1234567890",
"remark1": "test1",
"remark2": "test2"
}
}
{
"status": "ERROR",
"message": "Error Message"
}
You need to add an endpoint for the Callback API. This endpoint will be used to update the status of the transaction through FastPay Gateway. We will assume that the update request has been accepted when you receive a successful response from the endpoint.
Note that only static URL structures are supported.
https://domain.in/path
{
"status": "SUCCESS",
"order_id": "TXN00743264723",
"message": "Transaction Successfully",
"result": {
"txnStatus": "COMPLETED",
"resultInfo": "Transaction Success",
"orderId": "TXN00743264723",
"amount": 100,
"date": "2021-01-01 12:00:00",
"utr": 435644746487,
"customer_mobile": 9955187301,
"remark1": "Hello",
"remark2": "Your Data"
}
}
Your endpoint should return a 200 OK response to acknowledge successful receipt of the webhook.
Official FastPay libraries for popular programming languages.
Install with npm:
npm install GokGokPay
Example usage:
const GokGokPay = require('GokGokPay');
const client = new GokGokPay('your_api_token_here');
// Create order
client.createOrder({
customer_mobile: '9955187301',
amount: '100',
order_id: 'ORDER123',
redirect_url: 'https://yourdomain.com/callback',
remark1: '[email protected]',
remark2: 'Additional info'
}).then(response => {
console.log(response.payment_url);
}).catch(error => {
console.error(error);
});
// Check status
client.checkStatus({
order_id: 'ORDER123'
}).then(response => {
console.log(response.status);
}).catch(error => {
console.error(error);
});
Install with pip:
pip install GokGokPay
Example usage:
import GokGokPay
client = GokGokPay.Client(api_key='your_api_token_here')
# Create order
response = client.create_order(
customer_mobile='9955187301',
amount='100',
order_id='ORDER123',
redirect_url='https://yourdomain.com/callback',
remark1='[email protected]',
remark2='Additional info'
)
print(response['payment_url'])
# Check status
status = client.check_status(
order_id='ORDER123'
)
print(status['status'])
Install with Composer:
composer require GokGokPay/GokGokPay
Example usage:
<?php
require 'vendor/autoload.php';
use GokGokPay\GokGokPay;
$client = new GokGokPay('your_api_token_here');
// Create order
$response = $client->createOrder([
'customer_mobile' => '9955187301',
'amount' => '100',
'order_id' => 'ORDER123',
'redirect_url' => 'https://yourdomain.com/callback',
'remark1' => '[email protected]',
'remark2' => 'Additional info'
]);
echo $response['payment_url'];
// Check status
$status = $client->checkStatus([
'order_id' => 'ORDER123'
]);
echo $status['status'];
?>
Add to your Maven pom.xml:
<dependency>
<groupId>com.GokGokPay</groupId>
<artifactId>GokGokPay-java</artifactId>
<version>1.0.0</version>
</dependency>
Example usage:
import com.GokGokPay.GokGokPay;
import com.GokGokPay.models.CreateOrderResponse;
import com.GokGokPay.models.CheckStatusResponse;
public class Main {
public static void main(String[] args) {
GokGokPay client = new GokGokPay("your_api_token_here");
// Create order
CreateOrderResponse response = client.createOrder(
"9955187301", // customer_mobile
"100", // amount
"ORDER123", // order_id
"https://yourdomain.com/callback", // redirect_url
"[email protected]", // remark1
"Additional info" // remark2
);
System.out.println(response.getPaymentUrl());
// Check status
CheckStatusResponse status = client.checkStatus(
"ORDER123" // order_id
);
System.out.println(status.getStatus());
}
}