Moonborn — API · billing
Handle Stripe webhook (signature-verified)
Stripe POSTs subscription lifecycle events here. Stripe-Signature header MUST verify against STRIPE_WEBHOOK_SECRET (HMAC-SHA256 within ±5 min tolerance). Duplicate stripe_event_id dedupes via stripe_webhook_events PK. Unsupported event types acked with 200 (no-op).
POST/v1/billing/webhooks/stripescope · Public (no auth)
Responses
200Event processed (or deduped)
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
400Malformed payload
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
401Signature mismatch
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
Examples
cURL
curl -X POST https://api.moonborn.co/v1/billing/webhooks/stripe \ -H "Authorization: Bearer $MOONBORN_API_KEY"
TypeScript
import Moonborn from '@moonborn/sdk';
const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });
const result = await client.billing.handleStripeWebhook();Python
import os from moonborn import Moonborn client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"]) result = client.billing.handle_stripe_webhook()