# Documentation Overview

The purpose of this documentation is to illustrate how to integrate any project with Trybit and start accepting cryptocurrency payments.

## About the service

[Trybit](https://trybit.com/) is a payment gateway that allows you to accept and process payments conveniently in popular cryptocurrencies. With our crypto acquiring service, you can connect cryptocurrency payment acceptance to an online service, online store, online school, Telegram bot and other platforms.

Our API is designed to provide flexibility and convenience for developers integrating cryptocurrency into their applications and platforms.

## Key API features

* **Invoice management:** create, manage and monitor your invoices in real-time.
* **Transaction automatization:** set up automatic payments and withdrawals to crypto wallets.
* **Security and transparency:** high level of transaction security and full transparency of all operations.

You can connect to your website or other platform in several ways:

* [API](/api-reference-v2/authorization);
* [Host2Host (H2H);](/api-reference-v2/h2h)
* [CMS plugins](/cms-plugins/list);
* [HTML forms and buttons](/buttons-forms/html-widget).

Choose the method that suits your needs and contact our support if you have any questions.


# How the Integration Works

Trybit integration involves your platform interacting with our API to automate transactions. Here's how it works:

1. **Request authorization:**

   * All requests to the API must be authorized using your API keys.

2. **Invoice creation:**
   * You submit a request to create an invoice, specifying the required parameters and total amount.<br>

3. **Receiving a payment link or payment details:**
   * In response to your request, the system generates and sends you a unique payment link or payment details.<br>

4. **User payment:**
   * Your user completes the payment via the provided link or payment details.<br>

5. **Funds receipt notification:**
   * Once funds are received in your account, we send a POSTBACK to the notification URL specified in your project settings.
   * You need to process this notification and, if necessary, take the corresponding action on the side of your platform.<br>

6. Invoice verification:
   * You can independently verify the status of an invoice using its INV number through a corresponding request to the API.

This process provides a secure and efficient interaction between your platform and the Trybit service, allowing you to automate the payment acceptance and account management process.


# Integration Testing

After you have added your project, a test mode is automatically enabled. It is necessary to check the correctness of integration.

The current mode of the project can be tracked in the «My Projects» section.

{% hint style="info" %}
When the test mode is enabled, you can create invoices in any available way and confirm them without making a payment. These invoices will not change your balance.
{% endhint %}

1. To test the integration, you need to create an invoice by going to the checkout on your website or another platform you have integrated with. Creating an invoice manually in the «Payments» section will not test the integration with your platform.

<figure><img src="/files/6uiF7dMUeDrBSxCDrdnC" alt=""><figcaption></figcaption></figure>

2. To confirm the test invoice and send a payment notification, you need to go to the «Payments» section, turn on the «Show test invoices» toggle, find the required invoice and click on it.

<figure><img src="/files/0cRci54TGuTPWHX1sslR" alt=""><figcaption></figcaption></figure>

After opening the page with information about the invoice, you will see the «Confirm invoice without payment» button.

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

3. When you click on this button, we will send a notification of successful payment to the «Notification URL» of your project. After sending, the invoice status in your personal account and on the payment page will automatically change to «Paid». No funds will be credited to the balance.

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

If, after clicking on the «Confirm invoice without payment» button, the status on the page of the created invoice has not changed, you need to make adjustments to the integration settings. In your personal account, the status of the created invoice will automatically change to «Created». After making changes to the integration settings, you can send the notification again.

To view the notification status, go to the “POSTBACK History” section. Clicking a specific notification opens a window with the request sent and the response received from your server. After exiting test mode, you can resend a notification for an already paid invoice in this section.

After the integration is configured and tested, make sure that all fields in the project are filled in correctly. Then send a request to exit the test mode — it will take up to 24 hours from the moment of sending. You can track the status of the request in your personal account.

When the test mode is turned off, you can create invoices in any available way, but the only way to confirm them will be to pay the invoice fully. The payments of these invoices will be credited to your balance.

If necessary, you can enable test mode at any time. To activate payment acceptance again, you must resubmit a request to exit test mode.


# How to Get API Keys

To work with the Trybit API, you will need to get unique API keys. These keys identify your project and enable secure communication between your platform and the Trybit service. Here's how you can get your API keys:

1. **Log in to your personal account:**

   * Register and log in to your personal account on the Trybit platform.

2. **Create a new project:**

   * Go to «My Projects» in the left menu.
   * Click the «Create a new project» button.
   * In the «How do you want to accept payments» section, select «On your website».
   * Fill in all the required parameters.

3. **Receiving keys:**
   * After creating a project, go to its settings.
   * On the right side of the screen, find the section with your API KEY, SHOP ID and SECRET KEY.

{% hint style="info" %}
[How can I add a project?](https://support.trybit.com/getting-started/add-project)
{% endhint %}

You now have all the keys you need to work with the Trybit API. Keep them secured and do not share them with third parties.


# SDK for Work with API

In this section, you can download an SDK that makes integrating with our API much easier and faster. Here are the basic steps to help you get started:

1. **Download the SDK:**

   Download the latest version of the SDK for your platform. Our SDK is available for various programming languages, providing maximum flexibility and convenience for your project.

{% file src="/files/TplD59s5PwZpnL62Xd0p" %}

2. **Connect the SDK file:**\
   After downloading, simply add the SDK file to your project. It's easy to do. Our documentation provides detailed instructions for each programming language.<br>
3. **Start the integration:**

   With the SDK, you can quickly set up a connection to our API. The SDK includes a set of handy functions and methods that make it easy to send requests and process responses.

Start using our SDK today and speed up the process of integrating applications with our API!


# Integration of Icons and Buttons

Proper use of branded elements helps create a unified and recognizable user experience and increases conversion rates during the payment selection process.

The Trybit Brand Guide is designed to simplify the work for everyone who interacts with our brand. It provides clear instructions for the correct use of:

* Trybit logos on your website and marketing materials;
* The color palette and typography;
* Icons for available payment methods (BTC, ETH, USDT, and others);
* Payment buttons and banners for integration into the checkout process.

<div><figure><img src="/files/5hmY4aOmaK1rUh3OSIaL" alt=""><figcaption></figcaption></figure> <figure><img src="/files/BCm8Kx9KNsiR0QLfMXzj" alt=""><figcaption></figcaption></figure></div>

Branded Elements. This section contains everything you need for the proper use of the brand’s visual components: logos, buttons, icons, and other elements for designing payment pages and interfaces.

Marketing Materials. Here you will find ready-to-use recommendations on how to inform your users about the new cryptocurrency payment option via Trybit: banners, texts, and examples of placement on your website and communication channels.

Using the Brand Guide Helps:

* Build customer trust;
* Create a consistent brand image;
* Increase the number of successful payments and repeat purchases;
* Boost the average order value and overall website conversion rates.

Proper integration of Trybit icons and buttons makes the payment process clear and predictable for users, positively impacting all key business metrics.


# Cryptocurrency payment instruction

This section offers a cryptocurrency payment instruction template for your customers. You can place it on your website as well as on the checkout page.

{% hint style="info" %}
Publishing payment instructions helps increase conversion, especially for customers with little experience in cryptocurrency transactions.
{% endhint %}

We are pleased to offer you a convenient and secure cryptocurrency payment method. \[Company Name] accepts payment in Tether (USDT), Bitcoin (BTC), Ethereum (ETH), Litecoin (LTC) and other cryptocurrencies.

Below is a simple guide to help you through this payment process.

### 1. Creating an order

Create an order on our website and go to the payment page. In the payment methods, select «Trybit». You will be redirected to the created invoice page.

### 2. Select cryptocurrency for payment

Select the cryptocurrency and network you want to use for payment from the list of supported ones. Also, provide an email address to receive payment notifications.

<figure><img src="/files/0sO483f9dVat7ZC7VIfe" alt="Select cryptocurrency for payment" width="563"><figcaption></figcaption></figure>

Make sure that your cryptocurrency wallet has enough funds to complete the payment. Remember that sending funds in cryptocurrency involves charging a network fee. Next, click the «Pay» button.

### 3. Receiving payment address

The next payment process step will display a unique payment address for making the transaction with a QR code.

<figure><img src="/files/Ol3AQKXdG8DwEpc3Muxo" alt="Receiving payment address" width="563"><figcaption></figcaption></figure>

Copy the payment address or scan the QR code using your cryptocurrency wallet or exchange's mobile app. Make sure to be accurate, as sending cryptocurrency to the wrong address can result in loss of funds.

### 4. Making payment from your wallet

Open your cryptocurrency wallet from which you are going to send the payment. Select the appropriate cryptocurrency and network in the «Send» or «Withdraw» section.

Enter your wallet's copied address (or scan the QR code). Enter the exact amount of cryptocurrency needed for the transaction.

<figure><img src="/files/fzD19R7jqPhvoM9xlAAl" alt="Making payment from your wallet" width="563"><figcaption></figcaption></figure>

Remember about the transaction fee charged by your wallet or blockchain network, which may need to be added to the total amount of funds sent. When sending money, you need to verify that the correct amount reaches the Trybit service after all fee deductions.

Most providers add the commission to the required sum, but there are wallets and exchanges where the commission amount is deducted from the total transfer amount.

If you send the wrong funds amount, the system will detect your payment and calculate the minimum amount to be paid.

### 5. Confirmation and sending of payment

The invoice is available for payment for a limited time. On the payment page, there is a countdown timer for your convenience.

If you have sent funds and the invoice has expired, it will be confirmed as soon as the funds are received. If your invoice expires and you have not yet paid, we advise you to create or submit a new invoice for payment.

Double-check the address and amount before confirming the transaction. Remember that transactions on the blockchain are irreversible. Next, follow your wallet's procedure to authorize and submit the transaction. This may include two-factor authentication or other security measures.

### 6. Waiting for confirmation from the blockchain

Once confirmed, the transaction data will be sent to the blockchain. Once the payment service identifies your transaction, the status on the screen will change. The transaction confirmation speed depends on the selected cryptocurrency and the workload of the blockchain network. It usually takes between 2 to 10 minutes to confirm a transaction. Bitcoin bill payments can take up to 1 hour or more.

You can use a blockchain explorer, such as [Blockchair](https://blockchair.com/) or [Tronscan](https://tronscan.org/#/), to monitor transactions. You will need a transaction ID, usually provided by the wallet, after the payment is sent.

### 7. Completing the order

Once the transaction has been confirmed by the payment service, you will receive a notification of successful payment. At this point, the status of your order will change to «Paid».

After confirmation, we will start processing your order.

### Recommendations

* Always ensure you send the payment to the correct address with the right currency and network.
* Keep the transaction ID and any other information about your payment for future reference.
* You can contact our specialists or payment service support if you have any questions during or after the payment process.


# Support and FAQ

You can find more information about CryptoCloud service in the knowledge base. There, you will find answers to many popular questions:

* [How can I add a project?](https://support.trybit.com/getting-started/add-project)
* [How to set up an added project?](https://support.trybit.com/getting-started/project-settings)
* [How to create an invoice?](https://support.trybit.com/payments/invoice-creation-methods)
* [What are your service fees?](https://support.trybit.com/general-information/fees)
* [What currencies does your service support?](https://support.trybit.com/general-information/currencies-networks)
* [What business types do you connect?](https://support.trybit.com/general-information/connection-requirements)
* [How does the payment process work for the customer?](https://support.trybit.com/general-information/payment-page)
* [How and how quickly do I withdraw funds?](https://support.trybit.com/withdrawals/withdrawal-request)

Contacts of our tech support specialists [are here](https://trybit.com/support).&#x20;

Company website — <https://trybit.com/>.


# Request Authorization

### Authorization header

To authorize each API request, pass your API KEY in the `Authorization` header as follows:

```
Authorization: Token <API KEY>
```

### Example of a request with a token

An example of using the `Authorization` header in an API request:

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

```bash
curl -X POST https://api.trybit.com/v2/invoice/create \
-header "Authorization: Token eyJ0eXAi1iJKV1QiLCJhbGci1iJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEH"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.trybit.com/v2/invoice/create"
headers = {
    "Authorization": "Token eyJ0eXAi1iJKV1QiLCJhbGciOiJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEH"
}

response = requests.post(url, headers=headers)

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Fail:", response.status_code, response.text)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const url = 'https://api.trybit.com/v2/invoice/create';
const headers = new Headers({
    'Authorization': 'Token eyJ0eXAi1iJKV1QiLCJhbGciOiJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEH'
});

fetch(url, { method: 'POST', headers })
    .then(response => {
        if (response.ok) {
            return response.json();
        } else {
            return Promise.reject('Auth error');
        }
    })
    .then(data => {
        console.log('Success:', data);
    })
    .catch(error => {
        console.error('Fail:', error);
    });
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.trybit.com/v2/invoice/create");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$headers = array(
    "Authorization: Token eyJ0eXAi1iJKV1QiLCJhbGciOiJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEH"
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Error cURL: ' . curl_error($ch);
} else {
    $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

    if ($statusCode == 200) {
        echo "Success: " . $response;
    } else {
        echo "Fail: " . $statusCode . " " . $response;
    }
}

curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
You don't need to send a separate authorization request. API KEY should be transferred in the Authorization header.
{% endhint %}

### Possible errors

| Response code      | Error key    | Error description |
| ------------------ | ------------ | ----------------- |
| 400                | Bad request  | Invalid request   |
| Некорректный токен | Unauthorized | Invalid token     |

### Example of a response with an error

```json
{
    "status": "error",
    "result": {
        "authorization": "Unauthorized request."
    }
}
```


# Invoice Creation

The method allows you to create an invoice for a customer using a POST request.

In order to create an invoice, you need to send a POST request.

### What the method allows you to do

* Creates a unique invoice
* Returns a payment link or payment details
* Allows you to pass additional data

### Endpoint

<mark style="color:green;">`POST`</mark> `https://api.trybit.com/v2/invoice/create`

### Headers

| Name                                            | Type   | Example                             | Description     |
| ----------------------------------------------- | ------ | ----------------------------------- | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Token eyJ0eXAiOiJK<...>4npi1ksS8tSY | Project API key |

### Request Body

Key parameters

| Name                                       | Type   | Example           | Description                                                                                                                                                                                                                 |
| ------------------------------------------ | ------ | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| shop\_id<mark style="color:red;">\*</mark> | string | NGpD44<...>KXRdQ  | Unique identifier of the store from personal account                                                                                                                                                                        |
| amount<mark style="color:red;">\*</mark>   | float  | 100               | Payment amount in USD                                                                                                                                                                                                       |
| currency                                   | string | USD               | <p>Available conversion currencies:</p><p></p><p>USD, UZS, KGS, KZT, AMD, AZN, BYN, AUD, TRY, AED, CAD, CNY, HKD, IDR, INR, JPY, PHP, SGD, THB, VND, MYR, RUB, UAH, EUR, GBP.</p><p></p><p>The default currency is USD.</p> |
| order\_id                                  | string | ORDER\_93223      | Custom invoice number in the external system                                                                                                                                                                                |
| email                                      | string | <email@gmail.com> | Payer’s email address                                                                                                                                                                                                       |

Optional parameters

**add\_fields** — an object for passing additional data

| Name        | Type | Example                                                                     | Description           |
| ----------- | ---- | --------------------------------------------------------------------------- | --------------------- |
| add\_fields | dict | <p>{time\_to\_pay: {</p><p> "hours": 24, "minutes": 0</p><p> },</p><p>}</p> | Additional parametres |

{% hint style="warning" %}
Optional parameters must be passed within the **add\_fields** object.
{% endhint %}

<table data-full-width="false"><thead><tr><th width="215">Name</th><th width="175.8984375">Type</th><th width="193.6492919921875">Example</th><th width="196">Description</th></tr></thead><tbody><tr><td>time_to_pay</td><td>dict</td><td>{ "hours": 24, "minutes": 0 }</td><td>Invoice lifetime</td></tr><tr><td>available_currencies</td><td>list[string]</td><td>[ "USDT_TRC20", "ETH", "BTC" ]</td><td><p>Available payment currencies:<br></p><p>BTC, LTC, TRX, SOL, TON, BNB, ETH, ETH_ARB, ETH_BASE, ETH_OPT, USDT_ARB, USDT_BSC, USDT_ERC20, USDT_OPT, USDT_SOL, USDT_TON, USDT_TRC20, USDC_ARB, USDC_BASE, USDC_BSC, USDC_ERC20, USDC_OPT, USDC_SOL, DAI_ARB, DAI_BASE, DAI_BSC, DAI_ERC20, DAI_OPT, USDD_TRC20, PYUSD_ERC20, PYUSD_SOL, XAUT_ERC20, XAUT_TON, ARB_ARB, OP_OPT, PEPE_BSC, PEPE_ERC20, SHIB_BSC, SHIB_ERC20, TRUMP_SOL</p></td></tr><tr><td>cryptocurrency</td><td>string</td><td>ETH</td><td><p>Selecting the payment currency on behalf of the user.<br></p><p>If a currency is specified, the payment page will display the payment details without a currency selection option.<br></p><p>The address and amount will also be returned in the API response.</p></td></tr></tbody></table>

### Request examples

These examples show how to send a request to create an invoice. Note that you must provide your API key in the `Authorization` header to successfully authorize the request.

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

```bash
curl -X POST \
     -H "Authorization: Token <API KEY>" \
     -H "Content-Type: application/json" \
     -d '{"amount": 100, "shop_id": "xBAivfPIbskwuEWj", "currency": "USD"}' \
     "https://api.trybit.com/v2/invoice/create"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://api.trybit.com/v2/invoice/create"
headers = {
    "Authorization": "Token <API KEY>",
    "Content-Type": "application/json"
}

data = {
    "amount": 100,
    "shop_id": "xBAivfPIbskwuEWj",
    "currency": "USD"
}

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Fail:", response.status_code, response.text)
```

{% endtab %}

{% tab title="JavaScript " %}
{% code title="Fetch.js:" %}

```javascript
const url = 'https://api.trybit.com/v2/invoice/create';
const headers = new Headers({
    'Authorization': 'Token <API KEY>',
    'Content-Type': 'application/json'
});
const data = {
    amount: 100,
    shop_id: 'xBAivfPIbskwuEWj',
    currency: 'USD'
};

fetch(url, {
    method: 'POST',
    headers,
    body: JSON.stringify(data)
})
.then(response => {
    if (response.ok) {
        return response.json();
    } else {
        return Promise.reject('Creation Error');
    }
})
.then(data => {
    console.log('Success:', data);
})
.catch(error => {
    console.error('Fail:', error);
});
```

{% endcode %}

{% code title="Ajax.js:" %}

```javascript
$.ajax({
    url: 'https://api.trybit.com/v2/invoice/create',
    method: 'POST',
    headers: {
        'Authorization': 'Token <API KEY>',
        'Content-Type': 'application/json'
    },
    data: JSON.stringify({
        amount: 100,
        shop_id: 'xBAivfPIbskwuEWj',
        currency: 'USD'
    }),
    success: function(data) {
        console.log('Success:', data);
    },
    error: function(error) {
        console.error('Fail:', error);
    }
});
```

{% endcode %}

{% code title="Axios.js:" %}

```javascript
const axios = require('axios');

const url = 'https://api.trybit.com/v2/invoice/create';
const headers = {
    'Authorization': 'Token <API KEY>',
    'Content-Type': 'application/json'
};
const data = {
    amount: 100,
    shop_id: 'xBAivfPIbskwuEWj',
    currency: 'USD'
};

axios.post(url, data, { headers })
    .then(response => {
        console.log('Success:', response.data);
    })
    .catch(error => {
        console.error('Fail:', error);
    });
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code title="cURL:" %}

```php
<?php
$url = "https://api.trybit.com/v2/invoice/create";
$headers = array(
    "Authorization: Token <API KEY>",
    "Content-Type: application/json"
);

$data = array(
    "amount" => 100,
    "shop_id" => "xBAivfPIbskwuEWj",
    "currency" => "USD"
);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if($http_code == 200){
    echo "Success: " . $response;
} else {
    echo "Fail: " . $http_code . " " . $response;
}

curl_close($ch);
?>
```

{% endcode %}

{% code title="File\_get\_contents:" %}

```php
<?php
$url = "https://api.trybit.com/v2/invoice/create";
$headers = array(
    "http" => array(
        "header" => "Authorization: Token <API KEY>\r\n" .
                    "Content-Type: application/json\r\n",
        "method" => "POST",
        "content" => json_encode(array(
            "amount" => 100,
            "shop_id" => "xBAivfPIbskwuEWj",
            "currency" => "USD"
        )),
    ),
);

$context  = stream_context_create($headers);
$response = file_get_contents($url, false, $context);
$http_code = $http_response_header[0];

if(strpos($http_code, "200")){
    echo "Success: " . $response;
} else {
    echo "Fail: " . $http_code . " " . $response;
}
?>
```

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

### Response examples

A successful request returns a response with the status `success` and a `result` object.

{% tabs %}
{% tab title="200: OK – Invoice has been created" %}

```json
{
    "status": "success",
    "result": {
        "uuid": "INV-89UX09KA",
        "created": "2026-01-27 09:03:58.958133",
        "address": "0xb07427fc721C23674c48233ffE93D3846ee58B63",
        "expiry_date": "2026-01-28 09:03:57.493361",
        "side_commission": "client",
        "side_commission_service": "merchant",
        "type_payments": "crypto",
        "amount": 0.034187,
        "amount_usd": 100.0,
        "amount_in_fiat": 100.0,
        "fee": 1.499999996212864e-06,
        "fee_usd": 0.0,
        "service_fee": 0.00065,
        "service_fee_usd": 1.9,
        "fiat_currency": "USD",
        "status": "created",
        "is_email_required": false,
        "link": "https://pay.trybit.com/89UX09KA",
        "invoice_id": null,
        "currency": {
            "id": 3,
            "code": "ETH",
            "fullcode": "ETH",
            "network": {
                "code": "ERC20",
                "id": 3,
                "icon": "https://cdn.trybit.com/img/network/ERC.svg",
                "fullname": "Ethereum"
            },
            "name": "Ethereum",
            "is_email_required": false,
            "stablecoin": false,
            "icon_base": "https://cdn.trybit.com/img/currency/ETH.svg",
            "icon_network": "https://cdn.trybit.com/img/currency/ETH.svg",
            "icon_qr": "https://cdn.trybit.com/img/stroke/ETH_STROKE.svg",
            "order": 9
        },
        "project": {
            "id": 1,
            "name": "Test",
            "fail": "https://test.com/failed-payment",
            "success": "https://test.com/successful-payment",
            "logo": "https://static.trybit.com/logo/L52hWwjt98uYtUF91765782359.174416.jpg"
        },
        "test_mode": false
    }
}
```

{% endtab %}
{% endtabs %}

### Response parameters

The `result` object contains:

<table data-full-width="false"><thead><tr><th>Name</th><th>Type</th><th width="198.35498046875">Example</th><th>Description</th></tr></thead><tbody><tr><td>uuid</td><td>string</td><td>INV-89UX09KA</td><td>Unique invoice identifier with the INV prefix</td></tr><tr><td>created</td><td>string</td><td>2026-01-01 12:00:00.000000</td><td>Invoice creation time in UTC+0 format: YYYY-MM-DD HH:MI:SS.FFFFFF</td></tr><tr><td>address</td><td>string</td><td>0xb07427&#x3C;...>E93D3846ee58B63</td><td><p>Payment address</p><p></p><p>Will be prefilled only if a cryptocurrency for payment is selected.</p><p></p><p>To select the currency on behalf of the customer, specify a project-supported currency in <code>add_fields.cryptocurrency</code>.</p></td></tr><tr><td>expiry_date</td><td>string</td><td>2026-01-02 12:00:00.000000</td><td><p>Invoice expiration date in UTC+0 format: YYYY-MM-DD HH:MI:SS.FFFFFF.</p><p></p><p>After the expiration time, the invoice status will change to <code>canceled</code> if payment has not been received.</p></td></tr><tr><td>side_commission</td><td>string</td><td>client</td><td>Transfer fee payer</td></tr><tr><td>side_commission_cc</td><td>string</td><td>client</td><td>Service fee payer</td></tr><tr><td>amount</td><td>float</td><td>0.033366</td><td>Invoice amount in the selected cryptocurrency</td></tr><tr><td>amount_usd</td><td>float</td><td>100.0</td><td>Invoice amount in USD</td></tr><tr><td>amount_in_fiat</td><td>float</td><td>100.0</td><td>Invoice amount in the creation currency (depends on the <code>currency</code> parameter)</td></tr><tr><td>fee</td><td>float</td><td>4.500000159168849e-06</td><td>Invoice transfer fee</td></tr><tr><td>fee_usd</td><td>float</td><td>0.01</td><td>Invoice transfer fee in USD</td></tr><tr><td>service_fee</td><td>float</td><td>0.000634</td><td>Service fee</td></tr><tr><td>service_fee_usd</td><td>float</td><td>1.9</td><td>Service fee in USD</td></tr><tr><td>fiat_currency</td><td>string</td><td>USD</td><td>Fiat currency code in which the invoice was created</td></tr><tr><td>status</td><td>string</td><td>created</td><td><p>Invoice status</p><p></p><p>When a create-invoice request is sent, the status is always <code>created</code>.</p><p></p><p>Other possible statuses: <code>paid</code> (paid), <code>partial</code> (partially paid), <code>overpaid</code> (overpaid), and <code>canceled</code> (canceled).</p></td></tr><tr><td>is_email_required</td><td>bool</td><td>false</td><td>Parameter for requiring the payer’s email in the invoice</td></tr><tr><td>link</td><td>string</td><td>pay.trybit.com/89UX09KA</td><td>Link to the invoice page</td></tr><tr><td>currency</td><td>dict</td><td><p>"currency": {</p><p>            "id": 3,</p><p>            "code": "ETH",</p><p>            "fullcode": "ETH",</p><p>            "network": {</p><p>                "code": "ERC20",</p><p>                "id": 3,</p><p>                "icon": "https://cdn.trybit.com/img/network/ERC.svg",</p><p>                "fullname": "Ethereum"</p><p>            },</p><p>            "name": "Ethereum",</p><p>            "is_email_required": false,</p><p>            "stablecoin": false,</p><p>            "icon_base": "https://cdn.trybit.com/img/currency/ETH.svg",</p><p>            "icon_network": "https://cdn.trybit.com/img/currency/ETH.svg",</p><p>            "icon_qr": "https://cdn.trybit.com/img/stroke/ETH_STROKE.svg",</p><p>            "order": 9</p><p>        }</p></td><td><p>Object of the selected cryptocurrency in the invoice.</p><p></p><p>Also contains the <code>network</code> object — information about the selected currency network.</p></td></tr><tr><td>project</td><td>dict</td><td><p>"project": {</p><p>            "id": 0,</p><p>            "name": "MyShop",</p><p>            "fail": "https://test.com/failed-payment",</p><p>            "success": "https://test.com/successful-payment",</p><p>            "logo": "https://static.trybit.com/logo/logo.jpg"</p><p>        }v</p></td><td>Object containing project information</td></tr><tr><td>test_mode</td><td>bool</td><td>false</td><td>Test invoice sign</td></tr></tbody></table>


# Invoice Cancellation

The method allows you to cancel a specific created invoice by sending a POST request.

### What the method allows you to do

* Cancels an invoice with the `created` status

### Endpoint

<mark style="color:green;">`POST`</mark> `https://api.trybit.com/v2/invoice/merchant/canceled`

### Headers

| Name                                            | Type   | Example                             | Description     |
| ----------------------------------------------- | ------ | ----------------------------------- | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Token eyJ0eXAiOiJK<...>4npi1ksS8tSY | Project API key |

### Request Body

Key parameters

| Name                                   | Type   | Example      | Description               |
| -------------------------------------- | ------ | ------------ | ------------------------- |
| uuid<mark style="color:red;">\*</mark> | string | INV-89UX09KA | Unique invoice identifier |

### Request examples

These examples show how to send a request to cancel an invoice. Note that the invoice must have the `created` status.

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

```bash
curl -X POST https://api.trybit.com/v2/invoice/merchant/canceled \
     -H "Authorization: Token <API KEY>" \
     -H "Content-Type: application/json" \
     -d '{"uuid":"INV-XXXXXXXX"}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.trybit.com/v2/invoice/merchant/canceled"
headers = {
    "Authorization": "Token <API KEY>"
}
data = {
    "uuid": "INV-XXXXXXXX"

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Fail:", response.status_code, response.text)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch('https://api.trybit.com/v2/invoice/merchant/canceled', {
    method: 'POST',
    headers: {
        'Authorization': 'Token <API KEY>',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({ uuid: 'INV-XXXXXXXX' })
})
.then(response => {
    if (response.ok) {
        return response.json();
    } else {
        throw new Error('Fail: ' + response.status + ' ' + response.statusText);
    }
})
.then(data => console.log('Success:', data))
.catch(error => console.error('Error:', error));
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.trybit.com/v2/invoice/merchant/canceled");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array("uuid" => "INV-XXXXXXXX")));
$headers = array(
    "Authorization: Token <API KEY>", 
    "Content-Type: application/json"
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {

    $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($statusCode == 200) {
        echo "Success: " . $response;
    } else {
        echo "Fail: " . $statusCode . " " . $response;
    }
}
curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

### Response examples

A successful request returns a response with the status `success` and a `result` object.

{% tabs %}
{% tab title="200: OK – Invoice has been cancelled" %}

```json
{
    "status": "success",
    "result": [
        "ok"
    ]
}
```

{% endtab %}
{% endtabs %}

### Response parameters

A successful request returns a response with the status `success` and a `result` object.

| Name   | Type   | Example | Description                                            |
| ------ | ------ | ------- | ------------------------------------------------------ |
| status | string | success | Response status                                        |
| result | string | ok      | An object describing a successful response or an error |


# Invoice List

The method allows you to retrieve a list of all invoices by sending a POST request.

To get a list of all invoices, send a POST request to the following URL:

### What the method allows you to do

* Returns a list of all invoices
* Maximum number of records per request — 100
* By default, the response contains 10 records

### Endpoint

<mark style="color:green;">`POST`</mark> `https://api.trybit.com/v2/invoice/merchant/list`

### Headers

| Name                                            | Type   | Example                             | Description     |
| ----------------------------------------------- | ------ | ----------------------------------- | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Token eyJ0eXAiOiJK<...>4npi1ksS8tSY | Project API key |

### Request Body

Key parameters

| Name                                    | Type   | Example    | Description                                                                                                                                                                                                                           |
| --------------------------------------- | ------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| start<mark style="color:red;">\*</mark> | string | 01.01.2026 | Date in format «dd.mm.yyyyy»                                                                                                                                                                                                          |
| end<mark style="color:red;">\*</mark>   | string | 31.01.2026 | Date in format «dd.mm.yyyyy». Must be later or equal to start.                                                                                                                                                                        |
| offset                                  | int    | 0          | <p>This is the index of the starting record from which data retrieval begins.</p><p></p><p>For example, if <code>offset=10</code>, the data will start from the 11th record.</p>                                                      |
| limit                                   | int    | 10         | <p>This is the number of the last record you want to retrieve.</p><p></p><p>For example, if <code>limit=20</code>, you will receive records up to and including the 20th, starting from the one specified in <code>offset</code>.</p> |

### Request examples

These examples show how to send a request to retrieve a list of invoices within the specified limits.

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

```bash
curl -X POST https://api.trybit.com/v2/invoice/merchant/list \
     -H "Authorization: Token <API KEY>" \
     -H "Content-Type: application/json" \
     -d '{"start":"01.01.2023","end":"31.01.2023","offset":0,"limit":10}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.trybit.com/v2/invoice/merchant/list"
headers = {
    "Authorization": "Token <API KEY>"
}
data = {
    "start": "01.01.2023",
    "end": "31.01.2023",
    "offset": 0,
    "limit": 10
}

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Fail:", response.status_code, response.text)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch('https://api.trybit.com/v2/invoice/merchant/list', {
    method: 'POST',
    headers: {
        'Authorization': 'Token <API KEY>',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        start: '01.01.2023',
        end: '31.01.2023',
        offset: 0,
        limit: 10
    })
})
.then(response => {
    if (response.ok) {
        return response.json();
    } else {
        throw new Error('Fail: ' + response.status + ' ' + response.statusText);
    }
})
.then(data => console.log('Success:', data))
.catch(error => console.error('Error:', error));
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.trybit.com/v2/invoice/merchant/list");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
    "start" => "01.01.2023",
    "end" => "31.01.2023",
    "offset" => 0,
    "limit" => 10
)));

$headers = array(
    "Authorization: Token <API KEY>",
    "Content-Type: application/json"
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($statusCode == 200) {
        echo "Success: " . $response;
    } else {
        echo "Fail: " . $statusCode . " " . $response;
    }
}

curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

### Response examples

A successful request returns a response with the status `success` and a `result` object.

{% tabs %}
{% tab title="200: OK – List received" %}

```json
{
    "status": "success",
    "result": [
       {
           "uuid": "INV-89UX09KA",
           "created": "2026-01-01 09:03:58.958133",
           "address": "0xb07427fc721C23674c48233ffE93D3846ee58B63",
           "currency": {
               "id": 3,
               "code": "ETH",
               "fullcode": "ETH",
               "network": {
                   "code": "ERC20",
                   "id": 3,
                   "icon": "https://cdn.trybit.com/img/network/ERC.svg",
                   "fullname": "Ethereum"
               },
               "name": "Ethereum",
               "is_email_required": false,
               "stablecoin": false,
               "icon_base": "https://cdn.trybit.com/img/currency/ETH.svg",
               "icon_network": "https://cdn.trybit.com/img/currency/ETH.svg",
               "icon_qr": "https://cdn.trybit.com/img/stroke/ETH_STROKE.svg",
               "order": 9
           },
           "date_finished": "2026-01-01 19:27:37.258735",
           "expiry_date": "2026-01-02 09:03:57.493361",
           "side_commission": "client",
           "side_commission_cc": "merchant",
           "type_payments": "crypto",
           "status": "paid",
           "invoice_status": "success",
           "is_email_required": false,
           "project": {
               "id": 1,
               "name": "Test",
               "fail": "None",
               "success": "None",
               "logo": null
           },
           "tx_list": [
               "0x4d52dc2d2fa8555ab10211bd6c9a7aed13e6f9e1901090b03e7bf74603178c15",
                          ],
           "test_mode": false,
           "type": "up",
           "user_email": "a**********b@gmail.com",
           "pay_url": "None",
           "phone": "",
           "order_id": "None",
           "amount_in_crypto": null,
           "amount_in_fiat": 1.0,
           "amount": 0.000693,
           "amount_usd": 1.0,
           "amount_to_pay": 0.000694,
           "amount_to_pay_usd": 2.03,
           "amount_paid": 0.000694,
           "amount_paid_usd": 2.03,
           "fee": 1e-06,
           "fee_usd": 0.0,
           "service_fee": 1.2e-05,
           "service_fee_usd": 0.04,
           "received": 0.000681,
           "received_usd": 1.99,
           "to_surcharge": 0.0,
           "to_surcharge_usd": 0.0
       }

    ],
    "all_count": 2
}
```

{% endtab %}
{% endtabs %}

### Response parameters

A successful request returns a response with the status `success` and a `result` object.

The `result` object contains:

<table><thead><tr><th>Name</th><th>Type</th><th width="200">Example</th><th>Description</th></tr></thead><tbody><tr><td>uuid</td><td>string</td><td>INV-89UX09KA</td><td>Unique invoice identifier with the INV prefix</td></tr><tr><td>created</td><td>string</td><td>2026-01-01 12:00:00.000000</td><td>Invoice creation time in UTC+0 format: YYYY-MM-DD HH:MI:SS.FFFFFF</td></tr><tr><td>address</td><td>string</td><td>0xb07427&#x3C;...>E93D3846ee58B63</td><td>Payment address</td></tr><tr><td>expiry_date</td><td>string</td><td>2026-01-02 12:00:00.000000</td><td><p>Invoice expiration date in UTC+0 format: YYYY-MM-DD HH:MI:SS.FFFFFF.</p><p></p><p>After the expiration time, the invoice status will change to <code>canceled</code> if payment has not been received.</p></td></tr><tr><td>side_commission</td><td>string</td><td>client</td><td>Transfer fee payer</td></tr><tr><td>side_commission_cc</td><td>string</td><td>client</td><td>Service fee payer</td></tr><tr><td>amount</td><td>float</td><td>0.033366</td><td>Invoice amount in the selected cryptocurrency</td></tr><tr><td>amount_usd</td><td>float</td><td>100.0</td><td>Invoice amount in USD</td></tr><tr><td>amount_in_fiat</td><td>float</td><td>100.0</td><td>Invoice amount in the creation currency (depends on the <code>currency</code> parameter)</td></tr><tr><td>fee</td><td>float</td><td>4.500000159168849e-06</td><td>Transfer fee</td></tr><tr><td>fee_usd</td><td>float</td><td>0.01</td><td>Transfer fee in USD</td></tr><tr><td>service_fee</td><td>float</td><td>0.000634</td><td>Service fee</td></tr><tr><td>service_fee_usd</td><td>float</td><td>1.9</td><td>Service fee in USD</td></tr><tr><td>fiat_currency</td><td>string</td><td>USD</td><td>Fiat currency code in which the invoice was created</td></tr><tr><td>status</td><td>string</td><td>created</td><td><p>Invoice status</p><p></p><p>When a create-invoice request is sent, the status is always <code>created</code>.</p><p></p><p>Other possible statuses: <code>paid</code> (paid), <code>partial</code> (partially paid), <code>overpaid</code> (overpaid), and <code>canceled</code> (canceled).</p></td></tr><tr><td>is_email_required</td><td>bool</td><td>false</td><td>Parameter for requiring the payer’s email in the invoice</td></tr><tr><td>link</td><td>string</td><td>pay.trybit.com/89UX09KA</td><td>Link to the invoice page</td></tr><tr><td>currency</td><td>dict</td><td><p>"currency": {</p><p>            "id": 3,</p><p>            "code": "ETH",</p><p>            "fullcode": "ETH",</p><p>            "network": {</p><p>                "code": "ERC20",</p><p>                "id": 3,</p><p>                "icon": "https://cdn.trybit.com/img/network/ERC.svg",</p><p>                "fullname": "Ethereum"</p><p>            },</p><p>            "name": "Ethereum",</p><p>            "is_email_required": false,</p><p>            "stablecoin": false,</p><p>            "icon_base": "https://cdn.trybit.com/img/currency/ETH.svg",</p><p>            "icon_network": "https://cdn.trybit.com/img/currency/ETH.svg",</p><p>            "icon_qr": "https://cdn.trybit.com/img/stroke/ETH_STROKE.svg",</p><p>            "order": 9</p><p>        }</p></td><td><p>Object of the selected cryptocurrency in the invoice.</p><p></p><p>Also contains the <code>network</code> object — information about the selected currency network.</p></td></tr><tr><td>project</td><td>dict</td><td><p>"project": {</p><p>            "id": 0,</p><p>            "name": "MyShop",</p><p>            "fail": "https://test.com/failed-payment",</p><p>            "success": "https://test.com/successful-payment",</p><p>            "logo": "https://static.trybit.com/logo/logo.jpg"</p><p>        }</p></td><td>Object containing project information</td></tr><tr><td>test_mode</td><td>bool</td><td>false</td><td>Test invoice sign</td></tr><tr><td>received</td><td>float</td><td>0.00206</td><td>Amount credited to the balance in cryptocurrency</td></tr><tr><td>received_usd</td><td>float</td><td>0.26</td><td>Amount credited to the balance in USD</td></tr><tr><td>to_surcharge</td><td>float</td><td>0.001172</td><td>Amount remaining to be paid in cryptocurrency</td></tr><tr><td>to_surcharge_usd</td><td>float</td><td>0.08</td><td>Amount remaining to be paid in USD</td></tr></tbody></table>


# Invoice Information

The method allows you to retrieve specific invoices by their identifiers using a POST request.

### What the method allows you to do

* Returns complete information for the specified invoices.
* Maximum number of identifiers per request — 100.

### Endpoint

<mark style="color:green;">`POST`</mark> `https://api.trybit.com/v2/invoice/merchant/info`

### Headers

| Name                                            | Type   | Example                             | Description     |
| ----------------------------------------------- | ------ | ----------------------------------- | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Token eyJ0eXAiOiJK<...>4npi1ksS8tSY | Project API key |

### Request Body

Key parameters

| Name                                    | Type  | Example      | Description                                            |
| --------------------------------------- | ----- | ------------ | ------------------------------------------------------ |
| uuids<mark style="color:red;">\*</mark> | array | INV-89UX09KA | List of invoice identifiers (INV-XXXXXXXX or XXXXXXXX) |

### Request examples

These examples show how to send a request to retrieve invoice information by INV number. Note that a single request must contain no more than 100 identifiers.

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

```bash
curl -X POST https://api.trybit.com/v2/invoice/merchant/info \
     -H "Authorization: Token <API KEY>" \
     -H "Content-Type: application/json" \
     -d '{"uuids":["INV-XXXXXXXX","INV-YYYYYYYY"]}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.trybit.com/v2/invoice/merchant/info"
headers = {
    "Authorization": "Token <API KEY>"
}
data = {
    "uuids": ["INV-XXXXXXXX", "INV-YYYYYYYY"]
}

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Fail:", response.status_code, response.text)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch('https://api.trybit.com/v2/invoice/merchant/info', {
    method: 'POST',
    headers: {
        'Authorization': 'Token <API KEY>',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        uuids: ['INV-XXXXXXXX', 'INV-YYYYYYYY']
    })
})
.then(response => {
    if (response.ok) {
        return response.json();
    } else {
        throw new Error('Fail: ' + response.status + ' ' + response.statusText);
    }
})
.then(data => console.log('Success:', data))
.catch(error => console.error('Error:', error));

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.trybit.com/v2/invoice/merchant/info");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
    "uuids" => array("INV-XXXXXXXX", "INV-YYYYYYYY")
)));

$headers = array(
    "Authorization: Token <API KEY>",
    "Content-Type: application/json"
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($statusCode == 200) {
        echo "Success: " . $response;
    } else {
        echo "Fail: " . $statusCode . " " . $response;
    }
}

curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

### Response examples

A successful request returns a response with the status `success` and a `result` object.

{% tabs %}
{% tab title="200: OK – Invoice info" %}

```json
{
    "status": "success",
    "result": [
        {
            "uuid": "INV-DO8ETFVT",
            "created": "2026-01-01 09:03:58.958133",
            "address": "LiWRq0uckKZ8qj5dhvgBdWzEtAxr8KbpBW",
            "currency": {
                "id": 2,
                "code": "LTC",
                "fullcode": "LTC",
                "network": {
                    "code": "litecoin",
                    "id": 2,
                    "icon": "https://cdn.trybit.com/img/network/LTC.svg",
                    "fullname": "Litecoin"
                },
                "name": "Litecoin",
                "is_email_required": false,
                "stablecoin": false,
                "icon_base": "https://cdn.trybit.com/img/currency/LTC.svg",
                "icon_network": "https://cdn.trybit.com/img/currency/LTC.svg",
                "icon_qr": "https://cdn.trybit.com/img/stroke/LTC_STROKE.svg",
                "order": 8
            },
            "date_finished": "2026-01-01 19:03:58.958133",
            "expiry_date": "2026-01-02 09:03:57.493361",
            "side_commission": "client",
            "side_commission_cc": "merchant",
            "type_payments": "crypto",
            "status": "overpaid",
            "invoice_status": "success",
            "is_email_required": false,
            "project": {
                "id": 1,
                "name": "Test",
                "fail": "https://test.com/failed-payment",
                "success": "https://test.com/successful-payment",
                "logo": ""
            },
            "tx_list": [
                ""
            ],
            "test_mode": false,
            "type": "up",
            "user_email": "",
            "pay_url": "None",
            "phone": "",
            "order_id": "None",
            "amount_in_crypto": null,
            "amount_in_fiat": 0.1,
            "amount": 0.01,
            "amount_usd": 0.1,
            "amount_to_pay": 0.01,
            "amount_to_pay_usd": 0.69,
            "amount_paid": 0.01,
            "amount_paid_usd": 0.69,
            "fee": 0.0,
            "fee_usd": 0.0,
            "service_fee": 0.00019,
            "service_fee_usd": 0.01,
            "received": 0.00981,
            "received_usd": 0.68,
            "to_surcharge": 0.0,
            "to_surcharge_usd": 0.0
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Response parameters

The `result` object contains:

| Name                 | Type   | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Description                                                                                                                                                                                                                                                                                         |
| -------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| uuid                 | string | INV-89UX09KA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Unique invoice identifier with the INV prefix                                                                                                                                                                                                                                                       |
| created              | string | 2026-01-01 12:00:00.000000                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Invoice creation time in UTC+0 format: YYYY-MM-DD HH:MI:SS.FFFFFF                                                                                                                                                                                                                                   |
| address              | string | LiWRq0uck<...>Axr8KbpBW                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Payment address                                                                                                                                                                                                                                                                                     |
| expiry\_date         | string | 2026-01-02 12:00:00.000000                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | <p>Invoice expiration date in UTC+0 format: YYYY-MM-DD HH:MI:SS.FFFFFF.</p><p></p><p>After the expiration time, the invoice status will change to <code>canceled</code> if payment has not been received.</p>                                                                                       |
| side\_commission     | string | client                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Transfer fee payer                                                                                                                                                                                                                                                                                  |
| side\_commission\_cc | string | client                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Service fee payer                                                                                                                                                                                                                                                                                   |
| amount               | float  | 0.033366                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Invoice amount in the selected cryptocurrency                                                                                                                                                                                                                                                       |
| amount\_usd          | float  | 100.0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Invoice amount in USD                                                                                                                                                                                                                                                                               |
| amount\_in\_fiat     | float  | 100.0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Invoice amount in the creation currency (depends on the `currency` parameter)                                                                                                                                                                                                                       |
| fee                  | float  | 4.500000159168849e-06                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Transfer fee                                                                                                                                                                                                                                                                                        |
| fee\_usd             | float  | 0.01                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Transfer fee in USD                                                                                                                                                                                                                                                                                 |
| service\_fee         | float  | 0.000634                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Service fee                                                                                                                                                                                                                                                                                         |
| service\_fee\_usd    | float  | 1.9                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Service fee in USD                                                                                                                                                                                                                                                                                  |
| fiat\_currency       | string | USD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Fiat currency code in which the invoice was created                                                                                                                                                                                                                                                 |
| status               | string | created                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | <p>Invoice status</p><p></p><p>When a create-invoice request is sent, the status is always <code>created</code>.</p><p></p><p>Other possible statuses: <code>paid</code> (paid), <code>partial</code> (partially paid), <code>overpaid</code> (overpaid), and <code>canceled</code> (canceled).</p> |
| is\_email\_required  | bool   | false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Parameter for requiring the payer’s email in the invoice                                                                                                                                                                                                                                            |
| link                 | string | pay.trybit.com/89UX09KA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Link to the invoice page                                                                                                                                                                                                                                                                            |
| currency             | dict   | <p>"currency": {</p><p>            "id": 3,</p><p>            "code": "ETH",</p><p>            "fullcode": "ETH",</p><p>            "network": {</p><p>                "code": "ERC20",</p><p>                "id": 3,</p><p>                "icon": "<https://cdn.trybit.com/img/network/ERC.svg>",</p><p>                "fullname": "Ethereum"</p><p>            },</p><p>            "name": "Ethereum",</p><p>            "is\_email\_required": false,</p><p>            "stablecoin": false,</p><p>            "icon\_base": "<https://cdn.trybit.com/img/currency/ETH.svg>",</p><p>            "icon\_network": "<https://cdn.trybit.com/img/currency/ETH.svg>",</p><p>            "icon\_qr": "<https://cdn.trybit.com/img/stroke/ETH_STROKE.svg>",</p><p>            "order": 9</p><p>        }</p> | <p>Object of the selected cryptocurrency in the invoice.</p><p></p><p>Also contains the <code>network</code> object — information about the selected currency network.</p>                                                                                                                          |
| project              | dict   | <p>"project": {</p><p>            "id": 0,</p><p>            "name": "MyShop",</p><p>            "fail": "<https://test.com/failed-payment>",</p><p>            "success": "<https://test.com/successful-payment>",</p><p>            "logo": "<https://static.trybit.com/logo/logo.jpg>"</p><p>        }</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Object containing project information                                                                                                                                                                                                                                                               |
| test\_mode           | bool   | false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Test invoice sign                                                                                                                                                                                                                                                                                   |
| received             | float  | 0.00206                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Amount credited to the balance in cryptocurrency                                                                                                                                                                                                                                                    |
| received\_usd        | float  | 0.26                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Amount credited to the balance in USD                                                                                                                                                                                                                                                               |
| to\_surcharge        | float  | 0.001172                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Amount remaining to be paid in cryptocurrency                                                                                                                                                                                                                                                       |
| to\_surcharge\_usd   | float  | 0.08                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Amount remaining to be paid in USD                                                                                                                                                                                                                                                                  |


# Balance

The method allows you to retrieve your account balance by sending a POST request.

### What the method allows you to do

* Returns an array of your account balances.

### Endpoint

<mark style="color:green;">`POST`</mark> `https://api.trybit.com/v2/merchant/wallet/balance/all`

### Headers

<table><thead><tr><th>Name</th><th width="249">Type</th><th>Example</th><th>Description</th></tr></thead><tbody><tr><td>Authorization<mark style="color:red;">*</mark></td><td>string</td><td>Token eyJ0eXAiOiJK&#x3C;...>4npi1ksS8tSY</td><td>Project API key</td></tr></tbody></table>

### Request Body

No request body is required.

### Request examples

These examples show how to send a request to retrieve the account balance. Note that the Request Body does not need to be filled in.

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

```bash
curl -X POST https://api.trybit.com/v2/merchant/wallet/balance/all \
     -H "Authorization: Token <API KEY>"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.trybit.com/v2/merchant/wallet/balance/all"
headers = {
    "Authorization": "Token <API KEY>"
}

response = requests.post(url, headers=headers)

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Fail:", response.status_code, response.text)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch('https://api.trybit.com/v2/merchant/wallet/balance/all', {
    method: 'POST',
    headers: {
        'Authorization': 'Token <API KEY>'
    }
})
.then(response => {
    if (response.ok) {
        return response.json();
    } else {
        throw new Error('Fail: ' + response.status + ' ' + response.statusText);
    }
})
.then(data => console.log('Success:', data))
.catch(error => console.error('Error:', error));
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.trybit.com/v2/merchant/wallet/balance/all");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);

$headers = array(
    "Authorization: Token <API KEY>",
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($statusCode == 200) {
        echo "Success: " . $response;
    } else {
        echo "Fail: " . $statusCode . " " . $response;
    }
}

curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

### Response examples

A successful request returns a response with the status `success` and a `result` object.

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

```json
{
   "status": "success",
   "result": [
       {
           "currency": {
               "id": 4,
               "code": "USDT_TRC20",
               "short_code": "USDT",
               "name": "Tether",
               "is_email_required": false,
               "stablecoin": true,
               "icon_base": "https://cdn.trybit.com/img/currency/USDT.svg",
               "icon_network": "https://cdn.trybit.com/img/currency_network/USDT_TRC.svg",
               "icon_qr": "https://cdn.trybit.com/img/stroke/USDT_STROKE.svg",
               "order": 1,
               "obj_network": {
                   "code": "TRC20",
                   "id": 4,
                   "icon": "https://cdn.trybit.com/img/network/TRC20.svg",
                   "fullname": "Tron"
               },
               "enable": true
           },
           "balance_crypto": 10.0,
           "balance_usd": 10.0,
           "available_balance": 10.0,
           "available_balance_usd": 10.0
       },
…
]
}
```

{% endtab %}
{% endtabs %}

### Response parameters

The `result` object contains:

<table><thead><tr><th>Name</th><th width="249">Type</th><th>Example</th><th>Description</th></tr></thead><tbody><tr><td>currency</td><td>dict</td><td><p>"currency": {</p><p>               "id": 4,</p><p>               "code": "USDT_TRC20",             "short_code": "USDT",</p><p>               "name": "Tether",               "is_email_required": false,               "stablecoin": true,               "icon_base": "https://cdn.trybit.com/img/currency/USDT.svg",               "icon_network": "https://cdn.trybit.com/img/currency_network/USDT_TRC.svg",</p><p>               "icon_qr": "https://cdn.trybit.com/img/stroke/USDT_STROKE.svg",</p><p>               "order": 1,               "obj_network": {</p><p>                   "code": "TRC20",</p><p>                   "id": 4,</p><p>                   "icon": "https://cdn.trybit.com/img/network/TRC20.svg",                   "fullname": "Tron"</p><p>               },</p><p>               "enable": true</p><p>           }</p></td><td>Currency object associated with the balance</td></tr><tr><td>balance_crypto</td><td>float</td><td>10.0</td><td>Balance in cryptocurrency</td></tr><tr><td>balance_usd</td><td>float</td><td>10.0</td><td>Balance in USD at the exchange rate at the time of the request</td></tr><tr><td>available_balance</td><td>float</td><td>10.0</td><td>Withdrawable balance in cryptocurrency</td></tr><tr><td>available_balance_usd</td><td>float</td><td>10.0</td><td>Withdrawable balance in USD</td></tr></tbody></table>


# Statistics

The method allows you to retrieve payment statistics by sending a POST request.

### What the method allows you to do

* Returns statistics on invoice statuses for the specified period.

### Endpoint

<mark style="color:green;">`POST`</mark> `https://api.trybit.com/v2/invoice/merchant/statistics`

### Headers

| Name                                            | Type   | Example                             | Description     |
| ----------------------------------------------- | ------ | ----------------------------------- | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Token eyJ0eXAiOiJK<...>4npi1ksS8tSY | Project API key |

### Request Body

Key parameters

| Name                                    | Type   | Example    | Description                                                                                                  |
| --------------------------------------- | ------ | ---------- | ------------------------------------------------------------------------------------------------------------ |
| start<mark style="color:red;">\*</mark> | string | 01.01.2026 | Date in format `«dd.mm.yyyyy»`                                                                               |
| end<mark style="color:red;">\*</mark>   | string | 31.01.2026 | <p>Date in format <code>«dd.mm.yyyyy»</code><br><br>Must be greater than or equal to <code>start</code>.</p> |

### Request examples

These examples show how to send a request to retrieve statistics on invoice statuses for the specified period.

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

```bash
curl -X POST https://api.trybit.com/v2/invoice/merchant/statistics \
     -H "Authorization: Token <API KEY>" \
     -H "Content-Type: application/json" \
     -d '{"start":"01.01.2023","end":"31.01.2023"}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.trybit.com/v2/invoice/merchant/statistics"
headers = {
    "Authorization": "Token <API KEY>"
}
data = {
    "start": "01.01.2023",
    "end": "31.01.2023"
}

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Fail:", response.status_code, response.text)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch('https://api.trybit.com/v2/invoice/merchant/statistics', {
    method: 'POST',
    headers: {
        'Authorization': 'Token <API KEY>',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        start: '01.01.2023',
        end: '31.01.2023'
    })
})
.then(response => {
    if (response.ok) {
        return response.json();
    } else {
        throw new Error('Fail: ' + response.status + ' ' + response.statusText);
    }
})
.then(data => console.log('Success:', data))
.catch(error => console.error('Error:', error));
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.trybit.com/v2/invoice/merchant/statistics");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
    "start" => "01.01.2023",
    "end" => "31.01.2023"
)));

$headers = array(
    "Authorization: Token <API KEY>",
    "Content-Type: application/json"
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($statusCode == 200) {
        echo "Success: " . $response;
    } else {
        echo "Fail: " . $statusCode . " " . $response;
    }
}

curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

### Response examples

A successful request returns a response with the status `success` and a `result` object.

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

```json
{
    "status": "success",
    "result": {
        "count": {
            "all": 907,
            "created": 4,
            "paid": 90,
            "overpaid": 8,
            "partial": 6,
            "canceled": 799
        },
        "amount": {
            "all": 214356.22712,
            "created": 4.0,
            "paid": 629.729137,
            "overpaid": 36.82,
            "partial": 11.4,
            "canceled": 213674.277983
        }
    }
}
```

{% endtab %}
{% endtabs %}

### Response parameters

The `result` object contains:

| Name     | Type       | Example                                                                                                                                                                                                                                                                   | Description                                         |
| -------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| count    | dict       | <p>        "count": {</p><p>            "all": 907,</p><p>            "created": 4,</p><p>            "paid": 90,</p><p>            "overpaid": 8,</p><p>            "partial": 6,</p><p>            "canceled": 799</p><p>        }</p>                                  | Object containing values for the number of invoices |
| amount   | dict       | <p>    "amount": {</p><p>            "all": 214356.22712,</p><p>            "created": 4.0,</p><p>            "paid": 629.729137,</p><p>            "overpaid": 36.82,</p><p>            "partial": 11.4,</p><p>            "canceled": 213674.277983</p><p>        }</p> | Object containing values for amounts in USD         |
| all      | int, float | 907 / 214356.22712                                                                                                                                                                                                                                                        | All invoices                                        |
| created  | int, float | 4 / 4.0                                                                                                                                                                                                                                                                   | Invoices with the “Created” status                  |
| paid     | int, float | 90 / 629.729137                                                                                                                                                                                                                                                           | Invoices with the “Paid” status                     |
| overpaid | int, float | 8 / 36.82                                                                                                                                                                                                                                                                 | Invoices with the “Overpaid” status                 |
| partial  | int, float | 6 / 11.4                                                                                                                                                                                                                                                                  | Invoices with the “Partially paid” status           |
| canceled | int, float | 799 / 213674.277983                                                                                                                                                                                                                                                       | Invoices with the “Canceled” status                 |


# Funds Withdrawal

The method allows you to create a withdrawal request by sending a POST request.

### Authentication

A separate API key must be used for authentication. It can be generated in the «Security» section in your account settings. The key is displayed only once, so make sure to store it in a secure place and do not disclose it.

### What the method allows you to do

* Creates a withdrawal request in the specified currency.
* Minimum interval between requests — 12 seconds.

### Endpoint

<mark style="color:green;">`POST`</mark> `https://api.trybit.com/v2/invoice/api/out/create`

### Headers

| Name                                            | Type   | Example                             | Description                                                  |
| ----------------------------------------------- | ------ | ----------------------------------- | ------------------------------------------------------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Token eyJ0eXAiOiJK<...>4npi1ksS8tSY | API key from the «Security» section in your account settings |

### Request Body

Key parameters

| Name                                             | Type   | Example                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------------------------------ | ------ | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| currency\_code<mark style="color:red;">\*</mark> | string | ETH                            | <p>Currency code:</p><p></p><p>BTC, LTC, TRX, SOL, TON, BNB, ETH, ETH\_ARB, ETH\_BASE, ETH\_OPT, USDT\_ARB, USDT\_BSC, USDT\_ERC20, USDT\_OPT, USDT\_SOL, USDT\_TON, USDT\_TRC20, USDC\_ARB, USDC\_BASE, USDC\_BSC, USDC\_ERC20, USDC\_OPT, USDC\_SOL, DAI\_ARB, DAI\_BASE, DAI\_BSC, DAI\_ERC20, DAI\_OPT, USDD\_TRC20, PYUSD\_ERC20, PYUSD\_SOL, XAUT\_ERC20, XAUT\_TON, ARB\_ARB, OP\_OPT, PEPE\_BSC, PEPE\_ERC20, SHIB\_BSC, SHIB\_ERC20, TRUMP\_SOL</p> |
| to\_address<mark style="color:red;">\*</mark>    | string | 0x396343<...>210945346fb82Aa49 | Recipient's wallet address                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| amount<mark style="color:red;">\*</mark>         | float  | 0.003                          | Withdrawal request amount in the specified currency                                                                                                                                                                                                                                                                                                                                                                                                          |

### Request examples

These examples show how to create a withdrawal request.

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

```bash
curl -X POST \
  https://api.trybit.com/v2/invoice/api/out/create \
  -H 'Authorization: Token YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "currency_code": "BTC",
    "to_address": "YOUR_RECIPIENT_ADDRESS",
    "amount": 0.00023
  }'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from typing import Optional


class PayoutAPIClient:
    def __init__(self, api_key: str):
        self.api_key = api_key
        self.base_url = 'https://api.trybit.com'
        self.headers = {
            'Authorization': f'Token {self.api_key}',
            'Content-Type': 'application/json'
        }

    def create_payout(self, currency_code: str, to_address: str, amount: float) -> dict:
        """
        Creates a withdrawal request.

        :param currency_code: Currency code (e.g. “BTC”, “ETH”, “USDT”, “LTC”).
        :param to_address: Recipient's address.
        :param amount: Amount to send.
        :return: API response in dict format.
        """
        url = f"{self.base_url}/v2/invoice/api/out/create"
        payload = {
            "currency_code": currency_code,
            "to_address": to_address,
            "amount": amount
        }

        response = requests.post(url, json=payload, headers=self.headers)

        if response.status_code == 200:
            return response.json()
        else:
            raise PayoutAPIError(response.status_code, response.json())


class PayoutAPIError(Exception):
    def __init__(self, status_code: int, error_data: Optional[dict] = None):
        self.status_code = status_code
        self.error_data = error_data or {}
        message = f"API Request failed with status {status_code}: {self.error_data}"
        super().__init__(message)


# Example of use:
if __name__ == "__main__":
    # Client Configuration
    api_key = ""

    client = PayoutAPIClient(api_key)

    try:
        result = client.create_payout(
            currency_code="BTC",
            to_address="",
            amount=0.00023
        )
        print("Success:", result)
    except PayoutAPIError as e:
        print("Error occurred:", e)
```

{% endtab %}

{% tab title="JavaScript " %}
{% code title="Axios.js:" %}

```javascript
/**
 * Custom error for handling payout API response failures.
 */
class PayoutAPIError extends Error {
  /**
   * @param {number} statusCode - HTTP status code returned by the API.
   * @param {object} [errorData={}] - Error details returned by the API.
   */
  constructor(statusCode, errorData = {}) {
    super(`API Request failed with status ${statusCode}: ${JSON.stringify(errorData)}`);
    this.name = 'PayoutAPIError';
    this.statusCode = statusCode;
    this.errorData = errorData;
  }
}

/**
 * Client for interacting with Trybit Payout API.
 */
class PayoutAPIClient {
  /**
   * @param {string} apiKey - API token used for authentication.
   */
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.baseUrl = 'https://api.trybit.com';
    this.headers = {
      'Authorization': `Token ${this.apiKey}`,
      'Content-Type': 'application/json'
    };
  }

  /**
   * Creates a payout request.
   *
   * @param {string} currencyCode - Currency code (e.g., "BTC", "ETH", "USDT", "LTC").
   * @param {string} toAddress - Recipient address.
   * @param {number} amount - Amount to send.
   * @returns {Promise<object>} - API response data.
   * @throws {PayoutAPIError} - On failed request.
   */
  async createPayout(currencyCode, toAddress, amount) {
    const url = `${this.baseUrl}/v2/invoice/api/out/create`;
    const payload = {
      currency_code: currencyCode,
      to_address: toAddress,
      amount: amount
    };

    try {
      const response = await axios.post(url, payload, {
        headers: this.headers
      });
      return response.data;
    } catch (error) {
      const status = error.response?.status || 500;
      const data = error.response?.data || {};
      throw new PayoutAPIError(status, data);
    }
  }
}

// Example usage with Axios
(async () => {
  const client = new PayoutAPIClient('<your_api_key_here>');

  try {
    const result = await client.createPayout("BTC", "<recipient_address>", 0.00023);
    console.log("Success:", result);
  } catch (error) {
    console.error("Error occurred:", error);
  }
})();
```

{% endcode %}

{% code title="Fetch.js:" %}

```javascript
const apiKey = '<your_api_key>';
const payload = {
  currency_code: 'BTC',
  to_address: '<recipient_address>',
  amount: 0.00023
};

fetch('https://api.trybit.com/v2/invoice/api/out/create', {
  method: 'POST',
  headers: {
    'Authorization': `Token ${apiKey}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(payload)
})
  .then(response => {
    if (!response.ok) throw new Error(`HTTP error ${response.status}`);
    return response.json();
  })
  .then(data => console.log('Success:', data))
  .catch(err => console.error('Error:', err));
```

{% endcode %}

{% code title="Ajax.js:" %}

```javascript
const apiKey = '<your_api_key>';
const xhr = new XMLHttpRequest();
xhr.open("POST", "https://api.trybit.com/v2/invoice/api/out/create");
xhr.setRequestHeader("Authorization", `Token ${apiKey}`);
xhr.setRequestHeader("Content-Type", "application/json");

xhr.onload = function () {
  if (xhr.status === 200) {
    console.log("Success:", JSON.parse(xhr.responseText));
  } else {
    console.error("Error:", xhr.status, xhr.responseText);
  }
};

const payload = {
  currency_code: 'BTC',
  to_address: '<recipient_address>',
  amount: 0.00023
};

xhr.send(JSON.stringify(payload));
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}

<pre class="language-php" data-title="PHP 8.0 +"><code class="lang-php"><strong>&#x3C;?php
</strong>
/**
 * Class PayoutAPIError
 *
 * Custom exception for API errors.
 */
class PayoutAPIError extends Exception
{
    public int $statusCode;
    public array $errorData;

    /**
     * PayoutAPIError constructor.
     *
     * @param int $statusCode
     * @param array $errorData
     */
    public function __construct(int $statusCode, array $errorData = [])
    {
        $this->statusCode = $statusCode;
        $this->errorData = $errorData;
        $message = "API Request failed with status $statusCode: " . json_encode($errorData);
        parent::__construct($message, $statusCode);
    }
}

/**
 * Class PayoutAPIClient
 *
 * Client for creating crypto payouts via Trybit API.
 */
class PayoutAPIClient
{
    private string $apiKey;
    private string $baseUrl;
    private array $headers;

    /**
     * PayoutAPIClient constructor.
     *
     * @param string $apiKey
     */
    public function __construct(string $apiKey)
    {
        $this->apiKey = $apiKey;
        $this->baseUrl = 'https://api.trybit.com';
        $this->headers = [
            'Authorization: Token ' . $this->apiKey,
            'Content-Type: application/json'
        ];
    }

    /**
     * Create payout request.
     *
     * @param string $currencyCode Currency code (e.g., BTC, ETH).
     * @param string $toAddress Recipient address.
     * @param float $amount Amount to send.
     * @return array Response from API.
     * @throws PayoutAPIError On API failure.
     */
    public function createPayout(string $currencyCode, string $toAddress, float $amount): array
    {
        $url = $this->baseUrl . '/v2/invoice/api/out/create';

        $payload = json_encode([
            'currency_code' => $currencyCode,
            'to_address' => $toAddress,
            'amount' => $amount,
        ]);

        $ch = curl_init($url);

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);

        $response = curl_exec($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        $decoded = json_decode($response, true);

        curl_close($ch);

        if ($httpCode === 200) {
            return $decoded;
        } else {
            throw new PayoutAPIError($httpCode, $decoded ?? []);
        }
    }
}

// Example usage
try {
    $client = new PayoutAPIClient('&#x3C;your_api_key_here>');
    $response = $client->createPayout('BTC', '&#x3C;recipient_address>', 0.00023);
    echo "Success:\n";
    print_r($response);
} catch (PayoutAPIError $e) {
    echo "Error occurred:\n" . $e->getMessage();
}
</code></pre>

{% endtab %}
{% endtabs %}

### Response example

A successful request returns a response with the status `success` and a `result` object.

{% tabs %}
{% tab title="200: OK – Request created" %}

```json
{
    "status": "success",
    "result": {
        "uuid": "INV-2Q2SICZN",
        "created": "2026-01-01 08:03:02.216905",
        "address": "TT2T11KZhoDu48i2p4FWxfG79zdkEWkU9N",
        "currency": {
            "id": 4,
            "code": "USDT",
            "fullcode": "USDT_TRC20",
            "network": {
                "code": "TRC20",
                "id": 4,
                "icon": "https://cdn.trybit.com/img/network/TRC20.svg",
                "fullname": "Tron"
            },
            "name": "Tether",
            "is_email_required": false,
            "stablecoin": true,
            "icon_base": "https://cdn.trybit.com/img/currency/USDT.svg",
            "icon_network": "https://cdn.trybit.com/img/currency_network/USDT_TRC.svg",
            "icon_qr": "https://cdn.trybit.com/img/stroke/USDT_STROKE.svg",
            "order": 1
        },
        "date_finished": null,
        "expiry_date": null,
        "side_commission": "client",
        "side_commission_cc": "merchant",
        "type_payments": "crypto",
        "status": "created",
        "invoice_status": "start",
        "is_email_required": false,
        "project": {
            "id": 1,
            "name": "Test",
            "fail": "https://test.com/failed-payment",
            "success": "https://test.com/successful-payment",
            "logo": ""
        },
        "tx_list": [],
        "step": 1,
        "test_mode": false,
        "type": "dw",
        "user_email": "",
        "pay_url": "None",
        "phone": "",
        "order_id": "None",
        "amount_in_crypto": null,
        "amount_in_fiat": 0,
        "amount": 10.0,
        "amount_usd": 10.0,
        "amount_to_pay": 10.0,
        "amount_to_pay_usd": 10.0,
        "amount_paid": 0.0,
        "amount_paid_usd": 0.0,
        "fee": 0.0,
        "fee_usd": 0.0,
        "service_fee": 0.0,
        "service_fee_usd": 0.0,
        "received": 0,
        "received_usd": 0,
        "to_surcharge": 10.0,
        "to_surcharge_usd": 10.0,
        "total_rub": 0,
        "currency_list": [
            {
                "code": "USDT",
                "fullcode": "USDT_TRC20",
                "name": "Tether",
                "is_email_required": false,
                "stablecoin": true,
                "icon_base": "https://cdn.trybit.com/img/currency/USDT.svg",
                "icon_qr": "https://cdn.trybit.com/img/stroke/USDT_STROKE.svg",
                "order": 28,
                "network": [
                    {
                        "code": "TRC20",
                        "id": 4,
                        "icon": "https://cdn.trybit.com/img/network/TRC20.svg",
                        "fullname": "Tron"
                    }
                ]
            }
        ],
        "aml_enabled": false,
        "aml_side": "merchant",
        "aml_cost": 0.0,
        "aml_cost_usd": 0.0,
        "aml_checks": [],
        "links": [],
        "quiz_result": false,
        "quiz_detail": {
            "invoice": null,
            "rating": null,
            "comment": null,
            "created": null
        },
        "memo": ""
    }
}
```

{% endtab %}
{% endtabs %}

### Parameter description

The `result` object contains:

<table data-full-width="false"><thead><tr><th>Name</th><th>Type</th><th>Example</th><th>Description</th></tr></thead><tbody><tr><td>invoice_id</td><td>string</td><td>INV-89UX09KA</td><td>Unique withdrawal request identifier with the INV prefix</td></tr><tr><td>status</td><td>string</td><td>created</td><td>Withdrawal request status — always <code>created</code> when the request is submitted</td></tr><tr><td>currency</td><td>string</td><td>ETH</td><td>Code of the selected cryptocurrency in the withdrawal request</td></tr><tr><td>amount</td><td>float</td><td>0.0029</td><td>Withdrawal request amount in cryptocurrency</td></tr></tbody></table>


# Automatic POSTBACK

The method allows you to automatically receive notifications about invoice confirmation.

After the invoice is successfully confirmed, a POST request with payment information is sent to the notification URL specified in the project settings.

The system supports two POSTBACK formats:

1. JSON
2. application/x-www-form-urlencoded

To configure the POSTBACK format, go to your project settings and open the «Integration & API» section.

After successful payment execution, a POST request with information about the payment is sent to the notification URL specified in the project settings.

### What the method allows you to do

* Automatically sends a POST request to the URL you specified after the invoice is confirmed by the system.
* The POSTBACK format can be configured.

### Postback parameters

| Name           | Type   | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| status         | string | success                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Request execution status                                                                                                                                                                                                                                                                                                                                                                                                                              |
| invoice\_id    | string | 89UX09KA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Unique payment identifier without the INV prefix                                                                                                                                                                                                                                                                                                                                                                                                      |
| amount\_crypto | float  | 0.000113                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Payment amount in cryptocurrency                                                                                                                                                                                                                                                                                                                                                                                                                      |
| currency       | string | BNB                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | <p>Currency code<br><br>BTC, LTC, TRX, SOL, TON, BNB, ETH, ETH\_ARB, ETH\_BASE, ETH\_OPT, USDT\_ARB, USDT\_BSC, USDT\_ERC20, USDT\_OPT, USDT\_SOL, USDT\_TON, USDT\_TRC20, USDC\_ARB, USDC\_BASE, USDC\_BSC, USDC\_ERC20, USDC\_OPT, USDC\_SOL, DAI\_ARB, DAI\_BASE, DAI\_BSC, DAI\_ERC20, DAI\_OPT, USDD\_TRC20, PYUSD\_ERC20, PYUSD\_SOL, XAUT\_ERC20, XAUT\_TON, ARB\_ARB, OP\_OPT, PEPE\_BSC, PEPE\_ERC20, SHIB\_BSC, SHIB\_ERC20, TRUMP\_SOL</p> |
| order\_id      | string | ORDER\_93223                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Custom invoice number in the external system                                                                                                                                                                                                                                                                                                                                                                                                          |
| token          | string | eyJ0eXAiOiJKV1QiLCJhbGciOiJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEHkaAzs                                                                                                                                                                                                                                                                                                                                                                                                                                                      | JWT token — server response signature                                                                                                                                                                                                                                                                                                                                                                                                                 |
| invoice\_info  | dict   | <p>"invoice\_info": {</p><p>        "uuid": "INV-ILRAJE1Q",</p><p>        "created": "2026-01-01 10:20:04.222439",</p><p>        "address": "0x635DBa<...>2Ec029fc555af05d2",</p><p>        "currency": {</p><p>            "id": 20,</p><p>            "code": "BNB",</p><p>            "fullcode": "BNB",</p><p>            "network": {</p><p>                "code": "BSC",</p><p>                "id": 20,</p><p>                "icon": "<https://cdn.trybit.com/img/network/BSC.svg>",</p><p>                "fullname": "BNB Smart Chain"</p><p>            }</p> | Detailed invoice information. Available only in JSON.                                                                                                                                                                                                                                                                                                                                                                                                 |

{% hint style="info" %}
JWT token — a signature of the server response. It is signed with the secret key (SECRET KEY) generated in the project settings. The token is valid for 5 minutes after the notification is created. A new token is generated each time a payment notification is sent.

Encryption algorithm — HS256.
{% endhint %}

### JSON Postback example

{% tabs %}
{% tab title="POSTBACK JSON" %}

```json
{
    "status": "success",
    "invoice_id": "ILRAJE1Q",
    "amount_crypto": 0.000113,
    "currency": "BNB",
    "order_id": null,
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJ<...>hPirF9kHCx3ZXEspVfGNGuK7cZ8",
    "invoice_info": {
        "uuid": "INV-ILRAJE1Q",
        "created": "2026-01-27 10:20:04.222439",
        "address": "0x635DBa9c6e5E9<...>6f8Bed2Ec029fc555af05d2",
        "currency": {
            "id": 20,
            "code": "BNB",
            "fullcode": "BNB",
            "network": {
                "code": "BSC",
                "id": 20,
                "icon": "https://cdn.trybit.com/img/network/BSC.svg",
                "fullname": "BNB Smart Chain"
            },
            "name": "BNB",
            "is_email_required": false,
            "stablecoin": false,
            "icon_base": "https://cdn.trybit.com/img/currency/BNB.svg",
            "icon_network": "https://cdn.trybit.com/img/currency/BNB.svg",
            "icon_qr": "https://cdn.trybit.com/img/stroke/BNB_STROKE.svg",
            "order": 13
        },
        "date_finished": "2026-01-01 10:23:14.000940",
        "expiry_date": "2026-01-02 10:20:04.197389",
        "side_commission": "client",
        "type_payments": "crypto",
        "amount": 0.000113,
        "amount_": 0.000113,
        "status": "paid",
        "invoice_status": "success",
        "is_email_required": false,
        "project": {
            "id": 1,
            "name": "Test",
            "fail": "https://test.com/failed-payment",
            "success": "https://test.com/successful-payment",
            "logo": ""
        },
        "tx_list": [
            "0x12fb777c41b58b8304278416e5a<...>c1e7708b2160745af56403641522"
        ],
        "amount_in_crypto": null,
        "amount_in_fiat": 0.1,
        "amount_usd": 0.1,
        "amount_to_pay": 0.000113,
        "amount_to_pay_usd": 0.1,
        "amount_paid": 0.000113,
        "amount_paid_usd": 0.1,
        "fee": 0,
        "fee_usd": 0,
        "service_fee": 0.000002,
        "service_fee_usd": 0,
        "received": 0.000111,
        "received_usd": 0.1,
        "to_surcharge": 0,
        "to_surcharge_usd": 0,
        "total_rub": 0,
        "step": 3,
        "test_mode": false,
        "type": "up",
        "aml_enabled": false,
        "aml_side": "merchant",
        "aml_checks": [],
        "links_invoice": null
    }
}
```

{% endtab %}

{% tab title="POSTBACK application/x-www-form-urlencoded" %}

```php
{
    "status": "success",
    "invoice_id": "ILRAJE1Q",
    "amount_crypto": 0.000113,
    "currency": "BNB",
    "order_id": null,
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJ<...>hPirF9kHCx3ZXEspVfGNGuK7cZ8",
}
```

{% endtab %}
{% endtabs %}

### JSON Postback handler examples

These examples show how you can handle POSTBACK notifications in JSON format on your project side.

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

```python
from flask import Flask, request, jsonify
import os
import jwt  # pip install PyJWT

app = Flask(__name__)

JWT_SECRET = os.getenv("JWT_SECRET", "super-secret")
JWT_ALGORITHMS = ["HS256"]


def validate_token(token: str) -> bool:
    """
    Validate HS256 JWT only if token is present and not empty.
    Token is expected to be a raw JWT string (no "Bearer " prefix).
    """
    if token is None:
        return True
    if not isinstance(token, str):
        return False

    token = token.strip()
    if token == "":
        return True

    try:
        jwt.decode(token, JWT_SECRET, algorithms=JWT_ALGORITHMS)
        return True
    except jwt.PyJWTError:
        return False


@app.route("/postback", methods=["POST"])
def handle_postback():
    # 1) Read JSON body
    data = request.get_json(silent=True)
    if not isinstance(data, dict):
        return jsonify({"error": "Invalid JSON"}), 400

    # 2) Top-level fields
    status = data.get("status")
    invoice_id = data.get("invoice_id")
    amount_crypto = data.get("amount_crypto")
    currency = data.get("currency")
    order_id = data.get("order_id")
    token = data.get("token")

    # Basic validation
    if not invoice_id or not order_id:
        return jsonify({"error": "Missing invoice_id or order_id"}), 400

    # 3) Validate JWT token (only if provided)
    if not validate_token(token):
        return jsonify({"error": "Invalid token"}), 401

    # 4) Nested invoice_info object
    invoice_info = data.get("invoice_info") or {}

    uuid = invoice_info.get("uuid")
    created = invoice_info.get("created")
    address = invoice_info.get("address")

    invoice_status = invoice_info.get("invoice_status")
    invoice_amount = invoice_info.get("amount")
    amount_paid = invoice_info.get("amount_paid")
    fee = invoice_info.get("fee")

    # 5) Deeper nesting: invoice_info.currency.network
    inv_currency = invoice_info.get("currency") or {}
    network = inv_currency.get("network") or {}
    network_code = network.get("code")

    # 6) Project info
    project = invoice_info.get("project") or {}
    project_name = project.get("name")

    # 7) Business logic should be implemented here:
    # - idempotency by invoice_id / uuid
    # - update invoice status in the database
    # - amount / currency validation
    # - logging (avoid logging token)

    return jsonify({"message": "Postback received"}), 200


if __name__ == "__main__":
    app.run(port=5000, debug=True)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const express = require("express");
const jwt = require("jsonwebtoken");

const app = express();
app.use(express.json());

// HS256 secret (store in ENV in production)
const JWT_SECRET = process.env.JWT_SECRET || "super-secret";

/**
 * Validate HS256 JWT token only if it is present and not empty.
 * Token is expected to be a raw JWT string (no "Bearer " prefix).
 */
function validateToken(token) {
  // Token is optional
  if (token === undefined || token === null) return true;
  if (typeof token !== "string") return false;

  const t = token.trim();
  if (t === "") return true;

  try {
    jwt.verify(t, JWT_SECRET, { algorithms: ["HS256"] });
    return true;
  } catch (err) {
    return false;
  }
}

app.post("/postback", (req, res) => {
  // 1) Read JSON body
  const data = req.body;
  if (!data || typeof data !== "object" || Array.isArray(data)) {
    return res.status(400).json({ error: "Invalid JSON" });
  }

  // 2) Basic required fields (adjust as needed)
  const invoice_id = data.invoice_id;
  const order_id = data.order_id;

  if (!invoice_id || !order_id) {
    return res.status(400).json({ error: "Missing invoice_id or order_id" });
  }

  // 3) Validate JWT token (only if provided)
  const token = data.token;
  if (!validateToken(token)) {
    return res.status(401).json({ error: "Invalid token" });
  }

  // 4) Nested invoice_info object
  const invoice_info = data.invoice_info || {};

  const uuid = invoice_info.uuid;
  const created = invoice_info.created;
  const address = invoice_info.address;

  const invoice_status = invoice_info.invoice_status;
  const invoice_amount = invoice_info.amount;
  const amount_paid = invoice_info.amount_paid;
  const fee = invoice_info.fee;

  // 5) Deeper nesting: invoice_info.currency.network
  const inv_currency = invoice_info.currency || {};
  const network = inv_currency.network || {};
  const network_code = network.code;

  // 6) Project info
  const project = invoice_info.project || {};
  const project_name = project.name;

  // 7) Business logic goes here (examples):
  // - idempotency by invoice_id / uuid
  // - update invoice status in DB
  // - validate amounts/currency
  // - logging (avoid logging token)
  //
  // Example (pseudo):
  // await db.invoices.upsert({ invoice_id, order_id, uuid, invoice_status, amount_paid, fee, network_code, project_name, created, address })

  // 8) Minimal response (as requested)
  return res.status(200).json({ message: "Postback received" });
});

app.listen(5000, () => {
  console.log("Server running on http://127.0.0.1:5000");
});
```

{% endtab %}

{% tab title="PHP 7.4 +" %}

```php
<?php
// postback.php

header('Content-Type: application/json; charset=utf-8');

$JWT_SECRET = getenv('JWT_SECRET') ?: 'super-secret';

/**
 * Base64URL decode (JWT uses base64url without padding)
 */
function base64url_decode($data) {
    $remainder = strlen($data) % 4;
    if ($remainder) {
        $data .= str_repeat('=', 4 - $remainder);
    }
    $data = strtr($data, '-_', '+/');
    return base64_decode($data);
}

/**
 * Validate HS256 JWT only if token is present and not empty.
 * Token is expected to be a raw JWT string (no "Bearer " prefix).
 */
function validateToken($token, $secret) {
    // Token is optional
    if (!isset($token)) return true;
    if (!is_string($token)) return false;

    $t = trim($token);
    if ($t === '') return true;

    $parts = explode('.', $t);
    if (count($parts) !== 3) return false;

    [$headerB64, $payloadB64, $sigB64] = $parts;

    $headerJson = base64url_decode($headerB64);
    $payloadJson = base64url_decode($payloadB64);
    if ($headerJson === false || $payloadJson === false) return false;

    $header = json_decode($headerJson, true);
    $payload = json_decode($payloadJson, true);
    if (!is_array($header) || !is_array($payload)) return false;

    // Ensure HS256
    if (($header['alg'] ?? null) !== 'HS256') return false;

    // Verify signature
    $dataToSign = $headerB64 . '.' . $payloadB64;
    $expectedSigRaw = hash_hmac('sha256', $dataToSign, $secret, true);
    $sigRaw = base64url_decode($sigB64);
    if ($sigRaw === false) return false;

    if (!hash_equals($expectedSigRaw, $sigRaw)) return false;

    // Optional: validate exp/nbf if present
    $now = time();
    if (isset($payload['nbf']) && is_numeric($payload['nbf']) && $now < (int)$payload['nbf']) {
        return false;
    }
    if (isset($payload['exp']) && is_numeric($payload['exp']) && $now >= (int)$payload['exp']) {
        return false;
    }

    return true;
}

// 1) Read raw JSON body
$raw = file_get_contents('php://input');
$data = json_decode($raw, true);

if (!is_array($data)) {
    http_response_code(400);
    echo json_encode(['error' => 'Invalid JSON'], JSON_UNESCAPED_UNICODE);
    exit;
}

// 2) Basic required fields
$invoice_id = $data['invoice_id'] ?? null;
$order_id   = $data['order_id'] ?? null;

if (!$invoice_id || !$order_id) {
    http_response_code(400);
    echo json_encode(['error' => 'Missing invoice_id or order_id'], JSON_UNESCAPED_UNICODE);
    exit;
}

// 3) Validate JWT token (only if provided)
$token = $data['token'] ?? null;
if (!validateToken($token, $JWT_SECRET)) {
    http_response_code(401);
    echo json_encode(['error' => 'Invalid token'], JSON_UNESCAPED_UNICODE);
    exit;
}

// 4) Nested invoice_info object
$invoice_info = $data['invoice_info'] ?? [];

$uuid    = $invoice_info['uuid'] ?? null;
$created = $invoice_info['created'] ?? null;
$address = $invoice_info['address'] ?? null;

$invoice_status = $invoice_info['invoice_status'] ?? null;
$invoice_amount = $invoice_info['amount'] ?? null;
$amount_paid    = $invoice_info['amount_paid'] ?? null;
$fee            = $invoice_info['fee'] ?? null;

// 5) Deeper nesting: invoice_info.currency.network
$inv_currency = $invoice_info['currency'] ?? [];
$network      = $inv_currency['network'] ?? [];
$network_code = $network['code'] ?? null;

// 6) Project info
$project      = $invoice_info['project'] ?? [];
$project_name = $project['name'] ?? null;

// 7) Business logic goes here (examples):
// - idempotency by invoice_id / uuid
// - update invoice status in DB
// - validate amounts/currency
// - logging (avoid logging token)
//
// Example (pseudo):
// save_postback($invoice_id, $order_id, $uuid, $invoice_status, $amount_paid, $fee, $network_code, $project_name, $created, $address);

// 8) Minimal response
http_response_code(200);
echo json_encode(['message' => 'Postback received'], JSON_UNESCAPED_UNICODE);
```

{% endtab %}
{% endtabs %}

### Example of a POSTBACK handler for `application/x-www-form-urlencoded`:

These examples show how you can handle POSTBACK notifications in `application/x-www-form-urlencoded` format on your project side.

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

```python
from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route('/postback', methods=['POST'])
def handle_postback():
    # Changed to request.form for processing data in x-www-form-urlencoded format
    status = request.form.get('status')
    invoice_id = request.form.get('invoice_id')
    amount_crypto = request.form.get('amount_crypto')
    currency = request.form.get('currency')
    order_id = request.form.get('order_id')
    token = request.form.get('token')
    
    # ... your code for handling the postback ...
    
    return jsonify({'message': 'Postback received'}), 200

if __name__ == '__main__':
    app.run(port=5000)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const express = require('express');
const app = express();

// Add middleware for processing JSON
app.use(express.json());

// Add middleware for processing x-www-form-urlencoded data
app.use(express.urlencoded({ extended: true }));

app.post('/postback', (req, res) => {
    const { status, invoice_id, amount_crypto, currency, order_id, token } = req.body;
    
    // ... your code for handling the postback ...
    
    res.json({ message: 'Postback received' });
});

app.listen(3000, () => {
    console.log('Server is running on port 3000');
});

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$body = file_get_contents('php://input');
$data = [];
parse_str($body, $data);

$status = $data['status'] ?? null;
$invoice_id = $data['invoice_id'] ?? null;
$amount_crypto = $data['amount_crypto'] ?? null;
$currency = $data['currency'] ?? null;
$order_id = $data['order_id'] ?? null;
$token = $data['token'] ?? null;

// ... your code for processing postback ...

echo json_encode(['message' => 'Postback received']);
?>
```

{% endtab %}
{% endtabs %}


# Static Wallets

The method allows you to create a static wallet to accept payments to the same address without creating a new invoice.

### What is a static wallet

A static wallet allows customers to make payments to the same address without the need to create a new invoice or open a payment page each time.

This is a convenient solution that enables receiving funds in a specific cryptocurrency with automatic crediting to the merchant’s balance after all fees are deducted.

The solution is well-suited for projects that support user account balance top-ups, donation collection, iGaming platforms, and similar use cases.

### How a static wallet works

1. The user proceeds to top up their balance on the merchant’s website.
2. The user creates wallets for different cryptocurrencies and can top up any of them. Important — 1 wallet = 1 currency.
3. The user transfers the amount to the wallet address or scans the QR code.
4. After the transfer, any amount of cryptocurrency received by the wallet is credited as a successful balance top-up for the user.
5. The merchant receives a notification about the successful payment.

### Advantages of a static wallet

* Convenience for customers. Payment in a particular cryptocurrency is made to one permanent address without going to a payment page.
* Automation of crediting. Funds are automatically credited to the client's balance with the sending of a postback notification.
* Transparency of fees. All fees (service, transfer and, if necessary, AML) are deducted from the transaction amount automatically.

***

### Static wallet creation

#### What the method allows you to do

* Creates a static wallet with the specified parameters

#### Endpoint:

<mark style="color:green;">`POST`</mark> `https://api.trybit.com/v2/invoice/static/create`

#### Headers:

| Name                                            | Type   | Example                             | Description     |
| ----------------------------------------------- | ------ | ----------------------------------- | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Token eyJ0eXAiOiJK<...>4npi1ksS8tSY | Project API key |

#### Request body

Key parameters

| Name                                       | Type   | Example          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------ | ------ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| shop\_id<mark style="color:red;">\*</mark> | string | NGpD44<...>KXRdQ | Unique store identifier from the project settings                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| currency                                   | string | ETH              | <p>Currency code:</p><p></p><p>BTC, LTC, TRX, SOL, BNB, ETH, ETH\_ARB, ETH\_BASE, ETH\_OPT, USDT\_ARB, USDT\_BSC, USDT\_ERC20, USDT\_OPT, USDT\_SOL, USDT\_TRC20, USDC\_ARB, USDC\_BASE, USDC\_BSC, USDC\_ERC20, USDC\_OPT, USDC\_SOL, DAI\_ARB, DAI\_BASE, DAI\_BSC, DAI\_ERC20, DAI\_OPT, USDD\_TRC20, PYUSD\_ERC20, PYUSD\_SOL, XAUT\_ERC20, ARB\_ARB, OP\_OPT, PEPE\_BSC, PEPE\_ERC20, SHIB\_BSC, SHIB\_ERC20, TRUMP\_SOL</p><p></p><p>Static wallets are not supported on the TON network.</p> |
| identify<mark style="color:red;">\*</mark> | string | ID\_8843         | <p>Customer identifier.</p><p><br>When a POSTBACK is sent upon receiving a payment, it will be recorded in <code>order\_id</code>.</p>                                                                                                                                                                                                                                                                                                                                                              |

#### Request examples

These examples show how to send a request to create a static wallet.

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

```bash
curl -X POST https://api.trybit.com/v2/invoice/static/create \
     -H 'Authorization: Token <API KEY>' \
     -H 'Content-Type: application/json' \
     -d '{"shop_id": "<SHOP ID>", "currency": "BTC", "identify": "F4jSjfpwf4t"}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.trybit.com/v2/invoice/static/create"

headers = {
    'Authorization': "Token <API KEY>"
}

body = {
    "shop_id": "<SHOP ID>",
    "currency": "BTC",
    "identify": "F4jSjfpwf4t",
}

response = requests.post(url, headers=headers, json=body)

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Fail:", response.status_code, response.text)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const url = "https://api.trybit.com/v2/invoice/static/create";

const headers = {
    'Authorization': 'Token <API KEY>',
    'Content-Type': 'application/json'
};

const body = {
    "shop_id": "<SHOP ID>",
    "currency": "BTC",
    "identify": "F4jSjfpwf4t"
};

fetch(url, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify(body)
})
.then(response => {
    if (response.ok) {
        return response.json();
    } else {
        throw new Error(`Failed to fetch: ${response.statusText}`);
    }
})
.then(data => console.log("Success:", data))
.catch(error => console.log("Fail:", error));
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$url = "https://api.trybit.com/v2/invoice/static/create";

$headers = [
    'Authorization: Token <API KEY>',
    'Content-Type: application/json'
];

$body = [
    "shop_id" => "<SHOP ID>",
    "currency" => "BTC",
    "identify" => "F4jSjfpwf4t"
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));

$response = curl_exec($ch);

if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == 200) {
    echo "Success: " . $response;
} else {
    echo "Fail: " . curl_getinfo($ch, CURLINFO_HTTP_CODE) . " " . $response;
}

curl_close($ch);

?>
```

{% endtab %}
{% endtabs %}

#### Response examples

A successful request returns a response with the status `success` and a `result` object.

{% tabs %}
{% tab title="200: OK – Static wallet created" %}

```json
{
    "status": "success",
    "result": {
        "currency": {
            "id": 4,
            "code": "USDT_TRC20",
            "short_code": "USDT",
            "name": "Tether",
            "is_email_required": false,
            "stablecoin": true,
            "icon_base": "https://cdn.trybit.com/img/currency/USDT.svg",
            "icon_network": "https://cdn.trybit.com/img/currency_network/USDT_TRC.svg",
            "icon_qr": "https://cdn.trybit.com/img/stroke/USDT_STROKE.svg",
            "order": 1,
            "obj_network": {
                "code": "TRC20",
                "id": 4,
                "icon": "https://cdn.trybit.com/img/network/TRC20.svg",
                "fullname": "Tron"
            },
            "enable": true
        },
        "address": "TKDyKp8F874WiPd1q2jrxgg3HE4AHPDms6",
        "uuid": "KW2WWTTNNBHM17MGFUJPSDOFQVS4ER0X",
        "active": true,
        "created": "2026-01-01 09:13:57.599180",
        "identify": "test_static_wallet"
    }
}
```

{% endtab %}
{% endtabs %}

#### Response parameters

The `result` object contains:

| Name     | Type    | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Description                     |
| -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
| status   | string  | success                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Request execution status        |
| currency | dict    | <p>  "currency": {</p><p>            "id": 4,</p><p>            "code": "USDT\_TRC20",</p><p>      "short\_code": "USDT",</p><p>            "name": "Tether",            "is\_email\_required": false,</p><p>            "stablecoin": true,</p><p>            "icon\_base": "<https://cdn.trybit.com/img/currency/USDT.svg>",            "icon\_network": "<https://cdn.trybit.com/img/currency_network/USDT_TRC.svg>",</p><p>            "icon\_qr": "<https://cdn.trybit.com/img/stroke/USDT_STROKE.svg>",</p><p>            "order": 1,            "obj\_network": {</p><p>                "code": "TRC20",</p><p>                "id": 4,</p><p>                "icon": "<https://cdn.trybit.com/img/network/TRC20.svg>",                "fullname": "Tron"</p><p>            }</p> | Currency information            |
| enable   | boolean | true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Wallet status                   |
| address  | string  | “TT2T17<...>79zdkEWkU9N”                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Generated static wallet address |
| uuid     | string  | “KW2W<...>UJPSDNFQVS4ER0X”                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Static wallet identifier        |
| created  | string  | "2026-01-01 09:13:57.599180"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Creation date                   |
| identify | string  | test\_static\_wallet                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Static wallet name              |

***

### Getting the list of static wallets <a href="#poluchenie-spiska-staticheskikh-koshelkov-polzovatelya" id="poluchenie-spiska-staticheskikh-koshelkov-polzovatelya"></a>

#### What the method allows you to do

* Returns a list of created static wallets.

#### Endpoint

<mark style="color:green;">`POST`</mark> `https://api.trybit.com/v2/invoice/static/list`

#### Headers

| Name                                            | Type   | Example                             | Description     |
| ----------------------------------------------- | ------ | ----------------------------------- | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Token eyJ0eXAiOiJK<...>4npi1ksS8tSY | Project API key |

#### Request body

Key parameters

| Name                                       | Type   | Example          | Description                                                                                                                                                                                                                       |
| ------------------------------------------ | ------ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| shop\_id<mark style="color:red;">\*</mark> | string | NGpD44<...>KXRdQ | Unique store identifier from the project settings                                                                                                                                                                                 |
| start                                      | string | 01.01.2026       | Date in the format `dd.mm.yyyy`                                                                                                                                                                                                   |
| end                                        | string | 31.01.2026       | Date in the format `dd.mm.yyyy`. Must be greater than or equal to `start`                                                                                                                                                         |
| offset                                     | int    | 0                | <p>This is the index of the starting record from which data retrieval begins.</p><p><br>For example, if <code>offset=10</code>, the data will start from the 11th record</p>                                                      |
| limit                                      | int    | 10               | <p>This is the number of the last record you want to retrieve.</p><p><br>For example, if <code>limit=20</code>, you will receive records up to and including the 20th, starting from the one specified in <code>offset</code></p> |

#### Request examples

These examples show how to send a request to retrieve a list of static wallets.

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

```bash
curl --location 'https://api.trybit.com/v2/invoice/static/list' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <API KEY>' \
--data '{
    "shop_id": "<SHOP ID>",
    "start": "04.01.26",
    "end": "31.01.26",
    "limit": 100,
    "offset": 0
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.trybit.com/v2/invoice/static/list"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Token <API KEY>"
}
data = {
    "shop_id": "<SHOP ID>",
    "start": "04.01.26",
    "end": "31.01.26",
    "limit": 100,
    "offset": 0
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
import fetch from 'node-fetch';

const url = 'https://api.trybit.com/v2/invoice/static/list';
const headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Token <API KEY>'
};
const body = JSON.stringify({
  shop_id: '<SHOP ID>',
  start: '04.01.26',
  end: '31.01.26',
  limit: 100,
  offset: 0
});

fetch(url, {
  method: 'POST',
  headers: headers,
  body: body
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error('Error:', err));
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$url = 'https://api.trybit.com/v2/invoice/static/list';

$headers = [
    'Content-Type: application/json',
    'Authorization: Token <API KEY>'
];

$data = json_encode([
    'shop_id' => '<SHOP ID>',
    'start' => '04.01.26',
    'end' => '31.01.26',
    'limit' => 100,
    'offset' => 0
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
```

{% endtab %}
{% endtabs %}

#### Response examples

A successful request returns a response with the status `success` and a `result` object.

{% tabs %}
{% tab title="200: OK – Static list" %}

```json
{
    "status": "success",
    "result": {
        "staticWallets": [
            {
                "currency": {
                    "id": 19,
                    "code": "USDT_BSC",
                    "short_code": "USDT",
                    "name": "Tether",
                    "is_email_required": false,
                    "stablecoin": true,
                    "icon_base": "https://cdn.trybit.com/img/currency/USDT.svg",
                    "icon_network": "https://cdn.trybit.com/img/currency_network/USDT_BSC.svg",
                    "icon_qr": "https://cdn.trybit.com/img/stroke/USDT_STROKE.svg",
                    "order": 14,
                    "obj_network": {
                        "code": "BSC",
                        "id": 19,
                        "icon": "https://cdn.trybit.com/img/network/BSC.svg",
                        "fullname": "BNB Smart Chain"
                    },
                    "enable": true
                },
                "address": "0x34eD0a7d57d2abA71871603dB206A06df141309D",
                "uuid": "J9JFJN085D921I390ULTP8EELYSE0P87",
                "active": true,
                "created": "2026-01-01 09:49:36.311119",
                "identify": "Test1"
            },
            {
                "currency": {
                    "id": 4,
                    "code": "USDT_TRC20",
                    "short_code": "USDT",
                    "name": "Tether",
                    "is_email_required": false,
                    "stablecoin": true,
                    "icon_base": "https://cdn.trybit.com/img/currency/USDT.svg",
                    "icon_network": "https://cdn.trybit.com/img/currency_network/USDT_TRC.svg",
                    "icon_qr": "https://cdn.trybit.com/img/stroke/USDT_STROKE.svg",
                    "order": 1,
                    "obj_network": {
                        "code": "TRC20",
                        "id": 4,
                        "icon": "https://cdn.trybit.com/img/network/TRC20.svg",
                        "fullname": "Tron"
                    },
                    "enable": true
                },
                "address": "TKDyKl8F871WiPd3q1jrxgg3HE4AHPDms6",
                "uuid": "KW2WWTTVNBHM97AGFUJ1SDNFQVS4ER0X",
                "active": true,
                "created": "2026-01-01 09:13:57.599180",
                "identify": "Test1"
            }
        ],
        "all_count": 2
    }
}
```

{% endtab %}
{% endtabs %}

#### Response parameters

The `result` object contains:

| Name          | Type    | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Description                     |
| ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
| staticWallets | array   | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | List of static wallets          |
| currency      | dict    | <p>  "currency": {</p><p>            "id": 4,</p><p>            "code": "USDT\_TRC20",</p><p>      "short\_code": "USDT",</p><p>            "name": "Tether",            "is\_email\_required": false,</p><p>            "stablecoin": true,</p><p>            "icon\_base": "<https://cdn.trybit.com/img/currency/USDT.svg>",            "icon\_network": "<https://cdn.trybit.com/img/currency_network/USDT_TRC.svg>",</p><p>            "icon\_qr": "<https://cdn.trybit.com/img/stroke/USDT_STROKE.svg>",</p><p>            "order": 1,            "obj\_network": {</p><p>                "code": "TRC20",</p><p>                "id": 4,</p><p>                "icon": "<https://cdn.trybit.com/img/network/TRC20.svg>",                "fullname": "Tron"</p><p>            }</p> | Currency information            |
| enable        | boolean | true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Wallet status                   |
| address       | string  | “TT2T17K<...>79zdkEWkU9N”                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Generated static wallet address |
| uuid          | string  | “KW2WW<...>JPSDNFQVS4ER0X”                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Static wallet identifier        |
| created       | string  | "2026-01-01 09:13:57.599180"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Creation date                   |
| identify      | string  | test\_static\_wallet                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Static wallet name              |
| all\_count    | int     | 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Number of static wallets        |

***

### Address subscription management <a href="#poluchenie-spiska-staticheskikh-koshelkov-polzovatelya" id="poluchenie-spiska-staticheskikh-koshelkov-polzovatelya"></a>

#### What the method allows you to do

* Activates a previously created static wallet
* Deactivates a previously created static wallet

#### Endpoint

<mark style="color:green;">`POST`</mark> `https://api.trybit.com/v2/invoice/static/subscribe`

<mark style="color:green;">`POST`</mark> `https://api.trybit.com/v2/invoice/static/unsubscribe`

#### Headers

| Name                                            | Type   | Example                             | Description     |
| ----------------------------------------------- | ------ | ----------------------------------- | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Token eyJ0eXAiOiJK<...>4npi1ksS8tSY | Project API key |

#### Request Body

Key parameters

| Name                                   | Type   | Example                            | Description              |
| -------------------------------------- | ------ | ---------------------------------- | ------------------------ |
| uuid<mark style="color:red;">\*</mark> | string | "J9JFJN085D922I394UL1P8EELYSE0P87" | Static wallet identifier |

#### Activation request example

These examples show how to activate or deactivate a previously created static wallet.

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

```bash
cURL
curl --location 'https://api.trybit.com/v2/invoice/static/subscribe  ' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <API KEY>' \
--data '{
"uuid": "J9JFJN085D922I394UL1P8EELYSE0P87"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.trybit.com/v2/invoice/static/subscribe"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Token <API KEY>"
}
data = {
    "uuid": "J9JFJN085D922I394UL1P8EELYSE0P87"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const url = 'https://api.trybit.com/v2/invoice/static/subscribe';
const headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Token <API KEY>'
};
const body = JSON.stringify({
  uuid: 'J9JFJN085D922I394UL1P8EELYSE0P87'
});

fetch(url, {
  method: 'POST',
  headers: headers,
  body: body
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error('Error:', err));
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$url = 'https://api.trybit.com/v2/invoice/static/subscribe';

$headers = [
    'Content-Type: application/json',
    'Authorization: Token <API KEY>'
];

$data = json_encode([
    'uuid' => 'J9JFJN085D922I394UL1P8EELYSE0P87'
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
```

{% endtab %}
{% endtabs %}

#### Response example

A successful request returns a response with the status `success` and a `result` object.

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

```json
{
    "status": "success",
    "result": {
        "currency": {
            "id": 23,
            "code": "SOL",
            "short_code": "SOL",
            "name": "Solana",
            "is_email_required": false,
            "stablecoin": false,
            "icon_base": "https://cdn.trybit.com/img/currency/SOL.svg",
            "icon_network": "https://cdn.trybit.com/img/currency/SOL.svg",
            "icon_qr": "https://cdn.trybit.com/img/stroke/SOL_STROKE.svg",
            "order": 19,
            "obj_network": {
                "code": "SOL",
                "id": 23,
                "icon": "https://cdn.trybit.com/img/currency/SOL.svg",
                "fullname": "Solana"
            },
            "enable": true
        },
        "address": "BZeZochHaCVNtyS1vLAzavd5vJEV5tiFJBkGiXFLw6XA",
        "active": false
    }
}
```

{% endtab %}
{% endtabs %}

#### Response parameters

The `result` object contains:

| Name     | Type    | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Description                     |
| -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------- |
| currency | dict    | <p>  "currency": {</p><p>            "id": 23,</p><p>            "code": "SOL",</p><p>           "short\_code": "SOL",</p><p>            "name": "Solana",          "is\_email\_required": false,</p><p>            "stablecoin": false,</p><p>            "icon\_base": "<https://cdn.trybit.com/img/currency/SOL.svg>",           "icon\_network": "<https://cdn.trybit.com/img/currency/SOL.svg>",</p><p>            "icon\_qr": "<https://cdn.trybit.com/img/stroke/SOL_STROKE.svg>",</p><p>            "order": 19,           "obj\_network": {</p><p>                "code": "SOL",</p><p>                "id": 23,</p><p>                "icon": "<https://cdn.trybit.com/img/currency/SOL.svg>",</p><p>            "fullname": "Solana"</p><p>            },</p> | Currency information            |
| enable   | boolean | true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Wallet status                   |
| address  | string  | BZeZochH<...>vJEV5tiFJBkGiXFLw6XA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Generated static wallet address |
| active   | boolean | true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Subscription status             |


# H2H Integration (White Label)

Learn how to enable Host2Host (H2H) — white-label crypto payment acceptance without redirects: payment details are displayed in your interface, and statuses are delivered via API.

Host2Host (H2H) is a white-label API integration scenario in which payment details are transmitted directly to your side without redirecting the user to the Trybit payment page. You fully control the payment interface: you display the wallet address, network, and amount within your website or application design, maintaining a consistent branded user experience.

Payment statuses are delivered via API notifications and can be processed automatically in your system.

**When to use H2H:**

* White-label crypto payment acceptance is required without mentioning the payment provider
* Redirects to external pages are prohibited
* Full control over the payment UI/UX is needed
* A custom checkout, application, or terminal is used

### How H2H works

1. **Request authentication**\
   All API requests are signed with your API keys from the Trybit project settings.
2. **Invoice creation**\
   You send an API request to [create an invoice](/api-reference-v2/create-invoice), specifying:

* invoice amount
* invoice currency
* `cryptocurrency` parameter — the currency in which the user will pay

In H2H, specifying `cryptocurrency` is mandatory, as the payment details are generated for the selected currency.

3. **Receiving payment details**\
   The API response returns:

* unique wallet address
* exact payment amount

You display this data to the user in your interface (white-label checkout).

4. **User payment**\
   The user transfers funds to the issued address in the specified network and amount.
5. **Payment notification (Postback)**\
   After funds are received, Trybit sends a POST notification to the notification URL configured in your [project settings](https://support.trybit.com/getting-started/project-settings).\
   You verify the notification signature and update the order/service status in your system.
6. **Invoice status check (optional)**\
   The [invoice status](https://support.trybit.com/payments/invoice-statuses) can be requested manually via API using the INV number.\
   Used for reconciliation, rechecks in case of notification failures, or manual processing.

### Integration result

After H2H is enabled:

* payments occur in a fully white-label interface
* the user does not leave your website or application
* the Trybit brand is not shown during payment
* payment statuses are automatically synchronized via API

### Important

* the user must pay strictly in the specified network and currency
* the amount must match the API-issued amount
* each invoice has a unique address
* the address is valid for one invoice only

### Connection

The technical description of invoice creation, status checks, and Postback handling is available in the [API Reference V2 section](/api-reference-v2/authorization).


# List of CMS Plugins

We develop ready-made plugins for fast and secure integration of Trybit with popular CMS and regularly update their list.

For each module, we provide step-by-step instructions, so the process of connecting your project takes just a few minutes.

At the moment, modules are available for:

* [Woocommerce](/cms-plugins/list/woocommerce);
* [OpenCart](/cms-plugins/list/opencart);
* [Tilda](/cms-plugins/list/tilda);
* [GetCourse](/cms-plugins/list/getcourse);
* [WHMCS](/cms-plugins/list/whmcs);
* [Xenforo 2](/cms-plugins/list/xenforo-2);
* [Drupal](/cms-plugins/list/drupal);
* [PrestaShop](/cms-plugins/list/prestashop).

For other platforms, you can choose an alternative connection method. The list of ready-made modules constantly grows.

Please contact our technical support if you need a module for another CMS.


# WooCommerce

Below there is a simple instruction on how to integrate CryptoCloud with WooCommerce:

1. Sign up on the website <https://app.trybit.com/registration>.
2. Read the instructions in your personal account.
3. Add your project in your personal account by filling in the required boxes. In the CMS list, select Woocommerce.

**Your website:**\
<https://domain.com/>

**Successful URL:**\
<https://domain.com/thank-you\\>
(can be any link)

**Unsuccessful URL:**\
<https://domain.com/fail\\>
(can be any link)\
\
**URL for notifications:**\
<https://domain.com/?wc-api=WC\\_Gateway\\_CryptoCloud>

4. Install the plugin by downloading the module file and moving the woocryptocloud folder to the /wp-content/plugins folder. You can also download the plugin from the [official WordPress plugin store](https://wordpress.org/plugins/cryptocloud-crypto-payment-gateway/).

{% file src="/files/EnwjFpDBACTpXg9PmRBl" %}

5. In the WordPress admin panel in the Plugins section, search for and activate the plugin WooCommerce — CryptoCloud Payment Module.
6. Go to WooCommerce — Settings — Payments and set up the CryptoCloud payment method.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/woocommerce/1_en.png" alt=""><figcaption></figcaption></figure>

**Enable/Disable:**\
Tick the checkbox if you want to enable the CryptoCloud payment method.

**Name:**\
You can specify CryptoCloud (convenient cryptocurrency payment) in the name of the payment method.

**APIKey:**\
To get APIKey, go to the settings of your project.

**ShopID:**\
To get ShopID, go to the settings of your project. ID consists of 16 characters and is unique for each project.

7. The module is ready to work! Before publishing a payment method on the website, it is necessary to [test the integration](/start/test-integration).

{% hint style="info" %}
Woocommerce uses blocks by default. In order for CryptoCloud integration to work properly, you need to switch the shopping cart to the classic view.
{% endhint %}


# OpenCart

Below there is a simple instruction on how to integrate CryptoCloud with OpenCart:

1. Sign up on the website <https://app.trybit.com/registration>.
2. Read the instructions in your personal account.
3. Add your project in your personal account by filling in the required boxes. In the CMS list, select OpenCart.

**Your website:**\
<https://domain.com/>

{% tabs %}
{% tab title="1.5.x" %}
**Successful URL:**\
<https://domain.com/index.php?route=payment/cryptocloud/response>

**Unsuccessful URL:**\
<https://domain.com/index.php?route=extension/payment/cryptocloud/response>

**URL for notifications:**\
<https://domain.com/index.php?route=payment/cryptocloud/callback>
{% endtab %}

{% tab title="2.0" %}
**Successful URL:**\
<https://domain.com/index.php?route=extension/payment/cryptocloud/response>

**Unsuccessful URL:**\
<https://domain.com/index.php?route=extension/payment/cryptocloud/response\\&fail=1>

**URL for notifications:**\
<https://domain.com/index.php?route=extension/payment/cryptocloud/callback>
{% endtab %}

{% tab title="2.1, 2.2, 2.3" %}
**Successful URL:**\
<https://domain.com/index.php?route=extension/payment/cryptocloud/response>

**Unsuccessful URL:**\
<https://domain.com/index.php?route=extension/payment/cryptocloud/response\\&fail=1>

**URL for notifications:**\
<https://domain.com/index.php?route=extension/payment/cryptocloud/callback>
{% endtab %}

{% tab title="3.x" %}
**Successful URL:**\
<https://domain.com/index.php?route=extension/payment/cryptocloud/response>

**Unsuccessful URL:**\
<https://domain.com/index.php?route=extension/payment/cryptocloud/response\\&fail=1>

**URL for notifications:**\
<https://domain.com/index.php?route=extension/payment/cryptocloud/callback>
{% endtab %}
{% endtabs %}

4. Download the ZIP archive with the files to integrate the module.

{% file src="/files/dijdvTki6S3wWwnvOBhc" %}

5. Select the right Opencart version and perform the integration according to the instructions:

{% tabs %}
{% tab title="1.5.x" %}

1. Copy the contents of admin and catalog folders to the root of OpenCart installation (files should be merged when pasting);
2. In the OpenCart admin panel go to the «Add-ons» — «Payment» section, activate and customize the payment method «CryptoCloud».

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/opencart/1_en.jpeg" alt=""><figcaption></figcaption></figure>

**APIKey:** \
To get an API key, go to your project settings.

**Shop ID:**\
To get the ShopID, go to the settings of your project. The ID consists of 16 characters and is unique for each project.

**Title:**\
You can enter CryptoCloud (convenient cryptocurrency payment) in the payment method title.

**Order Status after payment:**\
Determines the status of the order after successful payment.

**Status:**\
Enables and disables the payment method.

**Sort Order:**\
Determines the order in which the payment method is displayed (you can specify "1").
{% endtab %}

{% tab title="2.0" %}

1. To install the module, you need to enable FTP in the store settings (if not already enabled);
2. In the OpenCart admin panel, go to «System» — «Settings» — «FTP»;
3. After enabling FTP, go to «Modules» — «Install Extensions» — «Download» and upload the downloaded module xxx.ocmod.zip;
4. In the OpenCart admin panel, go to «Modules» — «Payment», activate and customize the payment method «CryptoCloud».

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

**APIKey:** \
To get an API key, go to your project settings.

**Shop ID:**\
To get the ShopID, go to the settings of your project. The ID consists of 16 characters and is unique for each project.

**Title:**\
You can enter CryptoCloud (convenient cryptocurrency payment) in the payment method title.

**Order Status after payment:**\
Determines the status of the order after successful payment.

**Status:**\
Enables and disables the payment method.

**Sort Order:**\
Determines the order in which the payment method is displayed (you can specify "1").
{% endtab %}

{% tab title="2.1, 2.2, 2.3" %}

1. To install the module, you need to enable FTP in the store settings (if not already enabled);
2. In the OpenCart admin panel, go to «System» — «Settings» — «FTP»;
3. After enabling FTP, go to «Modules» — «Install Extensions» — «Download» and upload the downloaded module xxx.ocmod.zip;
4. In the OpenCart admin panel, go to «Modules» — «Payment», activate and customize the payment method «CryptoCloud».

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5U1THZAib81UsHLz0L7L%2Fuploads%2FmusH8SxITQxlRXQINCAI%2Fo1.png?alt=media&#x26;token=3bd3ac19-d578-43c5-ab42-92e9476a264d" alt=""><figcaption></figcaption></figure>

**APIKey:** \
To get an API key, go to your project settings.

**Shop ID:**\
To get the ShopID, go to the settings of your project. The ID consists of 16 characters and is unique for each project.

**Title:**\
You can enter CryptoCloud (convenient cryptocurrency payment) in the payment method title.

**Order Status after payment:**\
Determines the status of the order after successful payment.

**Status:**\
Enables and disables the payment method.

**Sort Order:**\
Determines the order in which the payment method is displayed (you can specify "1").
{% endtab %}

{% tab title="3.x" %}

1. Copy the contents of admin and catalog folders to the root of OpenCart installation (files should be merged when pasting);
2. In the OpenCart admin panel go to the «Add-ons» — «Payment» section, activate and customize the payment method «CryptoCloud».

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5U1THZAib81UsHLz0L7L%2Fuploads%2FmusH8SxITQxlRXQINCAI%2Fo1.png?alt=media&#x26;token=3bd3ac19-d578-43c5-ab42-92e9476a264d" alt=""><figcaption></figcaption></figure>

**APIKey:** \
To get an API key, go to your project settings.

**Shop ID:**\
To get the ShopID, go to the settings of your project. The ID consists of 16 characters and is unique for each project.

**Title:**\
You can enter CryptoCloud (convenient cryptocurrency payment) in the payment method title.

**Order Status after payment:**\
Determines the status of the order after successful payment.

**Status:**\
Enables and disables the payment method.

**Sort Order:**\
Determines the order in which the payment method is displayed (you can specify "1").
{% endtab %}
{% endtabs %}

6. The module is ready to work! Before publishing a payment method on the website, it is necessary to [test the integration](/start/test-integration).


# Tilda

Below there is a simple instruction on how to integrate CryptoCloud with Tilda:

1. Sign up on the website <https://app.trybit.com/registration>.
2. Read the instructions in your personal account;
3. Add your project in your personal account by filling in the required boxes. In the CMS list, select Tilda.

**Your website:**\
<https://domain.com/>

**Successful URL:**\
<https://domain.com/thank-you\\>
(can be any link)

**Unsuccessful URL:**\
<https://domain.com/fail\\>
(can be any link)

**URL for notifications:**\
<https://tilda.cryptocloud.plus/payment/callback>

4. Go to Tilda — Site settings — Payment systems. In the list of payment services, select «Custom Payment Gateway». In the «Settings template» item, select New payment system (for developers) from the drop-down list.
5. Fill in all fields of the form according to the example below. Settings that are not described in the instructions should be left as default.<br>

   Login — specify SHOP ID of your project.

   Secret for order sign — specify API KEY of your project.

   Notification URL — will be filled in automatically.

   Currency — specify the currency in which you accept payments. Among supported currencies: USD, EUR, GBP, UAH and others.

   Country — enter the country code for the payment system.

   Information on taxation and electronic checks can be left unchanged.

   Payment widget language — EN.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/tilda/1_en.jpg" alt=""><figcaption></figcaption></figure>

6. Open advanced settings and fill in all the form boxes according to the example below. Settings not described in the instructions should be left as default.

**URL:** \
API URL — <https://tilda.cryptocloud.plus/payment\\>
\
**Fields:**\
Login — crypto\_cloud\_shop\_id\
Currency — currency\
Language — language\
Country — country\
URL for notifications — notify\_url\
Order number — order\_number\
Order description — order\_description\
Order amount — order\_amount\
Order time — order\_time\
Customer Email — client\_email\
Customer's phone number — client\_phone\
Customer's name — client\_name\
Signature — signature\
Products — order\_products\
Order number — index\
Name — name\
Quantity — quantity\
Price — price\
Total cost — total\_price\
Photo — image

Tick the «Add shipping to the list of products» and «Use discounted price for products» checkboxes.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/tilda/2_en.jpg" alt=""><figcaption></figcaption></figure>

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/tilda/3_en.jpg" alt=""><figcaption></figcaption></figure>

**Order signature:**\
Signature Rules — Custom Rules\
Custom Signature Rules — {{crypto\_cloud\_shop\_id}}{{order\_amount}}{{order\_number}}{{secret}}.\
The signature encryption algorithm is SHA-256. Tick the «Use secret as algorithm key (HMAC)» checkbox.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/tilda/4_en.jpg" alt=""><figcaption></figcaption></figure>

**Notification signature:**\
Signature Rules — Custom Rules\
Custom Signature Rules — {{crypto\_cloud\_shop\_id}}{{order\_amount}}{{order\_number}}{{secret}}{{paid}}.\
The signature encryption algorithm is SHA-256. Tick the «Use secret as algorithm key (HMAC)» checkbox.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/tilda/5_en.jpg" alt=""><figcaption></figcaption></figure>

**Notification:**\
Successful payment indicator\
Field — paid\
Value — 1

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/tilda/6_en.jpg" alt=""><figcaption></figcaption></figure>

**Form settings:**\
Title for the «Login» box — SHOP ID\
Tip for the «Login» box — To get the ShopID, go to your project's settings. The ID consists of 16 characters and is unique for each project.\
Header for the «Secret for order signature» box — API KEY\
Hint for the box «Secret for order signature» — To get APIKey, go to your project's settings.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/tilda/7_en.jpg" alt=""><figcaption></figcaption></figure>

**Support:**\
Support Email — <support@cryptocloud.pro>\
Feedback link — <https://cryptocloud.plus/en/support\\>
Link to instructions — <https://docs.cryptocloud.plus/en/cms-plugins/list/tilda\\>
Title — set the name of the payment method, example: CryptoCloud (convenient cryptocurrency payment).

7. After completing the form, check all the data entered and click the «Add» button.
8. Republish all pages of your website.
9. The module is ready to work! Before publishing the payment method on the website, you need to [test the integration](/start/test-integration).

{% hint style="info" %}
In order for CryptoCloud integration with Tilda to work correctly, you have to have a shopping cart installed on your website.

<img src="/files/6uiF7dMUeDrBSxCDrdnC" alt="" data-size="original">
{% endhint %}


# GetCourse

Below there is a simple instruction on how to integrate CryptoCloud on GetCourse:

1. Sign up on the website <https://app.trybit.com/registration>.
2. Read the instructions in your personal account.
3. Add your project in your personal account by filling in the required boxes. In the CMS list, select GetCourse.

**Your website:**\
<https://domain.com/>

**Successful URL:**\
<https://domain.com/thank-you\\>
(can be any link)

**Unsuccessful URL:**\
<https://domain.com/fail\\>
(can be any link)

**URL for notifications:**\
<https://account\\_name.getcourse.ru/pl/api/deals>

**Getcourse API**\
The key can be found at <https://account\\_name.getcourse.ru/saas/account/api>

4. In the list of pages select «Order Payment» and proceed to edit this page.
5. Go to the GetCourse website: Website — Pages — System pages — Order payment.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/getcourse/1_en.png" alt=""><figcaption></figcaption></figure>

6. Select a place to insert the block and click on the «Add Block» button on the right side of the screen.
7. In the window that opens, select «HTML block».
8. Disable the «WYSIWYG» mode and tick the «Replace variables» checkbox.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/getcourse/2_en.png" alt=""><figcaption></figcaption></figure>

9. Open the inserted HTML block and replace all the content with this code. Before inserting the code, specify SHOP ID, API KEY and CURRENCY (EUR / USD / GBP / UAH / other currency). You can find them in the project settings in your CryptoCloud personal account.

```javascript
<link href="https://api.cryptocloud.plus/static/widget/css/app.css" rel="stylesheet" >
<vue-widget shop_id="YOUR_SHOP_ID" api_key="YOUR_KEY" currency="CURRENCY" ></vue-widget>
<script src="https://api.cryptocloud.plus/static/widget/js/app.js"></script >
```

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/getcourse/4_en.png" alt=""><figcaption></figcaption></figure>

10. Click the «Save» button in the upper right corner of the page and go to the page viewer.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/getcourse/5_en.png" alt=""><figcaption></figcaption></figure>

11. The module is ready to work! Before publishing the payment method on the website, you need to [test the integration](/start/test-integration).


# XenForo 2

Below there is a simple instruction on how to integrate CryptoCloud on XenForo 2:

1. Sign up on the website <https://app.trybit.com/registration>.
2. Read the instructions in your personal account.
3. Add your project in your personal account by filling in the required boxes. In the CMS list, select XenForo 2.

**Your website:**\
<https://domain.com/>

**Successful URL:**\
<https://domain.com/thank-you\\>
(can be any link)

**Unsuccessful URL:**\
<https://domain.com/fail\\>
(can be any link)

**URL for notifications:**\
<https://domain.com/payment\\_callback.php?\\_xfProvider=CryptoCloud>

4. Download the plugin for XenForo.

{% file src="/files/Ld2Qec7s6weBNTN0fJCA" %}

5. Install the plugin using the standard [XenForo tools](https://xenforo.com/docs/xf2/add-ons/#installing-or-upgrading-an-add-on).
6. In the XenForo control panel, go to the Settings — Payment Gateways page. In the forum control panel, click the «Add Payment Gateway» button.
7. Fill in all boxes using the data from your CryptoCloud personal account.

**APIKey:**\
To get an API Key, go to your project settings.

**Secret Key:**\
To get a Secret Key, go to your project settings.

**Shop ID:**\
To get the ShopID, go to the settings of your project. The ID consists of 16 characters and is unique for each project.

8. The module is ready to work! Before publishing the payment method on the website, you need to [test the integration](/start/test-integration).


# PrestaShop

Below there is a simple instruction on how to integrate CryptoCloud on PrestaShop:

1. Sign up on the website <https://app.trybit.com/registration>.
2. Read the instructions in your personal account.
3. Add your project in your personal account by filling in the required boxes. In the CMS list, select PrestaShop.

**Your website:**\
<https://domain.com/>

**Successful URL:**\
<https://domain.com/thank-you\\>
(can be any link)

**Unsuccessful URL:**\
<https://domain.com/fail\\>
(can be any link)

**URL for notifications:**\
<https://domain.com/module/ewcryptocloud/callback>

4. Download the ZIP archive with the PrestaShop module.

{% file src="/files/XM5Y8NNbHhQRDNYqVmId" %}

5. In the PrestaShop admin panel in the Modules section, go to «Module Manager» and click on the «Upload Module» button at the top of the page.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/prestashop/1_en.jpg" alt=""><figcaption></figcaption></figure>

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/prestashop/2_en.jpg" alt=""><figcaption></figcaption></figure>

6. Drag the downloaded ZIP-archive to the opened window and wait until the module is installed. Then, go to the module settings.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/prestashop/3_en.jpg" alt=""><figcaption></figcaption></figure>

**APIKey:**\
To get an API Key, go to your project settings.

**Secret Key:**\
To get a Secret Key, go to your project settings.

**Shop ID:**\
To get the ShopID, go to the settings of your project. The ID consists of 16 characters and is unique for each project.

**OrderState:**\
The status of the order in your store after creation.

**Successful payment status:**\
The status of the order in your store after successful payment.

**Failed payment status:**\
The status of the order in your store after failed payment.

7. The module is ready to work! Before publishing the payment method on the website, you need to [test the integration](/start/test-integration).


# Drupal

Below there is a simple instruction on how to integrate CryptoCloud on Drupal:

1. Sign up on the website <https://app.trybit.com/registration>.
2. Read the instructions in your personal account.
3. Add your project in your personal account by filling in the required boxes. In the CMS list, select Drupal.

**Your website:**\
<https://domain.com/>

**Successful URL:**\
<https://domain.com/thank-you\\>
(can be any link)

**Unsuccessful URL:**\
<https://domain.com/fail\\>
(can be any link)

**URL for notifications:**\
<https://domain.com/cryptocloud-payment/index>

4. Download the ZIP archive with the Drupal module in your personal account.

{% file src="/files/oPNrOSRGSUzYhiRMGkAw" %}

5. In the Drupal admin panel under «Manage» go to «Extensions» and click on «Add New Module».

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/drupal/1_en.jpg" alt=""><figcaption></figcaption></figure>

6. In the appeared window, specify the location of the ZIP archive with the module and wait for the module to load.
7. Go back to the «Administration» — «Extensions» section and enable the installed CryptoCloud module.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/drupal/2_en.jpg" alt=""><figcaption></figcaption></figure>

8. To display the module on your website, go to the «Commerce» section — «Configuration» — «Payment gateway». In the «Payment gateway» section click on «Add payment gateway».

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/drupal/3_en.jpg" alt=""><figcaption></figcaption></figure>

9. Go to the CryptoCloud module settings.

<figure><img src="https://app.cryptocloud.plus/img/integrations/instructions/drupal/4_en.jpg" alt=""><figcaption></figcaption></figure>

**APIKey:**\
To get an API Key, go to your project settings.

**Secret Key:**\
To get a Secret Key, go to your project settings.

**Shop ID:**\
To get the ShopID, go to the settings of your project. The ID consists of 16 characters and is unique for each project.

10. The module is ready to work! Before publishing the payment method on the website, you need to [test the integration](/start/test-integration).


# WHMCS

Below there is a simple instruction on how to integrate CryptoCloud on WHMCS:

1. Sign up on the website <https://app.trybit.com/registration>.
2. Read the instructions in your personal account.
3. Add your project in your personal account by filling in the required boxes. In the CMS list, select WHMCS.

**Your website:**\
<https://domain.com/>

**Successful URL:**\
<https://domain.com/modules/gateways/cryptocloudplus/cryptocloudplus\\_success.php>

**Unsuccessful URL:**\
<https://domain.com/modules/gateways/cryptocloudplus/cryptocloudplus\\_fail.php>

**URL for notifications:**\
<https://domain.com/modules/gateways/cryptocloudplus/cryptocloudplus.php>

4. Download and unzip the ZIP archive with the WHMCS module.

{% file src="/files/Yz0ifHXprncHyVSOp4so" %}

5. Upload the files from the /modules/gateway/ folder to the folder on the server where WHMCS /modules/gateway is installed.
6. In the WHMCS admin panel, go to System Settings — Apps & Integrations — Apps & Integrations.
7. Search for CryptoСloud. Select the module and click «Activate».
8. On the page that opens, fill in the required fields using the data from the project settings in your CryptoCloud personal account.

<figure><img src="/files/0Syhpg9rHT4i4PhJeek6" alt=""><figcaption></figcaption></figure>

**Display Name:** \
Name of payment method, example: CryptoCloud (convenient payment in cryptocurrency).

**ShopID:** \
To get the ShopID, go to the settings of your project. The ID consists of 16 characters and is unique for each project.

**APIKey:** \
To get an API Key, go to your project settings.

**Secret Key:** \
To get a Secret Key, go to your project settings.

**Invoice expiration time:** \
Invoice expiration time. The possible range is from 3 to 24 hours.

**Test mode:** \
Activation of the test mode WHMCS.

**Disabled:** \
Disabling the payment method.

9. Save changes.
10. The module is ready to work! Before publishing the payment method on the website, you need to [test the integration](/start/test-integration).


# HTML-widget

Enable crypto payment acceptance on your website using a ready-made HTML widget.

You can enable cryptocurrency payment acceptance with an HTML widget — a ready-made form that can be easily installed on your website by inserting code.

Your customers will only need to choose a currency, specify an arbitrary amount and their e-mail. You will see statuses and receive notifications about incoming payments.

You can install the widget in one of two ways:

* [HTML-form](/buttons-forms/html-widget/form);
* [HTML-button](/buttons-forms/html-widget/button).

When enabling payment acceptance via the HTML widget, you can receive [automatic postbacks](/api-reference-v2/postback) by specifying a notification URL in your project settings.

You can also receive payment notifications in your dashboard, via Telegram, and by email.


# HTML-form

Embedded HTML payment form on your website.

HTML form is an HTML widget option in which an embedded payment form is placed on your website page. The user selects the currency, enters the amount, and pays the invoice within an iframe on your site without redirection to the Trybit payment page.

### HTML form setup

1. Log in to your dashboard.
2. Go to the «Widget» section in the left menu.
3. Select the project.
4. In the «Widget type», choose «Form».

### Form parameters

During setup, you can:

* choose a dark or light form theme
* change the payment button text
* show or hide the Email field
* set a predefined payment amount
* select the payment page language

All changes are reflected in the preview window in real time.

### Installation on your website

Copy the generated widget code and paste it into the desired location on your website page. After the user clicks the payment button, the invoice opens in an embedded iframe without navigating to an external page.

When enabling payment acceptance via the HTML widget, you can receive [automatic postbacks](/api-reference-v2/postback) by specifying a notification URL in your project settings.

You can also receive payment notifications in your dashboard, via Telegram, and by email.


# HTML-button

Cryptocurrency payment button for your website.

HTML button is an HTML widget option in which a payment button is placed on your website page. After clicking, the user proceeds to invoice payment within an embedded iframe on your site without redirection to the Trybit payment page.

### HTML button setup

1. Log in to your dashboard.
2. Go to the «Widget» section in the left menu.
3. Select the project.
4. In the «Widget type», choose «Button».

### Button parameters

During setup, you can:

* choose the button style
* choose the button color
* choose the button size
* change the payment button text
* set the payment amount
* select the payment page language

All changes are reflected in the preview window in real time.

### Installation on your website

Copy the generated button code and paste it into the desired location on your website page. After the user clicks the payment button, the invoice opens in an embedded iframe without navigating to an external page.

When enabling payment acceptance via the HTML widget, you can receive [automatic postbacks](/api-reference-v2/postback) by specifying a notification URL in your project settings.

You can also receive payment notifications in your dashboard, via Telegram, and by email.


