> For the complete documentation index, see [llms.txt](https://help.getlfg.app/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.getlfg.app/p/developers/api-reference.md).

# 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**](https://github.com/LayerFlowGateway/openapi).

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](/p/developers/pay-api-integration-guide.md).

* **Base URL:** `https://api.getlfg.app/pay`
* **Auth:** `Authorization: Bearer lfg_sk_live_…` (server-side only)
* **Field casing:** `camelCase` everywhere

## Payment links

{% openapi src="/files/LmiUpGph7sb74yuAhe15" path="/v1/payment-links" method="post" %}
[openapi.yaml](https://751729885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FreQD2uJtAxY2zZaB0y6M%2Fuploads%2Fgit-blob-75bf08d3799024c9c5f93403554a5ddeb236fa4e%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/LmiUpGph7sb74yuAhe15" path="/v1/payment-links" method="get" %}
[openapi.yaml](https://751729885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FreQD2uJtAxY2zZaB0y6M%2Fuploads%2Fgit-blob-75bf08d3799024c9c5f93403554a5ddeb236fa4e%2Fopenapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/LmiUpGph7sb74yuAhe15" path="/v1/payment-links/{id}" method="get" %}
[openapi.yaml](https://751729885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FreQD2uJtAxY2zZaB0y6M%2Fuploads%2Fgit-blob-75bf08d3799024c9c5f93403554a5ddeb236fa4e%2Fopenapi.yaml?alt=media)
{% endopenapi %}

## 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](/p/developers/pay-api-integration-guide.md#verifying-the-signature) for a worked example.
