Pragence

Billing API

POST /api/v1/billing/webhooks/stripe

Summary: Stripe Webhook

Stripe webhook endpoint.

Receives and processes Stripe events to keep subscriptions in sync.

IMPORTANT: This endpoint must be registered in Stripe Dashboard:

  1. Go to Developers > Webhooks
  2. Add endpoint: https://your-domain.com/billing/webhooks/stripe
  3. Select events to listen for:
    • customer.subscription.created
    • customer.subscription.updated
    • customer.subscription.deleted
    • customer.subscription.trial_will_end
    • invoice.paid
    • invoice.payment_failed
    • invoice.upcoming
  4. Copy webhook signing secret to STRIPE_WEBHOOK_SECRET env var

Security: Verifies webhook signature to ensure events are from Stripe.

Response Schema (WebhookEventResponse - Status 200):

PropertyTypeRequiredDescription
event_idstring*
event_typestring*
processedboolean*
messagestring*

POST /api/v1/billing/webhooks/paystack

Summary: Paystack Webhook

Paystack webhook endpoint.

Receives and processes Paystack events to keep subscriptions in sync.

IMPORTANT: This endpoint must be registered in Paystack Dashboard:

  1. Go to Settings > Webhooks
  2. Add webhook URL: https://your-domain.com/billing/webhooks/paystack
  3. Copy webhook secret to PAYSTACK_WEBHOOK_SECRET env var

Security: Verifies webhook signature using HMAC SHA512.

Paystack Events:

  • subscription.create - New subscription created
  • subscription.disable - Subscription canceled
  • subscription.enable - Subscription reactivated
  • charge.success - Payment successful
  • charge.failed - Payment failed
  • invoice.create - Invoice generated
  • invoice.update - Invoice status changed

Response Schema (WebhookEventResponse - Status 200):

PropertyTypeRequiredDescription
event_idstring*
event_typestring*
processedboolean*
messagestring*

GET /api/v1/billing/addons/catalog

Summary: List Addon Catalog

List available add-ons (public).


On this page