Quickstart
Take your first crypto payment in about ten minutes. You'll create a test key, send a customer to the hosted checkout, and fulfil the order when a signed webhook arrives.
The Lipacoin API is a REST API at https://lipacoin.io/api/v1. Requests and responses are JSON, amounts are decimal strings (never floats), and every object carries a livemode flag.
1. Get a test key
Create an account, then open Dashboard → Developers → API keys and create a key. Test keys start with lp_test_ and operate on public testnets, so nothing you do costs real money. The full key is shown once — store it as a server-side secret.
export LIPACOIN_SECRET_KEY="lp_test_..."2. Create an invoice
The fastest integration is an invoice: you set the price in fiat (or crypto), and the customer picks which coin to pay with on our hosted checkout. Redirect them to invoice_url.
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"
}'Prefer to build your own UI? Create a payment for a specific coin instead and render the returned pay_address and pay_amount yourself:
curl https://lipacoin.io/api/v1/payments \
-H "Authorization: Bearer $LIPACOIN_SECRET_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order_1042" \
-d '{
"price_amount": "49.00",
"price_currency": "USD",
"pay_asset": "USDT_TRC20",
"order_id": "order_1042",
"ipn_callback_url": "https://shop.example/webhooks/lipacoin"
}'3. Pay it on a testnet
Open the checkout, pick a coin and send the exact amount from a testnet wallet. The checkout shows live progress — waiting, confirming (with a confirmation count), paid. See Test mode & faucets for where to get test coins.
4. Handle the webhook
Add an endpoint under Developers → Webhooks (or pass ipn_callback_url per payment). When the payment is fully confirmed you'll receive payment.finished (or payment.confirmed while an auto-forward is in flight). Verify the Lipacoin-Signature header, then fulfil the order:
import crypto from "node:crypto";
// Use the RAW request body — not a re-serialized JSON object.
export function verifyLipacoin(rawBody, header, secret, toleranceSec = 300) {
const parts = Object.fromEntries(
String(header).split(",").map((p) => p.trim().split("=", 2)),
);
const t = Number(parts.t);
if (!t || !parts.v1) return false;
if (Math.abs(Date.now() / 1000 - t) > toleranceSec) return false; // replay guard
const expected = crypto
.createHmac("sha256", secret)
.update(`${t}.${rawBody}`)
.digest("hex");
const a = Buffer.from(expected), b = Buffer.from(parts.v1);
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
// Express
app.post("/webhooks/lipacoin", express.raw({ type: "application/json" }), (req, res) => {
const raw = req.body.toString("utf8");
if (!verifyLipacoin(raw, req.get("Lipacoin-Signature"), process.env.LIPACOIN_WEBHOOK_SECRET)) {
return res.sendStatus(400);
}
const event = JSON.parse(raw);
if (event.type === "payment.finished") fulfil(event.data.order_id);
res.sendStatus(200);
});id (also sent as X-Event-Id) to de-duplicate.5. Go live
When you're ready, complete business verification in the dashboard. Once live mode is enabled for your account, create an lp_live_ key and swap it in. Nothing else in your integration changes.