Uygulamayı aç
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
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
400Malformed payload
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
401Signature mismatch
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring

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()