Receive and process Stripe webhook events
curl --request POST \
--url https://api.decimal.ai/api/v1/webhooks/stripe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"type": "<string>",
"created": 123,
"data": {},
"livemode": false
}
'import requests
url = "https://api.decimal.ai/api/v1/webhooks/stripe"
payload = {
"id": "<string>",
"type": "<string>",
"created": 123,
"data": {},
"livemode": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>', type: '<string>', created: 123, data: {}, livemode: false})
};
fetch('https://api.decimal.ai/api/v1/webhooks/stripe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.decimal.ai/api/v1/webhooks/stripe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>',
'type' => '<string>',
'created' => 123,
'data' => [
],
'livemode' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.decimal.ai/api/v1/webhooks/stripe"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"created\": 123,\n \"data\": {},\n \"livemode\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.decimal.ai/api/v1/webhooks/stripe")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"created\": 123,\n \"data\": {},\n \"livemode\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/webhooks/stripe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"created\": 123,\n \"data\": {},\n \"livemode\": false\n}"
response = http.request(request)
puts response.read_bodywebhooks
Receive and process Stripe webhook events
Receive and process Stripe webhook events.
Verifies the Stripe signature (HMAC-SHA256 + replay protection via
timestamp tolerance), then dispatches to the appropriate handler via
stripe_service.dispatch_event. A handler failure returns 5xx so
Stripe retries (idempotency claims make the retry safe); success
returns 200.
NOTE: This route and POST /api/v1/billing/webhook share the same
dispatcher and behave identically. Configure exactly ONE of them as
your Stripe webhook URL; the other is preserved for compatibility.
POST
/
api
/
v1
/
webhooks
/
stripe
Receive and process Stripe webhook events
curl --request POST \
--url https://api.decimal.ai/api/v1/webhooks/stripe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"type": "<string>",
"created": 123,
"data": {},
"livemode": false
}
'import requests
url = "https://api.decimal.ai/api/v1/webhooks/stripe"
payload = {
"id": "<string>",
"type": "<string>",
"created": 123,
"data": {},
"livemode": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '<string>', type: '<string>', created: 123, data: {}, livemode: false})
};
fetch('https://api.decimal.ai/api/v1/webhooks/stripe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.decimal.ai/api/v1/webhooks/stripe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>',
'type' => '<string>',
'created' => 123,
'data' => [
],
'livemode' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.decimal.ai/api/v1/webhooks/stripe"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"created\": 123,\n \"data\": {},\n \"livemode\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.decimal.ai/api/v1/webhooks/stripe")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"created\": 123,\n \"data\": {},\n \"livemode\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/webhooks/stripe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"created\": 123,\n \"data\": {},\n \"livemode\": false\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Enter your API key (e.g. dai_sk_test_key_001)
Body
application/json
Stripe webhook event envelope.
https://stripe.com/docs/api/events/object — abbreviated to the fields DecimalAI actually inspects.
Response
Successful Response