Skip to content
Accept payments

Invoices & hosted checkout

An invoice is a price without a coin. The customer chooses how to pay on our hosted checkout; choosing a coin creates the underlying payment.

Create an invoice

POST/v1/invoices
Body
price_amountstringrequired
Positive decimal string.
price_currencystringrequired
Fiat code (USD, KES, NGN…) or an asset code.
allowed_assetsstring[]
Restrict the coin picker, e.g. ["USDT_TRC20","BTC"]. Default: every coin enabled on your account.
order_idstring
Your reference.
descriptionstring
Shown on the checkout.
ipn_callback_urlurl
Webhook URL for payments created from this invoice.
success_urlurl
Customer is sent here after paying.
cancel_urlurl
“Return to merchant” link.
customer_emailstring
For your records.
metadataobject
Copied onto every payment the invoice creates.
expires_in_minutesinteger
15 to 43200 (30 days). Default 1440 (24 h). Each payment attempt still has its own 60-minute window.
curl https://lipacoin.io/api/v1/invoices \
  -H "Authorization: Bearer $LIPACOIN_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "price_amount": "2500",
    "price_currency": "KES",
    "order_id": "inv-2291",
    "description": "Pro plan — 1 month",
    "success_url": "https://shop.example/thanks"
  }'
Response
{
  "id": "inv_0Nf3kQ9a7Kd1yU3nR8bS2xMc",
  "object": "invoice",
  "status": "open",
  "livemode": false,
  "price_amount": "2500",
  "price_currency": "KES",
  "order_id": "inv-2291",
  "description": "Pro plan — 1 month",
  "allowed_assets": [],
  "invoice_url": "https://lipacoin.io/i/inv_0Nf3kQ9a7Kd1yU3nR8bS2xMc",
  "success_url": "https://shop.example/thanks",
  "cancel_url": null,
  "customer_email": null,
  "metadata": {},
  "expires_at": "2026-11-24T10:00:00.000Z",
  "created_at": "2026-11-23T10:00:00.000Z"
}

Invoice status is open until one of its payments is confirmed, then paid. The resulting payment carries invoice_id, so your webhook handler can match it back.

Retrieve an invoice

GET/v1/invoices/:id

The hosted checkout

Every invoice and every payment has a hosted page at https://lipacoin.io/i/<id> — invoice_url on invoices, checkout_url on payments. It shows your business name, logo and brand color (set them in Settings), and handles:

  • a searchable coin picker grouped into stablecoins and coins, with clear network warnings;
  • a QR code (BIP-21 for BTC/LTC, EIP-681 for ETH, plain address otherwise), copy buttons and a countdown;
  • live progress: waiting → confirming (n/N confirmations) → paid, plus partial-payment and expiry states;
  • a redirect to success_url after payment.

If the customer switches coins, a new payment is created for the new coin; the invoice always shows the latest attempt.

Embedding in an iframe

Checkout pages may be framed by your site. Allow top navigation so the success redirect can leave the frame:

HTML
<iframe
  src="https://lipacoin.io/i/inv_0Nf3kQ9a7Kd1yU3nR8bS2xMc"
  style="width:100%;max-width:460px;height:760px;border:0;border-radius:16px"
  sandbox="allow-scripts allow-same-origin allow-popups allow-top-navigation-by-user-activation allow-top-navigation"
  allow="clipboard-write"
></iframe>
Don't rely on the redirect for fulfilment — customers close tabs. Fulfil from the webhook.