[{"data":1,"prerenderedAt":1345},["ShallowReactive",2],{"content-query-fqVLPle7Dd":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"layout":10,"author":11,"tags":12,"categories":17,"date":19,"faq":20,"image":36,"body":37,"_type":1338,"_id":1339,"_source":1340,"_file":1341,"_stem":1342,"_extension":1343,"sitemap":1344},"/blog/stripe-webhook-to-slack","blog",false,"","Send Stripe Webhooks to Slack Without a Server (JavaScript Function)","Turn Stripe webhooks into Slack messages without a backend: point Stripe at a Webhook Relay endpoint, attach a 20-line JavaScript function that builds the Slack payload, and forward to the Slack incoming webhook.","post","Karolis Rusenas",[13,14,15,16],"stripe","slack","transform","webhooks",[18],"integrations","2026-09-08 09:30:00",[21,24,27,30,33],{"q":22,"a":23},"How do I send Stripe webhooks to Slack without writing a backend?","Create a Slack incoming webhook URL, create a Webhook Relay endpoint that forwards to it, and attach a JavaScript function that reads the Stripe event and sets the body to Slack's message format. Point Stripe's webhook endpoint at the Webhook Relay URL. Every matching Stripe event then appears in the Slack channel, with no server, Lambda or Zap to maintain.",{"q":25,"a":26},"Why can't Stripe post directly to a Slack incoming webhook?","Slack incoming webhooks only accept their own JSON shape, a text string or a blocks array. Stripe sends an event object with type, data.object and other fields, so Slack rejects it. Something in the middle must rebuild the payload; that is what the transformation function does.",{"q":28,"a":29},"Can I filter which Stripe events reach Slack?","Yes. In the function, check event.type and call r.stopForwarding() for anything you do not want, or configure only the events you need on the Stripe side. Typical choices are payment_intent.succeeded, invoice.paid, invoice.payment_failed and customer.subscription.deleted.",{"q":31,"a":32},"Does this verify the Stripe signature?","It can. Functions can read the Stripe-Signature header and verify the HMAC using the signing secret stored as a Webhook Relay secret, dropping requests that fail. The example keeps the function short; the verify-webhook-signature guide shows the HMAC check to add.",{"q":34,"a":35},"Can the same Stripe webhook also go to my own backend?","Yes. Add a second output on the same bucket pointing at your API, with or without a transformation. Webhook Relay fans one incoming Stripe event out to every output, including localhost or a private server through the relay agent.","/images/blog/heroes/route.jpg",{"type":38,"children":39,"toc":1329},"root",[40,50,79,108,115,154,160,181,187,199,1175,1188,1201,1207,1234,1240,1277,1283,1304,1310,1323],{"type":41,"tag":42,"props":43,"children":44},"element","p",{},[45],{"type":41,"tag":46,"props":47,"children":49},"img",{"alt":48,"src":36},"Send Stripe webhooks to Slack without a server",[],{"type":41,"tag":42,"props":51,"children":52},{},[53,60,62,69,71,77],{"type":41,"tag":54,"props":55,"children":56},"strong",{},[57],{"type":58,"value":59},"text","Stripe webhooks can post straight into Slack if something rebuilds the payload on the way",{"type":58,"value":61},": Stripe sends an event object, Slack's incoming webhook only accepts ",{"type":41,"tag":63,"props":64,"children":66},"code",{"className":65},[],[67],{"type":58,"value":68},"{ \"text\": \"...\" }",{"type":58,"value":70}," or a ",{"type":41,"tag":63,"props":72,"children":74},{"className":73},[],[75],{"type":58,"value":76},"blocks",{"type":58,"value":78}," array. Webhook Relay does the rebuild with a small JavaScript function that runs on every request, so there is no backend to deploy. Setup takes about ten minutes.",{"type":41,"tag":80,"props":81,"children":84},"pre",{"className":82,"code":83,"language":58,"meta":7,"style":7},"language-text shiki shiki-themes github-dark","Stripe  ──▶  Webhook Relay endpoint  ──▶  JavaScript function  ──▶  Slack incoming webhook\n(event)       (permanent public URL)       (event → Slack message)    (message in channel)\n",[85],{"type":41,"tag":63,"props":86,"children":87},{"__ignoreMap":7},[88,99],{"type":41,"tag":89,"props":90,"children":93},"span",{"class":91,"line":92},"line",1,[94],{"type":41,"tag":89,"props":95,"children":96},{},[97],{"type":58,"value":98},"Stripe  ──▶  Webhook Relay endpoint  ──▶  JavaScript function  ──▶  Slack incoming webhook\n",{"type":41,"tag":89,"props":100,"children":102},{"class":91,"line":101},2,[103],{"type":41,"tag":89,"props":104,"children":105},{},[106],{"type":58,"value":107},"(event)       (permanent public URL)       (event → Slack message)    (message in channel)\n",{"type":41,"tag":109,"props":110,"children":112},"h2",{"id":111},"step-1-get-a-slack-incoming-webhook-url",[113],{"type":58,"value":114},"Step 1: Get a Slack incoming webhook URL",{"type":41,"tag":42,"props":116,"children":117},{},[118,120,129,131,136,138,144,146,152],{"type":58,"value":119},"In Slack, create an app at ",{"type":41,"tag":121,"props":122,"children":126},"a",{"href":123,"rel":124},"https://api.slack.com/apps",[125],"nofollow",[127],{"type":58,"value":128},"api.slack.com/apps",{"type":58,"value":130},", enable ",{"type":41,"tag":54,"props":132,"children":133},{},[134],{"type":58,"value":135},"Incoming Webhooks",{"type":58,"value":137},", add one to the channel that should get payment notifications, and copy the URL. It looks like ",{"type":41,"tag":63,"props":139,"children":141},{"className":140},[],[142],{"type":58,"value":143},"https://hooks.slack.com/services/T000/B000/XXXX",{"type":58,"value":145},". Full walkthrough: ",{"type":41,"tag":121,"props":147,"children":149},{"href":148},"/blog/how-to-get-slack-webhook-url",[150],{"type":58,"value":151},"how to get a Slack webhook URL",{"type":58,"value":153},".",{"type":41,"tag":109,"props":155,"children":157},{"id":156},"step-2-create-the-webhook-relay-endpoint",[158],{"type":58,"value":159},"Step 2: Create the Webhook Relay endpoint",{"type":41,"tag":42,"props":161,"children":162},{},[163,165,172,174,179],{"type":58,"value":164},"Open ",{"type":41,"tag":121,"props":166,"children":169},{"href":167,"rel":168},"https://my.webhookrelay.com/new-public-destination",[125],[170],{"type":58,"value":171},"new public destination",{"type":58,"value":173},", paste the Slack URL as the destination, and note the ",{"type":41,"tag":54,"props":175,"children":176},{},[177],{"type":58,"value":178},"input URL",{"type":58,"value":180}," Webhook Relay gives you. That input URL is permanent; it is what you will hand to Stripe.",{"type":41,"tag":109,"props":182,"children":184},{"id":183},"step-3-add-the-transformation-function",[185],{"type":58,"value":186},"Step 3: Add the transformation function",{"type":41,"tag":42,"props":188,"children":189},{},[190,192,197],{"type":58,"value":191},"On the output that points at Slack, choose ",{"type":41,"tag":54,"props":193,"children":194},{},[195],{"type":58,"value":196},"Transform",{"type":58,"value":198}," and create a function with this JavaScript:",{"type":41,"tag":80,"props":200,"children":204},{"className":201,"code":202,"language":203,"meta":7,"style":7},"language-javascript shiki shiki-themes github-dark","// Stripe event → Slack message\nconst event = JSON.parse(r.body)\nconst obj = event.data && event.data.object ? event.data.object : {}\n\n// Only forward the events we care about; drop the rest silently.\nconst wanted = {\n  \"payment_intent.succeeded\": \"💰 Payment received\",\n  \"invoice.paid\": \"🧾 Invoice paid\",\n  \"invoice.payment_failed\": \"⚠️ Invoice payment failed\",\n  \"customer.subscription.created\": \"🎉 New subscription\",\n  \"customer.subscription.deleted\": \"👋 Subscription cancelled\",\n}\nconst headline = wanted[event.type]\nif (!headline) {\n  r.stopForwarding()\n  return\n}\n\nconst amount = obj.amount_paid ?? obj.amount_received ?? obj.amount ?? null\nconst currency = (obj.currency || \"\").toUpperCase()\nconst money = amount === null ? \"\" : ` — ${(amount / 100).toFixed(2)} ${currency}`\nconst customer = obj.customer_email || obj.customer || \"unknown customer\"\nconst mode = event.livemode ? \"\" : \" (test mode)\"\n\nr.setBody(JSON.stringify({\n  blocks: [\n    {\n      type: \"section\",\n      text: {\n        type: \"mrkdwn\",\n        text: `*${headline}${money}*${mode}\\n${customer} · \\`${event.type}\\` · \u003Chttps://dashboard.stripe.com/events/${event.id}|open in Stripe>`,\n      },\n    },\n  ],\n}))\nr.setHeader(\"Content-Type\", \"application/json\")\nr.setMethod(\"POST\")\n","javascript",[205],{"type":41,"tag":63,"props":206,"children":207},{"__ignoreMap":7},[208,217,258,309,319,328,350,375,397,419,441,463,472,494,518,537,546,554,562,612,658,767,807,846,854,891,900,909,927,936,954,1076,1085,1094,1103,1112,1149],{"type":41,"tag":89,"props":209,"children":210},{"class":91,"line":92},[211],{"type":41,"tag":89,"props":212,"children":214},{"style":213},"--shiki-default:#6A737D",[215],{"type":58,"value":216},"// Stripe event → Slack message\n",{"type":41,"tag":89,"props":218,"children":219},{"class":91,"line":101},[220,226,232,237,242,247,253],{"type":41,"tag":89,"props":221,"children":223},{"style":222},"--shiki-default:#F97583",[224],{"type":58,"value":225},"const",{"type":41,"tag":89,"props":227,"children":229},{"style":228},"--shiki-default:#79B8FF",[230],{"type":58,"value":231}," event",{"type":41,"tag":89,"props":233,"children":234},{"style":222},[235],{"type":58,"value":236}," =",{"type":41,"tag":89,"props":238,"children":239},{"style":228},[240],{"type":58,"value":241}," JSON",{"type":41,"tag":89,"props":243,"children":245},{"style":244},"--shiki-default:#E1E4E8",[246],{"type":58,"value":153},{"type":41,"tag":89,"props":248,"children":250},{"style":249},"--shiki-default:#B392F0",[251],{"type":58,"value":252},"parse",{"type":41,"tag":89,"props":254,"children":255},{"style":244},[256],{"type":58,"value":257},"(r.body)\n",{"type":41,"tag":89,"props":259,"children":261},{"class":91,"line":260},3,[262,266,271,275,280,285,290,295,299,304],{"type":41,"tag":89,"props":263,"children":264},{"style":222},[265],{"type":58,"value":225},{"type":41,"tag":89,"props":267,"children":268},{"style":228},[269],{"type":58,"value":270}," obj",{"type":41,"tag":89,"props":272,"children":273},{"style":222},[274],{"type":58,"value":236},{"type":41,"tag":89,"props":276,"children":277},{"style":244},[278],{"type":58,"value":279}," event.data ",{"type":41,"tag":89,"props":281,"children":282},{"style":222},[283],{"type":58,"value":284},"&&",{"type":41,"tag":89,"props":286,"children":287},{"style":244},[288],{"type":58,"value":289}," event.data.object ",{"type":41,"tag":89,"props":291,"children":292},{"style":222},[293],{"type":58,"value":294},"?",{"type":41,"tag":89,"props":296,"children":297},{"style":244},[298],{"type":58,"value":289},{"type":41,"tag":89,"props":300,"children":301},{"style":222},[302],{"type":58,"value":303},":",{"type":41,"tag":89,"props":305,"children":306},{"style":244},[307],{"type":58,"value":308}," {}\n",{"type":41,"tag":89,"props":310,"children":312},{"class":91,"line":311},4,[313],{"type":41,"tag":89,"props":314,"children":316},{"emptyLinePlaceholder":315},true,[317],{"type":58,"value":318},"\n",{"type":41,"tag":89,"props":320,"children":322},{"class":91,"line":321},5,[323],{"type":41,"tag":89,"props":324,"children":325},{"style":213},[326],{"type":58,"value":327},"// Only forward the events we care about; drop the rest silently.\n",{"type":41,"tag":89,"props":329,"children":331},{"class":91,"line":330},6,[332,336,341,345],{"type":41,"tag":89,"props":333,"children":334},{"style":222},[335],{"type":58,"value":225},{"type":41,"tag":89,"props":337,"children":338},{"style":228},[339],{"type":58,"value":340}," wanted",{"type":41,"tag":89,"props":342,"children":343},{"style":222},[344],{"type":58,"value":236},{"type":41,"tag":89,"props":346,"children":347},{"style":244},[348],{"type":58,"value":349}," {\n",{"type":41,"tag":89,"props":351,"children":353},{"class":91,"line":352},7,[354,360,365,370],{"type":41,"tag":89,"props":355,"children":357},{"style":356},"--shiki-default:#9ECBFF",[358],{"type":58,"value":359},"  \"payment_intent.succeeded\"",{"type":41,"tag":89,"props":361,"children":362},{"style":244},[363],{"type":58,"value":364},": ",{"type":41,"tag":89,"props":366,"children":367},{"style":356},[368],{"type":58,"value":369},"\"💰 Payment received\"",{"type":41,"tag":89,"props":371,"children":372},{"style":244},[373],{"type":58,"value":374},",\n",{"type":41,"tag":89,"props":376,"children":378},{"class":91,"line":377},8,[379,384,388,393],{"type":41,"tag":89,"props":380,"children":381},{"style":356},[382],{"type":58,"value":383},"  \"invoice.paid\"",{"type":41,"tag":89,"props":385,"children":386},{"style":244},[387],{"type":58,"value":364},{"type":41,"tag":89,"props":389,"children":390},{"style":356},[391],{"type":58,"value":392},"\"🧾 Invoice paid\"",{"type":41,"tag":89,"props":394,"children":395},{"style":244},[396],{"type":58,"value":374},{"type":41,"tag":89,"props":398,"children":400},{"class":91,"line":399},9,[401,406,410,415],{"type":41,"tag":89,"props":402,"children":403},{"style":356},[404],{"type":58,"value":405},"  \"invoice.payment_failed\"",{"type":41,"tag":89,"props":407,"children":408},{"style":244},[409],{"type":58,"value":364},{"type":41,"tag":89,"props":411,"children":412},{"style":356},[413],{"type":58,"value":414},"\"⚠️ Invoice payment failed\"",{"type":41,"tag":89,"props":416,"children":417},{"style":244},[418],{"type":58,"value":374},{"type":41,"tag":89,"props":420,"children":422},{"class":91,"line":421},10,[423,428,432,437],{"type":41,"tag":89,"props":424,"children":425},{"style":356},[426],{"type":58,"value":427},"  \"customer.subscription.created\"",{"type":41,"tag":89,"props":429,"children":430},{"style":244},[431],{"type":58,"value":364},{"type":41,"tag":89,"props":433,"children":434},{"style":356},[435],{"type":58,"value":436},"\"🎉 New subscription\"",{"type":41,"tag":89,"props":438,"children":439},{"style":244},[440],{"type":58,"value":374},{"type":41,"tag":89,"props":442,"children":444},{"class":91,"line":443},11,[445,450,454,459],{"type":41,"tag":89,"props":446,"children":447},{"style":356},[448],{"type":58,"value":449},"  \"customer.subscription.deleted\"",{"type":41,"tag":89,"props":451,"children":452},{"style":244},[453],{"type":58,"value":364},{"type":41,"tag":89,"props":455,"children":456},{"style":356},[457],{"type":58,"value":458},"\"👋 Subscription cancelled\"",{"type":41,"tag":89,"props":460,"children":461},{"style":244},[462],{"type":58,"value":374},{"type":41,"tag":89,"props":464,"children":466},{"class":91,"line":465},12,[467],{"type":41,"tag":89,"props":468,"children":469},{"style":244},[470],{"type":58,"value":471},"}\n",{"type":41,"tag":89,"props":473,"children":475},{"class":91,"line":474},13,[476,480,485,489],{"type":41,"tag":89,"props":477,"children":478},{"style":222},[479],{"type":58,"value":225},{"type":41,"tag":89,"props":481,"children":482},{"style":228},[483],{"type":58,"value":484}," headline",{"type":41,"tag":89,"props":486,"children":487},{"style":222},[488],{"type":58,"value":236},{"type":41,"tag":89,"props":490,"children":491},{"style":244},[492],{"type":58,"value":493}," wanted[event.type]\n",{"type":41,"tag":89,"props":495,"children":497},{"class":91,"line":496},14,[498,503,508,513],{"type":41,"tag":89,"props":499,"children":500},{"style":222},[501],{"type":58,"value":502},"if",{"type":41,"tag":89,"props":504,"children":505},{"style":244},[506],{"type":58,"value":507}," (",{"type":41,"tag":89,"props":509,"children":510},{"style":222},[511],{"type":58,"value":512},"!",{"type":41,"tag":89,"props":514,"children":515},{"style":244},[516],{"type":58,"value":517},"headline) {\n",{"type":41,"tag":89,"props":519,"children":521},{"class":91,"line":520},15,[522,527,532],{"type":41,"tag":89,"props":523,"children":524},{"style":244},[525],{"type":58,"value":526},"  r.",{"type":41,"tag":89,"props":528,"children":529},{"style":249},[530],{"type":58,"value":531},"stopForwarding",{"type":41,"tag":89,"props":533,"children":534},{"style":244},[535],{"type":58,"value":536},"()\n",{"type":41,"tag":89,"props":538,"children":540},{"class":91,"line":539},16,[541],{"type":41,"tag":89,"props":542,"children":543},{"style":222},[544],{"type":58,"value":545},"  return\n",{"type":41,"tag":89,"props":547,"children":549},{"class":91,"line":548},17,[550],{"type":41,"tag":89,"props":551,"children":552},{"style":244},[553],{"type":58,"value":471},{"type":41,"tag":89,"props":555,"children":557},{"class":91,"line":556},18,[558],{"type":41,"tag":89,"props":559,"children":560},{"emptyLinePlaceholder":315},[561],{"type":58,"value":318},{"type":41,"tag":89,"props":563,"children":565},{"class":91,"line":564},19,[566,570,575,579,584,589,594,598,603,607],{"type":41,"tag":89,"props":567,"children":568},{"style":222},[569],{"type":58,"value":225},{"type":41,"tag":89,"props":571,"children":572},{"style":228},[573],{"type":58,"value":574}," amount",{"type":41,"tag":89,"props":576,"children":577},{"style":222},[578],{"type":58,"value":236},{"type":41,"tag":89,"props":580,"children":581},{"style":244},[582],{"type":58,"value":583}," obj.amount_paid ",{"type":41,"tag":89,"props":585,"children":586},{"style":222},[587],{"type":58,"value":588},"??",{"type":41,"tag":89,"props":590,"children":591},{"style":244},[592],{"type":58,"value":593}," obj.amount_received ",{"type":41,"tag":89,"props":595,"children":596},{"style":222},[597],{"type":58,"value":588},{"type":41,"tag":89,"props":599,"children":600},{"style":244},[601],{"type":58,"value":602}," obj.amount ",{"type":41,"tag":89,"props":604,"children":605},{"style":222},[606],{"type":58,"value":588},{"type":41,"tag":89,"props":608,"children":609},{"style":228},[610],{"type":58,"value":611}," null\n",{"type":41,"tag":89,"props":613,"children":615},{"class":91,"line":614},20,[616,620,625,629,634,639,644,649,654],{"type":41,"tag":89,"props":617,"children":618},{"style":222},[619],{"type":58,"value":225},{"type":41,"tag":89,"props":621,"children":622},{"style":228},[623],{"type":58,"value":624}," currency",{"type":41,"tag":89,"props":626,"children":627},{"style":222},[628],{"type":58,"value":236},{"type":41,"tag":89,"props":630,"children":631},{"style":244},[632],{"type":58,"value":633}," (obj.currency ",{"type":41,"tag":89,"props":635,"children":636},{"style":222},[637],{"type":58,"value":638},"||",{"type":41,"tag":89,"props":640,"children":641},{"style":356},[642],{"type":58,"value":643}," \"\"",{"type":41,"tag":89,"props":645,"children":646},{"style":244},[647],{"type":58,"value":648},").",{"type":41,"tag":89,"props":650,"children":651},{"style":249},[652],{"type":58,"value":653},"toUpperCase",{"type":41,"tag":89,"props":655,"children":656},{"style":244},[657],{"type":58,"value":536},{"type":41,"tag":89,"props":659,"children":661},{"class":91,"line":660},21,[662,666,671,675,680,685,690,695,699,704,709,714,719,724,729,733,738,742,747,752,757,762],{"type":41,"tag":89,"props":663,"children":664},{"style":222},[665],{"type":58,"value":225},{"type":41,"tag":89,"props":667,"children":668},{"style":228},[669],{"type":58,"value":670}," money",{"type":41,"tag":89,"props":672,"children":673},{"style":222},[674],{"type":58,"value":236},{"type":41,"tag":89,"props":676,"children":677},{"style":244},[678],{"type":58,"value":679}," amount ",{"type":41,"tag":89,"props":681,"children":682},{"style":222},[683],{"type":58,"value":684},"===",{"type":41,"tag":89,"props":686,"children":687},{"style":228},[688],{"type":58,"value":689}," null",{"type":41,"tag":89,"props":691,"children":692},{"style":222},[693],{"type":58,"value":694}," ?",{"type":41,"tag":89,"props":696,"children":697},{"style":356},[698],{"type":58,"value":643},{"type":41,"tag":89,"props":700,"children":701},{"style":222},[702],{"type":58,"value":703}," :",{"type":41,"tag":89,"props":705,"children":706},{"style":356},[707],{"type":58,"value":708}," ` — ${",{"type":41,"tag":89,"props":710,"children":711},{"style":356},[712],{"type":58,"value":713},"(",{"type":41,"tag":89,"props":715,"children":716},{"style":244},[717],{"type":58,"value":718},"amount",{"type":41,"tag":89,"props":720,"children":721},{"style":222},[722],{"type":58,"value":723}," /",{"type":41,"tag":89,"props":725,"children":726},{"style":228},[727],{"type":58,"value":728}," 100",{"type":41,"tag":89,"props":730,"children":731},{"style":356},[732],{"type":58,"value":648},{"type":41,"tag":89,"props":734,"children":735},{"style":249},[736],{"type":58,"value":737},"toFixed",{"type":41,"tag":89,"props":739,"children":740},{"style":356},[741],{"type":58,"value":713},{"type":41,"tag":89,"props":743,"children":744},{"style":228},[745],{"type":58,"value":746},"2",{"type":41,"tag":89,"props":748,"children":749},{"style":356},[750],{"type":58,"value":751},")",{"type":41,"tag":89,"props":753,"children":754},{"style":356},[755],{"type":58,"value":756},"} ${",{"type":41,"tag":89,"props":758,"children":759},{"style":244},[760],{"type":58,"value":761},"currency",{"type":41,"tag":89,"props":763,"children":764},{"style":356},[765],{"type":58,"value":766},"}`\n",{"type":41,"tag":89,"props":768,"children":770},{"class":91,"line":769},22,[771,775,780,784,789,793,798,802],{"type":41,"tag":89,"props":772,"children":773},{"style":222},[774],{"type":58,"value":225},{"type":41,"tag":89,"props":776,"children":777},{"style":228},[778],{"type":58,"value":779}," customer",{"type":41,"tag":89,"props":781,"children":782},{"style":222},[783],{"type":58,"value":236},{"type":41,"tag":89,"props":785,"children":786},{"style":244},[787],{"type":58,"value":788}," obj.customer_email ",{"type":41,"tag":89,"props":790,"children":791},{"style":222},[792],{"type":58,"value":638},{"type":41,"tag":89,"props":794,"children":795},{"style":244},[796],{"type":58,"value":797}," obj.customer ",{"type":41,"tag":89,"props":799,"children":800},{"style":222},[801],{"type":58,"value":638},{"type":41,"tag":89,"props":803,"children":804},{"style":356},[805],{"type":58,"value":806}," \"unknown customer\"\n",{"type":41,"tag":89,"props":808,"children":810},{"class":91,"line":809},23,[811,815,820,824,829,833,837,841],{"type":41,"tag":89,"props":812,"children":813},{"style":222},[814],{"type":58,"value":225},{"type":41,"tag":89,"props":816,"children":817},{"style":228},[818],{"type":58,"value":819}," mode",{"type":41,"tag":89,"props":821,"children":822},{"style":222},[823],{"type":58,"value":236},{"type":41,"tag":89,"props":825,"children":826},{"style":244},[827],{"type":58,"value":828}," event.livemode ",{"type":41,"tag":89,"props":830,"children":831},{"style":222},[832],{"type":58,"value":294},{"type":41,"tag":89,"props":834,"children":835},{"style":356},[836],{"type":58,"value":643},{"type":41,"tag":89,"props":838,"children":839},{"style":222},[840],{"type":58,"value":703},{"type":41,"tag":89,"props":842,"children":843},{"style":356},[844],{"type":58,"value":845}," \" (test mode)\"\n",{"type":41,"tag":89,"props":847,"children":849},{"class":91,"line":848},24,[850],{"type":41,"tag":89,"props":851,"children":852},{"emptyLinePlaceholder":315},[853],{"type":58,"value":318},{"type":41,"tag":89,"props":855,"children":857},{"class":91,"line":856},25,[858,863,868,872,877,881,886],{"type":41,"tag":89,"props":859,"children":860},{"style":244},[861],{"type":58,"value":862},"r.",{"type":41,"tag":89,"props":864,"children":865},{"style":249},[866],{"type":58,"value":867},"setBody",{"type":41,"tag":89,"props":869,"children":870},{"style":244},[871],{"type":58,"value":713},{"type":41,"tag":89,"props":873,"children":874},{"style":228},[875],{"type":58,"value":876},"JSON",{"type":41,"tag":89,"props":878,"children":879},{"style":244},[880],{"type":58,"value":153},{"type":41,"tag":89,"props":882,"children":883},{"style":249},[884],{"type":58,"value":885},"stringify",{"type":41,"tag":89,"props":887,"children":888},{"style":244},[889],{"type":58,"value":890},"({\n",{"type":41,"tag":89,"props":892,"children":894},{"class":91,"line":893},26,[895],{"type":41,"tag":89,"props":896,"children":897},{"style":244},[898],{"type":58,"value":899},"  blocks: [\n",{"type":41,"tag":89,"props":901,"children":903},{"class":91,"line":902},27,[904],{"type":41,"tag":89,"props":905,"children":906},{"style":244},[907],{"type":58,"value":908},"    {\n",{"type":41,"tag":89,"props":910,"children":912},{"class":91,"line":911},28,[913,918,923],{"type":41,"tag":89,"props":914,"children":915},{"style":244},[916],{"type":58,"value":917},"      type: ",{"type":41,"tag":89,"props":919,"children":920},{"style":356},[921],{"type":58,"value":922},"\"section\"",{"type":41,"tag":89,"props":924,"children":925},{"style":244},[926],{"type":58,"value":374},{"type":41,"tag":89,"props":928,"children":930},{"class":91,"line":929},29,[931],{"type":41,"tag":89,"props":932,"children":933},{"style":244},[934],{"type":58,"value":935},"      text: {\n",{"type":41,"tag":89,"props":937,"children":939},{"class":91,"line":938},30,[940,945,950],{"type":41,"tag":89,"props":941,"children":942},{"style":244},[943],{"type":58,"value":944},"        type: ",{"type":41,"tag":89,"props":946,"children":947},{"style":356},[948],{"type":58,"value":949},"\"mrkdwn\"",{"type":41,"tag":89,"props":951,"children":952},{"style":244},[953],{"type":58,"value":374},{"type":41,"tag":89,"props":955,"children":957},{"class":91,"line":956},31,[958,963,968,973,978,983,988,993,998,1003,1008,1013,1018,1023,1027,1032,1036,1041,1045,1049,1054,1058,1062,1067,1072],{"type":41,"tag":89,"props":959,"children":960},{"style":244},[961],{"type":58,"value":962},"        text: ",{"type":41,"tag":89,"props":964,"children":965},{"style":356},[966],{"type":58,"value":967},"`*${",{"type":41,"tag":89,"props":969,"children":970},{"style":244},[971],{"type":58,"value":972},"headline",{"type":41,"tag":89,"props":974,"children":975},{"style":356},[976],{"type":58,"value":977},"}${",{"type":41,"tag":89,"props":979,"children":980},{"style":244},[981],{"type":58,"value":982},"money",{"type":41,"tag":89,"props":984,"children":985},{"style":356},[986],{"type":58,"value":987},"}*${",{"type":41,"tag":89,"props":989,"children":990},{"style":244},[991],{"type":58,"value":992},"mode",{"type":41,"tag":89,"props":994,"children":995},{"style":356},[996],{"type":58,"value":997},"}",{"type":41,"tag":89,"props":999,"children":1000},{"style":228},[1001],{"type":58,"value":1002},"\\n",{"type":41,"tag":89,"props":1004,"children":1005},{"style":356},[1006],{"type":58,"value":1007},"${",{"type":41,"tag":89,"props":1009,"children":1010},{"style":244},[1011],{"type":58,"value":1012},"customer",{"type":41,"tag":89,"props":1014,"children":1015},{"style":356},[1016],{"type":58,"value":1017},"} · ",{"type":41,"tag":89,"props":1019,"children":1020},{"style":228},[1021],{"type":58,"value":1022},"\\`",{"type":41,"tag":89,"props":1024,"children":1025},{"style":356},[1026],{"type":58,"value":1007},{"type":41,"tag":89,"props":1028,"children":1029},{"style":244},[1030],{"type":58,"value":1031},"event",{"type":41,"tag":89,"props":1033,"children":1034},{"style":356},[1035],{"type":58,"value":153},{"type":41,"tag":89,"props":1037,"children":1038},{"style":244},[1039],{"type":58,"value":1040},"type",{"type":41,"tag":89,"props":1042,"children":1043},{"style":356},[1044],{"type":58,"value":997},{"type":41,"tag":89,"props":1046,"children":1047},{"style":228},[1048],{"type":58,"value":1022},{"type":41,"tag":89,"props":1050,"children":1051},{"style":356},[1052],{"type":58,"value":1053}," · \u003Chttps://dashboard.stripe.com/events/${",{"type":41,"tag":89,"props":1055,"children":1056},{"style":244},[1057],{"type":58,"value":1031},{"type":41,"tag":89,"props":1059,"children":1060},{"style":356},[1061],{"type":58,"value":153},{"type":41,"tag":89,"props":1063,"children":1064},{"style":244},[1065],{"type":58,"value":1066},"id",{"type":41,"tag":89,"props":1068,"children":1069},{"style":356},[1070],{"type":58,"value":1071},"}|open in Stripe>`",{"type":41,"tag":89,"props":1073,"children":1074},{"style":244},[1075],{"type":58,"value":374},{"type":41,"tag":89,"props":1077,"children":1079},{"class":91,"line":1078},32,[1080],{"type":41,"tag":89,"props":1081,"children":1082},{"style":244},[1083],{"type":58,"value":1084},"      },\n",{"type":41,"tag":89,"props":1086,"children":1088},{"class":91,"line":1087},33,[1089],{"type":41,"tag":89,"props":1090,"children":1091},{"style":244},[1092],{"type":58,"value":1093},"    },\n",{"type":41,"tag":89,"props":1095,"children":1097},{"class":91,"line":1096},34,[1098],{"type":41,"tag":89,"props":1099,"children":1100},{"style":244},[1101],{"type":58,"value":1102},"  ],\n",{"type":41,"tag":89,"props":1104,"children":1106},{"class":91,"line":1105},35,[1107],{"type":41,"tag":89,"props":1108,"children":1109},{"style":244},[1110],{"type":58,"value":1111},"}))\n",{"type":41,"tag":89,"props":1113,"children":1115},{"class":91,"line":1114},36,[1116,1120,1125,1129,1134,1139,1144],{"type":41,"tag":89,"props":1117,"children":1118},{"style":244},[1119],{"type":58,"value":862},{"type":41,"tag":89,"props":1121,"children":1122},{"style":249},[1123],{"type":58,"value":1124},"setHeader",{"type":41,"tag":89,"props":1126,"children":1127},{"style":244},[1128],{"type":58,"value":713},{"type":41,"tag":89,"props":1130,"children":1131},{"style":356},[1132],{"type":58,"value":1133},"\"Content-Type\"",{"type":41,"tag":89,"props":1135,"children":1136},{"style":244},[1137],{"type":58,"value":1138},", ",{"type":41,"tag":89,"props":1140,"children":1141},{"style":356},[1142],{"type":58,"value":1143},"\"application/json\"",{"type":41,"tag":89,"props":1145,"children":1146},{"style":244},[1147],{"type":58,"value":1148},")\n",{"type":41,"tag":89,"props":1150,"children":1152},{"class":91,"line":1151},37,[1153,1157,1162,1166,1171],{"type":41,"tag":89,"props":1154,"children":1155},{"style":244},[1156],{"type":58,"value":862},{"type":41,"tag":89,"props":1158,"children":1159},{"style":249},[1160],{"type":58,"value":1161},"setMethod",{"type":41,"tag":89,"props":1163,"children":1164},{"style":244},[1165],{"type":58,"value":713},{"type":41,"tag":89,"props":1167,"children":1168},{"style":356},[1169],{"type":58,"value":1170},"\"POST\"",{"type":41,"tag":89,"props":1172,"children":1173},{"style":244},[1174],{"type":58,"value":1148},{"type":41,"tag":42,"props":1176,"children":1177},{},[1178,1180,1186],{"type":58,"value":1179},"What it does: parses the Stripe event, drops anything not in the ",{"type":41,"tag":63,"props":1181,"children":1183},{"className":1182},[],[1184],{"type":58,"value":1185},"wanted",{"type":58,"value":1187}," map, formats the amount from cents, and sets the request body to a Slack Block Kit message. Webhook Relay then delivers that request to the Slack URL, retries it if Slack is briefly unavailable, and logs the delivery.",{"type":41,"tag":42,"props":1189,"children":1190},{},[1191,1193,1199],{"type":58,"value":1192},"Want a different message layout? Paste a sample Stripe event into the free ",{"type":41,"tag":121,"props":1194,"children":1196},{"href":1195},"/webhook-message-formatter",[1197],{"type":58,"value":1198},"webhook to Slack formatter",{"type":58,"value":1200},", design the message visually, and copy the generated function.",{"type":41,"tag":109,"props":1202,"children":1204},{"id":1203},"step-4-point-stripe-at-the-endpoint",[1205],{"type":58,"value":1206},"Step 4: Point Stripe at the endpoint",{"type":41,"tag":42,"props":1208,"children":1209},{},[1210,1212,1217,1219,1224,1226,1232],{"type":58,"value":1211},"In the Stripe dashboard go to ",{"type":41,"tag":54,"props":1213,"children":1214},{},[1215],{"type":58,"value":1216},"Developers → Webhooks → Add endpoint",{"type":58,"value":1218},", paste the Webhook Relay input URL, and select the events you listed in the function (or all events; the function filters). Save, then use ",{"type":41,"tag":54,"props":1220,"children":1221},{},[1222],{"type":58,"value":1223},"Send test event",{"type":58,"value":1225}," for ",{"type":41,"tag":63,"props":1227,"children":1229},{"className":1228},[],[1230],{"type":58,"value":1231},"payment_intent.succeeded",{"type":58,"value":1233},". The message appears in Slack within a second or two. If it does not, the request log in the Webhook Relay dashboard shows exactly what Stripe sent and what Slack answered.",{"type":41,"tag":109,"props":1235,"children":1237},{"id":1236},"optional-verify-the-stripe-signature",[1238],{"type":58,"value":1239},"Optional: verify the Stripe signature",{"type":41,"tag":42,"props":1241,"children":1242},{},[1243,1245,1251,1253,1259,1261,1267,1269,1275],{"type":58,"value":1244},"Stripe signs every webhook. To reject forged requests, store the endpoint's signing secret as a ",{"type":41,"tag":121,"props":1246,"children":1248},{"href":1247},"/docs/service-connections/secrets",[1249],{"type":58,"value":1250},"secret service connection",{"type":58,"value":1252},", read the ",{"type":41,"tag":63,"props":1254,"children":1256},{"className":1255},[],[1257],{"type":58,"value":1258},"Stripe-Signature",{"type":58,"value":1260}," header in the function, and compare the HMAC before building the message. The ",{"type":41,"tag":121,"props":1262,"children":1264},{"href":1263},"/blog/verify-webhook-signature",[1265],{"type":58,"value":1266},"webhook signature guide",{"type":58,"value":1268}," has the exact check; the ",{"type":41,"tag":121,"props":1270,"children":1272},{"href":1271},"/verify-stripe-webhook-signature",[1273],{"type":58,"value":1274},"free Stripe signature verifier",{"type":58,"value":1276}," helps you debug it against a captured payload.",{"type":41,"tag":109,"props":1278,"children":1280},{"id":1279},"also-deliver-the-event-to-your-own-app",[1281],{"type":58,"value":1282},"Also deliver the event to your own app",{"type":41,"tag":42,"props":1284,"children":1285},{},[1286,1288,1294,1296,1302],{"type":58,"value":1287},"The Slack message is usually a side channel. Add a second output on the same bucket that points at your API, a ",{"type":41,"tag":121,"props":1289,"children":1291},{"href":1290},"/docs/webhooks/functions/big-query",[1292],{"type":58,"value":1293},"BigQuery table",{"type":58,"value":1295},", or ",{"type":41,"tag":121,"props":1297,"children":1299},{"href":1298},"/webhooks",[1300],{"type":58,"value":1301},"your laptop during development",{"type":58,"value":1303},": every Stripe event is delivered to all of them, each with its own optional function.",{"type":41,"tag":109,"props":1305,"children":1307},{"id":1306},"alternatives",[1308],{"type":58,"value":1309},"Alternatives",{"type":41,"tag":42,"props":1311,"children":1312},{},[1313,1315,1321],{"type":58,"value":1314},"Stripe's own Slack app posts a fixed set of notifications with no customisation. Zapier and Make offer Stripe-to-Slack templates with per-task pricing. A Lambda or Cloudflare Worker gives full control if you want to host and operate it yourself. The comparison of ",{"type":41,"tag":121,"props":1316,"children":1318},{"href":1317},"/blog/webhook-transformation-tools",[1319],{"type":58,"value":1320},"webhook transformation tools",{"type":58,"value":1322}," covers when each makes sense.",{"type":41,"tag":1324,"props":1325,"children":1326},"style",{},[1327],{"type":58,"value":1328},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":260,"depth":260,"links":1330},[1331,1332,1333,1334,1335,1336,1337],{"id":111,"depth":101,"text":114},{"id":156,"depth":101,"text":159},{"id":183,"depth":101,"text":186},{"id":1203,"depth":101,"text":1206},{"id":1236,"depth":101,"text":1239},{"id":1279,"depth":101,"text":1282},{"id":1306,"depth":101,"text":1309},"markdown","content:blog:stripe-webhook-to-slack.md","content","blog/stripe-webhook-to-slack.md","blog/stripe-webhook-to-slack","md",{"loc":4},1788848875353]