Merchant Settings API
The Merchant Settings API allows you to manage your own account configuration. All endpoints require authentication with your merchant API key.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /api/merchant/me | Get account info and onboarding status |
GET | /api/merchant/l402-status | Check L402 license status |
PUT | /api/merchant/opennode-key | Update OpenNode API key |
PUT | /api/merchant/webhook-url | Update webhook URL and secret |
GET | /api/merchant/subscription | Get subscription details |
POST | /api/merchant/validate-opennode | Validate OpenNode API key |
GET | /api/merchant/quickstart | Get interactive onboarding guide |
Get Account Info
Get your merchant account information and onboarding status.
GET /api/merchant/me
Response
{
"merchantId": 123,
"name": "My Company",
"email": "api@mycompany.com",
"planTier": "standard",
"subscriptionStatus": "active",
"isActive": true,
"createdAt": "2024-01-15T10:30:00Z",
"features": {
"refundsEnabled": true,
"multiCurrencyEnabled": true,
"analyticsEnabled": true,
"prioritySupport": false,
"customBrandingEnabled": false,
"maxWebhookEndpoints": 3,
"slaUptimePercentage": 99.5
},
"onboarding": {
"hasOpenNodeKey": true,
"hasWebhookUrl": true,
"hasActiveProxy": true,
"proxyCount": 2,
"isFullyConfigured": true
}
}
Example
curl https://api.lightningenable.com/api/merchant/me \
-H "X-API-Key: le_merchant_abc123"
Check L402 License Status
Check if your account has L402 features enabled. This endpoint is used by MCP tools to validate license status before executing paid-tier operations.
GET /api/merchant/l402-status
Response (L402 Enabled)
{
"l402Enabled": true,
"planTier": "l402",
"subscriptionStatus": "active",
"isActive": true
}
Response (L402 Not Enabled)
{
"l402Enabled": false,
"planTier": "standalone",
"subscriptionStatus": "active",
"isActive": true
}
Response Fields
| Field | Type | Description |
|---|---|---|
l402Enabled | boolean | Whether L402 features are available |
planTier | string | Current plan: standalone, standard, or l402 |
subscriptionStatus | string | Subscription status: active, trialing, past_due, canceled |
isActive | boolean | Whether the merchant account is active |
Plan Tiers and L402 Support
| Plan | Price | L402 Enabled |
|---|---|---|
| Kentico Commerce | $249/mo | ❌ No |
| Agentic Commerce | $299/mo | ✅ Yes |
Example
curl https://api.lightningenable.com/api/merchant/l402-status \
-H "X-API-Key: le_merchant_abc123"
This endpoint is called automatically by the MCP server when using access_l402_resource or pay_l402_challenge tools. Set the LIGHTNING_ENABLE_API_KEY environment variable to your merchant API key.
Update OpenNode API Key
Configure your OpenNode API key. This is required before you can create payments or L402 proxies.
PUT /api/merchant/opennode-key
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
openNodeApiKey | string | Yes | Your OpenNode API key |
- Production: https://app.opennode.com → Settings → API Keys
- Testnet: https://dev-app.opennode.com → Settings → API Keys
Request
{
"openNodeApiKey": "your-opennode-api-key"
}
Response
{
"success": true,
"message": "OpenNode API key updated successfully. You can now create L402 proxies."
}
Example
curl -X PUT https://api.lightningenable.com/api/merchant/opennode-key \
-H "X-API-Key: le_merchant_abc123" \
-H "Content-Type: application/json" \
-d '{
"openNodeApiKey": "your-opennode-api-key"
}'
Update Webhook URL
Configure where Lightning Enable should send webhook notifications for payment events.
PUT /api/merchant/webhook-url
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
webhookUrl | string | No | URL to receive webhook notifications |
webhookSecret | string | No | Secret for HMAC signature verification |
Request
{
"webhookUrl": "https://mycompany.com/webhooks/lightning",
"webhookSecret": "my-webhook-signing-secret"
}
Response
{
"success": true,
"message": "Webhook settings updated successfully."
}
Example
curl -X PUT https://api.lightningenable.com/api/merchant/webhook-url \
-H "X-API-Key: le_merchant_abc123" \
-H "Content-Type: application/json" \
-d '{
"webhookUrl": "https://mycompany.com/webhooks/lightning",
"webhookSecret": "my-webhook-signing-secret"
}'
Get Subscription Details
Get your current subscription plan and limits.
GET /api/merchant/subscription
Response
{
"planTier": "standard",
"planName": "Standard",
"status": "active",
"stripeCustomerId": "cus_abc123",
"limits": {
"maxMerchants": 1,
"maxEnvironments": 2,
"maxWebhookEndpoints": 3
}
}
Subscription Status Values
| Status | Description |
|---|---|
active | Subscription is active and paid |
trialing | In free trial period |
past_due | Payment failed, grace period |
canceled | Subscription was canceled |
Example
curl https://api.lightningenable.com/api/merchant/subscription \
-H "X-API-Key: le_merchant_abc123"
Validate OpenNode API Key
Test your OpenNode API key to verify it's configured correctly.
POST /api/merchant/validate-opennode
Response (Valid Key)
{
"isValid": true,
"message": "OpenNode API key is valid and working."
}
Response (Invalid Key)
{
"isValid": false,
"message": "OpenNode API key validation failed: 401"
}
Response (No Key Configured)
{
"isValid": false,
"message": "No OpenNode API key configured. Use PUT /api/merchant/opennode-key to add one."
}
Example
curl -X POST https://api.lightningenable.com/api/merchant/validate-opennode \
-H "X-API-Key: le_merchant_abc123"
Get Quickstart Guide
Get an interactive onboarding guide that tracks your setup progress.
GET /api/merchant/quickstart
Response
{
"merchantId": 123,
"merchantName": "My Company",
"completedSteps": 3,
"totalSteps": 6,
"requiredStepsCompleted": 3,
"requiredStepsTotal": 4,
"isReadyForProduction": true,
"steps": [
{
"stepNumber": 1,
"title": "Configure OpenNode API Key",
"description": "Add your OpenNode API key so Lightning Enable can create invoices on your behalf.",
"endpoint": "PUT /api/merchant/opennode-key",
"exampleRequest": "{ \"openNodeApiKey\": \"your-opennode-api-key\" }",
"isCompleted": true,
"isRequired": true
},
{
"stepNumber": 2,
"title": "Validate OpenNode Key",
"description": "Verify your OpenNode API key is working correctly.",
"endpoint": "POST /api/merchant/validate-opennode",
"exampleRequest": null,
"isCompleted": true,
"isRequired": true
},
{
"stepNumber": 3,
"title": "Create Your First Proxy",
"description": "Create an L402 proxy configuration pointing to your API.",
"endpoint": "POST /api/proxy",
"exampleRequest": "{ \"name\": \"My AI API\", \"targetBaseUrl\": \"https://api.yourcompany.com/v1\", \"defaultPriceSats\": 100 }",
"isCompleted": true,
"isRequired": true
}
]
}
This endpoint is useful for building onboarding UIs that guide users through the setup process.
Example
curl https://api.lightningenable.com/api/merchant/quickstart \
-H "X-API-Key: le_merchant_abc123"
Error Responses
401 Unauthorized
{
"error": "Authentication required"
}
400 Bad Request
{
"error": "OpenNode API key is required"
}
{
"error": "Invalid webhook URL format"
}
404 Not Found
{
"error": "Merchant not found"
}
Next Steps
- Authentication - API key management
- L402 Protocol - Set up L402 proxy for API monetization
- Webhooks - Configure webhook notifications