For integrations beyond Light's pre-built connectors, Light provides a REST API enabling custom integrations with any system. The API allows creating and managing transactions, accessing financial dat...
Last updated Feb 18, 2026 · 5 min read
The Light API is organized around REST and uses standard HTTP response codes, authentication, and verbs. Most endpoints accept and return JSON-encoded data in camelCase format. The base URL for all API requests is:
https://api.light.inc
Some fields use enumerated (enum) values to represent specific states or types. While these enums are documented, they are not guaranteed to be exhaustive — new enum values may be introduced over time. To maintain forward compatibility, always handle unexpected or unknown enum values gracefully rather than relying on exhaustive matching.
The API provides endpoints for managing the following resources:
For full endpoint details, see the API Reference (click "API Reference" in the top navigation).
You can authenticate to the Light API using API keys or OAuth 2.0.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. Make sure your HTTP client follows redirects and forwards the Authorization header, as some endpoints may redirect to other URLs.
To create an API key:
Light API keys are linked to roles the same way user accounts are. The roles assigned to the API key determine what actions the key can perform.
To authenticate with an API key, include the Authorization header using Basic authentication:
Authorization: Basic YOUR_API_KEY
Security: Never expose API keys in client-side code, public repositories, or shared documents. Use environment variables or a secrets manager.
For integrations that act on behalf of users, Light supports the OAuth 2.0 authorization code flow:
client_id and client_secret, and provide Light with your redirect URIhttps://api.light.inc/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI
curl -X POST https://api.light.inc/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code&code=AUTHORIZATION_CODE&redirect_uri=YOUR_REDIRECT_URI&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"
Authorization: Bearer YOUR_ACCESS_TOKEN
The response also includes a refresh_token and expires_in value. When the access token expires, refresh it:
curl -X POST https://api.light.inc/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=refresh_token&refresh_token=YOUR_REFRESH_TOKEN&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"
Store your tokens securely and update the refresh token after each refresh, as the old one is invalidated.
For a full implementation example (Node.js/Express), see the OAuth Callback example in the API documentation.
A common use case is creating invoice payables (bills) from an external system.
Example: Create a bill in Light from your procurement system
curl -X POST https://api.light.inc/v1/invoice-payables \
-H "Authorization: Basic YOUR_API_KEY" \
-H "Content-Type: application/json;charset=UTF-8" \
-d '{
"vendorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 100000,
"currency": "USD"
}'
Note that amounts are specified in cents (e.g., 100000 = $1,000.00). Light creates the invoice payable and returns its ID and metadata.
You can also create sales invoices, journal entries, purchase orders, and other document types through their respective endpoints.
Retrieve existing records using GET endpoints with sorting, filtering, and pagination:
Example: List accounting documents sorted by date
curl -X GET "https://api.light.inc/v1/accounting-documents/accounting-documents?sort=documentDate:desc&limit=50" \
-H "Authorization: Basic YOUR_API_KEY"
Sort using the format field:direction. Separate multiple sort fields with commas.
Available directions: asc, desc
Example: sort=amount:desc,createdAt:asc
Filter using the format field:operator:value. Separate multiple filters with commas.
Available operators: eq, ne, in, not_in, gt, gte, lt, lte
For in and not_in operators, separate multiple values with the pipe character (|).
Example: filter=state:in:IN_DRAFT|SCHEDULED|PAID,amount:gte:500,vendorId:ne:null
Results are paginated. Use the limit parameter to control page size (default: 50, maximum: 200). For cursor-based pagination, provide 0 as the cursor for the initial request.
The Light API enforces two rate limits:
Exceeding a limit returns a 429 Too Many Requests response with these headers:
X-RateLimit-Limit — Maximum capacityX-RateLimit-Remaining — Remaining capacityX-RateLimit-Reset — Unix timestamp when the limit resetsRetry-After — Recommended seconds to wait before retryingBest practices for staying within limits: monitor X-RateLimit-Remaining before large operations, implement exponential backoff on retries, respect the Retry-After header, and spread scheduled jobs across different times.
If your use case requires higher limits, contact Light support at support@light.inc.
The API returns standard HTTP status codes:
Retry-After header)Example 1: Procurement system to AP automation
POST /v1/invoice-payables with vendor ID and amountPOST /v1/invoice-payables/{id}/line-itemsPOST /v1/invoice-payables/{id}/approveExample 2: CRM to invoicing
POST /v1/customers (or looks up existing via GET /v1/customers)POST /v1/invoices with customer and line itemsPOST /v1/invoices/{id}/openPOST /v1/invoices/{id}/send-emailExample 3: Financial reporting dashboard
GET /v1/ledger-accountsGET /v1/ledger-transactions/lines with date filters401 Unauthorized: Verify your API key is correct and hasn't been revoked. Check that the Authorization header uses Basic scheme (for API keys) or Bearer scheme (for OAuth tokens).
400 Bad Request: Verify request JSON is valid and all required fields are provided. Check that amounts are in cents (integer) and IDs are valid UUIDs.
403 Forbidden: The API key's assigned role may not have permission for this action. Check role permissions in Settings > API Keys.
429 Too Many Requests: Implement exponential backoff and check the Retry-After header. Consider spreading requests over time.
Redirect issues: Ensure your HTTP client follows redirects and forwards the Authorization header to redirected URLs.
Was this article helpful?