Docs API & Integrations

API & Integrations

Programmatic access to your LedgerPort data and sync operations.

Authentication

All API requests require authentication via a Bearer token. Generate API keys in Settings → API Keys.

Making Requests

Include your API key in the Authorization header:

curl -H "Authorization: Bearer lp_live_abc123..." \
     -H "Content-Type: application/json" \
     https://api.ledgerport.com/v1/syncs

Key Types

  • Live keys (lp_live_): Access production data. Use in your backend only.
  • Test keys (lp_test_): Access sandbox environment. Safe for development.

Security: Never expose API keys in frontend code or version control. Rotate keys immediately if compromised via Settings → API Keys → Revoke.

Core Endpoints

The LedgerPort REST API is organized around standard resources. All endpoints accept and return JSON.

Base URL: https://api.ledgerport.com/v1

Method Endpoint Description
GET /syncs List all sync operations. Supports pagination and filtering.
GET /syncs/:id Get details of a specific sync including payload and response.
POST /syncs/trigger Trigger a manual sync for a specific connection.
GET /connections List all connected platforms and their health status.
GET /mappings List all account, product, and tax mappings.
PUT /mappings/:id Update a specific mapping rule.
GET /audit-log Query the audit log. Supports filtering by date, status, and store.

All list endpoints support ?page= and ?per_page= query parameters for pagination (default 25, max 100).

Webhooks

LedgerPort can send webhook notifications to your server when sync events occur. Configure webhook endpoints in Settings → Webhooks.

Available Events

  • sync.completed — A sync operation finished successfully.
  • sync.failed — A sync operation failed after all retries.
  • connection.lost — A platform connection expired or was revoked.
  • mapping.unmapped — An order contains a product or tax code with no mapping.

Payload Format

{
  "event": "sync.completed",
  "timestamp": "2026-02-25T14:30:00Z",
  "data": {
    "sync_id": "sync_abc123",
    "connection_id": "conn_xyz",
    "orders_synced": 12,
    "duration_ms": 340
  }
}

Verification

Every webhook includes a X-LedgerPort-Signature header containing an HMAC-SHA256 signature. Verify it using your webhook secret to confirm the request came from LedgerPort.

Rate Limits & Best Practices

API requests are rate-limited per API key to ensure fair usage and platform stability.

Plan Rate Limit
Starter 60 requests/minute
Growth 300 requests/minute
Scale 1,000 requests/minute

Rate limit headers are included in every response:

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 287
X-RateLimit-Reset: 1740494400

If you exceed the limit, you’ll receive a 429 Too Many Requests response. Wait until the reset timestamp before retrying.