Common Uses for FokawaPay: Webmasters, Freelancers, Webcam Models, Developers, Independent Contractors, Advertising Networks, Affiliate Programs, Live Streaming Networks, Freelance Companies, Hosting Providers, Billing and Payment Processors, Webcam Studios, iGaming Sites & Others.
FokawaPay offers instant crypto transfers from your Fokawa.com balance to merchant wallets. To apply, please contact support@fokawa.com .
Integrations
API
Woocomerce
Shopify (Coming Soon)
Drupal (Coming Soon)
Zapier (Coming Soon)
OpenCart (Coming Soon)
WHMCS (Coming Soon)
Prestashop (Coming Soon)
Joomla Virtuemart (Coming Soon)
Magento (Coming Soon)
Smartstore (Coming Soon)
Nopcommerce (Coming Soon)
XenForo (Coming Soon)
Invoice Ninja (Coming Soon)
Fokawa API Payment Guidelines
Simplify the payment experience by allowing your customers to use their Fokawa account to pay for the products and services.
Payment Error Code
Error Code Description Invalid or inactive merchant_id
Failed to store payment data
Missing parameter: {parameter_name}
Unsupported or Invalid Coin
Payments
Fokawa Payments is a secure and efficient cryptocurrency payment gateway that allows merchants to accept crypto payments from customers.
One-time Wallet Payments
Endpoint
POST
/
https://payments.fokawa.com/apiv2/payment
Payload
Request Payload
Field Type Description Unique identifier for the order.
The total amount is based on the preferred currency to be paid by the consumer.
Unique identifier assigned to the merchant by Fokawa.
URL to which the consumer will be redirected after payment completion.
URL where the payment gateway will send payment notifications.
A timestamp indicating when the payment request was created is formatted as 'YYYY-MM-DD HH:MM:SS '.
Email address of the consumer.
HMAC-SHA256 signature to verify the authenticity of the request. Generated using a secret key.
Ex.
signature = hash_hmac('sha256', merchant_id + json_payload + merchant_secret)
The request payload should be a JSON object containing the following fields:
Copy {
"order_id": "string",
"amount": "decimal",
"currency_code":"string",
"merchant_id": "string",
"return_url": "string",
"notification_url": "string",
"payCoinSymbol": "string",
"date_created": "string",
"email": "string",
"signature": "string"
}
Example Implementation
PHP Python Javascript
Copy <?php
$secret = 'dz3WhB9z7JpYdkRzjvJt';
$merchant_id = 'demo';
$api_url = 'https://payments.fokawa.com/apiv2/payment/';
$data = [
"order_id" => "orderId-" . uniqid(),
"amount" => "200",
"currency_code" => "PHP",
"merchant_id" => $merchant_id,
"return_url" => "https://www.google.com/",
"notification_url" => "https://www.google.com/",
"payCoinSymbol" => "tether",
"date_created" => date('Y-m-d H:i:s'),
"email" => "yahoo@gmail.com"
];
function generate_signature($merchant_id, $json_payload, $secret) {
$message = $merchant_id . $json_payload . $secret;
return hash_hmac('sha256', $message, $secret);
}
$data['signature'] = hash_hmac('sha256', $merchant_id . json_encode($data, JSON_UNESCAPED_SLASHES) . $secret, $secret);
$ch = curl_init($api_url);
// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
// Execute the request
$response = curl_exec($ch);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
// Handle the response
if ($http_status === 200) {
$response_data = json_decode($response, true);
if (isset($response_data['payment_url'])) {
header('Location: ' . $response_data['payment_url']);
exit;
} else {
echo 'Error: Payment URL not found in the response.';
}
} else {
echo 'Error: Failed to connect to the payment gateway.';
echo 'HTTP Status: ' . $http_status;
echo 'Response: ' . $response;
}
Copy import hashlib
import hmac
import json
import requests
from datetime import datetime
import uuid
# Configuration variables
secret = 'dz3WhB9z7JpYdkRzjvJt'
merchant_id = 'demo'
api_url = 'https://payments.fokawa.com/apiv2/payment/'
# Payload data
data = {
"order_id": f"orderId-{uuid.uuid4()}",
"amount": "200",
"currency_code": "PHP",
"merchant_id": merchant_id,
"return_url": "https://www.google.com/",
"notification_url": "https://www.google.com/",
"payCoinSymbol": "tether",
"date_created": datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
"email": "yahoo@gmail.com"
}
# Function to generate signature
def generate_signature(merchant_id, json_payload, secret):
message = merchant_id + json_payload + secret
return hmac.new(secret.encode(), message.encode(), hashlib.sha256).hexdigest()
# Generate signature and add to payload
data['signature'] = generate_signature(merchant_id, json.dumps(data, separators=(',', ':')), secret)
# Make the HTTP POST request
headers = {
'Content-Type': 'application/json'
}
response = requests.post(api_url, headers=headers, data=json.dumps(data))
# Handle the response
if response.status_code == 200:
response_data = response.json()
if 'payment_url' in response_data:
print(f"Redirecting to: {response_data['payment_url']}")
# In a real web app, you would redirect the user to the payment URL
else:
print('Error: Payment URL not found in the response.')
else:
print('Error: Failed to connect to the payment gateway.')
print('HTTP Status:', response.status_code)
print('Response:', response.text)
Copy const secret = 'dz3WhB9z7JpYdkRzjvJt';
const merchant_id = 'demo';
const api_url = 'https://payments.fokawa.com/apiv2/payment/';
// Generate order ID and current date
const order_id = `orderId-${Date.now()}`;
const date_created = new Date().toISOString().slice(0, 19).replace('T', ' ');
// Payload data
const data = {
order_id: order_id,
amount: "200",
currency_code: "PHP",
merchant_id: merchant_id,
return_url: "https://www.google.com/",
notification_url: "https://www.google.com/",
payCoinSymbol: "tether",
date_created: date_created,
email: "yahoo@gmail.com"
};
// Function to generate HMAC SHA256 signature
function generateSignature(merchant_id, json_payload, secret) {
const message = merchant_id + json_payload + secret;
return CryptoJS.HmacSHA256(message, secret).toString(CryptoJS.enc.Hex);
}
// Generate signature and add to payload
data.signature = generateSignature(merchant_id, JSON.stringify(data, null, 0), secret);
// Function to make the HTTP POST request
async function makePaymentRequest(api_url, data) {
const response = await fetch(api_url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
});
if (response.ok) {
const responseData = await response.json();
if (responseData.payment_url) {
window.location.href = responseData.payment_url;
} else {
console.error('Error: Payment URL not found in the response.');
}
} else {
console.error('Error: Failed to connect to the payment gateway.');
console.error('HTTP Status:', response.status);
const responseText = await response.text();
console.error('Response:', responseText);
}
}
// Make the payment request
makePaymentRequest(api_url, data);
Response
Response Payload
The response payload will be a JSON object containing the following fields:
Field Type Description Unique identifier for the order. Matches the order_id
in the request.
URL where the consumer can complete the payment.
Unique identifier for the payment transaction.
Payment Callback
This API documentation describes the process of sending a callback to a merchant's notification URL after processing a payment.
Endpoint
POST : {notification_url}
Content-Type: application/json
Request Body
The request body is a JSON object containing the following fields:
Copy {
"orderStatus": "{status}",
"orderNum": "{orderNum}",
"order_id": "{order_id}",
"currency_amount":"{currency_amount}",
"currency_code":"{currency_code}",
"payAmount": "{payAmount}",
"coin": "{coin}",
"sign": "{sign}"
}
Parameters
Param Type Description The status of the order, which is always "PAID"
for successful payments.
The unique identifier for the order provided by the payment processor.
The unique identifier for the order provided by the merchant.
The total amount paid by the consumer.
The amount paid in the transaction.
The cryptocurrency symbol used for the payment.
A signature generated to verify the authenticity of the callback.
Signature Generation
The sign
field is generated using the generate_signature_to_merchant
function. This function requires the merchant's ID, the JSON encoded response_data
, and the merchant's secret key.
Copy function generate_signature_to_merchant ($merchant_id , $json_payload , $secret) {
$message = $merchant_id . $json_payload . $secret;
return hash_hmac ( 'sha256' , $message , $secret ) ;
}
Notes
Ensure the merchant_id
, secret
, and other sensitive data are stored securely and not exposed in client-side code.
The return_url
and notification_url
should be properly configured to handle the payment status and notifications.
This documentation provides the necessary details to integrate the Fokawa Payments API, including payload structure, signature generation, and expected response to ensure secure transactions.
Withdrawal
This API endpoint allows merchants to initiate a withdrawal request from their Fokawa account.
Fokawa Payments Withdrawal
Endpoint
POST
/
https://payments.fokawa.com/apiv2/withdraw/
Headers
Body
Name Type Description Unique identifier for the merchant
Unique identifier for the request
Email address of the consumer.
URL to receive notifications about the transaction
A timestamp indicating when the withdrawal request was created is formatted as 'YYYY-MM-DD HH:MM:SS '.
HMAC-SHA256 signature to verify the authenticity of the request. Generated using a secret key.
Ex.
signature = hash_hmac('sha256', merchant_id + json_payload + merchant_secret)
Payload
Copy {
"merchant_id": string,
"request_id": string,
"email": string,
"notification_url": string,
"fokawa_id": number,
"currency_code": string,
"amount": number,
"coin_symbol": string,
"date": string
}
Response Code
Code Description One or more required parameters are missing from the request.
The merchant ID provided is either invalid or the merchant is not active.
The signature provided does not match the expected signature.
The platform coin provided is not supported.
The currency code provided is not supported.
Insufficient account balance
PHP Python Javascript
Copy <?php
$secret = 'dz3WhB9z7JpYdkRzjvJt';
$merchant_id = 'demo';
$api_url = 'https://payments.fokawa.com/apiv2/withdraw/';
$payload = [
"merchant_id" => $merchant_id,
"request_id" => "cashout-" . uniqid(),
"email" => "yahoo@gmail.com",
"notification_url" => "https://www.yourwebsite.com/payments/callback.php",
"fokawa_id" => "32539503",
"currency_code" => "php",
"amount" => "2000",
"coin_symbol" => "ETH",
"date" => date('Y-m-d H:i:s')
];
$signature_data = $merchant_id . json_encode($payload) . $secret;
$sign = hash_hmac('sha256', $signature_data, $secret);
$payload['signature'] = $sign;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $api_url,
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 => json_encode($payload),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
if (curl_errno($curl)) {
$error_msg = curl_error($curl);
curl_close($curl);
die('CURL Error: ' . $error_msg);
}
curl_close($curl);
$response_data = json_decode($response, true);
if (json_last_error() === JSON_ERROR_NONE) {
var_dump($response_data);
} else {
var_dump($response);
}
Copy import requests
import hashlib
import hmac
import json
from datetime import datetime
import uuid
def generate_signature(secret, merchant_id, payload):
payload_str = json.dumps(payload, separators=(',', ':'))
signature_data = f"{merchant_id}{payload_str}{secret}"
signature = hmac.new(secret.encode(), signature_data.encode(), hashlib.sha256).hexdigest()
return signature
secret = 'dz3WhB9z7JpYdkRzjvJt'
merchant_id = 'demo'
api_url = 'https://payments.fokawa.com/apiv2/withdraw/'
payload = {
"merchant_id": merchant_id,
"request_id": f"cashout-{uuid.uuid4()}",
"email": "yahoo@gmail.com",
"notification_url": "https://www.yourwebsite.com/payments/callback.php",
"fokawa_id": "32539503",
"currency_code": "php",
"amount": "2000",
"coin_symbol": "ETH",
"date": datetime.now().strftime('%Y-%m-%d %H:%M:%S')
}
payload['signature'] = generate_signature(secret, merchant_id, payload)
headers = {
'Content-Type': 'application/json'
}
try:
response = requests.post(api_url, headers=headers, data=json.dumps(payload))
response.raise_for_status()
response_data = response.json()
print(response_data)
except requests.exceptions.RequestException as e:
print(f"Request failed: {e}")
except json.JSONDecodeError:
print("Failed to decode JSON response")
Copy const axios = require('axios');
const crypto = require('crypto');
const secret = 'dz3WhB9z7JpYdkRzjvJt';
const merchant_id = 'demo';
const api_url = 'https://payments.fokawa.com/apiv2/withdraw/';
const payload = {
merchant_id: merchant_id,
request_id: `cashout-${crypto.randomUUID()}`,
email: "yahoo@gmail.com",
notification_url: "https://www.yourwebsite.com/payments/callback.php",
fokawa_id: "32539503",
currency_code: "php",
amount: "2000",
coin_symbol: "ETH",
date: new Date().toISOString().replace('T', ' ').substring(0, 19)
};
const signatureData = merchant_id + JSON.stringify(payload) + secret;
const sign = crypto.createHmac('sha256', secret).update(signatureData).digest('hex');
payload.signature = sign;
const headers = {
'Content-Type': 'application/json'
};
axios.post(api_url, payload, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
if (error.response) {
console.error('Response error:', error.response.data);
} else if (error.request) {
console.error('Request error:', error.request);
} else {
console.error('Error:', error.message);
}
});
Response Payload
Success Failed
Copy {
"request_id" : "cashout-66ace0f772b67" ,
"code" : "0" ,
"msg" : "suc" ,
"orderNum" : "8ed0ffd53d3c479e987f716926f2aad9" ,
"signature" : "539e98b40601b81ada4f4d364b143d39d540c39e3493c0ba339393d675248202"
}
Copy {
"request_id" : "cashout-66acb24b9dbca" ,
"code" : "70006" ,
"msg" : "Insufficient account balance" ,
"orderNum" : "" ,
"signature" : "364414b14010253f60f7723aa80f969f48586522bb8600cd4e8ad3176fd148f5"
}
Balance
This endpoint retrieves the user's balance for a given merchant.
Get merchant's Balance
POST
/
https://payments.fokawa.com/apiv2/balance/
This endpoint retrieves the user's balance for a given merchant.
Headers
Request Body
Name Type Description HMAC-SHA256 signature to verify the authenticity of the request. Generated using a secret key.
Ex.
signature = hash_hmac('sha256', merchant_id + json_payload + merchant_secret)
Response
Copy {
"code":"0",
"msg":"Success",
"message":null,
"data":{
"totalBalance":"0.000009990531",
"totalBalanceSymbol":"BTC",
"yesterdayProfit":"--",
"yesterdayProfitRate":"--",
"platformCoin":"",
"allCoinMap":{
"USDT":{
"walletTransactionOpen":0,
"icon":"https:\/\/cbl13isq6gv9.s3.ap-northeast-1.amazonaws.com\/1317\/upload\/92c9da2c3f338881333aff4c91200546.png",
"tcpay_income":"0.000000000000",
"allBalance":"0.001369",
"tcpay_symbol":"USDT",
"exchange_symbol":"FKWT1799\/USDT",
"present_coin_balance":0,
"lock_position_balance":"0.000000000000",
"depositOpen":1,
"tcpay_balance":"0.001369",
"canShowProfit":false,
"otcOpen":1,
"depositMin":0,
"withdraw_balance":"0.000000000000",
"checked":"true",
"mainChainType":1,
"allBtcValuatin":"0.000000",
"lock_position_v2_amount":"0.000000000000",
"withdrawOpen":1,
"isFiat":0,
"showName":"USDT",
"normal_balance":"0.001369",
"coupon_balance":0,
"btcValuatin":"0.000000",
"sort":1,
"innerWithdrawShow":1,
"lock_grant_divided_balance":"0.000000000000",
"symbolType":1,
"total_balance":"0.001369",
"nc_lock_balance":"0.000000000000",
"fiatIncome":0,
"coinName":"USDT",
"lock_balance":"0.000000000000",
"overcharge_balance":""
},
"FKWT1799":{
"walletTransactionOpen":0,
"icon":"https:\/\/saas2-s3-public-01.s3.ap-northeast-1.amazonaws.com\/1799\/upload\/80948e46a607c37c0fe0e3bedb30c939.png",
"tcpay_income":"0.000000000000",
"allBalance":"0.000000963420",
"tcpay_symbol":"USDT",
"exchange_symbol":"FKWT1799\/USDT",
"present_coin_balance":0,
"lock_position_balance":"0.000000000000",
"depositOpen":1,
"tcpay_balance":"0.000000963420",
"canShowProfit":true,
"otcOpen":1,
"depositMin":0,
"withdraw_balance":"0.000000000000",
"checked":"true",
"mainChainType":0,
"allBtcValuatin":"0.000000000000",
"lock_position_v2_amount":"0.000000000000",
"withdrawOpen":1,
"isFiat":0,
"showName":"FKWT",
"normal_balance":"0.000000963420",
"coupon_balance":0,
"btcValuatin":"0.000000000000",
"sort":2,
"innerWithdrawShow":1,
"lock_grant_divided_balance":"0.000000000000",
"symbolType":1,
"total_balance":"0.000000963420",
"nc_lock_balance":"0.000000000000",
"fiatIncome":0,
"coinName":"FKWT1799",
"lock_balance":"0.000000000000",
"overcharge_balance":""
},
"BTC":{
"walletTransactionOpen":0,
"icon":"https:\/\/cbl13isq6gv9.s3.ap-northeast-1.amazonaws.com\/1317\/upload\/4e3f2bbd19a5cf34d722c377f56da175.png",
"tcpay_income":"0.000000000000",
"allBalance":"0.000006130440",
"tcpay_symbol":"USDT",
"exchange_symbol":"BTC\/USDT",
"present_coin_balance":0,
"lock_position_balance":"0.000000000000",
"depositOpen":1,
"tcpay_balance":"0.000006130440",
"canShowProfit":true,
"otcOpen":0,
"depositMin":0,
"withdraw_balance":"0.000000000000",
"checked":"true",
"mainChainType":1,
"allBtcValuatin":"0.000006130440",
"lock_position_v2_amount":"0.000000000000",
"withdrawOpen":1,
"isFiat":0,
"showName":"BTC",
"normal_balance":"0.000006130440",
"coupon_balance":0,
"btcValuatin":"0.000006130440",
"sort":3,
"innerWithdrawShow":1,
"lock_grant_divided_balance":"0.000000000000",
"symbolType":1,
"total_balance":"0.000006130440",
"nc_lock_balance":"0.000000000000",
"fiatIncome":0,
"coinName":"BTC",
"lock_balance":"0.000000000000",
"overcharge_balance":""
}
}
}
}
Error Code
Code Message Description One or more required parameters are missing from the request.
Invalid or inactive merchant ID
The provided merchant ID is either invalid or inactive.
The provided signature does not match the expected signature.
Error occurred while fetching the merhcant's balance
An error occurred while attempting to fetch the user's balance.
Currency Codes
This endpoint allows you to query all the supported currencies on FokawaPay.
GET
/
https://payments.fokawa.com/apiv2/currencycodes
Response
Copy [
{
"code": "CNY",
"name": "Chinese Yuan"
},
{
"code": "EUR",
"name": "Euro"
},
{
"code": "JPY",
"name": "Japanese Yen"
},
{
"code": "MYR",
"name": "Malaysian Ringgit"
},
{
"code": "PHP",
"name": "Philippine Peso"
},
{
"code": "SGD",
"name": "Singapore Dollar"
},
{
"code": "KRW",
"name": "South Korean Won"
},
{
"code": "CAD",
"name": "Canadian Dollar"
},
{
"code": "AUD",
"name": "Australian Dollar"
},
{
"code": "GBP",
"name": "British Pound"
},
{
"code": "ILS",
"name": "Israeli Shekel"
},
{
"code": "BRL",
"name": "Brazilian Real"
},
{
"code": "HKD",
"name": "Hong Kong Dollar"
},
{
"code": "TRY",
"name": "Turkish Lira"
},
{
"code": "UAH",
"name": "Ukrainian Hryvnia"
},
{
"code": "INR",
"name": "Indian Rupee"
},
{
"code": "THB",
"name": "Thai Baht"
},
{
"code": "VND",
"name": "Vietnamese Dong"
},
{
"code": "CHF",
"name": "Swiss Franc"
}
]
Coins List
This endpoint allows you to query all the supported coins on FokawaPay with coins id, name and symbol.
GET
/
https://payments.fokawa.com/apiv2/coinlist/
Response
Copy [
{
"id": "fkwt1799",
"symbol": "fkwt",
"name": "Fokawa",
"image": "https://payments.fokawa.com/backoffice/wp-content/plugins/fokawapayments/icon.png?v=6",
"precision": 4
},
{
"id": "bitcoin",
"symbol": "btc",
"name": "Bitcoin",
"image": "https://assets.coingecko.com/coins/images/1/large/bitcoin.png",
"precision": 8
},
{
"id": "ethereum",
"symbol": "eth",
"name": "Ethereum",
"image": "https://assets.coingecko.com/coins/images/279/large/ethereum.png",
"precision": 8
},
{
"id": "tether",
"symbol": "usdt",
"name": "Tether",
"image": "https://assets.coingecko.com/coins/images/325/large/Tether-logo.png",
"precision": 4
},
{
"id": "binancecoin",
"symbol": "bnb",
"name": "Binance Coin",
"image": "https://assets.coingecko.com/coins/images/825/large/binance-coin-logo.png",
"precision": 8
},
{
"id": "ripple",
"symbol": "xrp",
"name": "Ripple",
"image": "https://assets.coingecko.com/coins/images/44/large/xrp-symbol-white-128.png",
"precision": 6
},
{
"id": "cardano",
"symbol": "ada",
"name": "Cardano",
"image": "https://assets.coingecko.com/coins/images/975/large/cardano.png",
"precision": 6
},
{
"id": "polkadot",
"symbol": "dot",
"name": "Polkadot",
"image": "https://assets.coingecko.com/coins/images/12171/large/polkadot.png",
"precision": 8
},
{
"id": "solana",
"symbol": "sol",
"name": "Solana",
"image": "https://assets.coingecko.com/coins/images/4128/large/solana.png",
"precision": 8
},
{
"id": "dogecoin",
"symbol": "doge",
"name": "Dogecoin",
"image": "https://assets.coingecko.com/coins/images/5/large/dogecoin.png",
"precision": 8
},
{
"id": "litecoin",
"symbol": "ltc",
"name": "Litecoin",
"image": "https://assets.coingecko.com/coins/images/2/large/litecoin.png",
"precision": 8
},
{
"id": "chainlink",
"symbol": "link",
"name": "Chainlink",
"image": "https://assets.coingecko.com/coins/images/877/large/chainlink-new-logo.png",
"precision": 8
},
{
"id": "shiba-inu",
"symbol": "shib",
"name": "Shiba Inu",
"image": "https://assets.coingecko.com/coins/images/11939/large/shiba.png",
"precision": 8
},
{
"id": "uniswap",
"symbol": "uni",
"name": "Uniswap",
"image": "https://assets.coingecko.com/coins/images/12504/large/uniswap-uni.png",
"precision": 8
},
{
"id": "matic-network",
"symbol": "matic",
"name": "Polygon",
"image": "https://assets.coingecko.com/coins/images/4713/large/matic-token-icon.png",
"precision": 8
},
{
"id": "stellar",
"symbol": "xlm",
"name": "Stellar",
"image": "https://assets.coingecko.com/coins/images/100/large/Stellar_symbol_black_RGB.png",
"precision": 6
}
]