---
title: "Stripe Webhook"
method: POST
path: "/api/billing/webhook"
---

# Stripe Webhook

`POST /api/billing/webhook`

## Request

- Base URL: `https://api.crowelogic.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.crowelogic.com/api/billing/webhook`
- Auth: none declared

Handle Stripe webhook events.

Flow:
1. Verify signature (400 on failure).
2. Atomic idempotency check: insert into billing_events keyed by
   stripe_event_id. If the row already existed, treat as a replay
   and return 200 without running handlers.
3. Dispatch to per-event-type handler.
4. Mark event processed.

The reconciliation logic itself lives in module-level _handle_*
helpers so unit tests can drive them directly.

## Response `200`

Successful Response

- unknown

---

[API](https://skmtc.dev/crowelogic/apis/crowe-logic-foundry.md) · [All operations](https://skmtc.dev/crowelogic/apis/crowe-logic-foundry/llms.txt) · [OpenAPI document](https://skmtc.dev/crowelogic/apis/crowe-logic-foundry/revisions/a3c1ef17f171?raw)
