Stripe's webhook.
const url = 'https://api.opdns.io/v1/webhooks/stripe';const options = { method: 'POST', headers: {'Stripe-Signature': 'example', 'Content-Type': 'application/json'}, body: '{"id":"evt_1SXa1b2c3d4e5f6g7h8i9j0k","object":"event","type":"customer.subscription.updated","created":1791460800,"livemode":false,"api_version":"2026-09-30.endive","data":{"object":{"id":"sub_1SXa1b2c3d4e5f6g7h8i9j0k","object":"subscription","status":"active","customer":"cus_T7a1b2c3d4e5f6"}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.opdns.io/v1/webhooks/stripe \ --header 'Content-Type: application/json' \ --header 'Stripe-Signature: example' \ --data '{ "id": "evt_1SXa1b2c3d4e5f6g7h8i9j0k", "object": "event", "type": "customer.subscription.updated", "created": 1791460800, "livemode": false, "api_version": "2026-09-30.endive", "data": { "object": { "id": "sub_1SXa1b2c3d4e5f6g7h8i9j0k", "object": "subscription", "status": "active", "customer": "cus_T7a1b2c3d4e5f6" } } }'Stripe’s webhook endpoint, signed with the Stripe-Signature header
(t=<unix time>,v1=<hex HMAC-SHA256 of "t.body" with the endpoint's signing secret>, within 5 minutes); anything else is 400. Events are recorded by their id,
so an event Stripe delivers again changes nothing, and an event of the other mode
(live or test) than the deployment’s key is acknowledged and ignored. On
checkout.session.completed, customer.subscription.created|updated|deleted|paused|resumed,
invoice.paid, invoice.payment_failed, refund.created, refund.updated and
refund.failed the control plane reads the subscription (or refund) back from
Stripe and applies what it says now: the organisation’s plan (from the price’s
metadata opdns_plan), free when the subscription ended, and the dunning grace
while it is past due. Other events are acknowledged and ignored. A 5xx or 429
answer makes Stripe deliver again. Public (the signature is the authentication)
and rate limited per client IP; 404 while billing is off.
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”A Stripe event (https://docs.stripe.com/api/events/object).
object
object
Example
{ "id": "evt_1SXa1b2c3d4e5f6g7h8i9j0k", "object": "event", "type": "customer.subscription.updated", "created": 1791460800, "livemode": false, "api_version": "2026-09-30.endive", "data": { "object": { "id": "sub_1SXa1b2c3d4e5f6g7h8i9j0k", "object": "subscription", "status": "active", "customer": "cus_T7a1b2c3d4e5f6" } }}Responses
Section titled “Responses”Received (applied, a duplicate, or ignored).
object
Example
{ "result": "applied"}Malformed request.
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
The plan limit a plan_limit problem hit.
object
The plan’s value of the limit.
Where to move to a larger plan.
The scope the API token lacked (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/bad_request", "title": "Bad Request", "status": 400, "code": "bad_request", "detail": "We couldn't read the request because its JSON isn't valid (unexpected end of JSON input). Please fix it and try again.", "request_id": "5f2c9a0e7b1d4c38"}Not found (also for resources of another organisation).
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
The plan limit a plan_limit problem hit.
object
The plan’s value of the limit.
Where to move to a larger plan.
The scope the API token lacked (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/not_found", "title": "Not Found", "status": 404, "code": "not_found", "detail": "We couldn't find that. It may have been deleted, or the link may be wrong.", "request_id": "5f2c9a0e7b1d4c38"}Malformed request.
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
The plan limit a plan_limit problem hit.
object
The plan’s value of the limit.
Where to move to a larger plan.
The scope the API token lacked (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/bad_request", "title": "Bad Request", "status": 400, "code": "bad_request", "detail": "We couldn't read the request because its JSON isn't valid (unexpected end of JSON input). Please fix it and try again.", "request_id": "5f2c9a0e7b1d4c38"}Rate limited (rate_limited). For an API token, the organisation’s plan rate is spent until RateLimit-Reset.
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
The plan limit a plan_limit problem hit.
object
The plan’s value of the limit.
Where to move to a larger plan.
The scope the API token lacked (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/rate_limited", "title": "Too Many Requests", "status": 429, "code": "rate_limited", "detail": "Too many requests in a short time. Please wait a moment, then try again.", "request_id": "5f2c9a0e7b1d4c38", "retry_after": 6}Headers
Section titled “Headers”On every response to an API token: the organisation’s plan rate, requests per one-minute window (api_requests_per_minute).
On every response to an API token: the requests left to the organisation in the current window.
On every response to an API token: seconds until the current window ends and the count resets.
On every response to an API token: the quota policy, <limit>;w=60.
The payment provider (Stripe) failed or did not answer.
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
The plan limit a plan_limit problem hit.
object
The plan’s value of the limit.
Where to move to a larger plan.
The scope the API token lacked (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/billing_provider_error", "title": "Bad Gateway", "status": 502, "code": "billing_provider_error", "detail": "Our payment provider isn't responding right now. This isn't a problem with your account. Please try again in a minute."}