For the complete documentation index, see llms.txt. This page is also available as Markdown.

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/pay

  • Auth: Authorization: Bearer lfg_sk_live_… (server-side only)

  • Field casing: camelCase everywhere

Create a payment link

post

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.

Authorizations
AuthorizationstringRequired

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.

Body
orderIdstringRequired

Your own order reference. Echoed back on webhooks and the success redirect.

fiatAmountnumberRequired

The amount to charge.

tokenstring · enumRequiredPossible values:
networkstring · enumRequiredPossible values:
fiatCurrencystringOptional

Defaults to your business currency.

Default: USD
expiryMinutesnumberOptional

How long the checkout stays payable.

Default: 15
successUrlstring · uriOptional

Where the buyer returns after paying.

cancelUrlstring · uriOptional

Where the buyer returns on cancel or failure.

webhookUrlstring · uriOptional

Overrides the API key's default webhook URL for this link.

Responses
201

Payment link created.

application/json
post/v1/payment-links
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"
  }
}
get

Returns your business's payment links, newest first, each with its current session.

Authorizations
AuthorizationstringRequired

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.

Query parameters
pageinteger · min: 1OptionalDefault: 1
limitinteger · min: 1OptionalDefault: 15
Responses
200

A page of payment links.

application/json
get/v1/payment-links
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
  }
}
get

Returns a single payment link and its session. Returns 404 if the link doesn't belong to your business.

Authorizations
AuthorizationstringRequired

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.

Path parameters
idstring · uuidRequired
Responses
200

The payment link.

application/json
get/v1/payment-links/{id}
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