LirPay
OpenAPI

Create and manage payment links

Payment links normally open a LirPay hosted checkout. Preselected Telegram Stars or Robux payments return a direct provider URL. The API key environment determines whether the checkout uses test or live payment state.

Pay crypto directly into Bybit

Checkout uses Bybit deposit addresses. Send the exact invoice amount and any required memo/comment. Credit follows a released deposit reported by Bybit. Read GET /payment-methods for platform availability and GET /projects/{id}/payment-methods for project permission and fees. The selected deposit network must also be open on Bybit.

ParameterTypeInRequiredDescription
bscBNBbodynoUSDT and exchange-supported USDC on BNB Smart Chain.
tonGRAMbodynoUSDT and USDE on TON.
litecoinLTCbodynoLTC only; no stablecoin rail.
polygonPOLbodynoUSDT and USDC on Polygon.
arbitrumARBbodynoUSDT and USDC on Arbitrum One.

For a single method set method_mode: "single" and the matching selected_chain / selected_asset_symbol. Dynamic project links accept ?method=bnb, gram, ltc, pol, or arb. Stablecoins use an explicit pair, for example ?method=arbitrum:USDC. The invoice currency remains USD, EUR, or RUB.

POSThttps://lirpay.org/api/v2/integration/payment-links

Create a checkout or direct Telegram Stars / Robux payment.

API key or OAuth tokenpayments:writeIdempotency-Key required
ParameterTypeInRequiredDescription
Idempotency-KeystringheaderyesUnique key for this monetary operation. Maximum 255 characters.
display_namestringbodyyesLabel shown on checkout.
amountdecimal stringbodyyesInvoice amount such as 129.00.
currencystringbodyyesInvoice currency: RUB, USD, or EUR.
project_iduuidbodyyesApproved project identifier.
customer_idstringbodynoYour customer reference.
webhook_urlURLbodynoSigned event destination for this request. Overrides the deprecated saved URL; retained for retries and redelivery.
method_modestringbodynomulti by default, or single.
selected_chainstringbodynoRequired when method_mode is single.
selected_asset_symbolstringbodynoRequired when method_mode is single.
link_typestringbodynoone_time by default, or reusable.
expires_in_minutesintegerbodynoPositive custom expiration period.

Request

{
  "display_name": "Premium subscription",
  "amount": "129.00",
  "currency": "RUB",
  "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "customer_id": "customer_1042",
  "method_mode": "multi",
  "link_type": "one_time"
}

Response

{
  "public_id": "a1b2c3d4e5f67890",
  "payment_link": "https://lirpay.org/pay/a1b2c3d4e5f67890"
}

Exchange minimums. Crypto payments are settled on an exchange, so each coin has a minimum payment (for example about 5.50 USD for GRAM). With method_mode single a lower amount is rejected with HTTP 400 and code: "below_minimum", method and min_amount_usd. With multi the link is created and the response carries a warnings array with the same fields for every method that cannot be used. The merchant payment-methods endpoint and the public checkout expose min_amount_usd (and below_minimum on the checkout) per method.

Headless Telegram Stars

Set method_mode to single, selected_chain to telegram, and selected_asset_symbol to XTR. In LIVE mode the API creates the Bot API invoice immediately and returns its https://t.me/$... URL instead of a lirpay.org checkout URL.

{
  "display_name": "Premium subscription",
  "amount": "129.00",
  "currency": "RUB",
  "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "customer_id": "customer_1042",
  "method_mode": "single",
  "selected_chain": "telegram",
  "selected_asset_symbol": "XTR",
  "link_type": "one_time"
}
{
  "public_id": "a1b2c3d4e5f67890",
  "payment_link": "https://t.me/$AbCdEf123",
  "payment_method": "telegram:XTR",
  "stars_amount": 125
}

Send payment_link from your bot. Status checks and webhooks use the returned public_id. With a TEST key, payment succeeds immediately without creating a real invoice; the response has no payment_link and includes status: "succeeded" and test_mode: true.

Headless Robux

Set method_mode to single, selected_chain to roblox, and selected_asset_symbol to ROBUX. In LIVE mode the API creates the gamepass immediately and returns its https://www.roblox.com/game-pass/... URL as payment_link. Also returns checkout_url (hosted LirPay page with Robux already selected) for an on-site <iframe> status UI — Roblox itself blocks embedding of game-pass pages.

{
  "display_name": "Premium subscription",
  "amount": "129.00",
  "currency": "RUB",
  "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "customer_id": "customer_1042",
  "method_mode": "single",
  "selected_chain": "roblox",
  "selected_asset_symbol": "ROBUX",
  "link_type": "one_time"
}
{
  "public_id": "a1b2c3d4e5f67890",
  "payment_link": "https://www.roblox.com/game-pass/1962126448",
  "checkout_url": "https://lirpay.org/pay/a1b2c3d4e5f67890",
  "payment_method": "roblox:ROBUX",
  "roblox_gamepass_id": 1962126448,
  "expected_amount": "1557"
}

Open payment_link for the buyer to purchase. Poll or webhook on public_id. With a TEST key, payment succeeds immediately without creating a real gamepass.

POSThttps://lirpay.org/api/v2/integration/payment-links/{public_id}/cancel

Deactivate an unpaid payment link.

API key or OAuth tokenpayments:writeIdempotency-Key required
ParameterTypeInRequiredDescription
public_idstringpathyesPublic payment link identifier.
Idempotency-KeystringheaderyesUnique key for this monetary operation. Maximum 255 characters.

The endpoint returns 409 after payment or after another terminal state.