# Setup of MyFatoorah Payment Gateway

### Overview

### MyFatoorah – Overview

**MyFatoorah** is a payment gateway that allows businesses to accept online payments through multiple payment methods. With the MyFatoorah integration, you can collect payments directly through the platform and manage transactions from your dashboard.

Once connected, it enables a smooth and secure payment experience for your customers.

***

### Key Benefits of MyFatoorah Integration

* Accept online payments through multiple methods.
* Send payment links directly to customers.
* Secure and reliable transaction processing.
* Track payment status in real time.
* Simplifies subscription and add-on purchases.

***

### Where MyFatoorah Is Used

MyFatoorah can be used for:

* Plan purchases
* Add-on purchases
* Subscription renewals

Customers can select MyFatoorah as their payment method during checkout.

***

### Prerequisites

Before starting, make sure you have:

* An active **MyFatoorah account**
* Access to **API credentials** (API Key / Token)
* Admin access to your BotPenguin dashboard

***

### A. Get API Credentials from MyFatoorah

**How to Generate Your API Token Key:**

* Log in to your MyFatoorah account using your Super Master Account <https://portal.myfatoorah.com/En/KWT/Dashboard>.
* From the side menu, select **Integration Settings → API Key**

<figure><img src="/files/4qz5IfVANJAyjeTBEtUo" alt=""><figcaption></figcaption></figure>

* Click the "**Add button"** to generate a new key.

<figure><img src="/files/qRnrsMvVGjtu4FKrF9AV" alt=""><figcaption></figcaption></figure>

* You will be redirected to a page where you can configure the key settings:
  * **Name:** A custom label for your token.
  * **Expiry Date:** Define when this key will expire.
  * **Active Status:** Choose whether the key is active or inactive.
  * **Permissions:** Select which API endpoints the key can access, and you can assign custom permissions like Super Rules, Create Payments, Update Payments, etc.

<figure><img src="/files/dQstardbg5qaZ45jG05F" alt=""><figcaption></figcaption></figure>

* After filling in the details, scroll down and click Create to generate the new API key.

<figure><img src="/files/m7Mr94DTKzr1osXg22ub" alt=""><figcaption></figcaption></figure>

* Once created, your key will appear in the list.

<figure><img src="/files/tw8YRauKCmAe1cUJtfXR" alt=""><figcaption></figcaption></figure>

* Click on the Copy icon next to the key to copy it and start using this key in your integration.

<figure><img src="/files/jeo61hCzACTD8EHnQGap" alt=""><figcaption></figcaption></figure>

> Use **Test credentials** for testing and **Live credentials** when going production.

5. Then navigate to the "Webhook settings".
6. Copy the "Webhook Secret Key".

{% hint style="success" %}
**Important Notes**

* You can **create up to 5 API keys** only.
* If you use a token to access an endpoint **without the required permissions**,\
  you will receive the following error:\
  `Status Code: 401 , Message: "The token does not have the required permissions!"`
* You can edit an existing API key by clicking the Edit icon next to it. This allows you to update the name, permissions, status, or **delete** the key.
  {% endhint %}

**Generating Webhook**

We use webhooks to notify your application when an event happens in your account. Webhooks are particularly useful for asynchronous events, like when a customer has made a payment, deposited money to your account, the refund status has changed, or the supplier account status has changed.\
You can listen to specific events by webhook, as you don’t need to inquire about these actions to get the response.

To start with the MyFatoorah Webhook service, you can follow these steps to complete your integration settings:

1. Log in to your portal account and go to **Integration Settings** => **Webhook Settings** and configure your settings.

<figure><img src="/files/wptSX6TbpAetSpAB7GwO" alt=""><figcaption></figcaption></figure>

2. Enable the Webhook Feature.
3. Add your endpoint URL, which will handle the event.

<figure><img src="/files/je6ZaHKdcnvPYIrthnC2" alt=""><figcaption></figcaption></figure>

4. Select the event types to get the webhook events.
5. Choose the Webhook Version. If you choose V2, make sure to configure the retries.
6. Click on the **Save** button.
7. Be ready to receive the notifications.
8. &#x20;Navigate to the "**Webhook Settings"**.
9. Copy the webhook secret key

<figure><img src="/files/MOWibWCduITWAD49anK6" alt=""><figcaption></figcaption></figure>

***

### B. Connect MyFatoorah in Agency Panel.

1. Log in to your **BotPenguin Dashboard**.
2. Click on **Integrations**.
3. Search or Select MyFatoorah by clicking on the **"Connect"** button.

<figure><img src="/files/9srJaX2OugQcAL5Cxc5I" alt=""><figcaption></figcaption></figure>

4. Enter the required details:

* MyFatoorah API secret Key
* Webhook Secret Key

Once entered, click on the "**Update**" button.&#x20;

<figure><img src="/files/ZeJ7VOZWehXU9Fp0ML7W" alt=""><figcaption></figcaption></figure>

### C. Enable MyFatoorah Payment Method for Customers

After completing the MyFatoorah integration, you need to enable it as a payment method for your customers.

**Steps:**

1. Log in to your agency dashboard.
2. Go to **Customers** → **Customer Plans**.
3. Open the **Configuration** sub-tab.
4. Navigate to **Currency & Payment Reminders**.
5. Under **Set Payment Method For Your Currencies**:
   * Select the **Currency** (e.g., KWD).
   * Choose **MyFatoorah** as the **Payment Method**.
   * Select Payment Grace Applicable.
6. Click the **Update** button to save the settings.

The selected currency will now use MyFatoorah as the payment method for customer subscriptions and invoices.

<figure><img src="/files/KHYme9jb8eeOBdPZ6EK5" alt=""><figcaption></figcaption></figure>

### FAQs

<details>

<summary>Can I use MyFatoorah in test mode?</summary>

Yes, you can use test credentials to simulate payments before going live. No money will be deducted when using the application in the test mode.

</details>

<details>

<summary>Can I switch from test to live later?</summary>

Yes, simply update the API key and change the environment to Live.

</details>

<details>

<summary>What currencies are supported?</summary>

Supported currencies depend on your MyFatoorah account and region.

</details>

<details>

<summary>What if payment link is not generated?</summary>

* Check if API key is correct.
* Ensure the correct environment (Test/Live) is selected.

</details>

<details>

<summary>What if Payment status not updating?</summary>

* Confirm integration is connected.
* Retry the transaction with valid credentials.

</details>

#### Need Help?

Please feel free to reach out to us at <mark style="color:$primary;"><support@botpenguin.com></mark>, in case of any questions or concerns.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://partners.botpenguin.com/partner-platform-guidelines/integration-setup/setup-of-myfatoorah-payment-gateway.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
