> For the complete documentation index, see [llms.txt](https://docs.trybit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trybit.com/start/how-it-works.md).

# How the Integration Works

Every integration method is built around an invoice: your system creates it, the customer pays it, and Trybit reports the result. Understanding this cycle helps you design payment processing on your side correctly — when to deliver goods, how to handle underpayment and how to reconcile data.

### How the interaction works

Your platform → Trybit API → Trybit payment page or your interface (H2H) → customer → blockchain → POSTBACK to your server

* **Your platform** — a website, app or Telegram bot where the customer places an order.
* **Trybit API** — accepts invoice creation requests and returns payment data.
* **Payment page or your interface** — where the customer sees the amount and payment details: the Trybit payment page or, with H2H, your own interface.
* **Blockchain** — the network in which the customer's transaction is processed and confirmed.
* **POSTBACK** — a notification Trybit sends to your server after the payment is confirmed.

### How an invoice is paid

1. **Invoice creation.** Your system sends an [invoice creation](/api-reference-v2/create-invoice.md) request with the API KEY in the header, the SHOP ID, amount, currency and, if needed, your order number (order\_id).
2. **Link or payment details.** In response, Trybit returns the invoice number (INV) and a link to the payment page, or, with H2H, payment details to display in your interface.
3. **Payment.** The customer selects a currency and network and sends a transfer from their wallet or exchange.
4. **Network confirmation.** The transaction is confirmed in the blockchain. Timing depends on the network: for ERC20, TRC20, BSC (BEP20), TON, SOL, BASE, ARB and OP — from 30 seconds to 5 minutes; for LTC — from 2 to 10 minutes; for BTC — from 10 minutes to several hours.
5. **POSTBACK.** Once the payment is confirmed, Trybit sends a POST request to the project's notification URL in the selected format — JSON or form-data.
6. **Status check.** If needed, your system requests [invoice information](/api-reference-v2/invoice-information.md) by INV number.

### Invoice statuses

| **Status**     | **Meaning**                                         |
| -------------- | --------------------------------------------------- |
| Created        | The invoice has been issued and is awaiting payment |
| Paid           | The payment has been credited in full               |
| Partially paid | Less than the invoice amount was received           |
| Overpaid       | More than the invoice amount was received           |
| Canceled       | The invoice was not paid; it has expired            |

Learn more [on the Invoice Statuses page in the Knowledge Base](https://support.trybit.com/payments/invoice-statuses).

### How payment scenarios differ

| **Scenario**                    | **Where the customer pays**            | **What your system does**                                                                   |
| ------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------- |
| Payment page (API, CMS modules) | On the Trybit payment page             | Creates an invoice, redirects the customer via the link and processes the POSTBACK          |
| Host2Host (H2H)                 | In your interface, without redirection | Creates an invoice, displays the payment details and tracks the status via API and POSTBACK |
| HTML widget                     | In an embedded window on your website  | Places ready-made code; POSTBACK only with the "HTML widget (with postback)" method         |
| Static wallets                  | By transfer to a permanent address     | Creates a wallet once and receives deposit notifications without creating new invoices      |

### How to process a POSTBACK on your side

1. Accept the POST request at the notification URL. Notifications are sent only to ports 443 and 80.
2. Verify authenticity: the token parameter is a JWT signed with the project's SECRET KEY using the HS256 algorithm. The token is valid for 5 minutes from the moment it is sent, so the server time must be synchronized.
3. Match the invoice number, amount and currency against the order data in your system.
4. Process each invoice only once: if a notification for the same invoice\_id arrives again, do not deliver the goods again.
5. Return a response with code 200.

{% hint style="info" %}
The delivery status of each notification is shown in the "Postback history" section of the dashboard, where the notification can also be resent. The section is located on the paid invoice page: "Payments" → the relevant invoice. Parameters and handler examples are available [on the Automatic POSTBACK page](/api-reference-v2/postback.md).
{% endhint %}

### How to reconcile invoice data

Before delivering goods or in case of discrepancies, request [invoice information](/api-reference-v2/invoice-information.md) by INV number — a single request returns data for up to 100 invoices. The amount actually received, including overpayment, can also be checked in the "Payments" section of the dashboard.

### Underpayment, overpayment and expired invoices

* **Underpayment** — the invoice receives the "Partially paid" status. The customer can pay the remaining amount; you can confirm the invoice manually in the "Payments" section or set up auto-confirmation for small deviations in the "Fees" section of the project settings.
* **Overpayment** — credited in full. Your system may display the original amount, since the invoice was created for it.
* **Expired invoice** — if the payment is not confirmed before the invoice expires, it is not credited automatically. To have it credited, contact support with the INV number and TXID.
* **Repeat payment** — a repeat payment for an already paid invoice is not credited automatically, only via support.

Learn more [on the Invoice Payment Issues page](https://docs.trybit.com/api-reference-v2/invoice-information).

{% hint style="success" %}
If you have any questions or need assistance, contact our support chat on the website and in the dashboard, or reach us on Telegram. Support contacts are listed on our [website](https://trybit.com/support).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.trybit.com/start/how-it-works.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

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