Welcome to our documentation

Tidapay provides modern financial infrastructure for businesses and developers to receeive payments from any country. This documentation is intended for developers familiar with an API documentation.

Can we assist you?

Thank you for taking the time to use Tidapay APIs. Please contact us at developper@tidapay.com if you have any queries, feature suggestions, or discover any problems.

HTTP Request Sample

We would provide cURL request sample, just so you can quickly test each endpoint on your terminal or command line. Need a quick how-to for making cURL requests? just use an HTTP client such as Postman, like the rest of us!

Requests and Responses

Both request body data and response data are formatted as JSON. Content type for responses is always of the type application/json. You can use your test API key, which does not affect your live data. The API key you use to authenticate the request determines whether the request is a live mode or test mode


Environments

To make testing and developing with Tidapay quick and easy, we make use of the same API endpoint for sandbox and production, the only difference is the keys used when calling the APIs.

Production

The sandbox environment is dedicated to test and development phases. In this environment, you can create account holders with real credentials and you can pull test data from all endpoints.

https://hpanel.tidapay.com/ext_transfer


Test Mode vs Live Mode

There are two "modes" of operation for your Tidapay account:

Live Mode: Real money, real transactions, real effects. Only switch to this after you've tested your integration thoroughly.

Test Mode: No real money is involved. We'll still send webhooks, and most of the API functions the same.

API keys

It can authorize any action on your account, so it should never be exposed to the public.

To get your keys:

  • Log in to your Tidapay dashboard
  • Navigate to Settings
  • Select API keys from API & Webhook section to view and copy your keys


Don't take any chances

If you think your keys may have been compromised (for instance, you accidentally committed them to Git), you should immediately generate new ones using the Generate new keys button on the Settings> API & Webhook page on your dashboard. This will invalidate all existing keys and give you a new set, and you can then update your app to use the new ones.

Authorizing API calls

All API calls on Tidapay are authenticated. API requests made without authorization will fail with the status code 401: Unauthorized.

Your api key can perform any actions on your Tidapay account without restriction. It should be kept confidential and only stored on your servers, preferably as an environment variable. It should not be included in your Git repository or front-end JavaScript code.

To authorize API calls from your server, pass your API key as a bearer token. This means passing an Authorization header with a value of "Bearer: {secret_key}".


Integrating Website Payment

Receiving money on your website is now easy with simple integeration at a fee of 1.3% per transaction. This document will introduce you to all the basic information you need to better understand our technologies. To start receiving payment on your website, or you need to do is copy the html form code below to your website page

											
<form method="POST" action="https://hpanel.tidapay.com/ext_transfer" >
    <input type="hidden" name="merchant_key" value="MERCHANT KEY" />
    <input type="hidden" name="public_key" value="PUBLIC KEY" />
    <input type="hidden" name="callback_url" value="mydomain.com/success.html" />
    <input type="hidden" name="tx_ref" value="REF_123456" />
    <input type="hidden" name="amount" value="10000" />
    <input type="hidden" name="email" value="user@test.com" />
    <input type="hidden" name="first_name" value="Finn" />
    <input type="hidden" name="last_name" value="Marshal" />
    <input type="hidden" name="title" value="Payment For Item" />
    <input type="hidden" name="description" value="Payment For Item" />
    <input type="hidden" name="quantity" value="10" />
    <input type="hidden" name="currency" value="USD" />
    <input type="submit" value="submit" />
</form>
											
											

Verifying payment

Depending on your callback url is not fully secure, ensure you verify payment with our api before going further.

											
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_URL, 'https://hpanel.tidapay.com/api/verify-payment/{txref}/{secretkey}');
 $result = curl_exec($ch);
 curl_close($ch);
 $obj=json_decode($result, true);
 //Verify Payment
 if (array_key_exists("data", $obj)  && ($obj["status"] == "success")) {
     echo 'success';
 }
											
											

Successful Json Callback

											
{
    "message":null,
    "status":"success",
    "data":{
        "id":6,
        "email":"a@b.com",
        "first_name":"qwert",
        "last_name":"trewq",
        "payment_type":account,
        "title":Rubik Cube,
        "description":Payment for Rubik Cube,
        "quantity":2,
        "reference":"Di9Wr1LuC7u4WEGu",
        "amount":10000,
        "charge":50,
        "merchant_key":"r1Kn6nzk1cE63rQE",
        "callback_url":"mydomain.com\/thank_you.html",
        "tx_ref":"deff",
        "status":"paid",
        "created_at":"2021-01-01T22:05:02.000000Z",
        "updated_at":"2020-05-15T12:05:29.000000Z"
    }
}