Settlement
GETSettlement APILF Pay API Documentation
The LF Pay API lets you accept cryptocurrency payments, manage settlements, and track transactions programmatically.
https://api.pay.lflabs.fund/v1
# Base URL https://api.pay.lflabs.fund/v1 # All requests require an API key curl https://api.pay.lflabs.fund/v1/payments \ -H "Authorization: Bearer mk_live_..."
Authentication
Authenticate requests by including your API key in the Authorization header.
API keys are available in your Merchant Dashboard → Integration. Use mk_test_ keys for sandbox and mk_live_ for production.
AuthorizationstringYesBearer token with your API keyContent-TypestringYesMust be application/jsonAuthorization: Bearer mk_live_7a3c9fE78543113412f6Ae1a... Content-Type: application/json
Quick Start
Create your first payment in a single API call. The response includes a checkout_url you can redirect your customer to.
curl -X POST https://api.pay.lflabs.fund/v1/payments \ -H "Authorization: Bearer mk_live_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 149.99, "currency": "USD", "accepted_crypto": ["USDT","ETH","BTC","\$LF"], "callback_url": "https://yoursite.com/webhook", "metadata": {"order_id": "ORD-12345"} }'
POST Create Payment
/v1/payments
Creates a new payment intent. Returns a checkout URL and payment ID.
Request Body
amountnumberYesPayment amount in fiat currencycurrencystringYesFiat currency code (USD, EUR, GBP, etc.)accepted_cryptoarrayNoCrypto whitelist. Default: all supportedcallback_urlstringNoWebhook URL for payment eventsredirect_urlstringNoURL to redirect customer after paymentmetadataobjectNoCustom key-value data (max 10 keys)expiry_minutesintegerNoPayment expiry time. Default: 30{
"id": "pay_8f3a2b1c...",
"status": "pending",
"amount": 149.99,
"currency": "USD",
"checkout_url": "https://pay.lflabs.fund/c/pay_8f3a2b1c",
"expires_at": "2026-03-24T20:00:00Z",
"created_at": "2026-03-24T19:30:00Z"
}
GET Get Payment
/v1/payments/{id}
Retrieves details of a specific payment including status, crypto used, settlement amount, and cashback distributed.
idstringPathThe payment ID (e.g. pay_8f3a2b1c){
"id": "pay_8f3a2b1c...",
"status": "completed",
"amount": 149.99,
"currency": "USD",
"crypto_used": "USDT",
"crypto_amount": 149.99,
"cashback_lf": 3.75,
"settled": true
}
GET List Payments
/v1/payments
Returns a paginated list of your payments. Supports filters: status, crypto, created_after, created_before, limit, offset.
{
"data": [
{ "id": "pay_8f3a...", "status": "completed" },
{ "id": "pay_2b1c...", "status": "pending" }
],
"total": 47,
"limit": 20,
"offset": 0
}
POST Refund Payment
/v1/payments/{id}/refund
Initiates a refund for a completed payment. Refund is sent in the original cryptocurrency to the customer's wallet. Partial refunds supported.
amountnumberNoPartial refund amount. Omit for full refundreasonstringNoRefund reason for records{
"id": "ref_4d2e1a...",
"payment_id": "pay_8f3a2b1c...",
"status": "processing",
"amount": 149.99,
"crypto": "USDT"
}
Webhook Events
Configure your webhook URL in the dashboard. LF Pay sends POST requests for the following events:
payment.createdPayment intent createdpayment.completedOn-chain payment confirmedpayment.failedPayment expired or failedpayment.refundedRefund processedsettlement.processedFiat settled to bank accountcashback.distributed\$LF cashback sent to customer{
"event": "payment.completed",
"data": {
"id": "pay_8f3a2b1c...",
"status": "completed",
"amount": 149.99,
"crypto_used": "USDT"
},
"timestamp": "2026-03-24T19:31:42Z"
}
Webhook Verification
Verify webhook authenticity using the X-LFPay-Signature header. We sign each webhook payload with your webhook secret using HMAC-SHA256.
// Node.js verification const crypto = require('crypto'); const sig = crypto .createHmac('sha256', WEBHOOK_SECRET) .update(rawBody) .digest('hex'); const valid = sig === req.headers['x-lfpay-signature'];
Checkout Widget
Embed the LF Pay checkout directly in your page. The widget handles crypto selection, QR code display, and payment confirmation.
data-merchantstringYesYour API keydata-amountstringYesPayment amountdata-currencystringYesFiat currency codedata-themestringNodark or light. Default: dark<script src="https://pay.lflabs.fund/v1/widget.js"></script> <div id="lf-pay-widget" data-merchant="mk_live_YOUR_KEY" data-amount="149.99" data-currency="USD" data-theme="dark"> </div>
Hosted Checkout
Redirect customers to our hosted checkout page instead of embedding the widget. Use the checkout_url returned from the Create Payment endpoint.
The hosted page handles all payment logic — crypto selection, QR code, wallet connect, and confirmation. Customers are redirected to your redirect_url on completion.
// Redirect to hosted checkout window.location.href = payment.checkout_url; // Example URL "https://pay.lflabs.fund/c/pay_8f3a2b1c"
GET Settlement API
/v1/settlements
Returns settlement history including dates, amounts, bank details, and associated transactions. Filter by status, date_from, date_to.
{
"data": [{
"id": "stl_9a2b...",
"amount": 4823.50,
"currency": "USD",
"transactions": 32,
"fees": 36.18,
"burned": 12.66,
"settled_at": "2026-03-24"
}]
}
Error Codes
400Bad RequestInvalid parameters401UnauthorizedMissing or invalid API key403ForbiddenInsufficient permissions or tier404Not FoundResource does not exist429Rate LimitedToo many requests500Server ErrorInternal error — contact support{
"error": {
"code": 401,
"status": "Unauthorized",
"message": "Invalid API key provided"
}
}
Rate Limits
X-RateLimit-Limit: 60 X-RateLimit-Remaining: 58 X-RateLimit-Reset: 1711310400
SDKs & Plugins
Official SDKs and plugins:
# Node.js npm install @lflabs/pay # Python pip install lf-pay # PHP composer require lflabs/pay