Skip to content

Payment Page

Each invoice has a public payment page that customers can use to complete their payment. No authentication is required.

Payment page URL

https://fincobra.com/pay/:id

Where :id is the invoice UUID returned when you create an invoice.

Payment page API

The payment page frontend fetches invoice data from a public endpoint:

GET /api/checkout/pay/:id

This endpoint requires no authentication and returns:

json
{
  "id": "a1b2c3d4-...",
  "amountUsd": 49.99,
  "amountBtc": 0.0005,
  "btcRate": 99980,
  "paymentState": "unpaid",
  "receivedBtc": 0,
  "remainingBtc": 0.0005,
  "overpaidBtc": 0,
  "btcAddress": "bc1q...",
  "qrCode": "data:image/png;base64,...",
  "status": "pending",
  "productName": "Pro Plan - Monthly",
  "redirectUrl": "https://yoursite.com/thank-you",
  "txHash": null,
  "txHashes": [],
  "confirmations": 0,
  "paidAt": null,
  "confirmedAt": null,
  "expiresAt": "2025-01-15T10:50:00.000Z",
  "timeRemainingSeconds": 1140
}

Features

The hosted payment page includes:

  • QR code — BIP-21 payment URI (bitcoin:<address>?amount=<btc>) scannable by any Bitcoin wallet
  • Live countdown — shows time remaining before the invoice expires
  • Copy buttons — one-click copy for BTC address and amount
  • Real-time status — polls for payment updates and shows progress (partial payments, confirmations)
  • Auto-redirect — when the invoice reaches confirmed status, the page automatically redirects to the configured redirectUrl (if set)

Embedding

You can link customers directly to the payment page:

html
<a href="https://fincobra.com/pay/a1b2c3d4-...">
  Pay with Bitcoin
</a>

Or embed it in an iframe:

html
<iframe
  src="https://fincobra.com/pay/a1b2c3d4-..."
  width="100%"
  height="600"
  frameborder="0"
></iframe>

Polling behavior

The payment page polls GET /api/checkout/pay/:id every few seconds while the invoice is pending or paid. Polling stops when the invoice reaches a terminal state (confirmed, expired, or underpaid).

Building a custom payment page

If you prefer a custom UI, use the public GET /api/checkout/pay/:id endpoint to fetch invoice data and build your own payment experience. The endpoint returns all the information needed: BTC address, amount, QR code, status, and countdown timer.