💸FokawaPay

FokawaPay is a secure peer-to-peer e-wallet payment service that offers businesses and individuals a time-saving, cost-effective solution.For instant worldwide cryptocurrency transfers, available 24

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 CodeDescription

0

success

1

Invalid signature

2

Invalid or inactive merchant_id

3

Failed to store payment data

4

Missing parameter: {parameter_name}

5

Invalid Amount

6

Method not allowed

7

Unsupported Currency

8

Unsupported or Invalid Coin

9

Unrecognized IP Address

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

FieldTypeDescription

order_id

string

Unique identifier for the order.

amount

decimal

The total amount is based on the preferred currency to be paid by the consumer.

currency_code

string

A currency code is a three-letter code used to identify a specific currency (PHP, JPY, EUR, etc.). https://payments.fokawa.com/apiv2/currencycodes/

merchant_id

string

Unique identifier assigned to the merchant by Fokawa.

return_url

string

URL to which the consumer will be redirected after payment completion.

notification_url

string

URL where the payment gateway will send payment notifications.

payCoinSymbol

string

Symbol of the cryptocurrency to be used for the payment (e.g., fkwt, btc, usdt, etc). https://payments.fokawa.com/apiv2/coinlist/

date_created

string

A timestamp indicating when the payment request was created is formatted as 'YYYY-MM-DD HH:MM:SS '.

email

string

Email address of the consumer.

signature

string

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:

{
    "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 
$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;
} 

Response

Response Payload

The response payload will be a JSON object containing the following fields:

FieldTypeDescription

order_id

string

Unique identifier for the order. Matches the order_id in the request.

payment_url

string

URL where the consumer can complete the payment.

payment_id

string

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}

Request Headers

  • Content-Type: application/json

Request Body

The request body is a JSON object containing the following fields:

{
  "orderStatus": "{status}",
  "orderNum": "{orderNum}",
  "order_id": "{order_id}",
  "currency_amount":"{currency_amount}",
  "currency_code":"{currency_code}",
  "payAmount": "{payAmount}",
  "coin": "{coin}",
  "sign": "{sign}"
}

Parameters

ParamTypeDescription

orderStatus

string

The status of the order, which is always "PAID" for successful payments.

orderNum

string

The unique identifier for the order provided by the payment processor.

order_id

string

The unique identifier for the order provided by the merchant.

currency_amount

string

The total amount paid by the consumer.

currency_code

string

A currency code is a three-letter code used to identify a specific currency (PHP, JPY, EUR, etc.). https://payments.fokawa.com/apiv2/currencycodes/

payAmount

string

The amount paid in the transaction.

coin

string

The cryptocurrency symbol used for the payment.

sign

string

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.

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

NameValue

Content-Type

application/json

Body

NameTypeDescription

merchant_id

string

Unique identifier for the merchant

request_id

number

Unique identifier for the request

email

string

Email address of the consumer.

notification_url

string

URL to receive notifications about the transaction

fokawa_id

number

Fokawa user ID

currency_code

string

A currency code is a three-letter code used to identify a specific currency (PHP, JPY, EUR, etc.). https://payments.fokawa.com/apiv2/currencycodes/

amount

number

coin_symbol

string

Symbol of the cryptocurrency to be used for the withdrawal (e.g., usdt, fkwt, btc, etc). https://payments.fokawa.com/apiv2/coinlist/

date

string

A timestamp indicating when the withdrawal request was created is formatted as 'YYYY-MM-DD HH:MM:SS '.

signature

string

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

{
    "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

CodeDescription

0

msg: suc - Success

1

One or more required parameters are missing from the request.

2

The merchant ID provided is either invalid or the merchant is not active.

3

The signature provided does not match the expected signature.

4

The platform coin provided is not supported.

5

The currency code provided is not supported.

70006

Insufficient account balance

<?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);
} 

Response Payload

{
   "request_id":"cashout-66ace0f772b67",
   "code":"0",
   "msg":"suc",
   "orderNum":"8ed0ffd53d3c479e987f716926f2aad9",
   "signature":"539e98b40601b81ada4f4d364b143d39d540c39e3493c0ba339393d675248202"
}

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

NameValue

Content-Type

application/json

Request Body

NameTypeDescription

merchant_id

string

Name of the user

signature

string

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)

date

string

YYYY-MM-DD HH:MM:SS

Response

{
   "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

CodeMessageDescription

0

Success

1

Missing parameters

One or more required parameters are missing from the request.

2

Invalid or inactive merchant ID

The provided merchant ID is either invalid or inactive.

3

Invalid signature

The provided signature does not match the expected signature.

4

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

[
  {
    "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

[
  {
    "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
  }
]

Last updated