API reference
Machine-readable OpenAPI 3.1 reference for the LFG Pay API — every endpoint, schema, error, and the signed webhook.
The full LFG Pay API is described by an OpenAPI 3.1 spec: openapi.yaml.
Point your client generator, SDK tooling, or AI coding assistant at that file to get typed clients and request builders for free. For the narrative walkthrough — auth, redirects, webhook verification — read the Pay API integration guide.
Base URL:
https://api.getlfg.app/payAuth:
Authorization: Bearer lfg_sk_live_…(server-side only)Field casing:
camelCaseeverywhere
Payment links
Creates a payment link and returns a hosted checkoutUrl to redirect the
buyer to. Always compute the amount on your own server — never trust an
amount sent from the browser.
Your secret API key from Settings → API Keys, sent as
Authorization: Bearer lfg_sk_live_…. Server-side only — never ship it
to a browser or mobile app.
Your own order reference. Echoed back on webhooks and the success redirect.
The amount to charge.
Defaults to your business currency.
USDHow long the checkout stays payable.
15Where the buyer returns after paying.
Where the buyer returns on cancel or failure.
Overrides the API key's default webhook URL for this link.
Payment link created.
The request body failed validation.
Your credential is wrong — rotate it. code is one of missing_api_key,
invalid_api_key, api_key_revoked.
LFG turned something off — a new key won't help; contact support. code
is api_key_disabled or business_disabled.
Rate limit exceeded — 60 requests per 60 seconds, per API key.
POST /pay/v1/payment-links HTTP/1.1
Host: api.getlfg.app
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 181
{
"orderId": "order_1042",
"fiatAmount": 49.99,
"fiatCurrency": "USD",
"token": "USDC",
"network": "base",
"successUrl": "https://yourstore.com/thanks",
"cancelUrl": "https://yourstore.com/cart"
}{
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"linkToken": "pay_yourbiz_ab12cd",
"checkoutUrl": "https://pay.getlfg.app/pay/pay_yourbiz_ab12cd",
"sessionId": "123e4567-e89b-12d3-a456-426614174000",
"depositAddress": "text",
"quotedTokenAmount": 1,
"feeAmount": 1,
"netAmount": 1,
"expiresAt": "2026-01-01T00:00:00.000Z"
},
"meta": {
"timestamp": "2026-01-01T00:00:00.000Z"
}
}Returns your business's payment links, newest first, each with its current session.
Your secret API key from Settings → API Keys, sent as
Authorization: Bearer lfg_sk_live_…. Server-side only — never ship it
to a browser or mobile app.
115A page of payment links.
Your credential is wrong — rotate it. code is one of missing_api_key,
invalid_api_key, api_key_revoked.
LFG turned something off — a new key won't help; contact support. code
is api_key_disabled or business_disabled.
Rate limit exceeded — 60 requests per 60 seconds, per API key.
GET /pay/v1/payment-links HTTP/1.1
Host: api.getlfg.app
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"businessId": "123e4567-e89b-12d3-a456-426614174000",
"orderId": "text",
"linkToken": "text",
"fiatCurrency": "text",
"fiatAmount": 1,
"token": "USDC",
"network": "base",
"quotedTokenAmount": 1,
"feePercent": 1,
"feeAmount": 1,
"netAmount": 1,
"depositAddress": "text",
"state": "created",
"successUrl": null,
"cancelUrl": null,
"webhookUrl": null,
"skuMetadataJson": {
"items": [
{
"name": "text",
"platform": "text",
"region": "text",
"quantity": 1,
"unitPrice": 1
}
]
},
"expiresAt": "2026-01-01T00:00:00.000Z",
"createdAt": "2026-01-01T00:00:00.000Z",
"session": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"state": "created",
"txHash": null,
"sourceWallet": null
}
}
],
"meta": {
"timestamp": "2026-01-01T00:00:00.000Z",
"page": 1,
"limit": 1,
"total": 1,
"totalPages": 1
}
}Returns a single payment link and its session. Returns 404 if the link doesn't belong to your business.
Your secret API key from Settings → API Keys, sent as
Authorization: Bearer lfg_sk_live_…. Server-side only — never ship it
to a browser or mobile app.
The payment link.
Your credential is wrong — rotate it. code is one of missing_api_key,
invalid_api_key, api_key_revoked.
LFG turned something off — a new key won't help; contact support. code
is api_key_disabled or business_disabled.
No such payment link for your business.
Rate limit exceeded — 60 requests per 60 seconds, per API key.
GET /pay/v1/payment-links/{id} HTTP/1.1
Host: api.getlfg.app
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"businessId": "123e4567-e89b-12d3-a456-426614174000",
"orderId": "text",
"linkToken": "text",
"fiatCurrency": "text",
"fiatAmount": 1,
"token": "USDC",
"network": "base",
"quotedTokenAmount": 1,
"feePercent": 1,
"feeAmount": 1,
"netAmount": 1,
"depositAddress": "text",
"state": "created",
"successUrl": null,
"cancelUrl": null,
"webhookUrl": null,
"skuMetadataJson": {
"items": [
{
"name": "text",
"platform": "text",
"region": "text",
"quantity": 1,
"unitPrice": 1
}
]
},
"expiresAt": "2026-01-01T00:00:00.000Z",
"createdAt": "2026-01-01T00:00:00.000Z",
"session": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"state": "created",
"txHash": null,
"sourceWallet": null
}
},
"meta": {
"timestamp": "2026-01-01T00:00:00.000Z"
}
}Webhook
The spec also documents the payment.state.changed webhook LFG sends to your webhookUrl, including the X-LFG-Timestamp / X-LFG-Signature headers. See Verifying the signature for a worked example.
Last updated