> For the complete documentation index, see [llms.txt](https://lara-script.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lara-script.gitbook.io/docs/admin-panel-functionality/general/auto-withdrawals/ecpay.md).

# ECPAY

Integration with **ECPAY Systems** allows you to automatically pay fiat funds to clients immediately after the request is paid. As soon as an auto-payout request is paid, the system sends it to your ECPAY personal account, where you can moderate the payouts.

The integration process takes 10–15 minutes and consists of three parts: currency setup, custom field setup, and direction setup.

### Step 1: Obtaining API keys in ECPAY

* Register an account on [ecpay.systems](https://ecpay.systems/) and log in to your personal account
* Click on the **profile icon** in the top right corner and go to **"Settings"**
* Scroll down to the section **"🔌 API access"**
* Make sure the status is **"● Active"** — if the status is "Off", contact the platform administrator to activate it<br>

  <figure><img src="/files/RQbWHzgwZe65P8vM7aAh" alt="" width="276"><figcaption></figcaption></figure>
* Copy:
  * **API key** — public key
  * **API secret** — secret key<br>

    <figure><img src="/files/huAvSy5EzLblzTWr3L0g" alt="" width="563"><figcaption></figcaption></figure>

> 💡 Read more about obtaining keys in the [ECPAY documentation](https://ecpay.systems/docs.php#getkey)

### Step 2: Connecting auto-payouts in the admin panel

* Log in to the Lara Script admin panel
* Go to **"General"** → **"Auto payouts"**
* Find **ECPAY Systems** in the list and click **"Edit"**
* Fill in the fields:
  * **API key** — paste the public API key from the ECPAY personal account
  * **API secret** — paste the secret key from the same section
* Click "Save"
* Click the switch to activate the provider

### Step 3: Currency setup

Go to **"General"** → **"Currencies"**.

The key rule: the currency ticker in Lara Script must **exactly match** the `bank_code` from the ECPAY documentation. The system uses this code to determine the bank for the payout.

Matching examples:

| Bank / Method | Currency | Ticker (bank\_code) |
| ------------- | -------- | ------------------- |
| Halyk Bank    | KZT      | `HALYKKZT`          |
| Monobank      | UAH      | `MONOBUAH`          |
| Card Transfer | KGS      | `CARDKGS`           |
| Kaspi Bank    | KZT      | `KASPIKZT`          |
| SEPA Instant  | EUR      | `SEPAEUR`           |
| Privat Bank   | UAH      | `P24UAH`            |

The full list of current `bank_code` for all currencies is available in the [ECPAY documentation → Bank codes](https://ecpay.systems/docs.php#banks).

> ⚠️ If the ticker is incorrect, the system will not be able to match the currency with the bank and the payout will not be created.

### Step 4: Custom field setup

Go to **"General"** → **"Custom fields"**.

Custom fields determine which details the client must enter when creating a request. They need to be configured according to ECPAY requirements — in the section [Bank details → Validation types](https://ecpay.systems/docs.php#requisites).

For each field, you need to choose a **tag**that matches the data type in ECPAY:

| Detail type in ECPAY | Field tag in Lara Script |
| -------------------- | ------------------------ |
| Card number (`card`) | Card                     |
| IBAN (`iban`)        | IBAN                     |
| Email (`email`)      | Email                    |
| Phone (`phone`)      | Phone                    |
| Recipient full name  | FIO                      |

<figure><img src="/files/SHdjETqWTmPFrLoi3dF6" alt="" width="375"><figcaption></figcaption></figure>

Create all the fields required by the bank you need. For example, for Halyk Bank (KZT), the fields **Card** and **Recipient full name**, and for SEPA Instant (EUR) — **IBAN** and **Recipient full name**.

After creating the fields, they need to be linked to the currency:

* Go to **"General"** → **"Currencies"** → open the required currency
* In the section **"Receive"** click **"+Add"** and select the created fields

### Step 5: Exchange direction setup

Go to **"General"** → **"Directions"**.

Open the required direction, where fiat acts as the currency **"Receive"** (that is, what the client receives).

In the section **"Payouts"**:

* Click **"Add row"**
* In the field **"Automatic payouts"** select **ECPAY Systems**
* Specify **minimum** and **maximum** amount to trigger the auto-payout (limits apply to the "Receive" currency)
* Save the direction

### How it works

After setup is complete, the request processing flow looks like this:

1. The client creates a request and enters the details (card, IBAN, email, etc.)
2. The client pays for the request
3. Lara Script records the payment → the request gets the status **"Paid"**
4. The system automatically creates a payout in ECPAY
5. The request appears in your ECPAY personal account in the requests section<br>

   <figure><img src="/files/qosPwcmqrlJ2HOBTk8vR" alt="" width="563"><figcaption></figcaption></figure>
6. The ECPAY operator moderates and completes the payout to the client
7. After the payout, the request moves to the status **"Completed"**

> ℹ️ If the amount of the received payment does not match the request amount, the request will receive the status **"Under review"** and the payout will not be completed automatically. In that case, manual processing will be required via the button **"Start auto-payment"** with the manual withdrawal code entered. The code is configured in **Admin settings → Confirmation code for manual withdrawal.**

#### Using quotes **ECPAY** Systems

Lara Script also supports working with quotes from the ECPAY Systems service.

You can create quotes based on ECPay rates and then use them for currencies and exchange directions. Quotes are supported for all currencies and networks available in ECPAY Systems.

To add a quote:

1. Go to the section:\
   **Currency rates → Quotes**
2. Click the **"Add"**
3. When creating a formula, choose the quote source **ecpay**
4. Save the quote

After that, the created quote can be used:

* in currency formulas;
* in exchange direction formulas;
* in automatic rate calculation.

This allows you to automatically receive and use current ECPAY Systems rates inside Lara Script and process requests without being tied to different services; the same service will provide you with current rates, and the same service will act as a merchant for processing requests.
