[{"data":1,"prerenderedAt":2023},["ShallowReactive",2],{"navigation_docs":3,"-packages-javascript-webhooks":465,"-packages-javascript-webhooks-surround":2018},[4,8,62,115,450],{"title":5,"path":6,"stem":7},"Introduction","\u002Fintroduction","0.introduction",{"title":9,"path":10,"stem":11,"children":12,"page":61},"Guides","\u002Fguides","1.guides",[13,17,21,25,29,33,37,41,45,49,53,57],{"title":14,"path":15,"stem":16},"Quickstart","\u002Fguides\u002Fquickstart","1.guides\u002F1.quickstart",{"title":18,"path":19,"stem":20},"Payouts & Settlement","\u002Fguides\u002Fpayouts","1.guides\u002F10.payouts",{"title":22,"path":23,"stem":24},"Customer Emails","\u002Fguides\u002Fcustomer-emails","1.guides\u002F11.customer-emails",{"title":26,"path":27,"stem":28},"Build your own integration","\u002Fguides\u002Fbuild-your-own-integration","1.guides\u002F2.build-your-own-integration",{"title":30,"path":31,"stem":32},"Selling Workflow","\u002Fguides\u002Fselling-workflow","1.guides\u002F2.selling-workflow",{"title":34,"path":35,"stem":36},"Vatly SDKs","\u002Fguides\u002Fsdks","1.guides\u002F3.sdks",{"title":38,"path":39,"stem":40},"Authentication","\u002Fguides\u002Fauthentication","1.guides\u002F4.authentication",{"title":42,"path":43,"stem":44},"Pagination","\u002Fguides\u002Fpagination","1.guides\u002F5.pagination",{"title":46,"path":47,"stem":48},"Errors","\u002Fguides\u002Ferrors","1.guides\u002F6.errors",{"title":50,"path":51,"stem":52},"Webhooks","\u002Fguides\u002Fwebhooks","1.guides\u002F7.webhooks",{"title":54,"path":55,"stem":56},"Idempotency","\u002Fguides\u002Fidempotency","1.guides\u002F8.idempotency",{"title":58,"path":59,"stem":60},"Testing","\u002Fguides\u002Ftesting","1.guides\u002F9.testing",false,{"title":63,"path":64,"stem":65,"children":66,"page":61},"Api Reference","\u002Fapi-reference","2.api-reference",[67,71,75,79,83,87,91,95,99,103,107,111],{"title":68,"path":69,"stem":70},"Customers","\u002Fapi-reference\u002Fcustomers","2.api-reference\u002F1.customers",{"title":72,"path":73,"stem":74},"Webhook Endpoints","\u002Fapi-reference\u002Fwebhook-endpoints","2.api-reference\u002F10.webhook-endpoints",{"title":76,"path":77,"stem":78},"Test helpers","\u002Fapi-reference\u002Ftest-helpers","2.api-reference\u002F11.test-helpers",{"title":80,"path":81,"stem":82},"Checkouts","\u002Fapi-reference\u002Fcheckouts","2.api-reference\u002F2.checkouts",{"title":84,"path":85,"stem":86},"One-off Products","\u002Fapi-reference\u002Fone-off-products","2.api-reference\u002F3.one-off-products",{"title":88,"path":89,"stem":90},"Subscriptions","\u002Fapi-reference\u002Fsubscriptions","2.api-reference\u002F4.subscriptions",{"title":92,"path":93,"stem":94},"Subscription Plans","\u002Fapi-reference\u002Fsubscription-plans","2.api-reference\u002F5.subscription-plans",{"title":96,"path":97,"stem":98},"Orders","\u002Fapi-reference\u002Forders","2.api-reference\u002F6.orders",{"title":100,"path":101,"stem":102},"Order Refunds","\u002Fapi-reference\u002Frefunds","2.api-reference\u002F7.refunds",{"title":104,"path":105,"stem":106},"Refunds","\u002Fapi-reference\u002Fglobal-refunds","2.api-reference\u002F8.global-refunds",{"title":108,"path":109,"stem":110},"Chargebacks","\u002Fapi-reference\u002Fchargebacks","2.api-reference\u002F9.chargebacks",{"title":112,"path":113,"stem":114},"Webhook Events","\u002Fapi-reference\u002Fwebhook-events","2.api-reference\u002F99.webhook-events",{"title":116,"path":117,"stem":118,"children":119},"Packages","\u002Fpackages","3.packages",[120,122,164,210,244,283,318,366,408],{"title":116,"path":117,"stem":121},"3.packages\u002Findex",{"title":123,"path":124,"stem":125,"children":126,"page":61},"PHP SDK","\u002Fpackages\u002Fphp","3.packages\u002F1.php",[127,131,134,137,140,144,147,151,154,157,160],{"title":128,"path":129,"stem":130},"Getting started","\u002Fpackages\u002Fphp\u002Freadme","3.packages\u002F1.php\u002F00.readme",{"title":68,"path":132,"stem":133},"\u002Fpackages\u002Fphp\u002Fcustomers","3.packages\u002F1.php\u002F02.customers",{"title":80,"path":135,"stem":136},"\u002Fpackages\u002Fphp\u002Fcheckouts","3.packages\u002F1.php\u002F03.checkouts",{"title":88,"path":138,"stem":139},"\u002Fpackages\u002Fphp\u002Fsubscriptions","3.packages\u002F1.php\u002F04.subscriptions",{"title":141,"path":142,"stem":143},"Subscription plans","\u002Fpackages\u002Fphp\u002Fsubscriptionplans","3.packages\u002F1.php\u002F05.subscriptionplans",{"title":96,"path":145,"stem":146},"\u002Fpackages\u002Fphp\u002Forders","3.packages\u002F1.php\u002F06.orders",{"title":148,"path":149,"stem":150},"One-off products","\u002Fpackages\u002Fphp\u002Foneoffproducts","3.packages\u002F1.php\u002F07.oneoffproducts",{"title":104,"path":152,"stem":153},"\u002Fpackages\u002Fphp\u002Frefunds","3.packages\u002F1.php\u002F08.refunds",{"title":108,"path":155,"stem":156},"\u002Fpackages\u002Fphp\u002Fchargebacks","3.packages\u002F1.php\u002F09.chargebacks",{"title":50,"path":158,"stem":159},"\u002Fpackages\u002Fphp\u002Fwebhooks","3.packages\u002F1.php\u002F10.webhooks",{"title":161,"path":162,"stem":163},"Webhook URLs","\u002Fpackages\u002Fphp\u002Fwebhookendpoints","3.packages\u002F1.php\u002F11.webhookendpoints",{"title":165,"path":166,"stem":167,"children":168,"page":61},"PHP Fluent","\u002Fpackages\u002Ffluent-php","3.packages\u002F2.fluent-php",[169,172,176,180,183,186,189,192,196,199,203,207],{"title":128,"path":170,"stem":171},"\u002Fpackages\u002Ffluent-php\u002Freadme","3.packages\u002F2.fluent-php\u002F00.readme",{"title":173,"path":174,"stem":175},"Configuration","\u002Fpackages\u002Ffluent-php\u002Fconfiguration","3.packages\u002F2.fluent-php\u002F01.configuration",{"title":177,"path":178,"stem":179},"Core concepts","\u002Fpackages\u002Ffluent-php\u002Fcoreconcepts","3.packages\u002F2.fluent-php\u002F02.coreconcepts",{"title":68,"path":181,"stem":182},"\u002Fpackages\u002Ffluent-php\u002Fcustomers","3.packages\u002F2.fluent-php\u002F03.customers",{"title":80,"path":184,"stem":185},"\u002Fpackages\u002Ffluent-php\u002Fcheckouts","3.packages\u002F2.fluent-php\u002F04.checkouts",{"title":88,"path":187,"stem":188},"\u002Fpackages\u002Ffluent-php\u002Fsubscriptions","3.packages\u002F2.fluent-php\u002F05.subscriptions",{"title":96,"path":190,"stem":191},"\u002Fpackages\u002Ffluent-php\u002Forders","3.packages\u002F2.fluent-php\u002F06.orders",{"title":193,"path":194,"stem":195},"Customer portal","\u002Fpackages\u002Ffluent-php\u002Fcustomerportal","3.packages\u002F2.fluent-php\u002F07.customerportal",{"title":50,"path":197,"stem":198},"\u002Fpackages\u002Ffluent-php\u002Fwebhooks","3.packages\u002F2.fluent-php\u002F08.webhooks",{"title":200,"path":201,"stem":202},"Webhook event flow","\u002Fpackages\u002Ffluent-php\u002Fwebhook-flow","3.packages\u002F2.fluent-php\u002F09.webhook-flow",{"title":204,"path":205,"stem":206},"Existing tables","\u002Fpackages\u002Ffluent-php\u002Fhost-owns-its-tables","3.packages\u002F2.fluent-php\u002F10.host-owns-its-tables",{"title":58,"path":208,"stem":209},"\u002Fpackages\u002Ffluent-php\u002Ftesting","3.packages\u002F2.fluent-php\u002F11.testing",{"title":211,"path":212,"stem":213,"children":214,"page":61},"Laravel","\u002Fpackages\u002Flaravel","3.packages\u002F3.laravel",[215,218,221,224,227,230,233,236,240],{"title":128,"path":216,"stem":217},"\u002Fpackages\u002Flaravel\u002Freadme","3.packages\u002F3.laravel\u002F00.readme",{"title":173,"path":219,"stem":220},"\u002Fpackages\u002Flaravel\u002Fconfiguration","3.packages\u002F3.laravel\u002F01.configuration",{"title":68,"path":222,"stem":223},"\u002Fpackages\u002Flaravel\u002Fcustomers","3.packages\u002F3.laravel\u002F02.customers",{"title":80,"path":225,"stem":226},"\u002Fpackages\u002Flaravel\u002Fcheckouts","3.packages\u002F3.laravel\u002F03.checkouts",{"title":88,"path":228,"stem":229},"\u002Fpackages\u002Flaravel\u002Fsubscriptions","3.packages\u002F3.laravel\u002F04.subscriptions",{"title":96,"path":231,"stem":232},"\u002Fpackages\u002Flaravel\u002Forders","3.packages\u002F3.laravel\u002F05.orders",{"title":50,"path":234,"stem":235},"\u002Fpackages\u002Flaravel\u002Fwebhooks","3.packages\u002F3.laravel\u002F06.webhooks",{"title":237,"path":238,"stem":239},"Comparison","\u002Fpackages\u002Flaravel\u002Fcomparison","3.packages\u002F3.laravel\u002F07.comparison",{"title":241,"path":242,"stem":243},"Migrating from Cashier","\u002Fpackages\u002Flaravel\u002Fmigrating-to-vatly","3.packages\u002F3.laravel\u002F08.migrating-to-vatly",{"title":245,"path":246,"stem":247,"children":248,"page":61},"JavaScript SDK","\u002Fpackages\u002Fjavascript","3.packages\u002F4.javascript",[249,252,255,258,261,264,267,270,273,276,279],{"title":128,"path":250,"stem":251},"\u002Fpackages\u002Fjavascript\u002Freadme","3.packages\u002F4.javascript\u002F00.readme",{"title":68,"path":253,"stem":254},"\u002Fpackages\u002Fjavascript\u002Fcustomers","3.packages\u002F4.javascript\u002F02.customers",{"title":80,"path":256,"stem":257},"\u002Fpackages\u002Fjavascript\u002Fcheckouts","3.packages\u002F4.javascript\u002F03.checkouts",{"title":88,"path":259,"stem":260},"\u002Fpackages\u002Fjavascript\u002Fsubscriptions","3.packages\u002F4.javascript\u002F04.subscriptions",{"title":141,"path":262,"stem":263},"\u002Fpackages\u002Fjavascript\u002Fsubscriptionplans","3.packages\u002F4.javascript\u002F05.subscriptionplans",{"title":96,"path":265,"stem":266},"\u002Fpackages\u002Fjavascript\u002Forders","3.packages\u002F4.javascript\u002F06.orders",{"title":148,"path":268,"stem":269},"\u002Fpackages\u002Fjavascript\u002Foneoffproducts","3.packages\u002F4.javascript\u002F07.oneoffproducts",{"title":104,"path":271,"stem":272},"\u002Fpackages\u002Fjavascript\u002Frefunds","3.packages\u002F4.javascript\u002F08.refunds",{"title":108,"path":274,"stem":275},"\u002Fpackages\u002Fjavascript\u002Fchargebacks","3.packages\u002F4.javascript\u002F09.chargebacks",{"title":50,"path":277,"stem":278},"\u002Fpackages\u002Fjavascript\u002Fwebhooks","3.packages\u002F4.javascript\u002F10.webhooks",{"title":280,"path":281,"stem":282},"API reference","\u002Fpackages\u002Fjavascript\u002Fapi","3.packages\u002F4.javascript\u002F12.api",{"title":284,"path":285,"stem":286,"children":287,"page":61},"JavaScript Fluent","\u002Fpackages\u002Ffluent-js","3.packages\u002F5.fluent-js",[288,291,294,297,300,303,306,309,312,315],{"title":128,"path":289,"stem":290},"\u002Fpackages\u002Ffluent-js\u002Freadme","3.packages\u002F5.fluent-js\u002F00.readme",{"title":173,"path":292,"stem":293},"\u002Fpackages\u002Ffluent-js\u002Fconfiguration","3.packages\u002F5.fluent-js\u002F01.configuration",{"title":177,"path":295,"stem":296},"\u002Fpackages\u002Ffluent-js\u002Fcoreconcepts","3.packages\u002F5.fluent-js\u002F02.coreconcepts",{"title":68,"path":298,"stem":299},"\u002Fpackages\u002Ffluent-js\u002Fcustomers","3.packages\u002F5.fluent-js\u002F03.customers",{"title":80,"path":301,"stem":302},"\u002Fpackages\u002Ffluent-js\u002Fcheckouts","3.packages\u002F5.fluent-js\u002F04.checkouts",{"title":88,"path":304,"stem":305},"\u002Fpackages\u002Ffluent-js\u002Fsubscriptions","3.packages\u002F5.fluent-js\u002F05.subscriptions",{"title":96,"path":307,"stem":308},"\u002Fpackages\u002Ffluent-js\u002Forders","3.packages\u002F5.fluent-js\u002F06.orders",{"title":193,"path":310,"stem":311},"\u002Fpackages\u002Ffluent-js\u002Fcustomerportal","3.packages\u002F5.fluent-js\u002F07.customerportal",{"title":50,"path":313,"stem":314},"\u002Fpackages\u002Ffluent-js\u002Fwebhooks","3.packages\u002F5.fluent-js\u002F08.webhooks",{"title":58,"path":316,"stem":317},"\u002Fpackages\u002Ffluent-js\u002Ftesting","3.packages\u002F5.fluent-js\u002F11.testing",{"title":319,"path":320,"stem":321,"children":322,"page":61},"Python SDK","\u002Fpackages\u002Fpython","3.packages\u002F6.python",[323,326,329,332,335,338,341,344,347,350,353,356,359,362],{"title":128,"path":324,"stem":325},"\u002Fpackages\u002Fpython\u002Freadme","3.packages\u002F6.python\u002F00.readme",{"title":173,"path":327,"stem":328},"\u002Fpackages\u002Fpython\u002Fconfiguration","3.packages\u002F6.python\u002F01.configuration",{"title":68,"path":330,"stem":331},"\u002Fpackages\u002Fpython\u002Fcustomers","3.packages\u002F6.python\u002F02.customers",{"title":80,"path":333,"stem":334},"\u002Fpackages\u002Fpython\u002Fcheckouts","3.packages\u002F6.python\u002F03.checkouts",{"title":88,"path":336,"stem":337},"\u002Fpackages\u002Fpython\u002Fsubscriptions","3.packages\u002F6.python\u002F04.subscriptions",{"title":141,"path":339,"stem":340},"\u002Fpackages\u002Fpython\u002Fsubscriptionplans","3.packages\u002F6.python\u002F05.subscriptionplans",{"title":96,"path":342,"stem":343},"\u002Fpackages\u002Fpython\u002Forders","3.packages\u002F6.python\u002F06.orders",{"title":148,"path":345,"stem":346},"\u002Fpackages\u002Fpython\u002Foneoffproducts","3.packages\u002F6.python\u002F07.oneoffproducts",{"title":104,"path":348,"stem":349},"\u002Fpackages\u002Fpython\u002Frefunds","3.packages\u002F6.python\u002F08.refunds",{"title":108,"path":351,"stem":352},"\u002Fpackages\u002Fpython\u002Fchargebacks","3.packages\u002F6.python\u002F09.chargebacks",{"title":50,"path":354,"stem":355},"\u002Fpackages\u002Fpython\u002Fwebhooks","3.packages\u002F6.python\u002F10.webhooks",{"title":161,"path":357,"stem":358},"\u002Fpackages\u002Fpython\u002Fwebhookendpoints","3.packages\u002F6.python\u002F11.webhookendpoints",{"title":280,"path":360,"stem":361},"\u002Fpackages\u002Fpython\u002Fapi","3.packages\u002F6.python\u002F12.api",{"title":363,"path":364,"stem":365},"Development","\u002Fpackages\u002Fpython\u002Fdevelopment","3.packages\u002F6.python\u002F13.development",{"title":367,"path":368,"stem":369,"children":370,"page":61},"Python Fluent","\u002Fpackages\u002Ffluent-python","3.packages\u002F7.fluent-python",[371,374,377,380,383,386,389,392,395,398,401,405],{"title":128,"path":372,"stem":373},"\u002Fpackages\u002Ffluent-python\u002Freadme","3.packages\u002F7.fluent-python\u002F00.readme",{"title":173,"path":375,"stem":376},"\u002Fpackages\u002Ffluent-python\u002Fconfiguration","3.packages\u002F7.fluent-python\u002F01.configuration",{"title":177,"path":378,"stem":379},"\u002Fpackages\u002Ffluent-python\u002Fcoreconcepts","3.packages\u002F7.fluent-python\u002F02.coreconcepts",{"title":68,"path":381,"stem":382},"\u002Fpackages\u002Ffluent-python\u002Fcustomers","3.packages\u002F7.fluent-python\u002F03.customers",{"title":80,"path":384,"stem":385},"\u002Fpackages\u002Ffluent-python\u002Fcheckouts","3.packages\u002F7.fluent-python\u002F04.checkouts",{"title":88,"path":387,"stem":388},"\u002Fpackages\u002Ffluent-python\u002Fsubscriptions","3.packages\u002F7.fluent-python\u002F05.subscriptions",{"title":96,"path":390,"stem":391},"\u002Fpackages\u002Ffluent-python\u002Forders","3.packages\u002F7.fluent-python\u002F06.orders",{"title":193,"path":393,"stem":394},"\u002Fpackages\u002Ffluent-python\u002Fcustomerportal","3.packages\u002F7.fluent-python\u002F07.customerportal",{"title":50,"path":396,"stem":397},"\u002Fpackages\u002Ffluent-python\u002Fwebhooks","3.packages\u002F7.fluent-python\u002F08.webhooks",{"title":58,"path":399,"stem":400},"\u002Fpackages\u002Ffluent-python\u002Ftesting","3.packages\u002F7.fluent-python\u002F11.testing",{"title":402,"path":403,"stem":404},"Porting","\u002Fpackages\u002Ffluent-python\u002Fporting","3.packages\u002F7.fluent-python\u002F12.porting",{"title":363,"path":406,"stem":407},"\u002Fpackages\u002Ffluent-python\u002Fdevelopment","3.packages\u002F7.fluent-python\u002F13.development",{"title":409,"path":410,"stem":411,"children":412,"page":61},"Django","\u002Fpackages\u002Fdjango","3.packages\u002F8.django",[413,416,420,423,427,431,434,437,440,444,447],{"title":128,"path":414,"stem":415},"\u002Fpackages\u002Fdjango\u002Freadme","3.packages\u002F8.django\u002F00.readme",{"title":417,"path":418,"stem":419},"Installation","\u002Fpackages\u002Fdjango\u002Finstallation","3.packages\u002F8.django\u002F01.installation",{"title":173,"path":421,"stem":422},"\u002Fpackages\u002Fdjango\u002Fconfiguration","3.packages\u002F8.django\u002F02.configuration",{"title":424,"path":425,"stem":426},"Billable models","\u002Fpackages\u002Fdjango\u002Fbillablemodels","3.packages\u002F8.django\u002F03.billablemodels",{"title":428,"path":429,"stem":430},"Checkout","\u002Fpackages\u002Fdjango\u002Fcheckout","3.packages\u002F8.django\u002F04.checkout",{"title":88,"path":432,"stem":433},"\u002Fpackages\u002Fdjango\u002Fbilling","3.packages\u002F8.django\u002F05.billing",{"title":193,"path":435,"stem":436},"\u002Fpackages\u002Fdjango\u002Fcustomerportal","3.packages\u002F8.django\u002F06.customerportal",{"title":50,"path":438,"stem":439},"\u002Fpackages\u002Fdjango\u002Fwebhooks","3.packages\u002F8.django\u002F07.webhooks",{"title":441,"path":442,"stem":443},"Admin","\u002Fpackages\u002Fdjango\u002Fadmin","3.packages\u002F8.django\u002F08.admin",{"title":58,"path":445,"stem":446},"\u002Fpackages\u002Fdjango\u002Ftesting","3.packages\u002F8.django\u002F09.testing",{"title":363,"path":448,"stem":449},"\u002Fpackages\u002Fdjango\u002Fdevelopment","3.packages\u002F8.django\u002F10.development",{"title":451,"path":452,"stem":453,"children":454},"Integrations","\u002Fintegrations","4.integrations",[455,457,461],{"title":451,"path":452,"stem":456},"4.integrations\u002Findex",{"title":458,"path":459,"stem":460},"Lovable payments with Vatly","\u002Fintegrations\u002Flovable","4.integrations\u002F1.lovable",{"title":462,"path":463,"stem":464},"Bolt payments with Vatly","\u002Fintegrations\u002Fbolt","4.integrations\u002F2.bolt",{"id":466,"title":50,"body":467,"description":2011,"extension":2012,"links":2013,"meta":2014,"navigation":2015,"path":277,"seo":2016,"stem":278,"__hash__":2017},"docs\u002F3.packages\u002F4.javascript\u002F10.webhooks.md",{"type":468,"value":469,"toc":2000},"minimark",[470,474,495,500,516,883,887,925,1401,1423,1454,1463,1468,1494,1498,1506,1543,1547,1557,1648,1651,1655,1860,1867,1871,1874,1936,1940,1956,1996],[471,472,473],"p",{},"Vatly sends webhooks to notify your application when events happen — an order being paid, a refund completing, a subscription being canceled. Every delivery is HMAC-signed; the SDK verifies the signature and hands you a typed event.",[471,475,476,477,483,484,488,489,494],{},"For event fields and endpoint options, see the ",[478,479,112],"a",{"href":480,"rel":481},"https:\u002F\u002Fdocs.vatly.com\u002Fapi-reference\u002Fwebhook-events",[482],"nofollow"," and ",[478,485,72],{"href":486,"rel":487},"https:\u002F\u002Fdocs.vatly.com\u002Fapi-reference\u002Fwebhook-endpoints",[482]," API references. The ",[478,490,493],{"href":491,"rel":492},"https:\u002F\u002Fdocs.vatly.com\u002Fopenapi.yaml",[482],"OpenAPI spec"," is also available for tooling.",[496,497,499],"h2",{"id":498},"webhook-events","Webhook events",[471,501,502,503,507,508,515],{},"The ",[504,505,506],"code",{},"eventName"," field identifies what happened. Names are available as constants\non ",[478,509,512],{"href":510,"rel":511},"https:\u002F\u002Fgithub.com\u002Fvatly\u002Fvatly-api-js\u002Fblob\u002Fmain\u002Fsrc\u002Fwebhooks\u002Fevents.ts",[482],[504,513,514],{},"WebhookEventName",".",[517,518,519,538],"table",{},[520,521,522],"thead",{},[523,524,525,529,535],"tr",{},[526,527,528],"th",{},"Event",[526,530,531,534],{},[504,532,533],{},"object"," type",[526,536,537],{},"Description",[539,540,541,555,567,579,592,604,617,629,641,654,666,678,690,702,714,726,741,756,776,791,808,822,834,846,858,870],"tbody",{},[523,542,543,549,552],{},[544,545,546],"td",{},[504,547,548],{},"order.paid",[544,550,551],{},"Order",[544,553,554],{},"Order payment was successful.",[523,556,557,562,564],{},[544,558,559],{},[504,560,561],{},"order.canceled",[544,563,551],{},[544,565,566],{},"Order was canceled.",[523,568,569,574,576],{},[544,570,571],{},[504,572,573],{},"order.payment_failed",[544,575,551],{},[544,577,578],{},"A payment failed and dunning started.",[523,580,581,586,589],{},[544,582,583],{},[504,584,585],{},"order.chargeback_received",[544,587,588],{},"Chargeback",[544,590,591],{},"A chargeback was received for an order.",[523,593,594,599,601],{},[544,595,596],{},[504,597,598],{},"order.chargeback_reversed",[544,600,588],{},[544,602,603],{},"A chargeback was reversed.",[523,605,606,611,614],{},[544,607,608],{},[504,609,610],{},"refund.completed",[544,612,613],{},"Refund",[544,615,616],{},"Refund was processed successfully.",[523,618,619,624,626],{},[544,620,621],{},[504,622,623],{},"refund.failed",[544,625,613],{},[544,627,628],{},"Refund processing failed.",[523,630,631,636,638],{},[544,632,633],{},[504,634,635],{},"refund.canceled",[544,637,613],{},[544,639,640],{},"Refund was canceled.",[523,642,643,648,651],{},[544,644,645],{},[504,646,647],{},"subscription.started",[544,649,650],{},"Subscription",[544,652,653],{},"Subscription was started.",[523,655,656,661,663],{},[544,657,658],{},[504,659,660],{},"subscription.billing_updated",[544,662,650],{},[544,664,665],{},"Billing details (e.g. the mandate) changed.",[523,667,668,673,675],{},[544,669,670],{},[504,671,672],{},"subscription.canceled_immediately",[544,674,650],{},[544,676,677],{},"Canceled immediately.",[523,679,680,685,687],{},[544,681,682],{},[504,683,684],{},"subscription.canceled_with_grace_period",[544,686,650],{},[544,688,689],{},"Canceled; access until period end.",[523,691,692,697,699],{},[544,693,694],{},[504,695,696],{},"subscription.cancellation_grace_period_completed",[544,698,650],{},[544,700,701],{},"Grace period ended.",[523,703,704,709,711],{},[544,705,706],{},[504,707,708],{},"subscription.resumed",[544,710,650],{},[544,712,713],{},"A canceled subscription was resumed.",[523,715,716,721,723],{},[544,717,718],{},[504,719,720],{},"subscription.canceled_for_nonpayment",[544,722,650],{},[544,724,725],{},"Payment recovery exhausted.",[523,727,728,733,735],{},[544,729,730],{},[504,731,732],{},"subscription.updated",[544,734,650],{},[544,736,737,738,515],{},"Immediate\u002Fscheduled change or renewal; inspect ",[504,739,740],{},"reason",[523,742,743,748,750],{},[544,744,745],{},[504,746,747],{},"subscription.update_scheduled",[544,749,650],{},[544,751,752,753,515],{},"Change scheduled; inspect ",[504,754,755],{},"scheduledUpdate",[523,757,758,770,773],{},[544,759,760,763,764,763,767],{},[504,761,762],{},"one_off_product.update_submitted"," \u002F ",[504,765,766],{},"update_approved",[504,768,769],{},"update_rejected",[544,771,772],{},"OneOffProduct",[544,774,775],{},"Product change review lifecycle (each suffix uses the same prefix).",[523,777,778,786,788],{},[544,779,780,763,783],{},[504,781,782],{},"one_off_product.archived",[504,784,785],{},"unarchived",[544,787,772],{},[544,789,790],{},"Product availability changed.",[523,792,793,802,805],{},[544,794,795,763,798,763,800],{},[504,796,797],{},"subscription_plan.update_submitted",[504,799,766],{},[504,801,769],{},[544,803,804],{},"SubscriptionPlan",[544,806,807],{},"Plan change review lifecycle.",[523,809,810,817,819],{},[544,811,812,763,815],{},[504,813,814],{},"subscription_plan.archived",[504,816,785],{},[544,818,804],{},[544,820,821],{},"Plan availability changed.",[523,823,824,829,831],{},[544,825,826],{},[504,827,828],{},"checkout.paid",[544,830,428],{},[544,832,833],{},"Checkout was paid.",[523,835,836,841,843],{},[544,837,838],{},[504,839,840],{},"checkout.failed",[544,842,428],{},[544,844,845],{},"Checkout payment failed.",[523,847,848,853,855],{},[544,849,850],{},[504,851,852],{},"checkout.canceled",[544,854,428],{},[544,856,857],{},"Checkout was canceled.",[523,859,860,865,867],{},[544,861,862],{},[504,863,864],{},"checkout.expired",[544,866,428],{},[544,868,869],{},"Checkout session expired.",[523,871,872,877,880],{},[544,873,874],{},[504,875,876],{},"webhook.setup",[544,878,879],{},"Webhook",[544,881,882],{},"Verification call sent when an endpoint is registered or its URL changes.",[496,884,886],{"id":885},"verify-and-process-in-one-step","Verify and process in one step",[471,888,889,892,893,896,897,900,901,905,906,909,910,913,914,917,918,920,921,924],{},[504,890,891],{},"constructWebhookEventFromRequest"," reads the raw body and ",[504,894,895],{},"Vatly-Signature","\nheader off a Fetch ",[504,898,899],{},"Request",", verifies the HMAC, and returns a ",[902,903,904],"strong",{},"discriminated","\nevent. Check ",[504,907,908],{},"event.known"," first, then switch on ",[504,911,912],{},"event.eventName"," to narrow ",[504,915,916],{},"event.object"," to the exact\nresource — no casts, no follow-up API call (Vatly sends fat, signed payloads, so\n",[504,919,533],{}," is the full ",[504,922,923],{},"GET \u002F…\u002F{id}"," snapshot).",[926,927,932],"pre",{"className":928,"code":929,"language":930,"meta":931,"style":931},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { constructWebhookEventFromRequest } from \"@getvatly\u002Fsdk\u002Fwebhooks\";\n\nexport async function POST(request: Request): Promise\u003CResponse> {\n  let event;\n  try {\n    event = await constructWebhookEventFromRequest(request, process.env.VATLY_WEBHOOK_SECRET!);\n  } catch {\n    return new Response(\"invalid signature\", { status: 400 });\n  }\n\n  if (!event.known) {\n    \u002F\u002F Retain the verified envelope durably for triage, then acknowledge it.\n    \u002F\u002F Until retention succeeds, retry rather than silently losing the delivery.\n    return new Response(\"unsupported event requires triage\", { status: 503 });\n  }\n  switch (event.eventName) {\n    case \"order.paid\":\n      event.object.total; \u002F\u002F Money — typed as Order\n      break;\n    case \"subscription.billing_updated\":\n      event.object.mandate; \u002F\u002F typed as Subscription\n      break;\n    case \"webhook.setup\":\n      return new Response(\"ok\"); \u002F\u002F verification handshake — just acknowledge\n  }\n  return new Response(\"ok\");\n}\n","ts","",[504,933,934,970,977,1026,1037,1045,1088,1099,1139,1145,1150,1175,1182,1188,1223,1228,1246,1261,1282,1290,1303,1322,1329,1342,1368,1373,1395],{"__ignoreMap":931},[935,936,939,943,947,951,954,957,960,964,967],"span",{"class":937,"line":938},"line",1,[935,940,942],{"class":941},"s7zQu","import",[935,944,946],{"class":945},"sMK4o"," {",[935,948,950],{"class":949},"sTEyZ"," constructWebhookEventFromRequest",[935,952,953],{"class":945}," }",[935,955,956],{"class":941}," from",[935,958,959],{"class":945}," \"",[935,961,963],{"class":962},"sfazB","@getvatly\u002Fsdk\u002Fwebhooks",[935,965,966],{"class":945},"\"",[935,968,969],{"class":945},";\n",[935,971,973],{"class":937,"line":972},2,[935,974,976],{"emptyLinePlaceholder":975},true,"\n",[935,978,980,983,987,990,994,997,1001,1004,1008,1011,1014,1017,1020,1023],{"class":937,"line":979},3,[935,981,982],{"class":941},"export",[935,984,986],{"class":985},"spNyl"," async",[935,988,989],{"class":985}," function",[935,991,993],{"class":992},"s2Zo4"," POST",[935,995,996],{"class":945},"(",[935,998,1000],{"class":999},"sHdIc","request",[935,1002,1003],{"class":945},":",[935,1005,1007],{"class":1006},"sBMFI"," Request",[935,1009,1010],{"class":945},"):",[935,1012,1013],{"class":1006}," Promise",[935,1015,1016],{"class":945},"\u003C",[935,1018,1019],{"class":1006},"Response",[935,1021,1022],{"class":945},">",[935,1024,1025],{"class":945}," {\n",[935,1027,1029,1032,1035],{"class":937,"line":1028},4,[935,1030,1031],{"class":985},"  let",[935,1033,1034],{"class":949}," event",[935,1036,969],{"class":945},[935,1038,1040,1043],{"class":937,"line":1039},5,[935,1041,1042],{"class":941},"  try",[935,1044,1025],{"class":945},[935,1046,1048,1051,1054,1057,1059,1062,1064,1067,1070,1072,1075,1077,1080,1083,1086],{"class":937,"line":1047},6,[935,1049,1050],{"class":949},"    event",[935,1052,1053],{"class":945}," =",[935,1055,1056],{"class":941}," await",[935,1058,950],{"class":992},[935,1060,996],{"class":1061},"swJcz",[935,1063,1000],{"class":949},[935,1065,1066],{"class":945},",",[935,1068,1069],{"class":949}," process",[935,1071,515],{"class":945},[935,1073,1074],{"class":949},"env",[935,1076,515],{"class":945},[935,1078,1079],{"class":949},"VATLY_WEBHOOK_SECRET",[935,1081,1082],{"class":945},"!",[935,1084,1085],{"class":1061},")",[935,1087,969],{"class":945},[935,1089,1091,1094,1097],{"class":937,"line":1090},7,[935,1092,1093],{"class":945},"  }",[935,1095,1096],{"class":941}," catch",[935,1098,1025],{"class":945},[935,1100,1102,1105,1108,1111,1113,1115,1118,1120,1122,1124,1127,1129,1133,1135,1137],{"class":937,"line":1101},8,[935,1103,1104],{"class":941},"    return",[935,1106,1107],{"class":945}," new",[935,1109,1110],{"class":992}," Response",[935,1112,996],{"class":1061},[935,1114,966],{"class":945},[935,1116,1117],{"class":962},"invalid signature",[935,1119,966],{"class":945},[935,1121,1066],{"class":945},[935,1123,946],{"class":945},[935,1125,1126],{"class":1061}," status",[935,1128,1003],{"class":945},[935,1130,1132],{"class":1131},"sbssI"," 400",[935,1134,953],{"class":945},[935,1136,1085],{"class":1061},[935,1138,969],{"class":945},[935,1140,1142],{"class":937,"line":1141},9,[935,1143,1144],{"class":945},"  }\n",[935,1146,1148],{"class":937,"line":1147},10,[935,1149,976],{"emptyLinePlaceholder":975},[935,1151,1153,1156,1159,1161,1164,1166,1169,1172],{"class":937,"line":1152},11,[935,1154,1155],{"class":941},"  if",[935,1157,1158],{"class":1061}," (",[935,1160,1082],{"class":945},[935,1162,1163],{"class":949},"event",[935,1165,515],{"class":945},[935,1167,1168],{"class":949},"known",[935,1170,1171],{"class":1061},") ",[935,1173,1174],{"class":945},"{\n",[935,1176,1178],{"class":937,"line":1177},12,[935,1179,1181],{"class":1180},"sHwdD","    \u002F\u002F Retain the verified envelope durably for triage, then acknowledge it.\n",[935,1183,1185],{"class":937,"line":1184},13,[935,1186,1187],{"class":1180},"    \u002F\u002F Until retention succeeds, retry rather than silently losing the delivery.\n",[935,1189,1191,1193,1195,1197,1199,1201,1204,1206,1208,1210,1212,1214,1217,1219,1221],{"class":937,"line":1190},14,[935,1192,1104],{"class":941},[935,1194,1107],{"class":945},[935,1196,1110],{"class":992},[935,1198,996],{"class":1061},[935,1200,966],{"class":945},[935,1202,1203],{"class":962},"unsupported event requires triage",[935,1205,966],{"class":945},[935,1207,1066],{"class":945},[935,1209,946],{"class":945},[935,1211,1126],{"class":1061},[935,1213,1003],{"class":945},[935,1215,1216],{"class":1131}," 503",[935,1218,953],{"class":945},[935,1220,1085],{"class":1061},[935,1222,969],{"class":945},[935,1224,1226],{"class":937,"line":1225},15,[935,1227,1144],{"class":945},[935,1229,1231,1234,1236,1238,1240,1242,1244],{"class":937,"line":1230},16,[935,1232,1233],{"class":941},"  switch",[935,1235,1158],{"class":1061},[935,1237,1163],{"class":949},[935,1239,515],{"class":945},[935,1241,506],{"class":949},[935,1243,1171],{"class":1061},[935,1245,1174],{"class":945},[935,1247,1249,1252,1254,1256,1258],{"class":937,"line":1248},17,[935,1250,1251],{"class":941},"    case",[935,1253,959],{"class":945},[935,1255,548],{"class":962},[935,1257,966],{"class":945},[935,1259,1260],{"class":945},":\n",[935,1262,1264,1267,1269,1271,1273,1276,1279],{"class":937,"line":1263},18,[935,1265,1266],{"class":949},"      event",[935,1268,515],{"class":945},[935,1270,533],{"class":949},[935,1272,515],{"class":945},[935,1274,1275],{"class":949},"total",[935,1277,1278],{"class":945},";",[935,1280,1281],{"class":1180}," \u002F\u002F Money — typed as Order\n",[935,1283,1285,1288],{"class":937,"line":1284},19,[935,1286,1287],{"class":941},"      break",[935,1289,969],{"class":945},[935,1291,1293,1295,1297,1299,1301],{"class":937,"line":1292},20,[935,1294,1251],{"class":941},[935,1296,959],{"class":945},[935,1298,660],{"class":962},[935,1300,966],{"class":945},[935,1302,1260],{"class":945},[935,1304,1306,1308,1310,1312,1314,1317,1319],{"class":937,"line":1305},21,[935,1307,1266],{"class":949},[935,1309,515],{"class":945},[935,1311,533],{"class":949},[935,1313,515],{"class":945},[935,1315,1316],{"class":949},"mandate",[935,1318,1278],{"class":945},[935,1320,1321],{"class":1180}," \u002F\u002F typed as Subscription\n",[935,1323,1325,1327],{"class":937,"line":1324},22,[935,1326,1287],{"class":941},[935,1328,969],{"class":945},[935,1330,1332,1334,1336,1338,1340],{"class":937,"line":1331},23,[935,1333,1251],{"class":941},[935,1335,959],{"class":945},[935,1337,876],{"class":962},[935,1339,966],{"class":945},[935,1341,1260],{"class":945},[935,1343,1345,1348,1350,1352,1354,1356,1359,1361,1363,1365],{"class":937,"line":1344},24,[935,1346,1347],{"class":941},"      return",[935,1349,1107],{"class":945},[935,1351,1110],{"class":992},[935,1353,996],{"class":1061},[935,1355,966],{"class":945},[935,1357,1358],{"class":962},"ok",[935,1360,966],{"class":945},[935,1362,1085],{"class":1061},[935,1364,1278],{"class":945},[935,1366,1367],{"class":1180}," \u002F\u002F verification handshake — just acknowledge\n",[935,1369,1371],{"class":937,"line":1370},25,[935,1372,1144],{"class":945},[935,1374,1376,1379,1381,1383,1385,1387,1389,1391,1393],{"class":937,"line":1375},26,[935,1377,1378],{"class":941},"  return",[935,1380,1107],{"class":945},[935,1382,1110],{"class":992},[935,1384,996],{"class":1061},[935,1386,966],{"class":945},[935,1388,1358],{"class":962},[935,1390,966],{"class":945},[935,1392,1085],{"class":1061},[935,1394,969],{"class":945},[935,1396,1398],{"class":937,"line":1397},27,[935,1399,1400],{"class":945},"}\n",[471,1402,1403,1404,1407,1408,1411,1412,1415,1416,1419,1420,515],{},"If you already have the raw bytes (e.g. a non-Fetch framework), use\n",[504,1405,1406],{},"constructWebhookEvent(rawBody, signatureHeader, secret)",". To verify only and\nget the raw ",[504,1409,1410],{},"WebhookDelivery"," envelope, use ",[504,1413,1414],{},"constructEvent"," \u002F\n",[504,1417,1418],{},"constructEventFromRequest",", then narrow later with ",[504,1421,1422],{},"toWebhookEvent(delivery)",[471,1424,1425,1428,1429,1158,1432,1435,1436,1158,1439,1442,1443,1442,1446,1449,1450,1453],{},[504,1426,1427],{},"VatlyWebhookEvent"," includes ",[504,1430,1431],{},"KnownWebhookEvent",[504,1433,1434],{},"known: true",") and\n",[504,1437,1438],{},"UnsupportedWebhookEvent",[504,1440,1441],{},"known: false",", ",[504,1444,1445],{},"eventName: string",[504,1447,1448],{},"object: unknown",").\nThe SDK adds this discriminator to a shallow copy after verification, overwriting\nany wire-supplied flag. It classifies the event name, not the resource schema.\nBoth sides of ",[504,1451,1452],{},"if (event.known)"," narrow normally; no custom type guards are needed.\nUnknown event names can appear before an SDK upgrade. Keep them for triage and\ndecide acknowledgement policy explicitly; a successful HMAC is not a reason to\ndiscard an event you cannot yet process.",[1455,1456,1457],"blockquote",{},[471,1458,1459,1462],{},[902,1460,1461],{},"Always verify against the raw body bytes."," Re-serializing the JSON changes\nthe bytes (whitespace, key order, number formatting) and breaks the HMAC.",[496,1464,502,1466,1034],{"id":1465},"the-webhooksetup-event",[504,1467,876],{},[471,1469,1470,1471,1473,1474,1477,1478,1481,1482,1484,1485,1489,1490,1493],{},"When you register a webhook endpoint (or change its URL), Vatly sends a signed\n",[504,1472,876],{}," call to confirm the endpoint is reachable. It's delivered as a\nnormal webhook — same envelope, same signature, same ",[504,1475,1476],{},"Vatly-Event-Id"," header —\nso there's nothing special to parse: verify it and return a ",[504,1479,1480],{},"2xx",". Its ",[504,1483,533],{},"\nis the (secret-free) ",[478,1486,1488],{"href":486,"rel":1487},[482],"webhook endpoint","\nconfig and ",[504,1491,1492],{},"links"," is omitted (it's not a persisted event).",[496,1495,1497],{"id":1496},"signature-scheme","Signature scheme",[926,1499,1504],{"className":1500,"code":1502,"language":1503},[1501],"language-text","Vatly-Signature: t=1700000000,v1=\u003Chex_hmac_sha256>\nVatly-Event-Id:  webhook_event_Qk8pRtSvWm2NjLhYcZaE\n","text",[504,1505,1502],{"__ignoreMap":931},[1507,1508,1509,1516,1526,1536],"ul",{},[1510,1511,1512,1515],"li",{},[504,1513,1514],{},"t"," is unix seconds, captured fresh on each delivery attempt.",[1510,1517,1518,1521,1522,1525],{},[504,1519,1520],{},"v1"," is ",[504,1523,1524],{},"HMAC-SHA256(\"{t}.{rawBody}\", webhookSecret)",", lowercase hex.",[1510,1527,1528,1529,1532,1533,515],{},"The SDK rejects signatures where ",[504,1530,1531],{},"|now − t| > 300"," seconds by default\n(5-minute clock-skew tolerance). Tune it with ",[504,1534,1535],{},"{ toleranceSeconds }",[1510,1537,1538,1539,1542],{},"Future algorithm rotation ships ",[504,1540,1541],{},"v1=…,v2=…"," simultaneously; the SDK verifies\nany version it recognizes and ignores the rest.",[496,1544,1546],{"id":1545},"deduplication-is-your-job","Deduplication is your job",[471,1548,1549,1550,1553,1554,1556],{},"The SDK is stateless — it can't remember which events it has verified. The\nclock-skew check bounds how long a leaked signature is replayable, but does not\nstop replays inside that window. For full replay defense, dedupe on the\nretry-stable, signed ",[504,1551,1552],{},"event.id"," in your own store after verification. The\n",[504,1555,1476],{}," header is not signed and is for correlation only:",[926,1558,1560],{"className":928,"code":1559,"language":930,"meta":931,"style":931},"const event = await constructWebhookEventFromRequest(request, secret);\nconst eventId = event.id;\nif (await store.has(eventId)) return new Response(\"ok\"); \u002F\u002F already processed\n",[504,1561,1562,1587,1605],{"__ignoreMap":931},[935,1563,1564,1567,1570,1573,1575,1577,1580,1582,1585],{"class":937,"line":938},[935,1565,1566],{"class":985},"const",[935,1568,1569],{"class":949}," event ",[935,1571,1572],{"class":945},"=",[935,1574,1056],{"class":941},[935,1576,950],{"class":992},[935,1578,1579],{"class":949},"(request",[935,1581,1066],{"class":945},[935,1583,1584],{"class":949}," secret)",[935,1586,969],{"class":945},[935,1588,1589,1591,1594,1596,1598,1600,1603],{"class":937,"line":972},[935,1590,1566],{"class":985},[935,1592,1593],{"class":949}," eventId ",[935,1595,1572],{"class":945},[935,1597,1034],{"class":949},[935,1599,515],{"class":945},[935,1601,1602],{"class":949},"id",[935,1604,969],{"class":945},[935,1606,1607,1610,1612,1615,1618,1620,1623,1626,1629,1631,1633,1635,1637,1639,1641,1643,1645],{"class":937,"line":979},[935,1608,1609],{"class":941},"if",[935,1611,1158],{"class":949},[935,1613,1614],{"class":941},"await",[935,1616,1617],{"class":949}," store",[935,1619,515],{"class":945},[935,1621,1622],{"class":992},"has",[935,1624,1625],{"class":949},"(eventId)) ",[935,1627,1628],{"class":941},"return",[935,1630,1107],{"class":945},[935,1632,1110],{"class":992},[935,1634,996],{"class":949},[935,1636,966],{"class":945},[935,1638,1358],{"class":962},[935,1640,966],{"class":945},[935,1642,1085],{"class":949},[935,1644,1278],{"class":945},[935,1646,1647],{"class":1180}," \u002F\u002F already processed\n",[471,1649,1650],{},"Record successful processing and deduplication atomically; do not mark an event\ncomplete before its business effects succeed. Concurrent deliveries need a\nunique constraint or equivalent transactional claim in your store.",[496,1652,1654],{"id":1653},"manage-webhook-endpoints","Manage webhook endpoints",[926,1656,1658],{"className":928,"code":1657,"language":930,"meta":931,"style":931},"const endpoint = await vatly.webhookEndpoints.create({\n  url: \"https:\u002F\u002Fyourapp.com\u002Fapi\u002Fwebhooks\u002Fvatly\",\n  secret: process.env.VATLY_WEBHOOK_SECRET!,\n  enabledEvents: [\"order.paid\", \"subscription.updated\"],\n});\nawait vatly.webhookEndpoints.update(endpoint.id, { enabledEvents: [] }); \u002F\u002F dormant\nconst page = await vatly.webhookEndpoints.list();\nawait vatly.webhookEndpoints.delete(endpoint.id); \u002F\u002F 204\n",[504,1659,1660,1688,1705,1725,1754,1763,1806,1833],{"__ignoreMap":931},[935,1661,1662,1664,1667,1669,1671,1674,1676,1679,1681,1684,1686],{"class":937,"line":938},[935,1663,1566],{"class":985},[935,1665,1666],{"class":949}," endpoint ",[935,1668,1572],{"class":945},[935,1670,1056],{"class":941},[935,1672,1673],{"class":949}," vatly",[935,1675,515],{"class":945},[935,1677,1678],{"class":949},"webhookEndpoints",[935,1680,515],{"class":945},[935,1682,1683],{"class":992},"create",[935,1685,996],{"class":949},[935,1687,1174],{"class":945},[935,1689,1690,1693,1695,1697,1700,1702],{"class":937,"line":972},[935,1691,1692],{"class":1061},"  url",[935,1694,1003],{"class":945},[935,1696,959],{"class":945},[935,1698,1699],{"class":962},"https:\u002F\u002Fyourapp.com\u002Fapi\u002Fwebhooks\u002Fvatly",[935,1701,966],{"class":945},[935,1703,1704],{"class":945},",\n",[935,1706,1707,1710,1712,1714,1716,1718,1720,1722],{"class":937,"line":979},[935,1708,1709],{"class":1061},"  secret",[935,1711,1003],{"class":945},[935,1713,1069],{"class":949},[935,1715,515],{"class":945},[935,1717,1074],{"class":949},[935,1719,515],{"class":945},[935,1721,1079],{"class":949},[935,1723,1724],{"class":945},"!,\n",[935,1726,1727,1730,1732,1735,1737,1739,1741,1743,1745,1747,1749,1752],{"class":937,"line":1028},[935,1728,1729],{"class":1061},"  enabledEvents",[935,1731,1003],{"class":945},[935,1733,1734],{"class":949}," [",[935,1736,966],{"class":945},[935,1738,548],{"class":962},[935,1740,966],{"class":945},[935,1742,1066],{"class":945},[935,1744,959],{"class":945},[935,1746,732],{"class":962},[935,1748,966],{"class":945},[935,1750,1751],{"class":949},"]",[935,1753,1704],{"class":945},[935,1755,1756,1759,1761],{"class":937,"line":1039},[935,1757,1758],{"class":945},"}",[935,1760,1085],{"class":949},[935,1762,969],{"class":945},[935,1764,1765,1767,1769,1771,1773,1775,1778,1781,1783,1785,1787,1789,1792,1794,1797,1799,1801,1803],{"class":937,"line":1047},[935,1766,1614],{"class":941},[935,1768,1673],{"class":949},[935,1770,515],{"class":945},[935,1772,1678],{"class":949},[935,1774,515],{"class":945},[935,1776,1777],{"class":992},"update",[935,1779,1780],{"class":949},"(endpoint",[935,1782,515],{"class":945},[935,1784,1602],{"class":949},[935,1786,1066],{"class":945},[935,1788,946],{"class":945},[935,1790,1791],{"class":1061}," enabledEvents",[935,1793,1003],{"class":945},[935,1795,1796],{"class":949}," [] ",[935,1798,1758],{"class":945},[935,1800,1085],{"class":949},[935,1802,1278],{"class":945},[935,1804,1805],{"class":1180}," \u002F\u002F dormant\n",[935,1807,1808,1810,1813,1815,1817,1819,1821,1823,1825,1828,1831],{"class":937,"line":1090},[935,1809,1566],{"class":985},[935,1811,1812],{"class":949}," page ",[935,1814,1572],{"class":945},[935,1816,1056],{"class":941},[935,1818,1673],{"class":949},[935,1820,515],{"class":945},[935,1822,1678],{"class":949},[935,1824,515],{"class":945},[935,1826,1827],{"class":992},"list",[935,1829,1830],{"class":949},"()",[935,1832,969],{"class":945},[935,1834,1835,1837,1839,1841,1843,1845,1848,1850,1852,1855,1857],{"class":937,"line":1101},[935,1836,1614],{"class":941},[935,1838,1673],{"class":949},[935,1840,515],{"class":945},[935,1842,1678],{"class":949},[935,1844,515],{"class":945},[935,1846,1847],{"class":992},"delete",[935,1849,1780],{"class":949},[935,1851,515],{"class":945},[935,1853,1854],{"class":949},"id)",[935,1856,1278],{"class":945},[935,1858,1859],{"class":1180}," \u002F\u002F 204\n",[471,1861,1862,1863,1866],{},"Secrets are write-only: store the one you supplied. HTTPS URLs must be unique\nwithin the storefront\u002Fmode, with up to five endpoints per mode. New event names\nare not automatically subscribed; update ",[504,1864,1865],{},"enabledEvents"," explicitly.",[496,1868,1870],{"id":1869},"rotating-secrets","Rotating secrets",[471,1872,1873],{},"Every verification helper accepts a single secret or an array. During a\nrotation, pass both — the SDK accepts whichever signed the delivery:",[926,1875,1877],{"className":928,"code":1876,"language":930,"meta":931,"style":931},"const event = await constructWebhookEventFromRequest(request, [\n  process.env.VATLY_WEBHOOK_SECRET_OLD!,\n  process.env.VATLY_WEBHOOK_SECRET_NEW!,\n]);\n",[504,1878,1879,1898,1914,1929],{"__ignoreMap":931},[935,1880,1881,1883,1885,1887,1889,1891,1893,1895],{"class":937,"line":938},[935,1882,1566],{"class":985},[935,1884,1569],{"class":949},[935,1886,1572],{"class":945},[935,1888,1056],{"class":941},[935,1890,950],{"class":992},[935,1892,1579],{"class":949},[935,1894,1066],{"class":945},[935,1896,1897],{"class":949}," [\n",[935,1899,1900,1903,1905,1907,1909,1912],{"class":937,"line":972},[935,1901,1902],{"class":949},"  process",[935,1904,515],{"class":945},[935,1906,1074],{"class":949},[935,1908,515],{"class":945},[935,1910,1911],{"class":949},"VATLY_WEBHOOK_SECRET_OLD",[935,1913,1724],{"class":945},[935,1915,1916,1918,1920,1922,1924,1927],{"class":937,"line":979},[935,1917,1902],{"class":949},[935,1919,515],{"class":945},[935,1921,1074],{"class":949},[935,1923,515],{"class":945},[935,1925,1926],{"class":949},"VATLY_WEBHOOK_SECRET_NEW",[935,1928,1724],{"class":945},[935,1930,1931,1934],{"class":937,"line":1028},[935,1932,1933],{"class":949},"])",[935,1935,969],{"class":945},[496,1937,1939],{"id":1938},"fetching-a-persisted-event","Fetching a persisted event",[471,1941,1942,1943,1946,1947,1950,1951,1953,1954,1003],{},"Persisted events are available via the API. Note these are returned as the\n",[504,1944,1945],{},"WebhookEvent"," shape (",[504,1948,1949],{},"GET \u002Fwebhook-events\u002F{id}","), which — unlike an inbound\ndelivery — never includes the ",[504,1952,876],{}," call and always carries ",[504,1955,1492],{},[926,1957,1959],{"className":928,"code":1958,"language":930,"meta":931,"style":931},"const event = await vatly.webhookEvents.get(\"webhook_event_abc123\");\n",[504,1960,1961],{"__ignoreMap":931},[935,1962,1963,1965,1967,1969,1971,1973,1975,1978,1980,1983,1985,1987,1990,1992,1994],{"class":937,"line":938},[935,1964,1566],{"class":985},[935,1966,1569],{"class":949},[935,1968,1572],{"class":945},[935,1970,1056],{"class":941},[935,1972,1673],{"class":949},[935,1974,515],{"class":945},[935,1976,1977],{"class":949},"webhookEvents",[935,1979,515],{"class":945},[935,1981,1982],{"class":992},"get",[935,1984,996],{"class":949},[935,1986,966],{"class":945},[935,1988,1989],{"class":962},"webhook_event_abc123",[935,1991,966],{"class":945},[935,1993,1085],{"class":949},[935,1995,969],{"class":945},[1997,1998,1999],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":931,"searchDepth":972,"depth":972,"links":2001},[2002,2003,2004,2006,2007,2008,2009,2010],{"id":498,"depth":972,"text":499},{"id":885,"depth":972,"text":886},{"id":1465,"depth":972,"text":2005},"The webhook.setup event",{"id":1496,"depth":972,"text":1497},{"id":1545,"depth":972,"text":1546},{"id":1653,"depth":972,"text":1654},{"id":1869,"depth":972,"text":1870},{"id":1938,"depth":972,"text":1939},"Vatly sends webhooks to notify your application when events happen — an order being paid, a refund completing, a subscription being canceled.","md",null,{},{"title":50},{"title":50,"description":2011},"fiRmuFGet2OljWQatLwrBkpXsttjdddboqq0TnMmPu8",[2019,2021],{"title":108,"path":274,"stem":275,"description":2020,"children":-1},"A chargeback is a payment dispute raised by the cardholder's bank against an order.",{"title":280,"path":281,"stem":282,"description":2022,"children":-1},"Import VatlyClient from @getvatly\u002Fsdk.",1794594930425]