Skip to content
Connect an agent
Billing

Receive a Stripe event. Called by Stripe, not by clients

Called by Stripe, not by clients.

POST/billing/webhook

TL;DR

QuestionAnswer
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

FieldTypeRequiredDescription
stripe-signaturestringyesThe 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.

FieldTypeRequiredDescription

Responses

StatusMeaningBody
200The event was received.WebhookAck
400The Stripe-Signature header is missing.ErrorResponse
401The signature is not valid.ErrorResponse
413The body is larger than the cap.ErrorResponse
429Too many requests.ErrorResponse
500The event could not be handled; Stripe will send it again.ErrorResponse
503Billing is not set up on this server.ErrorResponse

Response body

A 200 answer has the type WebhookAck.

FieldTypeRequiredDescription
receivedtrueyes
outcome"handled" | "duplicate" | "ignored"yeshandled 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

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools