Ledga

Rate limits

Each key has a per-second request budget; response headers show where you stand.

The default budget is 10 requests per second per API key; limits are set per key.

Header Meaning
X-RateLimit-Limit Requests allowed per second
X-RateLimit-Remaining Requests left in the current second
X-RateLimit-Reset Seconds until the budget resets
Retry-After On 429 only: seconds to wait
{ "success": false, "message": "Rate limit exceeded.", "code": "RATE_LIMIT_EXCEEDED", "meta": { "retry_after": 1 } }

Wait Retry-After seconds, then retry. To post many transactions, use POST /transactions/batch (up to 100 per request).

use Ledga\Api\Exceptions\LedgaRateLimitException;

try {
    $ledga->transactions->create($payload);
} catch (LedgaRateLimitException $e) {
    sleep($e->getRetryAfter());
}