Host2Host (H2H) is a way to accept cryptocurrency where the customer never leaves your product: your backend requests the payment details through an API and renders them in your own interface. This guide covers how the model works, what the requests and postbacks look like, and how to integrate it without losing payments.
What Is H2H Crypto Processing
Host2Host is an integration model in which a crypto payment api returns payment details straight to your server instead of sending the customer to a hosted checkout. The provider still processes the transaction and monitors the blockchain. The interface belongs to you.
In crypto, those details are the wallet address, the exact amount, and the network. H2H relies on the same request-response model as any other payment API: your backend authenticates, creates an invoice, and receives a JSON response. The difference is where the result is rendered. With a payment gateway api in H2H mode, the address and amount appear inside your checkout, so the payment stays white-label from the first click to the confirmation screen.
H2H vs Redirect Checkout
Most API-based crypto payment processing providers support both models. The choice is not about the payment itself but about how much of the flow you own.
With a redirect checkout, the payment happens on the provider's hosted page. You control the interface only through the settings the provider exposes, and its branding stays visible at checkout. Integration is minimal — one link — and your server only handles order data. This fits fast launches and small stores.
With an H2H integration, the payment happens on your own website or app. You get full control over layout and UX, and third-party branding is gone. The trade-off is backend work: invoices, postbacks, statuses. Your server now handles order data along with addresses, amounts and statuses. This fits custom checkouts, mobile apps and high-volume services.
A redirect is faster to ship. H2H costs development time and returns the checkout to you.
The H2H Payment Flow Step by Step
The H2H payment process has six steps, and only one of them happens on the customer’s side.
- Authorization. The project receives its API keys in the merchant account. Every request carries the key, so the service can identify the source and process payments securely.
- Invoice creation. Your backend sends the amount, the shop identifier, and the cryptocurrency the customer selected.
- Payment details. The service responds with a unique wallet address, the exact crypto amount, an invoice identifier, and an expiry date.
- Payment. The customer transfers the amount to that address from any wallet, while your interface shows the address, the amount, the network, and the remaining time.
- Postback. Once the funds are credited, the service sends a signed notification to the URL specified in the project settings.
- Status check. Optionally, your backend requests the invoice status directly, which is useful for reconciliation, or when a notification does not arrive.
Customer Your backend Trybit API Blockchain
| | | |
|-- starts payment -->| | |
| |-- POST invoice/create -->| |
| |<--- address + amount ----| |
|<-- details shown ---| | |
|----------------------------- sends crypto ---------------------------->|
| | |<--- confirmations ----|
| |<--- signed postback -----| |
|<-- order updated ---| | |
The entire payment logic runs through the API. The customer interacts only with your brand and is never handed off to a third-party page.
What the API Calls Look Like
This is where a crypto payment gateway API stops being abstract. The examples below follow the Trybit API Reference V2.
An invoice is created with a single POST request. The cryptocurrency value inside add_fields is what makes the response usable in H2H mode: it fixes the currency and network, so the service can issue one address and one amount instead of a currency selection screen.
curl -X POST \
-H "Authorization: Token <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"shop_id": "xBAivfPIbskwuEWj",
"amount": 100,
"currency": "USD",
"order_id": "1057",
"add_fields": {"cryptocurrency": "ETH"}
}' \
"https://API.trybit.com/v2/invoice/create"
The response carries everything the checkout needs to display:
{
"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",
"amount": 0.034187,
"amount_usd": 100.0,
"status": "created",
"link": "https://pay.trybit.com/89UX09KA"
}
}
Your interface renders address and amount, stores uuid with the order, and uses expiry_date for the countdown. The link field points to the hosted page, which an H2H checkout simply does not use.
When the payment arrives, the service posts a notification to your URL:
{
"status": "success",
"invoice_id": "89UX09KA",
"amount_crypto": 0.034187,
"currency": "ETH",
"order_id": "1057",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"invoice_info": {}
}
One detail is easy to miss: the postback delivers invoice_id without the INV- prefix that uuid carries in the creation response, so normalize the value before looking up the order.
Currency codes, error responses, and the full parameter list are documented in the API Reference V2, the part of a payment gateway API for developers that is worth reading before the first request.
Handling Postbacks Without Losing Payments
A crypto payments API reports a completed payment through the postback, so its handler is production-critical code. Six rules cover most of the risk:
- Verify the signature. The
tokenfield is a JWT signed with HS256 using the project secret key. Recompute the signature and compare it in constant time before trusting any other field. - Respect the token lifetime. The token is valid for five minutes after the notification is created, so an expired token should be rejected and logged rather than processed.
- Make the handler idempotent. Store the invoice identifier and ignore repeated notifications for an order that is already marked as paid.
- Answer with 200 quickly. Return the acknowledgment first, then move emails, provisioning, and accounting to a queue.
- Handle every status. Invoice statuses include
created,paid,partial,overpaid, andcanceled, and onlypaidandoverpaidmean the full amount has arrived. - Keep a fallback. A POST request to
/v2/invoice/merchant/infowith a list ofuuidsreturns current statuses for up to 100 invoices, which covers downtime on your side.
When a Business Needs H2H
H2H requires backend work, so it pays off when the checkout itself matters:
- custom checkout in a web product, where a redirect breaks the flow;
- mobile apps, where an external browser window costs conversions;
- marketplaces and services with their own order and payout logic;
- brands that need a checkout without third-party logos;
- products where crypto sits next to other payment methods in one interface.
For a small store that needs to launch this week, a redirect remains the rational choice.
Common H2H Integration Mistakes
Most crypto payment API integration problems are not exotic. They repeat from project to project:
- Omitting the required parameter. In H2H mode the
cryptocurrencyfield is mandatory. Without it the service cannot issue a fixed address and amount for a specific network. - Trusting amounts from the client. Build the invoice from server-side order data, because anything sent by the browser can be edited.
- Treating every postback as new. Duplicates and repeated deliveries happen, and a non-idempotent handler can credit the same payment twice.
- Skipping signature verification. An endpoint that marks orders as paid without checking the JWT is an open door.
- Ignoring the network. The same token can exist on several blockchains, and an address issued for one network will not receive that token sent through another.
- Deploying without a test payment. One small transfer through the full chain, from invoice to order status, catches configuration errors before customers do.
Connecting Trybit via H2H
A payment gateway API integration with Trybit follows a short sequence:
- Register an account. An email address and a Telegram account are required.
- Create a project in the merchant account, then fill in the company details and the required URLs.
- Copy the API KEY, SHOP ID, and SECRET KEY from the project settings and store them outside the repository.
- Specify the postback URL and the notification format in the project settings, then implement the handler and the status update in your own system.
- Create the first invoice through the API, including the cryptocurrency parameter that H2H requires.
- Run a test payment and confirm that the invoice status reaches your database.
Integration is free, and every method comes with request and response examples. Teams without spare backend capacity sometimes buy payment gateway API integration services, although the sequence above is short enough for most in-house developers.
Trybit Crypto Payment Gateway
Trybit is a cryptocurrency payment gateway API for businesses that need to take crypto without building blockchain infrastructure. It supports popular currencies and networks, including Bitcoin, Ethereum, and Tether.
Beyond invoices, the platform provides automatic AML checks, automatic conversion into stablecoins, and automatic withdrawals. A single accept crypto payments API covers invoice creation, status checks, balances, and payouts, so one set of keys serves the whole flow. Fees start from 0.4%, integration is free, and technical support helps during setup.
Keeping Payments Inside Your Product
H2H is the difference between sending customers to someone else’s page and owning the last step of the funnel. The engineering work is modest: authenticate, create an invoice, render an address and an amount, verify a signed postback, and keep a status check as a fallback. Verify the signature, make the handler idempotent, and send one test payment before release — these three habits prevent most production incidents.
Trybit helps businesses accept cryptocurrency on their own websites and apps through a fast H2H integration, with low fees, support for popular currencies, and documentation written for engineers.
Keep Up With the Crypto Market
Trybit provides businesses with the tools they need to accept cryptocurrency payments on digital platforms. From competitive fees and flexible integrations to ongoing support, the service helps simplify payment processing for companies of different sizes.
Follow us for industry news and practical recommendations for working with digital assets.
Top comments (0)