Stripe webhook
curl --request POST \
--url http://localhost:8000/api/stripe/webhook \
--header 'Stripe-Signature: <stripe-signature>'import requests
url = "http://localhost:8000/api/stripe/webhook"
headers = {"Stripe-Signature": "<stripe-signature>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Stripe-Signature': '<stripe-signature>'}};
fetch('http://localhost:8000/api/stripe/webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/stripe/webhook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Stripe-Signature: <stripe-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/stripe/webhook"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Stripe-Signature", "<stripe-signature>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/api/stripe/webhook")
.header("Stripe-Signature", "<stripe-signature>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/stripe/webhook")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Stripe-Signature"] = '<stripe-signature>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Event processed"
}
Billing
Stripe Webhook
Receive and process Stripe subscription lifecycle events.
POST
/
api
/
stripe
/
webhook
Stripe webhook
curl --request POST \
--url http://localhost:8000/api/stripe/webhook \
--header 'Stripe-Signature: <stripe-signature>'import requests
url = "http://localhost:8000/api/stripe/webhook"
headers = {"Stripe-Signature": "<stripe-signature>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Stripe-Signature': '<stripe-signature>'}};
fetch('http://localhost:8000/api/stripe/webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/stripe/webhook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Stripe-Signature: <stripe-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/stripe/webhook"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Stripe-Signature", "<stripe-signature>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/api/stripe/webhook")
.header("Stripe-Signature", "<stripe-signature>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/stripe/webhook")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Stripe-Signature"] = '<stripe-signature>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Event processed"
}
POST
/api/stripe/webhook
Do not call this endpoint directly. It is intended only for Stripe’s webhook delivery system. Configure the webhook URL in your Stripe Dashboard under Developers → Webhooks.
Handled Events
| Event | Action |
|---|---|
customer.subscription.created | Activate plan, set credit limits |
customer.subscription.updated | Update plan details and limits |
customer.subscription.deleted | Downgrade to free, revoke permissions |
invoice.payment_succeeded | Reset monthly credit counters |
invoice.payment_failed | Mark subscription as past_due |
Headers
string
required
HMAC signature from Stripe for payload verification. Format:
t=timestamp,v1=signature.Response
boolean
true when the event was processed successfully.{
"success": true,
"message": "Event processed"
}
Headers
Response
Event processed
Was this page helpful?