Public API
The Public API provides endpoints that can be accessed from client-side applications using a publishable API key. These endpoints are designed for tasks that don't require full secret key authentication, such as initializing payments and handling webhooks.
Authentication
Public API requests are authenticated using a publishable API key sent in the X-Lumen-Key
header.
Endpoints
Get Events for Payment Intent
Retrieves Server-Sent Events (SSE) for a specific payment intent, allowing the client to monitor the status of a payment in real-time.
GET https://api.getlumen.dev/v1/public/events/{paymentIntentId}
Dodo Webhook
Handles incoming webhooks from Dodo, the payment provider.
POST https://api.getlumen.dev/v1/public/webhook-dodo/{merchant_id}
Stripe Webhook
Handles incoming webhooks from Stripe.
POST https://api.getlumen.dev/v1/public/webhook/{merchant_id}
Stripe Test Webhook
An endpoint for testing Stripe webhooks.
POST https://api.getlumen.dev/v1/public/webhook-test/{merchant_id}
Initialize Payment
Initializes a payment process for a subscription, returning a client secret for Stripe or a payment link for Dodo.
POST https://api.getlumen.dev/v1/public/payment-init
Request Body
{
"planId": "plan_123",
"priceId": "price_456",
"customerId": "cust_789",
"customer": {
"name": "John Doe",
"email": "john.doe@example.com"
}
}