Error Reference
This page lists the errors the Lightning Enable API returns, by area.
Error Response Format
Every error body has an error field. Dispatch on the HTTP status first, then on error:
- Coded errors carry a stable snake_case
error(for exampleinvalid_expiry,payment_provider_not_configured) and a human-readablemessage. Match on the code. - Older errors carry a prose
error(for example"Invalid API key"), sometimes with amessage. Match these on the HTTP status; the wording can change. - The L402 producer endpoints (
/api/l402/challenges*) returnapplication/problem+jsonwith a stabletypeURI (https://lightningenable.com/problems/<code>) plus the sameerrorandmessagemembers.
{
"error": "Invalid API key",
"message": "The provided API key is invalid or inactive"
}
403 responses from subscription and feature enforcement add snake_case context fields:
| Field | Type | Present on | Description |
|---|---|---|---|
error | string | all errors | Short error identifier (e.g., "Invalid API key", "Subscription required") |
message | string | most errors | Human-readable description |
action_required | string | 403 subscription/feature errors | What to do next: contact_support, subscribe, update_payment_method, renew_subscription, upgrade_plan |
current_plan | string | null | some 403 errors | Your current plan tier — one of free, individual, l402. An account carrying a tier value we do not recognize is one exception: that value is echoed back raw so an operator can see what needs fixing. It is null when the account has no plan tier on file (a blank tier — for example an admin-created account that has not been assigned one). Handle an unexpected value rather than assuming the enum |
required_plan | string | null | 403 feature errors | Plan tier that would grant the feature, or null when no plan grants it |
subscription_status | string | some 403 errors | Current Stripe subscription status |
feature | string | 403 feature errors | The gated feature identifier |
support_email | string | null | 403 account-inactive and feature-gate errors only | The address to email when action_required is contact_support. It is null on feature-gate errors you can resolve yourself, such as an upgrade, and absent from the subscription-state 403s (subscribe, update_payment_method, renew_subscription) |
Every error response also includes an X-Correlation-Id response header that you can use when contacting support. See Request Headers for details.
Validation Errors (Model Binding)
When a request body fails model binding or data-annotation validation (missing required fields, wrong types, out-of-range values), ASP.NET Core returns the standard RFC 9457 validation problem shape — not the {error} shape above:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"Amount": [
"Amount must be 0 or greater (0 = demo mode)"
],
"OrderId": [
"OrderId is required"
]
},
"traceId": "00-a1b2c3d4e5f6...-01"
}
Check the Content-Type: validation problems are returned as application/problem+json, with per-field messages in the errors dictionary. Business-logic failures (e.g., duplicate order ID) use the {error} JSON shape instead.
POST /api/l402/challenges is the exception: its binding failures use the Lightning Enable problem shape, with error / message members and a stable type. See Invalid Challenge Request and Unsupported Media Type.
Unhandled Exceptions
Unhandled server errors return a correlation ID for support inquiries:
{
"error": "An error occurred processing your request.",
"correlationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"timestamp": "2026-01-09T12:00:00Z",
"support": "support@lightningenable.com"
}
correlationId matches the X-Correlation-Id response header; include it when you contact support. The support field appears on 5xx responses only. Production responses never include exception details.
HTTP Status Codes
Success Codes
| Code | Meaning | When Used |
|---|---|---|
200 OK | Request succeeded | GET, PUT, POST (when returning data) |
201 Created | Resource created | POST when creating payments, refunds, proxies |
204 No Content | Success, no response body | DELETE operations |
Client Error Codes
| Code | Meaning | Common Causes |
|---|---|---|
400 Bad Request | Invalid request | Missing required fields, invalid format, validation errors, duplicate order ID |
401 Unauthorized | Authentication failed | Missing/invalid API key, invalid webhook signature |
402 Payment Required | L402 payment needed | Accessing L402-protected endpoints without valid token |
403 Forbidden | Access denied | Inactive account, subscription issues, feature not available |
404 Not Found | Resource not found | Invalid invoice ID, order ID, proxy ID |
409 Conflict | Conflicts with the current state | Idempotency key reused for a different charge, a renewal refusal, a store state-machine refusal. Duplicate order IDs return 400, not 409 |
414 URI Too Long | L402 resource path too long | A proxied path over 848 characters (resource_too_long) |
415 Unsupported Media Type | Request body isn't JSON | No body, or a Content-Type other than application/json |
429 Too Many Requests | Rate limit or auth-failure throttle | Too many requests in the window, or too many failed authentication attempts from your IP |
499 Client Closed Request | You disconnected before the response was ready | Recorded in logs, never read by you: there's no body. Seen when your client timeout is shorter than the time an invoice takes to mint |
Server Error Codes
| Code | Meaning | When Used |
|---|---|---|
500 Internal Server Error | Server error | Unexpected errors, includes correlationId |
502 Bad Gateway | Upstream error | The payment provider refused the request, or a proxied API couldn't be reached |
503 Service Unavailable | Temporary outage | Payment provider down or busy, or a seller's payment provider not set up |
504 Gateway Timeout | Upstream timeout | A proxied API didn't answer in time |
Authentication Errors
Missing API Key
HTTP Status: 401 Unauthorized
{
"error": "API key required",
"message": "Please provide API key in X-API-Key header"
}
Cause: Request missing the X-API-Key header.
Solution: Include your API key in every request:
curl -H "X-API-Key: YOUR_API_KEY" https://api.lightningenable.com/api/payments
Invalid API Key
HTTP Status: 401 Unauthorized
{
"error": "Invalid API key",
"message": "The provided API key is invalid or inactive"
}
Cause: API key doesn't match any active merchant account.
Solution:
- Verify you're using the correct API key (view it at Dashboard → Settings)
- Check if your account is active
- Contact support if you've lost your API key
Too Many Failed Authentication Attempts
HTTP Status: 429 Too Many Requests
Header: Retry-After: <seconds>
{
"error": "Too many failed authentication attempts",
"message": "Slow down and try again in 42 seconds"
}
Cause: More than 20 failed authentication attempts from your IP within a 60-second window. This is a per-IP throttle, separate from the general rate limiter.
Solution: Fix your API key — do not retry with the same key. Retrying failed authentications only keeps the throttle engaged. See Failed-Authentication Throttling.
Server Configuration Error
HTTP Status: 500 Internal Server Error
{
"error": "Server configuration error"
}
Cause: Server configuration issue on the Lightning Enable side.
Solution: Contact support@lightningenable.com with your correlation ID.
Subscription Errors
Account Inactive
HTTP Status: 403 Forbidden
{
"error": "Account inactive",
"message": "Your account is inactive. Please contact support.",
"action_required": "contact_support",
"support_email": "support@lightningenable.com"
}
Cause: Merchant account has been deactivated.
Solution: Contact support@lightningenable.com to reactivate.
Subscription Required
HTTP Status: 403 Forbidden
{
"error": "Subscription required",
"message": "Your plan tier requires an active subscription. Please subscribe to continue using the service.",
"current_plan": "individual",
"action_required": "subscribe"
}
Cause: Paid-tier account without a valid Stripe subscription.
Solution: Subscribe at lightningenable.com.
Subscription Not Active
HTTP Status: 403 Forbidden
{
"error": "Subscription not active",
"message": "Your subscription payment is past due. Please update your payment method to continue using the service.",
"subscription_status": "past_due",
"action_required": "update_payment_method"
}
Possible Status Values:
| Status | Message summary | action_required |
|---|---|---|
past_due | Payment is past due | update_payment_method |
canceled | Subscription canceled | renew_subscription |
unpaid | Subscription unpaid | renew_subscription |
incomplete | Setup incomplete | renew_subscription |
incomplete_expired | Setup expired | renew_subscription |
action_required is update_payment_method only for past_due; every other inactive status returns renew_subscription. The message text varies per status.
Subscription Period Expired
HTTP Status: 403 Forbidden
{
"error": "Subscription period expired",
"message": "Your subscription billing period has expired. Please renew your subscription to continue using the service.",
"subscription_status": "active",
"current_period_end": "2026-01-15T00:00:00.0000000Z",
"action_required": "renew_subscription"
}
Cause: The subscription's CurrentPeriodEnd has passed even though the status may still show active. This typically occurs when a Stripe webhook is delayed. The middleware catches expired billing periods as a safety net.
Solution: Renew your subscription or wait for Stripe to process the renewal. If your payment method is valid, this should resolve automatically once the Stripe webhook updates the billing period.
Lightning-paid period expired
An account paid in sats over L402 gets its own variant of this 403 once its paid-through date passes. It carries a renew object naming the endpoint that takes the payment:
{
"error": "Subscription period expired",
"message": "Your Lightning-paid subscription period has ended. Renew now with an L402 payment, or the account moves to the Free Producer Sandbox within 24 hours.",
"subscription_status": "active",
"current_period_end": "2026-11-10T14:03:22.0000000Z",
"action_required": "renew_subscription",
"renew": { "endpoint": "/api/merchant/subscription/renew" }
}
Cause: The account's paymentMethod is l402, it has no Stripe subscription, and currentPeriodEnd has passed. Nothing renews a sats period automatically.
Solution: Pay at renew.endpoint (see Renew in sats). That endpoint is exempt from subscription enforcement, so the lapsed account can reach it. If you don't pay, a daily job moves the account to the Free Producer Sandbox, after which the API key keeps working within the Free limits. Agents should branch on action_required and, when renew is present, pay there rather than open card checkout.
Feature Not Available
HTTP Status: 403 Forbidden
{
"error": "Feature not available",
"message": "L402 Agentic Commerce is not enabled for your plan. Upgrade to an Agentic Commerce plan to use the L402 producer API.",
"feature": "l402",
"current_plan": "individual",
"required_plan": "individual",
"action_required": "upgrade_plan",
"support_email": null
}
Gated features:
feature | Endpoints | required_plan | action_required |
|---|---|---|---|
refunds | /api/refunds | null | contact_support |
l402 | /api/l402/challenges | individual | upgrade_plan |
Refunds send required_plan: null because no plan grants them: support turns them on per account, so upgrading wouldn't help. That body carries support_email: "support@lightningenable.com"; the upgrade_plan row sends support_email: null.
current_plan can equal required_planThe gate reads a per-account flag, not the plan table. All three tiers include L402, so this means the flag was never applied to your account (most often one created under a retired tier id). Contact support rather than buying the plan again.
See Subscription & Plan Enforcement for full details on plan tiers and feature gating.
Plan Required (store API)
HTTP Status: 403 Forbidden
Returned when an account on the Free Producer Sandbox calls the store API (/api/store-orders, /api/store-designs, /api/store-quotes, /api/store-settings, /api/store-listings, /api/community-submissions) with its API key. Running your own Lightning store needs a paid plan.
{
"error": "plan_required",
"message": "Running a Lightning store on the store API needs a paid Lightning Enable plan (Agentic Commerce). The Free Producer Sandbox does not include it. Subscribe, then retry with the same API key.",
"feature": "store",
"current_plan": "free",
"required_plan": "individual",
"action_required": "subscribe"
}
Subscribe to Agentic Commerce, then retry with the same API key. Another account's store record is never a 403: it answers 404 Not Found, as if it didn't exist.
Other store API errors
| Status | error | When | What to do |
|---|---|---|---|
401 | unauthorized | No valid X-API-Key (or legacy store key). | Send your merchant API key in X-API-Key. |
400 | invalid_submission_id | A community-submission file route got an id with characters other than A-Z a-z 0-9 _ -. | Use a submission id made of those characters. |
409 | payment_hash_in_use | The Lightning payment hash is already bound, or was bound before a re-bind, to another design or order (payment hashes are unique across all accounts). | Create a new invoice and bind its hash. |
400 | invoice_outlives_quote | A custom-product order's BOLT11 stays payable later than maxInvoiceExpiresAt (the quote's quoteExpiresAt plus the allowed lifetime, one hour by default). The response also carries maxExpiresInSeconds, the time left until maxInvoiceExpiresAt. | Create the invoice with POST /api/payments and expiresInSeconds no larger than maxExpiresInSeconds. The store's custom checkout sends the quote's remaining validity. |
409 | store_tenant_violation | A write would have touched a store record of another account. Nothing was saved. | Read the record with your own credentials and retry; contact support if it persists. |
400 | store_merchant_required | A store record needs an owning account and the request had none. Nothing was saved. | Authenticate with your merchant API key in X-API-Key. |
404 | store_settings_not_set | GET /api/store-settings found no stored settings for your account. The defaults apply. | Set them with PUT /api/store-settings if you want different values. |
400 | invalid_store_settings | A store setting is out of range. The response's field names it. Nothing was saved. | Fix that field and send the whole settings body again. |
409 | store_settings_conflict | The rowVersion you sent isn't the stored one: the settings changed since you read them. The response carries currentRowVersion. | Read the settings again, re-apply your change, and send the new rowVersion. |
409 | publishing_disabled | A design can't be published (or approved for publishing) because publishingEnabled is off in your store settings. | Turn publishing on with PUT /api/store-settings. |
409 | publish_limit_reached | The designer already holds limit open listings (pending review or published). | Withdraw one of the designer's listings first, or raise maxPublishedPerDesigner. |
400 | invalid_publication_action | The publication action isn't request, withdraw, approve or reject. | Send a supported action. approve and reject also need "actor": "operator" and a reason. |
400 | invalid_listing_title | listingTitle is empty, longer than 120 characters, or contains control characters. | Send a shorter title, or leave it out. |
404 | listing_not_found | No listing in your account has this listingId. | Check the id; another account's listing is never visible. |
400 | invalid_listing_id | listingId isn't a listing id, or a quote request sent both designId and listingId. | Send one listing id as returned by the API, or designId alone. |
409 | listing_not_available | The listing can't be quoted or ordered. The response carries publicationStatus and a reason: not_published, expired, design_not_approved, or publishing_disabled (publishing is turned off in your store settings). | Show the buyer another listing, or turn publishing back on. |
503 | publication_busy | Another publication request for the same designer is in progress. The response has a Retry-After header. Nothing was saved. | Retry after the Retry-After delay. |
409 | listing_taken_down | The listing this order was bought through was taken down, so the order won't be manufactured. A late payment on a cancelled order is still recorded. | Resolve the order from your store's review page, for example with a refund. |
429 | listing_quote_limit | The listing already has limit quotes being priced, counting only quotes opened in the last 15 minutes by default. | Retry shortly. |
400 | invalid_reason | A design takedown (POST /api/store-designs/{designId}/moderation-reject) sent a reason longer than maxLength (200) characters. Nothing was changed. | Send a shorter reason. A blank one is 400 reason_required; a missing or non-operator actor is 400 invalid_actor. |
400 | listing_quote_mismatch | The order's listingId isn't the listing its quote was made for. | Quote the listing with its listingId, then order that quote. |
Payment Errors
Payment Not Found
HTTP Status: 404 Not Found
{
"error": "Invoice 12345 not found for merchant 42"
}
Cause: Invoice ID doesn't exist or doesn't belong to your merchant account. Looking up a payment by order ID returns the same shape with an order-specific message ("Invoice not found for OrderId ORDER-123").
Solution: Verify the invoice ID is correct and belongs to your account.
Payment Provider Not Configured
{
"error": "payment_provider_not_configured",
"message": "No payment provider API key is configured on this account, so no Lightning invoice could be created and nothing was charged. ...",
"docs": "https://docs.lightningenable.com/strike-setup/account-setup"
}
Cause: your account has no usable credential for its payment provider (a new Free Producer Sandbox account starts this way). message and docs name the provider your account uses.
Status depends on who's asking:
| Surface | Status | Body |
|---|---|---|
Your own calls: POST /api/payments, POST /api/payments/{invoiceId}/sync, POST /api/l402/challenges, POST /api/checkout/sessions | 400 | Tells you what to add and where (PUT /api/merchant/strike-key, opennode-key, or nwc-connection) |
A buyer paying you: /l402/proxy/*, other L402-gated routes, Shopify checkout | 503 | Says the seller hasn't finished setup, with no instructions for your account |
Solution: add a credential under Dashboard → Settings, or with the endpoint named in message. Retrying without one never succeeds.
Invalid Invoice Expiry
HTTP Status: 400 Bad Request
{
"error": "invalid_expiry",
"message": "expiresInSeconds must be a whole number between 60 and 86400 seconds (1 minute to 24 hours), or omitted to use the payment provider's default invoice lifetime. Nothing was created.",
"minExpiresInSeconds": 60,
"maxExpiresInSeconds": 86400
}
Cause: POST /api/payments got an expiresInSeconds outside 60 to 86400, or a value that isn't a whole number (a fraction, a string, or a number too large to read).
Solution: Send a value in range, or leave the field out to use the provider's default lifetime.
Payment Provider Rejected the Invoice
HTTP Status: 502 Bad Gateway
Illustrative body (message and providerStatus carry what Strike actually answered):
{
"error": "payment_provider_rejected",
"message": "The payment provider (strike) refused to create the invoice (HTTP 422): INVALID_DATA: Invalid data. (bolt11.expiryInSeconds: Value is out of range.) Nothing was created. Fix the request and retry; if it persists, contact support@lightningenable.com.",
"provider": "strike",
"providerStatus": 422,
"retryable": false
}
Cause: Strike answered POST /api/payments's invoice request with a 4xx error, so no invoice exists. message carries only Strike's error code, message and per-field validation messages; providerStatus is Strike's HTTP status.
Solution: Fix what message names and retry. A 401 or 403 in providerStatus means Strike rejected your Strike API key.
Payment Provider Unavailable (Invoice Creation)
HTTP Status: 502 Bad Gateway
Illustrative body:
{
"error": "payment_provider_unavailable",
"message": "The payment provider (strike) is unavailable (HTTP 503), so no invoice was created. Retry later; if it persists, contact support@lightningenable.com.",
"provider": "strike",
"providerStatus": 503,
"retryable": true
}
Cause: Strike answered POST /api/payments's invoice request with a 5xx error, so no invoice exists.
Solution: Retry the same request later.
NWC Request Refused (currency or amount)
HTTP Status: 400 Bad Request
Your account settles into your own Lightning wallet over Nostr Wallet Connect. A Lightning wallet prices in satoshis and Lightning Enable converts nothing, so POST /api/payments and POST /api/checkout/sessions refuse three requests before anything reaches the wallet. Nothing is created. Every body has the shape { error, message, provider: "nwc", …, docs }:
error | Cause | Extra field |
|---|---|---|
currency_not_supported | A fiat currency. Both routes default currency to USD, so omitting it returns this too | supportedCurrencies: ["BTC", "SAT"] |
amount_too_small | The amount rounds to less than 1 satoshi | minimumSats: 1 |
amount_too_large | The amount is above 21,000,000 BTC (/api/payments only; checkout caps amount at 1,000,000) | maxSats: 2100000000000000 |
{
"error": "currency_not_supported",
"message": "Your payment lane is a Nostr Wallet Connect wallet, which cannot price a USD invoice: it settles in Bitcoin and Lightning Enable performs no currency conversion. Send currency \"BTC\" (amount in bitcoin) or \"SAT\" (amount in satoshis), or configure a Strike API key, which supports fiat-denominated invoices. Nothing was created. Details: https://docs.lightningenable.com/nwc-setup/account-setup",
"provider": "nwc",
"supportedCurrencies": ["BTC", "SAT"],
"docs": "https://docs.lightningenable.com/nwc-setup/account-setup"
}
Solution: Send BTC (amount in bitcoin) or SAT (whole satoshis), between 1 satoshi and 21,000,000 BTC. To invoice in fiat, configure a Strike API key and switch your payment provider to Strike.
Duplicate Order
HTTP Status: 400 Bad Request
{
"error": "Invoice already exists for OrderId ORDER-123"
}
Cause: A payment with this order ID already exists for your merchant account.
Solution: Use a unique order ID per payment. To retry a creation safely, send an X-Idempotency-Key header; see Request Headers. To detect this case, match the 400 status plus the "Invoice already exists" prefix.
Field-level failures (amount out of range, missing order ID, malformed URL) return the validation problem shape instead.
Refund Errors
Invalid Refund Request
HTTP Status: 400 Bad Request
{
"error": "Cannot refund invoice in status 'pending'. Only paid, underpaid, processing, or partially-refunded payments can be refunded."
}
Refundable Statuses: Only invoices with status paid, underpaid, processing, or refunded (for partial refunds) can be refunded. Strike refunds and Lightning refunds also need amountSatoshis.
An account that settles through its own wallet over Nostr Wallet Connect can't refund through the API (400): refund the payer from your wallet app.
Refund Not Found
HTTP Status: 404 Not Found
{
"error": "Refund 67890 not found for merchant 42"
}
Invoice Not Found (for refund)
HTTP Status: 400 Bad Request (on refund creation) or 404 Not Found (when listing refunds by invoice)
{
"error": "Invoice 12345 not found for merchant 42"
}
L402 Protocol Errors
Payment Required (402)
HTTP Status: 402 Payment Required
Headers:
WWW-Authenticate: L402 macaroon="AgEB...", invoice="lnbc..."
X-L402-Error: No Authorization header provided
Body:
{
"error": "Payment Required",
"message": "Pay the Lightning invoice to access this API",
"proxy": {
"id": "my-api-1234",
"name": "My API",
"description": "AI services monetized with Lightning"
},
"l402": {
"macaroon": "AgEBYXBpLmxpZ2h0bmluZ2VuYWJsZS5jb20...",
"invoice": "lnbc100n1pj...",
"amount_sats": 100,
"payment_hash": "abc123...",
"expires_at": "2026-01-09T13:00:00Z"
},
"instructions": {
"step1": "Pay the Lightning invoice using any Lightning wallet",
"step2": "Copy the preimage (proof of payment) from your wallet",
"step3": "Include in request: Authorization: L402 <macaroon>:<preimage> (or Authorization: Payment method=\"lightning\", preimage=\"<preimage>\")"
}
}
Invalid L402 Credential
HTTP Status: 402 Payment Required
A refused credential gets a fresh challenge, not a 401. The reason is in the X-L402-Error header and in message.
X-L402-Error (prefix) | Cause |
|---|---|
No Authorization header provided | No credential sent |
Invalid authorization scheme | A scheme other than L402, LSAT, or Payment |
Invalid payment credential format | Not L402 <macaroon>:<preimage> or Payment method="lightning", preimage="..." |
Invalid preimage format | The preimage isn't 64 hex characters |
Preimage does not match payment hash | The preimage is for a different invoice |
Token not valid for this merchant | The token was issued by another seller |
Token amount does not match required price | The endpoint's price changed since the token was bought |
| Anything else | The macaroon was altered, expired, or issued for another path |
Payment Provider Busy
HTTP Status: 503 Service Unavailable
Headers: Retry-After: 2
{
"error": "payment_provider_busy",
"message": "The Lightning wallet settling this payment is busy serving other requests and did not free a slot in time, so no invoice was created and nothing was charged. This is transient — retry in a couple of seconds. Details: https://docs.lightningenable.com/nwc-setup/account-setup",
"docs": "https://docs.lightningenable.com/nwc-setup/account-setup"
}
Cause: the merchant settles through their own Lightning wallet over Nostr Wallet Connect, and that wallet already has as many in-flight NIP-47 requests as Lightning Enable sends it at once. A wallet app is not an API gateway, so the concurrent make_invoice calls it receives are bounded rather than letting a burst overwhelm it.
Nothing was invoiced and nothing was charged — the request is refused before it reaches the wallet. Honor Retry-After and try again; a burst of immediate retries lands on the same saturated wallet.
Merchants on the Strike or OpenNode lane never see this error. If it persists for more than a few seconds, the wallet itself is likely unreachable — check that the wallet app is online and the connection string is still valid.
On POST /api/l402/challenges the same failure arrives as an RFC 9457 problem document (application/problem+json, "type": "https://lightningenable.com/problems/payment_provider_busy") carrying the same error, message and docs members.
Invalid Challenge Request
HTTP Status: 400 Bad Request (application/problem+json)
{
"type": "https://lightningenable.com/problems/invalid_request",
"title": "Invalid request",
"status": 400,
"detail": "priceSats must be a whole number of sats ≥ 1 (your plan's maximum is 1,000 sats).",
"error": "invalid_request",
"message": "priceSats must be a whole number of sats ≥ 1 (your plan's maximum is 1,000 sats).",
"errors": { "priceSats": ["priceSats must be a whole number of sats ≥ 1 (your plan's maximum is 1,000 sats)."] },
"example": "{\"resource\":\"/hello\",\"priceSats\":10,\"description\":\"Hello\"}"
}
Cause: The body of POST /api/l402/challenges failed validation: resource is missing or longer than 848 characters, priceSats is missing, below 1, fractional, or not a number, or the body isn't valid JSON. When your plan caps the price, the priceSats message quotes that maximum; on a plan with no price cap it names no maximum.
Solution: Fix the fields named in errors and resend. example shows a valid body. Nothing was minted or invoiced.
Unsupported Media Type
HTTP Status: 415 Unsupported Media Type (application/problem+json)
{
"type": "https://lightningenable.com/problems/unsupported_media_type",
"title": "Unsupported media type",
"status": 415,
"detail": "Send Content-Type: application/json and a JSON body like {\"resource\":\"/hello\",\"priceSats\":10,\"description\":\"Hello\"}",
"error": "unsupported_media_type",
"message": "Send Content-Type: application/json and a JSON body like {\"resource\":\"/hello\",\"priceSats\":10,\"description\":\"Hello\"}"
}
Cause: POST /api/l402/challenges was called with no body, or with a Content-Type other than application/json.
Solution: Send the header Content-Type: application/json and a JSON body.
Plan Price Limit
HTTP Status: 402 Payment Required (application/problem+json)
{
"type": "https://lightningenable.com/problems/plan_price_limit",
"title": "Plan price limit reached",
"status": 402,
"detail": "Plan 'free' caps challenge price at 1000 sats. Requested: 5000. Upgrade to remove the cap.",
"error": "plan_price_limit",
"message": "Plan 'free' caps challenge price at 1000 sats. Requested: 5000. Upgrade to remove the cap.",
"current_plan": "free",
"max_price_sats": 1000,
"upgrade_url": "https://api.lightningenable.com/checkout?plan=individual"
}
Cause: priceSats on POST /api/l402/challenges is above your plan's per-challenge cap. Like the monthly volume cap (plan_volume_limit) and the endpoint cap (plan_endpoint_limit), it answers 402.
Solution: Lower priceSats to max_price_sats or less, or upgrade.
A merchant with no payment provider key gets 400 payment_provider_not_configured before any plan cap is checked. No plan can mint without a provider key, so upgrading wouldn't help.
Reserved Resource
HTTP Status: 400 Bad Request (application/problem+json)
{
"type": "https://lightningenable.com/problems/reserved_resource",
"title": "Reserved resource",
"status": 400,
"detail": "Resources beginning with 'renew:' or 'signup:' are reserved for Lightning Enable's own signup and subscription flows.",
"error": "reserved_resource",
"message": "Resources beginning with 'renew:' or 'signup:' are reserved for Lightning Enable's own signup and subscription flows."
}
Cause: POST /api/l402/challenges was called with a resource that starts with renew: or signup: (case-insensitive, after surrounding whitespace is trimmed). Those prefixes belong to the Lightning renewal and the L402 Fast Lane signup.
Solution: Pick a resource name with a different prefix. Nothing was minted or invoiced.
Proxy Not Found
HTTP Status: 404 Not Found
{
"error": "Proxy not found",
"message": "No active proxy configuration found for ID: invalid-proxy"
}
Proxy Unavailable
HTTP Status: 404 Not Found
{
"error": "Proxy unavailable",
"message": "This API proxy is currently unavailable"
}
Cause: The merchant account owning the proxy is inactive.
L402 Proxy Gateway Errors
Bad Gateway (502):
{
"error": "Bad Gateway",
"message": "Unable to connect to the target API",
"proxy_id": "my-api-1234",
"details": "Connection refused"
}
Gateway Timeout (504):
{
"error": "Gateway Timeout",
"message": "The target API did not respond in time",
"proxy_id": "my-api-1234"
}
Webhook Errors
The provider webhook receivers (/api/webhooks/strike, /api/webhooks/opennode) answer your payment provider, not you. For problems with webhooks sent to your callback URL, see Webhooks → Troubleshooting.
Rate Limiting Errors
Rate Limit Exceeded
HTTP Status: 429 Too Many Requests
Header: Retry-After: <seconds>
{
"error": "Too many requests",
"message": "Rate limit exceeded. Please try again later.",
"retryAfter": 60
}
Solution: wait Retry-After seconds (the body's retryAfter is the same value), then retry. See Rate Limiting for the limits per route.
Auth-Failure Throttle (Distinct 429)
A separate 429 — see Too Many Failed Authentication Attempts under Authentication Errors above. Distinguish the two by the error string: "Too many requests" (rate limiter, wait and retry) vs. "Too many failed authentication attempts" (auth throttle, fix your key).
Payment Provider Errors on L402 Routes
When a seller's payment provider can't issue a challenge invoice, the proxy and other L402-gated routes answer:
| Status | error | Cause |
|---|---|---|
502 | Payment provider rejected your credentials | The provider answered 401 or 403: the seller's API key is invalid, revoked, or lacks invoice permission |
502 | Payment provider error | The provider answered another 4xx |
503 | Payment provider unavailable | The provider answered 5xx |
503 | Payment provider request timed out | The provider didn't answer in time |
503 | Payment provider unreachable | The provider couldn't be reached |
503 | payment_provider_busy | The seller's own NWC wallet is busy; see Payment Provider Busy |
503 | challenge_persist_failed | The challenge couldn't be recorded, so no invoice was issued |
503 | amount_too_small | The seller's NWC wallet can't invoice the price: it is below 1 satoshi (for example a 0-sat pricing rule). Only the seller can fix it, so retrying won't help |
414 | resource_too_long | The requested path is over 848 characters |
Each body carries a message saying what to check. Nothing was invoiced in any of these cases, so retrying a 503 is safe; it succeeds only once the cause clears (never for amount_too_small until the seller changes the price).
On POST /api/l402/challenges the same failures are 502 provider_rejected and 503 provider_unavailable (problem documents). On POST /api/payments they're 502 payment_provider_rejected and 502 payment_provider_unavailable.
Stripe Integration Errors
Checkout Session Errors
HTTP Status: 400 Bad Request
{
"error": "Failed to create checkout session. Please try again."
}
Common Causes:
- Invalid email format
- Missing required fields
- Stripe API error
Subscription Result Errors
Missing Session ID:
{
"error": "session_id is required"
}
Session Not Found:
{
"error": "Checkout session not found"
}
Payment Not Completed:
{
"error": "Payment not completed",
"paymentStatus": "unpaid"
}
Customer Not Found:
{
"error": "Customer not found for this session"
}
Merchant Not Found:
{
"error": "Merchant account not found. Please wait a moment and try again."
}
Customer Portal Errors
HTTP Status: 401 Unauthorized
{
"error": "API key authentication required"
}
HTTP Status: 400 Bad Request
{
"error": "Merchant does not have a Stripe customer ID. Please subscribe first."
}
Proxy Management Errors
Invalid Target URL
HTTP Status: 400 Bad Request
{
"error": "Invalid target URL. Must be a valid HTTP or HTTPS URL."
}
Invalid Path Pattern
HTTP Status: 400 Bad Request
{
"error": "Invalid path pattern. Must start with '/' and be a valid glob pattern."
}
Proxy Not Found
HTTP Status: 404 Not Found
{
"error": "Proxy not found"
}
Endpoint Pricing Not Found
HTTP Status: 404 Not Found
{
"error": "Endpoint pricing not found"
}
Merchant Settings Errors
| Status | error | When |
|---|---|---|
400 | Strike API key is required / OpenNode API key is required | Empty key on PUT /api/merchant/strike-key or opennode-key |
400 | Invalid webhook URL format | webhookUrl isn't an absolute URL |
400 | Provider must be 'strike', 'opennode' or 'nwc' | Unknown value on PUT /api/merchant/payment-provider |
400 | (names the bad part) | A malformed connection string on PUT /api/merchant/nwc-connection |
404 | Merchant not found | The account behind the key no longer exists |
Lightning renewal errors
These come from GET and POST /api/merchant/subscription/renew, which renews Agentic Commerce in sats over L402. Every call needs your merchant API key; a missing or wrong key gets the authentication errors above. Branch on error. For the request flow, see Renew with Lightning (L402).
If a 409, 403, or 503 arrives after you paid, nothing was credited. Keep the token: it stays redeemable, until it expires 7 days after its challenge was issued, once the cause is fixed, and each payment is credited at most once. A 401 invalid_l402_token is permanent for that token (see invalid_l402_token).
stripe_subscription_active
HTTP Status: 409 Conflict
{
"error": "stripe_subscription_active",
"message": "This account has a card subscription that is not canceled. Cancel it in the billing portal first; a Lightning renewal cannot run alongside it.",
"support_email": "support@lightningenable.com"
}
Cause: The account has a Stripe subscription that isn't canceled: any status other than canceled or incomplete_expired, including active, trialing, past_due, unpaid, incomplete, paused, or no recorded status. Such a subscription can still charge the card, so a sats renewal alongside it would bill you twice.
Solution: Cancel the card subscription in the billing portal, then renew in sats. Or keep paying by card.
business_plan_contact_support
HTTP Status: 409 Conflict
{
"error": "business_plan_contact_support",
"message": "Business plans are arranged directly with Lightning Enable.",
"support_email": "support@lightningenable.com"
}
Cause: The account is on Agentic Commerce — Business, which isn't sold in sats.
Solution: Email support@lightningenable.com.
prepaid_cap_reached
HTTP Status: 409 Conflict
{
"error": "prepaid_cap_reached",
"message": "This account is already paid as far ahead as Lightning renewals allow.",
"currentPeriodEnd": "2027-10-20T14:03:22Z"
}
Cause: You requested a new challenge while the account is already paid more than 365 days ahead. currentPeriodEnd is the account's effective paid-through date. The cap applies only when requesting a challenge: redeeming a token you've already paid never returns this error.
Solution: Wait until the paid-through date is within 365 days, then pay again.
account_disabled
HTTP Status: 403 Forbidden
{
"error": "account_disabled",
"message": "This account is disabled. Contact support.",
"action_required": "contact_support",
"support_email": "support@lightningenable.com"
}
Cause: An operator disabled the account.
Solution: Email support@lightningenable.com.
invalid_authorization
HTTP Status: 400 Bad Request
{
"error": "invalid_authorization",
"message": "Authorization header must be: L402 <macaroon>:<preimage>. POST without an Authorization header to get a challenge."
}
Cause: The POST carried an Authorization header that isn't an L402 credential with both a macaroon and a preimage.
Solution: Send Authorization: L402 <macaroon>:<preimage>, or omit the header to get a challenge.
invalid_l402_token
HTTP Status: 401 Unauthorized
{
"error": "invalid_l402_token",
"message": "The L402 token is invalid, expired, minted for another account, or does not match this renewal. POST again without an Authorization header for a fresh challenge."
}
Cause: One of these:
- The macaroon or preimage is wrong, or the macaroon was altered.
- The token expired.
- The token was minted for another account's renewal.
- The token was already credited to another account.
- The token was minted at a price lower than the configured renewal price. After a price increase, a token minted at the old price is refused, including on replay. A price decrease never strands a token.
Solution: POST without an Authorization header for a fresh challenge. This refusal is permanent for the token you sent. If you paid a challenge minted before a price increase, that payment is never credited; email support@lightningenable.com with the payment hash.
renewal_contended
HTTP Status: 503 Service Unavailable
Headers: Retry-After: 1
{
"error": "renewal_contended",
"message": "Your account was being updated by another request. Your payment is safe — retry this exact request with the same Authorization header; it is credited at most once."
}
Cause: Another request changed the account while this payment was being credited, several times in a row. Nothing was credited.
Solution: Retry the same request with the same Authorization header after Retry-After. Don't pay again.
upstream_unavailable
HTTP Status: 503 Service Unavailable
{
"error": "upstream_unavailable",
"message": "The payment provider did not answer. Retry shortly; nothing was invoiced."
}
Cause: The payment provider that issues the renewal invoice didn't answer. A Retry-After header is present when the receiving wallet was busy.
Solution: Retry shortly. Nothing was invoiced.
challenge_persist_failed
HTTP Status: 503 Service Unavailable
{
"error": "challenge_persist_failed",
"message": "Could not record the payment challenge; no invoice was issued to you. Retry in a moment."
}
Cause: The challenge couldn't be recorded, so no invoice was issued.
Solution: Retry in a moment.
l402_subscription_unavailable
HTTP Status: 503 Service Unavailable
{
"error": "l402_subscription_unavailable",
"message": "Lightning renewals are switched off on this deployment."
}
Cause: Lightning renewals are switched off. On GET, the same state is eligible: false with reason: "Disabled".
Solution: Pay by card, or retry later.
l402_subscription_misconfigured
HTTP Status: 503 Service Unavailable
{
"error": "l402_subscription_misconfigured",
"message": "Lightning renewal is not available on this deployment right now.",
"support_email": "support@lightningenable.com"
}
Cause: The account that receives renewal payments isn't set up on this deployment.
Solution: Retry later, or email support@lightningenable.com.
Error Handling Best Practices
Branch on the HTTP status, then on error and the context fields:
async function call(url, options) {
const response = await fetch(url, options);
if (response.ok) return response.json();
const body = await response.json().catch(() => ({}));
const correlationId = response.headers.get('X-Correlation-Id');
switch (response.status) {
case 401:
throw new Error('Check your API key');
case 403:
// subscribe, update_payment_method, renew_subscription, upgrade_plan, contact_support
throw new Error(`Account action needed: ${body.action_required}`);
case 429:
if (body.error === 'Too many failed authentication attempts') {
throw new Error('Fix your API key before retrying');
}
// wait Retry-After seconds, then retry
break;
}
throw new Error(`${response.status} ${body.error}: ${body.message ?? ''} (correlation ${correlationId})`);
}
Log the X-Correlation-Id with every failure; support can find your request by it.
Retry Strategy Summary
| Error Type | Retry? | Strategy |
|---|---|---|
| 400 Bad Request | No | Fix request data |
| 401 Unauthorized | No | Fix credentials |
| 402 Payment Required | No | Complete payment |
| 403 Forbidden | No | Check subscription/features |
| 404 Not Found | No | Check resource ID |
| 429 Rate Limited | Yes | Wait Retry-After seconds |
| 429 Auth Throttle | No | Fix your API key first — retrying keeps the throttle engaged |
| 500 Server Error | Yes | Exponential backoff |
| 502 Bad Gateway | Only if retryable is true | A provider 4xx (payment_provider_rejected, provider_rejected) needs a fix first; a 5xx cause can be retried with backoff |
| 503 Service Unavailable | Yes | Honor Retry-After when present, else back off |
| 504 Gateway Timeout | Yes | Back off, then retry |
Next Steps
- Rate Limiting - Detailed rate limit information
- Authentication - API key setup and security
- Webhooks - Webhook configuration and signatures
- Payments API - Payment creation and status