Billing
Receive a Stripe event. Called by Stripe, not by clients
Called by Stripe, not by clients.
POST
/billing/webhookTL;DR
| Question | Answer |
|---|---|
| What does it do? | Receive a Stripe event. Called by Stripe, not by clients. |
| What does it take? | A JSON body of type object. |
| What does it return? | Status 200 with a body of type WebhookAck. |
| What can go wrong? | 400 the stripe-signature header is missing; 401 the signature is not valid; 413 the body is larger than the cap; 429 too many requests; 500 the event could not be handled; stripe will send it again; 503 billing is not set up on this server. Every failure uses the one error envelope. |
What it does
Called by Stripe, not by clients. The body is a Stripe event, authenticated only by the signature in the Stripe-Signature header, checked against the exact bytes received. An event that is not about a Plotwork subscription is acknowledged and ignored; an event handled before is acknowledged as a duplicate; a handler that fails answers 500 so that Stripe sends the event again.
Header parameters
| Field | Type | Required | Description |
|---|---|---|---|
stripe-signature | string | yes | The signature Stripe computes over the timestamp and the exact request body with this endpoint's signing secret. |
Request body
The body has the type object.
| Field | Type | Required | Description |
|---|
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The event was received. | WebhookAck |
| 400 | The Stripe-Signature header is missing. | ErrorResponse |
| 401 | The signature is not valid. | ErrorResponse |
| 413 | The body is larger than the cap. | ErrorResponse |
| 429 | Too many requests. | ErrorResponse |
| 500 | The event could not be handled; Stripe will send it again. | ErrorResponse |
| 503 | Billing is not set up on this server. | ErrorResponse |
Response body
A 200 answer has the type WebhookAck.
| Field | Type | Required | Description |
|---|---|---|---|
received | true | yes | |
outcome | "handled" | "duplicate" | "ignored" | yes | handled when the event changed or confirmed an account, duplicate when it had been handled before, ignored when it is not about a Plotwork subscription. |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint, and the error envelope |
| Schemas | Every request and response type |
| Tool reference | The operations as callable tools |