# 👋 Welcome to Paychant

Stablecoins on and off-ramp Infrastructure for Africa.

{% hint style="info" %}
You can experience our ramp product in action [here](https://widget.paychant.com/buy?env=production\&assetAmount=20.5\&partnerApiKey=guest) or watch our demo [video](https://youtu.be/OU9uJPCjioY).
{% endhint %}

Welcome to the Paychant Documentation! Here you will find all the information you need to seamlessly integrate Paychant Ramp with your wallet, application, or website. Before you begin, please ensure you apply for our integration access. If you have any further questions or require assistance, feel free to reach out to us at <sales@paychant.com>.

<figure><img src="https://2267087691-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCGfDuKGzr_1lqUPMYS%2Fuploads%2F2eJ0wrEfHj5NZ4g12O4o%2Fwidget_meta_image.jpg?alt=media&amp;token=30bdb018-3508-4eb4-84a5-fdd28f35db7e" alt=""><figcaption></figcaption></figure>

### What is Paychant?

Paychant is a fintech company focused on building payment infrastructure that connects stablecoins with Africa’s traditional financial systems. Our secure and compliant on-and-off-ramp widget provides a seamless solution for converting between local fiat currencies and stablecoins, leveraging popular African payment methods like local bank transfers, M-Pesa, MTN MoMo, Tigo, Vodafone Cash, Airtel Money, and other widely used mobile wallets.

Our core mission is to empower the next billion users in Africa by facilitating the transition from fiat to stablecoins, bridging the gap between the continent’s traditional financial systems and the digital currency era.

### Use Cases

At Paychant, we provide infrastructure for seamless fiat-to-stablecoin conversion across Africa. Our platform simplifies stablecoin onboarding, enabling easy exchange between local currencies and stablecoins. With our comprehensive, compliant payment APIs, fintechs and digital wallets can integrate our fiat-to-stablecoin widget to offer services such as remittances, payroll, and USD savings to users in Africa.

### Technical Documents

Ready to integrate Paychant? Great! You have two integration options: Redirect or Overlay embed. Both options will display our ramp interface within the application where the API is implemented.


# Getting started with Paychant 🚀

⚠️ IMPORTANT: You're going to need an active production API key for the widget to work.

### How do I get an API key? 🔑

The API key allows you to integrate, customize, and track activities that occur on your widget. To get an API key please kindly [Fill out this form](https://paychant.com/contact) and one of our team will reach back to you in a few moments with the next steps. The best place to get technical support is our Discord channel, please [reach out to us on our Discord here](https://discord.com/invite/YUXPAJfZaN).

## The Paychant features

### **Countries and currencies supported** 🌍

The countries and currencies we support are

1. **Nigeria - NGN** 🇳🇬&#x20;
2. **Ghana - GHS** 🇬🇭
3. **Kenya - KSH** 🇰🇪
4. **Uganda - UGX** 🇺🇬
5. **Zambia - ZMW** 🇿🇲

### **Payment Methods 💰**

We provide an extensive network of local payment rails in Africa, giving your users a wide range of ways to exchange fiat for stablecoin on your platform.

**Bank transfe**r 🏛\
This payment method is available in all the countries where Paychant is available, the processing time takes not more than 10 minutes to either buy or sell.

**MTN Mobile Money (MoMo)**:mobile\_phone:\
This is a mobile wallet method of payment, with over 51 million users in Africa. Paychant support this method of payment for users to buy and sell stablecoin in Ghana, Uganda, and Zambia.

**Safaricom M-PESA**:mobile\_phone:\
This is the most popular mobile money platform in Africa, with approximately 50 million active users across Africa. Paychant support this method of payment for users to buy and sell stablecoin in Kenya.

**AirtelTigo**:mobile\_phone:\
AirtelTigo is a well-dominated mobile money service in Ghana, with a user base of 10 million. Paychant support this method of payment for users to buy and sell stablecoin in Ghana.

**Vodafone cash**:mobile\_phone:\
Vodafone cash is another mobile phone-based money transfer service that's well-known in Africa. Paychant support this method of payment for users to buy and sell stablecoin in Ghana.

**Zamtel**:mobile\_phone:\
Zamtel is a Mobile Money service that operates out of Zambia. Paychant support this method of payment for users to buy and sell stablecoin in Zambia.

**Airtel money**:mobile\_phone:\
Airtel is another well-dominated mobile money service provider in the African continent, with over 23.9 million users across Africa. Paychant support this method of payment for users to buy and sell stablecoin in Ghana, Uganda, Kenya, and Zambia.

### Fees 💸

For buying stablecoin, we charge from 1% to 2% per transaction, depending on the selected method of payment.

For selling stablecoin, we charge 1% to 2.5% per transaction, depending on the selected method of payment.

### Support of Stablecoins 🌕

Paychant supports the on and off-ramp of 4 stablecoins on major blockchain networks such as Ethereum, Celo, Stellar, Polygon, BSC, and Solana. See the list of supported stablecoins and their chains [here](/resources/supported-stablecoins).


# Integration options

The Paychant widget is flexible and can be integrated in different ways that fit your app UI needs.

### Redirect Integration

<figure><img src="https://2267087691-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCGfDuKGzr_1lqUPMYS%2Fuploads%2F7ZIknqrsRZLbtZXlxIiU%2FScreenshot%202024-10-07%20at%209.46.22%E2%80%AFAM.png?alt=media&amp;token=c46fb80c-dd92-4eb3-b96f-5e1cc25a473f" alt=""><figcaption></figcaption></figure>

It's the easiest and fastest way to integrate Paychant widget into your app. This embeds the widget directly on your app and it opens through a separate browser tab. Find out more here: [Redirect integration](/integrations/redirect-integration).

### **Overlay Embed**

<figure><img src="https://2267087691-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCGfDuKGzr_1lqUPMYS%2Fuploads%2Frcr7p3aHZESBXN1uBlrp%2FScreenshot%202024-10-07%20at%209.50.52%E2%80%AFAM.png?alt=media&amp;token=410d21b7-4160-4e81-9535-866497f4a90e" alt=""><figcaption></figcaption></figure>

This method of integration enables the Paychant widget to open as a pop-up overlay on your app, it doesn't require users to leave your app to another separate browser tab. It uses our Javascript SDK, and all you need to do is a few integrations that trigger the Paychant widget in your app. \
Find out more here: Overlay Embed integration.


# Redirect Integration

This is the easiest and fastest way to integrate Paychant widget into your app. You can copy and edit the below example code to add a button or link to the Paychant widget directly into a page of your website or app.

{% tabs %}
{% tab title="Sandbox" %}
{% code overflow="wrap" %}

```html
<a 
href="https://widget.paychant.com/sand/buy?env=sandbox&assetAmount=20.5&partnerApiKey=[YOUR_SANDBOX_PARTNER_API_KEY]&partnerLogoUrl=[YOUR_BRAND_LOGO_URL]&partnerThemeColor=[YOUR_BRAND_THEME_COLOR]"
target="_blank">Stablecoin on/off ramp with Paychant</a>
```

{% endcode %}
{% endtab %}

{% tab title="Production" %}
{% code overflow="wrap" %}

```html
<a 
href="https://widget.paychant.com/prod/buy?env=production&assetAmount=20.5&partnerApiKey=[YOUR_PRODUCTION_PARTNER_API_KEY]&partnerLogoUrl=[YOUR_BRAND_LOGO_URL]&partnerThemeColor=[YOUR_BRAND_THEME_COLOR]"
target="_blank">Stablecoin on/off ramp with Paychant</a>
```

{% endcode %}
{% endtab %}
{% endtabs %}

**Using the redirect integration**

<figure><img src="https://2267087691-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCGfDuKGzr_1lqUPMYS%2Fuploads%2F7ZIknqrsRZLbtZXlxIiU%2FScreenshot%202024-10-07%20at%209.46.22%E2%80%AFAM.png?alt=media&amp;token=c46fb80c-dd92-4eb3-b96f-5e1cc25a473f" alt=""><figcaption></figcaption></figure>

You can simply implement this integration by redirecting your user to `https://widget.paychant.com/sand` or `https://widget.paychant.com/prod` and using the [parameters](/integrations/parameters) needed to populate the user order details in the widget. Your user will be directed to the Paychant widget where their order will be pre-filled with the parameters that were passed through.

This method of approach is very straightforward, and it works great for desktop and mobile integrations - no additional work is required! All you have to do is add a link to your app.

You can set custom options for your integration, by adding them as query parameters in the URL.

More details on supported parameters and examples can be found [here](/integrations/parameters).


# Overlay Embed

The Overlay embed implementation allows you to embed the Paychant widget into your app or website. This method of integration opens the Paychant widget as a pop-up overlay on your app or website when the Javascript SDK is loaded. No new tab, this experience enables users to remain on your app or website.

<figure><img src="https://2267087691-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCGfDuKGzr_1lqUPMYS%2Fuploads%2Frcr7p3aHZESBXN1uBlrp%2FScreenshot%202024-10-07%20at%209.50.52%E2%80%AFAM.png?alt=media&amp;token=410d21b7-4160-4e81-9535-866497f4a90e" alt=""><figcaption></figcaption></figure>

**Using the Paychant Javascript SDK**

The method for this implementation is by placing the Paychant SDK right into your HTML files using a script tag, and the SDK will load via a CDN. Below is how to do the integration.

```html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Paychant</title>

    <!-- Paychant SDK -->
    <script 
      src="https://paychant.com/inline/v1" 
      crossorigin="anonymous">
    </script>
    
  </head>
  <body>
    <button type="button" onclick="triggerPaychant()">
      Buy & Sell with Paychant
    </button>

    <!-- Start Paychant on button click -->
    <script type="application/javascript">
      const triggerPaychant = () => {
        new PaychantWidget({
           env: 'production',
           action: 'buy',
           partnerApiKey: [YOUR_PRODUCTION_PARTNER_API_KEY]',
           partnerLogoUrl: [YOUR_BRAND_LOGO_URL],
           partnerThemeColor: [YOUR_BRAND_THEME_COLOR],
           callback: {
              onClose: function() {
                 // console.log('window closed');
              },
              onStatus: function(txStatus) {
                 // console.log(txStatus);
              },
           },
        }).openWindow();
      }
    </script>
  </body>
</html>
```

By clicking the button, the Paychant widget is going to pop up.

The available configuration parameters that can be passed to Paychant, can be found [here](/integrations/parameters).


# Parameters

Here is a list of the available configuration parameters. With these parameters, you can set what users see when they open the widget.

<table><thead><tr><th width="222">Paremeter</th><th width="100">Required</th><th>Description</th></tr></thead><tbody><tr><td>env</td><td>true</td><td>This differentiates between the PRODUCTION environment and the  SANDBOX environment. The options are <code>production</code> or <code>sandbox</code>.</td></tr><tr><td>action</td><td>true</td><td>A parameter to choose between the buy or sell mode of the widget. Options are <code>buy</code> - for buying crypto and <code>sell</code> - for selling crypto. Please note: This parameter is not relevant for redirect integration. Instead, the base URL must point to the correct action, being either https://widget.paychant.com/buy or https://widget.paychant.com/sell</td></tr><tr><td>partnerApiKey</td><td>true</td><td>Your Paychant Partner API Key. If you don't have one, please <a href="https://paychant.com/contact">Fill out this form</a> to request your Key.</td></tr><tr><td>listedAsset</td><td>false</td><td>This is an optional string parameter in a comma-separated list, it allows you to sets a list of available crypto assets for users to choose from. Only the crypto assets you set will be shown in the widget. This will be a string of comma-separated values, for example (listedAsset=ethereum_dai,polygon_matic,celo_cusd). If this parameter is not set, the user will select an asset on their own from all available assets. The list of the available crypto assets can be found <a href="/resources/supported-stablecoins">here</a>.</td></tr><tr><td>fiatAmount</td><td>false</td><td>fiatAmount is an integer parameter, that allows you to set the fiat amount of either buy or sell that will be presented to the user.</td></tr><tr><td>assetAmount</td><td>false</td><td>This is an integer optional parameter that represents the amount of crypto your user wants to buy or sell. If this is not set, the user will choose the amount on their own, but if it's set, users can't change the amount.</td></tr><tr><td>walletAddress</td><td>false</td><td>The blockchain address of the user's wallet where crypto will be sent to. This is an optional string parameter, If this parameter is not set, the user will be prompted to manually enter a wallet address.</td></tr><tr><td>selectedAsset</td><td>false</td><td>This is an optional string parameter that pre-selects a crypto asset that will be shown to the user when they are on the widget.</td></tr><tr><td>partnerLogoUrl</td><td>false</td><td>A hosted image URL of your brand logo. This will appear as the widget logo in your integration.</td></tr><tr><td>paymentMethod</td><td>false</td><td>This is an optional string parameter that pre-select the payment method type, If this parameter is not set, the user will be required to select the payment method. List of supported payment methods <code>id</code> can be found <a href="/api-reference/rest-api-reference#available-payment-methods">here</a></td></tr><tr><td>userEmailAddress</td><td>false</td><td>This is an optional string parameter that pre-sets the email address of your user to make the buy or sell process quicker. If this parameter is not set, the user will be prompted to enter their email</td></tr><tr><td>webhookStatusUrl</td><td>false</td><td>This is an optional parameter that allows you to subscribe to events via webhooks. More information about webhooks can be found <a href="/resources/webhooks">here</a>.</td></tr><tr><td>partnerReferenceId</td><td>false</td><td>A unique alphanumeric characters that can be used to identify your transactions.</td></tr><tr><td>partnerThemeColor</td><td>false</td><td>This is an optional parameter to sets the theme color for the widget. If this parameter is set, Its changes the color of buttons, links, and highlighted text in the widget. Only hexadecimal codes are accepted but do not include the #. For example (2a1f63).</td></tr><tr><td>selectedFiatCurrency</td><td>false</td><td>An optional parameter that allows you to pre-set the code of the fiat currency you want the user to use in buying or selling crypto. A list of supported fiat currencies can be found <a href="/resources/supported-fiat-currency">here</a>.</td></tr><tr><td>successUrl</td><td>false</td><td><p>This is an optional string parameter that allows you to provide a link that the user will be redirected to after completing the transaction.</p><p>Please note: this parameter is only available for the Redirect integration.</p></td></tr></tbody></table>


# Testing Environment

It's important to test how your widget integration works, before going to production, that's why we have provided a testing environment where you can test the widget.

Our sandbox environment uses test networks so that you can be able to make test purchases using testnet tokens on Celo Alfajores, Binance Smart Chain Faucet, and Matic Mumbai.


# Api Keys

### How do I get an API key?

The API key is a **unique identifier that is assigned to you**. This allows you to track usage and activities such as purchases and sales count made through your integration. To get an API key please kindly [Fill out this form](https://paychant.com/contact) and one of our team will reach back to you in a few moments with the next steps. In case you need additional support or inquiry, please contact us at [sales@paychant.com](http://sales@paychant.com).

### Adding an API key in your integration

The parameter name for the API key is partnerApiKey, its value type is a string, and it should be passed along with other parameters.

**For Overlay Embed - (Javascript SDK)**

{% code overflow="wrap" %}

```javascript
new PaychantWidget({
  env: 'production',
  action: 'buy',
  partnerApiKey: [YOUR_PARTNER_API_KEY]'
}).openWindow();
```

{% endcode %}

**For Redirect Integration**

```html
<a 
href="https://widget.paychant.com/buy?partnerApiKey=[YOUR_PARTNER_API_KEY]"
target="_blank">Buy & Sell Crypto with Paychant</a>
```


# Webhooks

### Overview

Paychant webhooks allow you to get automatic updates anytime the status on your widget instance changes.

The webhook will be called when the transaction reaches the processing status and also when it is complete. Once configured, your URL will receive notifications for the PROCESSING, COMPLETE, and FAILED statuses.<br>

<figure><img src="https://2267087691-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCGfDuKGzr_1lqUPMYS%2Fuploads%2FUbtItD55eP8wJFOiDkrV%2FScreenshot%202023-03-30%20at%203.19.55%20PM.png?alt=media&amp;token=4e4a16bb-a5f6-4338-8777-61916bb762f2" alt=""><figcaption></figcaption></figure>

Once Webhook as been created, you can monitor all past and present event details in the logs.<br>

### Receiving Event

To start receiving event, you need to create unauthenticated `POST` route on your application.

{% tabs %}
{% tab title="Node" %}

```javascript
const crypto = require('crypto');
const secret = process.env.SECRET_KEY; // Your paychant webhook secret

// Using Express
router.post("/webhook/url", function(req, res) {
    
   res.sendStatus(200); // Return status code 200 quickly

   // Validate event 
   const hmac = crypto.createHmac('sha512', secret);
   const hash = hmac.update(JSON.stringify(req.body)).digest('hex');
   const headerSig = req.headers['paychant-signature'];

   if (hash === headerSig) {
      var event = req.body;
      // Do someting with the event
   }
    
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

// Only a post method and headers that contain paychant-signature will be allowed
if ((strtoupper($_SERVER['REQUEST_METHOD']) != 'POST' ) || !array_key_exists('paychant-signature', $_SERVER) ) {
    exit();
}

// Retrieve the request's body
$input = @file_get_contents("php://input");

// SET the SECRET KEY
define('PAYCHANT_WEBHOOK_SECRET_KEY','SECRET_KEY');

// Validate event
if($_SERVER['HTTP_PAYCHANT_SIGNATURE'] !== hash_hmac('sha512', $input, PAYCHANT_WEBHOOK_SECRET_KEY)){
    exit();
}

// Return status code 200 quickly
http_response_code(200);

// Do someting with the event
$event = json_decode($input);

exit();
?>php
```

{% endtab %}

{% tab title="Python" %}

```python
import os
from flask import Flask, request, Response
import hmac
import hashlib
import urllib.parse

app = Flask(__name__)
secret = os.environ.get('SECRET_KEY') # Your paychant webhook secret

@app.route('/webhook', methods=['POST'])
def respond():
    
    # Validate event 
    encode = urllib.parse.urlencode(request.json).encode('utf8')
    hashMac = hmac.new(secret, encode, hashlib.sha512).hexdigest()
    headerSig = request.headers.get('paychant-signature')
    
    if(hashMac === headerSig):
        event = request.json; # Do someting with the event
        return Response(status=200)
```

{% endtab %}
{% endtabs %}

<br>

### Respond Quickly With Status code 2xx

For webhook notification event delivery to be satisfied, your endpoint must return a HTTP status code of  `2xx` to Paychant. All response codes outside this range, including `3xx` codes, indicate to Paychant that you did not receive the event, and thus continue to send the notification event every 30 minutes for 24 hours. After 24 hours Paychant marks the event as failed and stops trying to send it to your endpoint.\ <br>

### Events Response

{% tabs %}
{% tab title="WIDGET.CREATED" %}

```javascript
{
     event: 'WIDGET.CREATED',
     data: {
       env: 'sandbox',
       pid: '8847431020',
       date: '30/03/2023 - 01:46:02',
       fiat: 'NGN',
       asset: 'CUSD',
       chain: 'CELO',
       action: 'BUY',
       fiatAmount: 149241,
       assetAmount: 300,
       userAddress: '0xCd96602dBbeE307a1d50cb074C294847aB4702FB',
       exchangeRate: 497.47,
       partnerParams: {
         reference_id: 'TRXNE5BKBEQ'
       },
       paymentMethod: 'Bank Transfer',
       cryptoAddress: '---',
       transactionRef: '7CMJS1Q90GS79AA'
    }
 }
```

{% endtab %}

{% tab title="WIDGET.AWAITING\_PAYMENT" %}

```javascript
{
     event: 'WIDGET.AWAITING_PAYMENT',
     data: {
       env: 'sandbox',
       pid: '8847431020',
       date: '30/03/2023 - 01:57:57',
       fiat: 'NGN',
       asset: 'CUSD',
       chain: 'CELO',
       action: 'BUY',
       fiatAmount: 149241,
       assetAmount: 300,
       userAddress: '0xCd96602dBbeE307a1d50cb074C294847aB4702FB',
       exchangeRate: 497.47,
       partnerParams: {
         reference_id: 'TRXNE5BKBEQ'
       },
       paymentMethod: 'Bank Transfer',
       cryptoAddress: '---',
       transactionRef: '7CMJS1Q90GS79AA'
    }
 }
```

{% endtab %}

{% tab title="WIDGET.PAYMENT\_CONFIRMED" %}

```javascript
{
     event: 'WIDGET.PAYMENT_CONFIRMED',
     data: {
       env: 'sandbox',
       pid: '8847431020',
       date: '30/03/2023 - 02:09:40',
       fiat: 'NGN',
       asset: 'CUSD',
       chain: 'CELO',
       action: 'BUY',
       fiatAmount: 149241,
       assetAmount: 300,
       userAddress: '0xCd96602dBbeE307a1d50cb074C294847aB4702FB',
       exchangeRate: 497.47,
       partnerParams: {
         reference_id: 'TRXNE5BKBEQ'
       },
       paymentMethod: 'Bank Transfer',
       cryptoAddress: '---',
       transactionRef: '7CMJS1Q90GS79AA'
    }
 }
```

{% endtab %}

{% tab title="WIDGET.PAYMENT\_COMPLETED" %}

```javascript
{
     event: 'WIDGET.PAYMENT_COMPLETED',
     data: {
       env: 'sandbox',
       pid: '8847431020',
       date: '30/03/2023 - 02:15:40',
       fiat: 'NGN',
       asset: 'CUSD',
       chain: 'CELO',
       action: 'BUY',
       fiatAmount: 149241,
       assetAmount: 300,
       userAddress: '0xCd96602dBbeE307a1d50cb074C294847aB4702FB',
       exchangeRate: 497.47,
       partnerParams: {
         reference_id: 'TRXNE5BKBEQ'
       },
       paymentMethod: 'Bank Transfer',
       cryptoAddress: '---',
       transactionRef: '7CMJS1Q90GS79AA'
    }
 }
```

{% endtab %}
{% endtabs %}

Below is the list of the events when we send the webhook:

#### Buy (OnRamp)

| Event Code                | Description                                                                                                                                                                                        |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **CREATED**               | When the transaction is created.                                                                                                                                                                   |
| **AWAITING\_PAYMENT**     | When the transaction state is expecting the user to make a payment.                                                                                                                                |
| **PAYMENT\_CONFIRMED**    | When we have received the fiat payment from the user.                                                                                                                                              |
| **PAYMENT\_COMPLETED**    | When we have received the fiat payment and the asset is successfully sent to the user.                                                                                                             |
| **PAYMENT\_INSUFFICIENT** | When we received the fiat payment but the amount of fiat sent by the user is not sufficient.                                                                                                       |
| **PAYMENT\_TIMEOUT**      | When the user failed to make the fiat payment within the given timeframe.                                                                                                                          |
| **PAYMENT\_FAILED**       | There are a couple of things that can make a transaction fail, it can either be, a canceled transaction by the user, payment not made within the given timeframe, or a network connection problem. |

#### Sell (OffRamp)

| Event Code                | Description                                                                                                                                                                                        |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **CREATED**               | When the transaction is created.                                                                                                                                                                   |
| **AWAITING\_PAYMENT**     | When a wallet address is generated for the user to send the asset payment.                                                                                                                         |
| **PAYMENT\_CONFIRMED**    | When the asset payment is received & the fiat transfer is initiated via our fiat vendor.                                                                                                           |
| **PAYMENT\_COMPLETED**    | When the fiat transfer is successfully delivered to the user's bank account or mobile wallet by our fiat vendor.                                                                                   |
| **PAYMENT\_INSUFFICIENT** | When we received the asset payment but the amount of asset sent by the user is not sufficient.                                                                                                     |
| **PAYMENT\_TIMEOUT**      | When the user failed to make the asset payment within the given timeframe.                                                                                                                         |
| **PAYMENT\_FAILED**       | There are a couple of things that can make a transaction fail, it can either be, a canceled transaction by the user, payment not made within the given timeframe, or a network connection problem. |


# Supported Fiat Currency

Below is a list of the supported fiat currencies, and their parameters that you can use to configure the widget.

| Fiat Parameter                        | Name             |
| ------------------------------------- | ---------------- |
| { fiat: `NGN`, iso\_alpha\_3: `NGA` } | Nigerian Naira   |
| { fiat: `GHS`, iso\_alpha\_3: `GHA` } | Ghanaian Cedi    |
| { fait: `KSH`, iso\_alpha\_3: `KEN` } | Kenyan Shilling  |
| { fiat: `UGX`, iso\_alpha\_3: `UGA` } | Ugandan Shilling |
| { fait: `ZMW`, iso\_alpha\_3: `ZMB` } | Zambian Kwacha   |

If you would like to list your asset on Paychant, please contact us at <sales@paychant.com>.


# Supported Stablecoins

Paychant supports a wide range of crypto assets that your users can buy and sell. Below is a list of them, and their parameters that you can use to configure the widget.

| Asset Parameter | Asset  | Chain    |
| --------------- | ------ | -------- |
| celo\_usdc      | USDC   | Celo     |
| stellar\_usdc   | USDC   | Stellar  |
| celo\_cusd      | CUSD   | Celo     |
| celo\_ceur      | CEUR   | Celo     |
| celo\_usdt      | USDT   | Celo     |
| bsc\_usdc       | USDC   | Bsc      |
| ethereum\_usdt  | USDT   | Ethereum |
| ethereum\_usdc  | USDC   | Ethereum |
| polygon\_usdt   | USDT   | Polygon  |
| polygon\_usdc   | USDC   | Polygon  |
| polygon\_usdc.e | USDC.e | Polygon  |
| bsc\_usdt       | USDT   | Bsc      |
| tron\_usdt      | USDT   | Tron     |

If you would like to list your asset on Paychant, please contact us at <sales@paychant.com>.


# Rest API Reference

All endpoints as subject to rate limiting

{% hint style="info" %}
<https://api-partner.paychant.com>
{% endhint %}

### Get Price

## Get asset price

<mark style="color:blue;">`GET`</mark> `/price/{chain}/{asset}?iso={iso_alpha_3}&action={action}`

#### Path Parameters

<table><thead><tr><th width="261">Name</th><th width="156">Type</th><th>Description</th></tr></thead><tbody><tr><td>chain<mark style="color:red;">*</mark></td><td>String</td><td><a href="/resources/supported-stablecoins">Check Supported Stablecoin</a></td></tr><tr><td>asset</td><td>String</td><td><a href="/resources/supported-stablecoins">Check Supported Stablecoin</a></td></tr></tbody></table>

#### Query Parameters

<table><thead><tr><th width="258">Name</th><th width="159">Type</th><th>Description</th></tr></thead><tbody><tr><td>iso<mark style="color:red;">*</mark></td><td>String</td><td><a href="/resources/supported-fiat-currency">Check Supported Fiat Currency</a></td></tr><tr><td>action<mark style="color:red;">*</mark></td><td>String</td><td><a href="/integrations/parameters">Check Parameters for more info</a></td></tr><tr><td>fiatValue</td><td>Integer</td><td>This is an optional integer parameter. If this is selected, the value is used to calculate the returned asset price.</td></tr><tr><td>assetValue</td><td>Integer</td><td>This is an optional integer parameter. If this is selected, the value is used to calculate the returned fiat price.</td></tr><tr><td>networkFee</td><td>String</td><td>This is an optional string parameter of either [ON - OFF]. If ON is selected, paychant network fee will be calculated along side to get the fiat/asset price.</td></tr><tr><td>paymentMethod</td><td>String</td><td>This is an optional string parameter. If this is selected, the transaction fee for the payment method will be calculated along side to get the fiat/asset price. List of supported payment methods <code>id</code> can be found <a href="/api-reference/rest-api-reference#available-payment-methods">here</a></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "usd": 1,
    "nga": 1186.04,
    "price": 1216.45,
    "minimum": 1000,
    "maximum": 5000
}
```

{% endtab %}

{% tab title="200: OK" %}

```json
{
    "usd": 0.099,
    "usdc": 0.00084,
    "price": 1213.11,
    "minimum": 1000,
    "maximum": 5000
}
```

{% endtab %}
{% endtabs %}

### Available fiats

## Get supported fiat currency

<mark style="color:blue;">`GET`</mark> `/fiat`

{% tabs %}
{% tab title="200: OK " %}

```json
[
    {
        "fiat": "NGN",
        "iso_alpha_3": "NGA"
    },
    {
        "fiat": "GHS",
        "iso_alpha_3": "GHA"
    },
    ...
]
```

{% endtab %}
{% endtabs %}

## Available assets <a href="#available-assets-and-prices" id="available-assets-and-prices"></a>

## Get supported assets based on action and env

<mark style="color:blue;">`GET`</mark> `/assets/{action}/{env}`

#### Path Parameters

| Name                                     | Type   | Description                                                |
| ---------------------------------------- | ------ | ---------------------------------------------------------- |
| action<mark style="color:red;">\*</mark> | String | [Check Parameters for more info](/integrations/parameters) |
| env                                      | String | [Check Parameters for more info](/integrations/parameters) |

{% tabs %}
{% tab title="200: OK " %}

```json
[
    {
        "chain": "CELO",
        "asset": "CELO"
    },
    {
        "chain": "STELLAR",
        "asset": "USDC"
    },
    {
        "chain": "BSC",
        "asset": "USDT"
    },
    {
        "chain": "POLYGON",
        "asset": "USDC"
    },
    ...
]
```

{% endtab %}
{% endtabs %}

### Available Payment Methods

## Get supported payment method based on fiat currency type

<mark style="color:blue;">`GET`</mark> `/payment-method/{iso_alpha_3}`

#### Path Parameters

| Name          | Type   | Description                                                         |
| ------------- | ------ | ------------------------------------------------------------------- |
| iso\_alpha\_3 | String | [Check Supported Fiat Currency](/resources/supported-fiat-currency) |

{% tabs %}
{% tab title="200: OK " %}

```json
[
    {
        "name": "M-Pesa",
        "nameId": "m_pesa"
    },
    {
        "name": "Bank Transfer",
        "nameId": "bank_transfer"
    },
    ...
]
```

{% endtab %}
{% endtabs %}


