Stripe API

The Stripe API endpoints allow you to manage your Stripe integration with Lumen. This includes configuring your Stripe API keys and validating them.

Overview

Integrating with Stripe allows you to process payments through the Stripe payment gateway. The configuration requires a secret key and a publishable key from your Stripe account.

Authentication

All API requests require authentication via merchant credentials.

Endpoints

Get Stripe Configuration

Retrieves the current Stripe configuration for the authenticated merchant. The secret key is masked for security.

GET https://api.getlumen.dev/v1/stripe/config

Response

{
  "id": "stripe_cfg_123",
  "publicKey": "pk_live_...",
  "secretKey": "sk_live_...****1234",
  "hasWebhook": true,
  "createdAt": "2024-01-01T00:00:00Z"
}

Validate Stripe Keys

Validates a pair of Stripe secret and publishable keys by making a test API call to Stripe.

POST https://api.getlumen.dev/v1/stripe/validate-keys

Request Body

{
  "secretKey": "sk_live_...",
  "publicKey": "pk_live_..."
}

Response

{
  "message": "Stripe keys are valid",
  "success": true
}

Configure Stripe

Creates or updates the Stripe configuration for the merchant. This process includes creating a new webhook endpoint in your Stripe account for Lumen to receive payment events.

POST https://api.getlumen.dev/v1/stripe/config

Request Body

{
  "secretKey": "sk_live_...",
  "publicKey": "pk_live_..."
}

Response

{
  "message": "Stripe configuration updated successfully",
  "id": "stripe_cfg_123",
  "webhook": {
    "id": "we_123...",
    "url": "https://api.getlumen.dev/v1/public/webhook/merch_123",
    "enabled_events": [
      "payment_intent.succeeded",
      "payment_intent.payment_failed",
      "setup_intent.succeeded",
      "setup_intent.setup_failed",
      "checkout.session.completed"
    ]
  }
}