> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lancer-erp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference

> The Lancer public REST API, v1.

The reference pages are generated from Lancer's OpenAPI 3.1 document, which is built from the same Zod contracts the API validates requests with, so the docs and the API can't drift apart.

> [card] Base URL
>
> `https://api.lancer-erp.com/api`

> [card] [OpenAPI document](https://api.lancer-erp.com/api/v1/openapi.json)
>
> Public, no key needed. Import it into Postman, Insomnia or an n8n HTTP Request node.

## Endpoints

| Endpoint | Scope |
| - | - |
| `POST /v1/leads` | `leads:write` |
| `GET /v1/clients`, `GET /v1/clients/{id}` | `clients:read` |
| `POST /v1/clients` | `clients:write` |
| `GET /v1/projects`, `GET /v1/projects/{id}` | `projects:read` |
| `GET /v1/payment-requests`, `GET /v1/payment-requests/{id}` | `payment_requests:read` |
| `POST /v1/payment-requests` | `payment_requests:write` |
| `GET /v1/payments` | `payments:read` |

## Conventions

* **Auth:** `Authorization: Bearer lk_…` or `X-Api-Key: lk_…`. See [Authentication](https://docs.lancer-erp.com/guides/authentication.md).
* **Money:** integer agorot (₪1 = 100). See [Pagination and money](https://docs.lancer-erp.com/guides/pagination-and-money.md).
* **Lists:** `page` and `pageSize` (max 100) → `{ items, total, page, pageSize }`.
* **Errors:** `{ error, code? }`, and `400` lists the fields that failed validation. See [Errors and rate limits](https://docs.lancer-erp.com/guides/errors-and-rate-limits.md).

## Get a pay link in one call

`POST /v1/payment-requests` with `"createLink": true` creates the request, creates a hosted payment page through the organization's default payment processor, marks the request as sent and returns the link as `payUrl`:

```bash theme={null}
curl -X POST https://api.lancer-erp.com/api/v1/payment-requests \
  -H "Authorization: Bearer $LANCER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "clientId": "0193…", "title": "Website redesign: milestone 1", "amountAgorot": 590000, "createLink": true }'
```

When the client pays, you get a [`payment.succeeded` webhook](https://docs.lancer-erp.com/guides/webhooks) and the receipt is issued by the organization's documents provider.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.