POST to the Astral webhook endpoint. Astral verifies the request signature and updates your subscription accordingly. You do not call this endpoint directly; configure it in your Stripe Dashboard and Stripe delivers events automatically.
Stripe webhook endpoint
Stripe-Signature header. No bearer token is used.
This endpoint verifies the request against your Stripe webhook signing secret before processing any event. Requests that fail signature verification are rejected with 401.
Configuring the webhook in Stripe
Open Stripe Dashboard
Go to Stripe Dashboard → Webhooks and click Add endpoint.
Select events to listen for
Enable the following events:
checkout.session.completedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
Signature verification
Stripe signs every webhook request with aStripe-Signature header. Astral verifies this signature before processing any event. If you are forwarding or relaying webhook events, always pass the raw bytes of the request body to the verification function — do not parse or re-serialize the JSON first.
Handled events
checkout.session.completed
Triggered when a Stripe Checkout session completes successfully. Astral activates the corresponding subscription.
Event payload shape
customer.subscription.updated
Fired when a subscription’s status, plan, or billing details change. Astral maps Stripe’s subscription statuses to the values you see in the /subscriptions/status API response:
| Stripe status | Astral status |
|---|---|
active | active |
trialing | trial |
past_due | past_due |
canceled | canceled |
unpaid | past_due |
paused | suspended |
customer.subscription.deleted
Fired when Stripe cancels a subscription. The subscription is marked canceled and historical records are preserved. You keep access through the end of the current billing period.
Event payload shape
invoice.payment_succeeded
Fired when an invoice is paid. Astral confirms the subscription renewal and updates the subscription status to active.
Event payload shape
invoice.payment_failed
Fired when an invoice payment fails. Astral marks the subscription as past_due. The subscription remains active until the end of the grace period — the exact duration depends on your Stripe billing settings.
Event payload shape
Response format
On success, the endpoint returns:200 OK.
| Status | Condition |
|---|---|
400 | Request body is missing |
401 | Signature verification failed |