For the complete documentation index, see llms.txt. This page is also available as Markdown.

H2H Integration (White Label)

Creating an invoice for Host2Host integration: request parameters, response and displaying payment details in your interface.

Host2Host (H2H) is an integration method in which payment details are returned in the API response, and the customer pays the invoice in your interface without being redirected to the Trybit payment page. It suits custom checkouts, mobile apps and terminals. Learn more about the scenario on the Host2Host (White Label) page in the Knowledge Base.

Response fields needed for a custom checkout

Field

What to show the customer

address

Transfer address

amount

Exact amount to pay in cryptocurrency

currency.code, currency.name

Payment cryptocurrency

currency.network.code, currency.network.fullname

Transfer network

expiry_date

Invoice expiration time — for the timer. Time is in UTC+0

uuid

Invoice number (INV)

amount_in_fiat, fiat_currency

Invoice amount in fiat currency

MEMO / Comment

MEMO / Comment — for the TON network

What must be shown to the customer

  • Transfer address and network.

  • Exact amount in cryptocurrency.

  • MEMO / Comment — for the TON network.

  • A countdown timer until the invoice expires.

  • A QR code with the address.

  • A warning: the sender pays the network, wallet or exchange fee on top of the invoice amount. If less is received, the invoice will get the "Partially paid" status.

MEMO / Comment

MEMO / Comment is mandatory for payments in the TON network. Without it, the system cannot identify the payment, and it will not be credited automatically — such a payment can be credited to the invoice only manually via support. For invoices in the TON network, display the MEMO / Comment next to the address and warn the customer that it must be specified when making the transfer.

Underpayment, overpayment and additional payment

Underpayment. If less than the invoice amount is received, the invoice gets the partial ("Partially paid") status. Before the invoice expires, the customer can pay the difference to the same address. Show the remaining amount in your interface. You can also confirm the invoice manually in the "Payments" section or set up auto-confirmation for small deviations in the "Fees" section.

Overpayment. The invoice gets the overpaid ("Overpaid") status and is credited in full.

What happens when an invoice expires

If payment is not received before expiry_date, the invoice moves to the canceled status. Payment for an expired invoice is not credited automatically — to have it credited, contact support with the INV number and TXID. To let the customer pay for the order, create a new invoice — a new address will be issued for it.

Repeat payment to the same address

An address is valid for one invoice only. A repeat transfer to the address of an already paid invoice is not credited automatically — only via support. If customers need to pay to one permanent address, use static wallets.

How to process a POSTBACK

  • After payment, Trybit sends a POST request to the project's notification URL — only to ports 443 and 80.

  • 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.

  • Process each invoice only once: if a repeat notification for the same invoice_id arrives, do not deliver the goods again.

  • If the notification did not arrive, check the status with an Invoice Information request by INV number.

Notification parameters and handler examples are available on the Automatic POSTBACK page.

How to test H2H

  1. In test mode, create an invoice with the cryptocurrency parameter — the same way it will happen when a customer places an order.

  2. Check that the payment details are displayed correctly in your interface.

  3. In the "Payments" section, switch to "Test", open the invoice and click "Confirm invoice without payment".

  4. Make sure the POSTBACK is delivered and the order status is updated.

Learn more on the Testing the Integration page.

Access and restrictions

H2H is available to all projects without separate activation — simply pass the cryptocurrency parameter when creating an invoice. Currencies, networks, limits and project requirements are the same as for other integration methods.

Request sequence diagram

Client platform → Trybit API (invoice creation with cryptocurrency) → payment details in the platform interface → customer → blockchain → POSTBACK to the notification URL → status check by INV.

Last updated

Was this helpful?