[{"data":1,"prerenderedAt":203},["ShallowReactive",2],{"docs-\u002Fapi\u002Fbilling":3},{"id":4,"title":5,"body":6,"description":195,"extension":196,"meta":197,"navigation":198,"path":199,"seo":200,"stem":201,"__hash__":202},"docs\u002Fdocs\u002Fapi\u002Fbilling.md","Billing API",{"type":7,"value":8,"toc":185},"minimark",[9,13,21,49,55,83,89,113,119,146,152],[10,11,5],"h1",{"id":12},"billing-api",[14,15,17],"h3",{"id":16},"get-apibillingstate",[18,19,20],"code",{},"GET \u002Fapi\u002Fbilling\u002Fstate",[22,23,24,28,31,34,37,44],"ul",{},[25,26,27],"li",{},"Purpose: Return billing state and plan limits for the user.",[25,29,30],{},"Auth: Clerk session.",[25,32,33],{},"Request shape: none.",[25,35,36],{},"Response shape: Plan\u002Fstatus + limits + period metadata.",[25,38,39,40,43],{},"Key errors: ",[18,41,42],{},"401",".",[25,45,46,47,43],{},"Example: ",[18,48,20],{},[14,50,52],{"id":51},"post-apibillingcheckout",[18,53,54],{},"POST \u002Fapi\u002Fbilling\u002Fcheckout",[22,56,57,60,62,64,71,79],{},[25,58,59],{},"Purpose: Create a Stripe Checkout session for upgrade.",[25,61,30],{},[25,63,33],{},[25,65,66,67,70],{},"Response shape: ",[18,68,69],{},"{ url }"," for redirect.",[25,72,39,73,76,77,43],{},[18,74,75],{},"400"," when checkout cannot be created, ",[18,78,42],{},[25,80,46,81,43],{},[18,82,54],{},[14,84,86],{"id":85},"post-apibillingportal",[18,87,88],{},"POST \u002Fapi\u002Fbilling\u002Fportal",[22,90,91,94,96,98,102,109],{},[25,92,93],{},"Purpose: Create a Stripe Billing Portal session.",[25,95,30],{},[25,97,33],{},[25,99,66,100,70],{},[18,101,69],{},[25,103,39,104,106,107,43],{},[18,105,42],{},", ",[18,108,75],{},[25,110,46,111,43],{},[18,112,88],{},[14,114,116],{"id":115},"post-apibillingsync",[18,117,118],{},"POST \u002Fapi\u002Fbilling\u002Fsync",[22,120,121,124,127,129,135,142],{},[25,122,123],{},"Purpose: Force sync billing state from Stripe to local records.",[25,125,126],{},"Auth: Clerk session (administrative\u002Fowner action per app policy).",[25,128,33],{},[25,130,66,131,134],{},[18,132,133],{},"{ ok }"," or sync result payload.",[25,136,39,137,106,139,43],{},[18,138,42],{},[18,140,141],{},"403",[25,143,46,144,43],{},[18,145,118],{},[14,147,149],{"id":148},"post-apibillingwebhook",[18,150,151],{},"POST \u002Fapi\u002Fbilling\u002Fwebhook",[22,153,154,157,160,163,173,178],{},[25,155,156],{},"Purpose: Receive Stripe webhook events and update billing state.",[25,158,159],{},"Auth: Stripe webhook signature (no Clerk session).",[25,161,162],{},"Request shape: Raw Stripe payload + signature header.",[25,164,66,165,168,169,172],{},[18,166,167],{},"{ received: true }"," \u002F ",[18,170,171],{},"{ ok: true }"," (zavisno od handlera).",[25,174,39,175,177],{},[18,176,75],{}," invalid signature\u002Fpayload.",[25,179,180,181,184],{},"Example: Stripe webhook request with ",[18,182,183],{},"Stripe-Signature"," header.",{"title":186,"searchDepth":187,"depth":187,"links":188},"",2,[189,191,192,193,194],{"id":16,"depth":190,"text":20},3,{"id":51,"depth":190,"text":54},{"id":85,"depth":190,"text":88},{"id":115,"depth":190,"text":118},{"id":148,"depth":190,"text":151},"Subscription state, checkout\u002Fportal sessions, sync, and Stripe webhook handling.","md",{},true,"\u002Fdocs\u002Fapi\u002Fbilling",{"title":5,"description":195},"docs\u002Fapi\u002Fbilling","Fcmbz01pMjNRctFNJ6c0B62RNB97uZ_1TISyfobTvKM",1777579477592]