[{"data":1,"prerenderedAt":1374},["ShallowReactive",2],{"navigation_docs":3,"-packages-fluent-python-subscriptions":465,"-packages-fluent-python-subscriptions-surround":1369},[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":467,"body":468,"description":1362,"extension":1363,"links":1364,"meta":1365,"navigation":1366,"path":387,"seo":1367,"stem":388,"__hash__":1368},"docs\u002F3.packages\u002F7.fluent-python\u002F05.subscriptions.md","Manage subscriptions",{"type":469,"value":470,"toc":1356},"minimark",[471,484,489,814,825,914,918,1047,1061,1065,1180,1202,1206,1314,1344,1352],[472,473,474,475,479,480,483],"p",{},"Load a locally owned subscription, authorize its entity, then use a handle for\nplan changes or cancellation. Examples accept the configured ",[476,477,478],"code",{},"vatly"," from\n",[481,482,173],"a",{"href":375},"; its repositories must be wired.",[485,486,488],"h2",{"id":487},"load-a-handle-and-change-a-plan","Load a handle and change a plan",[490,491,496],"pre",{"className":492,"code":493,"language":494,"meta":495,"style":495},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from vatly import RequestOptions\nfrom vatly_fluent import EntityRef, FluentError, Vatly\n\n\nasync def example(vatly: Vatly):\n    record = await vatly.wiring.subscriptions.find_by_vatly_id(\"subscription_example\")\n    if record is None or record.entity != EntityRef(\"team\", \"42\"):\n        raise FluentError(\"Subscription is not owned by this team\")\n    handle = vatly.subscription(record)\n    await handle.swap(\n        \"subscription_plan_pro\",\n        options=RequestOptions(\n            idempotency_key=\"team-42:plan-change-1\",\n        ),\n    )\n    return handle.model().resource\n","python","",[476,497,498,517,542,549,554,583,629,681,700,722,739,753,766,783,789,795],{"__ignoreMap":495},[499,500,503,507,511,514],"span",{"class":501,"line":502},"line",1,[499,504,506],{"class":505},"s7zQu","from",[499,508,510],{"class":509},"sTEyZ"," vatly ",[499,512,513],{"class":505},"import",[499,515,516],{"class":509}," RequestOptions\n",[499,518,520,522,525,527,530,534,537,539],{"class":501,"line":519},2,[499,521,506],{"class":505},[499,523,524],{"class":509}," vatly_fluent ",[499,526,513],{"class":505},[499,528,529],{"class":509}," EntityRef",[499,531,533],{"class":532},"sMK4o",",",[499,535,536],{"class":509}," FluentError",[499,538,533],{"class":532},[499,540,541],{"class":509}," Vatly\n",[499,543,545],{"class":501,"line":544},3,[499,546,548],{"emptyLinePlaceholder":547},true,"\n",[499,550,552],{"class":501,"line":551},4,[499,553,548],{"emptyLinePlaceholder":547},[499,555,557,561,564,568,571,574,577,580],{"class":501,"line":556},5,[499,558,560],{"class":559},"spNyl","async",[499,562,563],{"class":559}," def",[499,565,567],{"class":566},"s2Zo4"," example",[499,569,570],{"class":532},"(",[499,572,478],{"class":573},"sHdIc",[499,575,576],{"class":532},":",[499,578,579],{"class":509}," Vatly",[499,581,582],{"class":532},"):\n",[499,584,586,589,592,595,598,601,605,607,610,612,615,617,620,624,626],{"class":501,"line":585},6,[499,587,588],{"class":509},"    record ",[499,590,591],{"class":532},"=",[499,593,594],{"class":505}," await",[499,596,597],{"class":509}," vatly",[499,599,600],{"class":532},".",[499,602,604],{"class":603},"swJcz","wiring",[499,606,600],{"class":532},[499,608,609],{"class":603},"subscriptions",[499,611,600],{"class":532},[499,613,614],{"class":566},"find_by_vatly_id",[499,616,570],{"class":532},[499,618,619],{"class":532},"\"",[499,621,623],{"class":622},"sfazB","subscription_example",[499,625,619],{"class":532},[499,627,628],{"class":532},")\n",[499,630,632,635,638,641,644,647,650,652,655,658,660,662,664,667,669,671,674,677,679],{"class":501,"line":631},7,[499,633,634],{"class":505},"    if",[499,636,637],{"class":509}," record ",[499,639,640],{"class":532},"is",[499,642,643],{"class":532}," None",[499,645,646],{"class":532}," or",[499,648,649],{"class":509}," record",[499,651,600],{"class":532},[499,653,654],{"class":603},"entity",[499,656,657],{"class":532}," !=",[499,659,529],{"class":566},[499,661,570],{"class":532},[499,663,619],{"class":532},[499,665,666],{"class":622},"team",[499,668,619],{"class":532},[499,670,533],{"class":532},[499,672,673],{"class":532}," \"",[499,675,676],{"class":622},"42",[499,678,619],{"class":532},[499,680,582],{"class":532},[499,682,684,687,689,691,693,696,698],{"class":501,"line":683},8,[499,685,686],{"class":505},"        raise",[499,688,536],{"class":566},[499,690,570],{"class":532},[499,692,619],{"class":532},[499,694,695],{"class":622},"Subscription is not owned by this team",[499,697,619],{"class":532},[499,699,628],{"class":532},[499,701,703,706,708,710,712,715,717,720],{"class":501,"line":702},9,[499,704,705],{"class":509},"    handle ",[499,707,591],{"class":532},[499,709,597],{"class":509},[499,711,600],{"class":532},[499,713,714],{"class":566},"subscription",[499,716,570],{"class":532},[499,718,719],{"class":566},"record",[499,721,628],{"class":532},[499,723,725,728,731,733,736],{"class":501,"line":724},10,[499,726,727],{"class":505},"    await",[499,729,730],{"class":509}," handle",[499,732,600],{"class":532},[499,734,735],{"class":566},"swap",[499,737,738],{"class":532},"(\n",[499,740,742,745,748,750],{"class":501,"line":741},11,[499,743,744],{"class":532},"        \"",[499,746,747],{"class":622},"subscription_plan_pro",[499,749,619],{"class":532},[499,751,752],{"class":532},",\n",[499,754,756,759,761,764],{"class":501,"line":755},12,[499,757,758],{"class":573},"        options",[499,760,591],{"class":532},[499,762,763],{"class":566},"RequestOptions",[499,765,738],{"class":532},[499,767,769,772,774,776,779,781],{"class":501,"line":768},13,[499,770,771],{"class":573},"            idempotency_key",[499,773,591],{"class":532},[499,775,619],{"class":532},[499,777,778],{"class":622},"team-42:plan-change-1",[499,780,619],{"class":532},[499,782,752],{"class":532},[499,784,786],{"class":501,"line":785},14,[499,787,788],{"class":532},"        ),\n",[499,790,792],{"class":501,"line":791},15,[499,793,794],{"class":532},"    )\n",[499,796,798,801,803,805,808,811],{"class":501,"line":797},16,[499,799,800],{"class":505},"    return",[499,802,730],{"class":509},[499,804,600],{"class":532},[499,806,807],{"class":566},"model",[499,809,810],{"class":532},"().",[499,812,813],{"class":603},"resource\n",[472,815,816,817,820,821,824],{},"The host must authorize team 42 separately. A handle's ",[476,818,819],{},"model()"," is local; methods\nsuch as ",[476,822,823],{},"sync()"," make API calls. Scheduled changes do not prematurely replace the\nactive plan.",[826,827,828,841],"table",{},[829,830,831],"thead",{},[832,833,834,838],"tr",{},[835,836,837],"th",{},"Method",[835,839,840],{},"Behavior",[842,843,844,854,864,874,884,894,904],"tbody",{},[832,845,846,851],{},[847,848,849],"td",{},[476,850,735],{},[847,852,853],{},"Schedule a plan change by default",[832,855,856,861],{},[847,857,858],{},[476,859,860],{},"swap_and_invoice",[847,862,863],{},"Apply and invoice immediately",[832,865,866,871],{},[847,867,868],{},[476,869,870],{},"swap_without_charge",[847,872,873],{},"Apply now, disable proration charge",[832,875,876,881],{},[847,877,878],{},[476,879,880],{},"cancel(immediately=False)",[847,882,883],{},"Request cancellation; wait for signed events to update local state",[832,885,886,891],{},[847,887,888],{},[476,889,890],{},"resume",[847,892,893],{},"Resume through the API and save its returned snapshot",[832,895,896,901],{},[847,897,898],{},[476,899,900],{},"sync",[847,902,903],{},"Refresh full resource and local expiry",[832,905,906,911],{},[847,907,908],{},[476,909,910],{},"update_billing",[847,912,913],{},"Return hosted billing URL; requires both redirect URLs",[485,915,917],{"id":916},"request-cancellation","Request cancellation",[490,919,921],{"className":492,"code":920,"language":494,"meta":495,"style":495},"from vatly import RequestOptions\nfrom vatly_fluent import LocalSubscription, Vatly\n\n\nasync def example(vatly: Vatly, local: LocalSubscription):\n    # local has already been authorized by the caller.\n    await vatly.subscription(local).cancel(\n        immediately=False, options=RequestOptions(idempotency_key=\"cancel:42\")\n    )\n",[476,922,923,933,948,952,956,983,989,1012,1043],{"__ignoreMap":495},[499,924,925,927,929,931],{"class":501,"line":502},[499,926,506],{"class":505},[499,928,510],{"class":509},[499,930,513],{"class":505},[499,932,516],{"class":509},[499,934,935,937,939,941,944,946],{"class":501,"line":519},[499,936,506],{"class":505},[499,938,524],{"class":509},[499,940,513],{"class":505},[499,942,943],{"class":509}," LocalSubscription",[499,945,533],{"class":532},[499,947,541],{"class":509},[499,949,950],{"class":501,"line":544},[499,951,548],{"emptyLinePlaceholder":547},[499,953,954],{"class":501,"line":551},[499,955,548],{"emptyLinePlaceholder":547},[499,957,958,960,962,964,966,968,970,972,974,977,979,981],{"class":501,"line":556},[499,959,560],{"class":559},[499,961,563],{"class":559},[499,963,567],{"class":566},[499,965,570],{"class":532},[499,967,478],{"class":573},[499,969,576],{"class":532},[499,971,579],{"class":509},[499,973,533],{"class":532},[499,975,976],{"class":573}," local",[499,978,576],{"class":532},[499,980,943],{"class":509},[499,982,582],{"class":532},[499,984,985],{"class":501,"line":585},[499,986,988],{"class":987},"sHwdD","    # local has already been authorized by the caller.\n",[499,990,991,993,995,997,999,1001,1004,1007,1010],{"class":501,"line":631},[499,992,727],{"class":505},[499,994,597],{"class":509},[499,996,600],{"class":532},[499,998,714],{"class":566},[499,1000,570],{"class":532},[499,1002,1003],{"class":566},"local",[499,1005,1006],{"class":532},").",[499,1008,1009],{"class":566},"cancel",[499,1011,738],{"class":532},[499,1013,1014,1017,1020,1023,1025,1027,1029,1032,1034,1036,1039,1041],{"class":501,"line":683},[499,1015,1016],{"class":573},"        immediately",[499,1018,1019],{"class":532},"=False,",[499,1021,1022],{"class":573}," options",[499,1024,591],{"class":532},[499,1026,763],{"class":566},[499,1028,570],{"class":532},[499,1030,1031],{"class":573},"idempotency_key",[499,1033,591],{"class":532},[499,1035,619],{"class":532},[499,1037,1038],{"class":622},"cancel:42",[499,1040,619],{"class":532},[499,1042,628],{"class":532},[499,1044,1045],{"class":501,"line":702},[499,1046,794],{"class":532},[472,1048,1049,1050,752,1053,1056,1057,1060],{},"Only offer resume while Vatly permits it. ",[476,1051,1052],{},"scheduled_update()",[476,1054,1055],{},"has_scheduled_update()"," and ",[476,1058,1059],{},"cancellation_reason()"," read remotely.",[485,1062,1064],{"id":1063},"use-expiry-without-mistaking-it-for-entitlement","Use expiry without mistaking it for entitlement",[490,1066,1068],{"className":492,"code":1067,"language":494,"meta":495,"style":495},"from vatly_fluent import LocalSubscription, Vatly\n\n\nasync def example(vatly: Vatly, local: LocalSubscription):\n    handle = vatly.subscription(local)\n    await handle.sync()\n    return handle.model().resource.status, handle.state()\n",[476,1069,1070,1084,1088,1092,1118,1136,1149],{"__ignoreMap":495},[499,1071,1072,1074,1076,1078,1080,1082],{"class":501,"line":502},[499,1073,506],{"class":505},[499,1075,524],{"class":509},[499,1077,513],{"class":505},[499,1079,943],{"class":509},[499,1081,533],{"class":532},[499,1083,541],{"class":509},[499,1085,1086],{"class":501,"line":519},[499,1087,548],{"emptyLinePlaceholder":547},[499,1089,1090],{"class":501,"line":544},[499,1091,548],{"emptyLinePlaceholder":547},[499,1093,1094,1096,1098,1100,1102,1104,1106,1108,1110,1112,1114,1116],{"class":501,"line":551},[499,1095,560],{"class":559},[499,1097,563],{"class":559},[499,1099,567],{"class":566},[499,1101,570],{"class":532},[499,1103,478],{"class":573},[499,1105,576],{"class":532},[499,1107,579],{"class":509},[499,1109,533],{"class":532},[499,1111,976],{"class":573},[499,1113,576],{"class":532},[499,1115,943],{"class":509},[499,1117,582],{"class":532},[499,1119,1120,1122,1124,1126,1128,1130,1132,1134],{"class":501,"line":556},[499,1121,705],{"class":509},[499,1123,591],{"class":532},[499,1125,597],{"class":509},[499,1127,600],{"class":532},[499,1129,714],{"class":566},[499,1131,570],{"class":532},[499,1133,1003],{"class":566},[499,1135,628],{"class":532},[499,1137,1138,1140,1142,1144,1146],{"class":501,"line":585},[499,1139,727],{"class":505},[499,1141,730],{"class":509},[499,1143,600],{"class":532},[499,1145,900],{"class":566},[499,1147,1148],{"class":532},"()\n",[499,1150,1151,1153,1155,1157,1159,1161,1164,1166,1169,1171,1173,1175,1178],{"class":501,"line":631},[499,1152,800],{"class":505},[499,1154,730],{"class":509},[499,1156,600],{"class":532},[499,1158,807],{"class":566},[499,1160,810],{"class":532},[499,1162,1163],{"class":603},"resource",[499,1165,600],{"class":532},[499,1167,1168],{"class":603},"status",[499,1170,533],{"class":532},[499,1172,730],{"class":509},[499,1174,600],{"class":532},[499,1176,1177],{"class":566},"state",[499,1179,1148],{"class":532},[472,1181,1182,1185,1186,1189,1190,1193,1194,1197,1198,1201],{},[476,1183,1184],{},"state()"," uses ",[476,1187,1188],{},"ends_at"," only. Check the resource status and your product's access\nrules too. ",[476,1191,1192],{},"canceled_at"," is the request time, not grace expiry. The shared mapper\nuses actual ",[476,1195,1196],{},"ended_at",", otherwise usable future renewal\u002Fpaid\u002Ftrial information or\na trusted prior end. Missing or conflicting trial\u002Fcycle deadlines raise\n",[476,1199,1200],{},"FluentError",", preserving committed state. Monitor and reconcile failures; stale\nstate is not proof of continuing access. An active snapshot clears stale expiry.",[485,1203,1205],{"id":1204},"recover-an-owned-checkout","Recover an owned checkout",[490,1207,1209],{"className":492,"code":1208,"language":494,"meta":495,"style":495},"from vatly_fluent import Vatly\n\n\nasync def example(vatly: Vatly):\n    result = await vatly.reconcile_checkout(\"checkout_example\", attempts=2)\n    return result.subscriptions, result.pending_subscription_ids, result.legacy_plan_ids\n",[476,1210,1211,1221,1225,1229,1247,1285],{"__ignoreMap":495},[499,1212,1213,1215,1217,1219],{"class":501,"line":502},[499,1214,506],{"class":505},[499,1216,524],{"class":509},[499,1218,513],{"class":505},[499,1220,541],{"class":509},[499,1222,1223],{"class":501,"line":519},[499,1224,548],{"emptyLinePlaceholder":547},[499,1226,1227],{"class":501,"line":544},[499,1228,548],{"emptyLinePlaceholder":547},[499,1230,1231,1233,1235,1237,1239,1241,1243,1245],{"class":501,"line":551},[499,1232,560],{"class":559},[499,1234,563],{"class":559},[499,1236,567],{"class":566},[499,1238,570],{"class":532},[499,1240,478],{"class":573},[499,1242,576],{"class":532},[499,1244,579],{"class":509},[499,1246,582],{"class":532},[499,1248,1249,1252,1254,1256,1258,1260,1263,1265,1267,1270,1272,1274,1277,1279,1283],{"class":501,"line":556},[499,1250,1251],{"class":509},"    result ",[499,1253,591],{"class":532},[499,1255,594],{"class":505},[499,1257,597],{"class":509},[499,1259,600],{"class":532},[499,1261,1262],{"class":566},"reconcile_checkout",[499,1264,570],{"class":532},[499,1266,619],{"class":532},[499,1268,1269],{"class":622},"checkout_example",[499,1271,619],{"class":532},[499,1273,533],{"class":532},[499,1275,1276],{"class":573}," attempts",[499,1278,591],{"class":532},[499,1280,1282],{"class":1281},"sbssI","2",[499,1284,628],{"class":532},[499,1286,1287,1289,1292,1294,1296,1298,1300,1302,1305,1307,1309,1311],{"class":501,"line":585},[499,1288,800],{"class":505},[499,1290,1291],{"class":509}," result",[499,1293,600],{"class":532},[499,1295,609],{"class":603},[499,1297,533],{"class":532},[499,1299,1291],{"class":509},[499,1301,600],{"class":532},[499,1303,1304],{"class":603},"pending_subscription_ids",[499,1306,533],{"class":532},[499,1308,1291],{"class":509},[499,1310,600],{"class":532},[499,1312,1313],{"class":603},"legacy_plan_ids\n",[472,1315,1316,1317,1320,1321,1323,1324,1327,1328,1331,1332,1335,1336,1339,1340,1343],{},"Authorize the checkout and wrap local writes in your driver's transaction. Reads\nfollow checkout → order → distinct subscription IDs from each line's\n",[476,1318,1319],{},"relatedResources.subscriptionId"," and from ",[476,1322,714],{}," renewal lines; repeated\n404s remain pending. A signup line whose ",[476,1325,1326],{},"subscriptionId"," is still null is\nreported in ",[476,1329,1330],{},"unresolved_line_ids",": core has not resolved that subscription yet, so\nreconcile again later; it may never resolve. Plan lines on historical orders\nwithout ",[476,1333,1334],{},"relatedResources"," are reported as ",[476,1337,1338],{},"legacy_plan_ids",". A plan\u002Fcustomer\nmatch is never an ownership fallback. Trial flows can lack ",[476,1341,1342],{},"order.paid",", so reconciliation\nmust be explicit. Unknown linkage must not grant access.",[472,1345,1346],{},[481,1347,1351],{"href":1348,"rel":1349},"https:\u002F\u002Fdocs.vatly.com\u002Fapi-reference\u002Fsubscriptions",[1350],"nofollow","Subscription API reference",[1353,1354,1355],"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 .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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);}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 pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":495,"searchDepth":519,"depth":519,"links":1357},[1358,1359,1360,1361],{"id":487,"depth":519,"text":488},{"id":916,"depth":519,"text":917},{"id":1063,"depth":519,"text":1064},{"id":1204,"depth":519,"text":1205},"Load a locally owned subscription, authorize its entity, then use a handle for plan changes or cancellation.","md",null,{},{"title":88},{"title":467,"description":1362},"RtDvONZn9IRVuQG0wN7ANCjm8xqe6oXB3GOfFUkyxsg",[1370,1372],{"title":80,"path":384,"stem":385,"description":1371,"children":-1},"Build a cart, then call create() to make the API request.",{"title":96,"path":390,"stem":391,"description":1373,"children":-1},"Use an order handle to read purchased lines, an invoice link and exact reversal amounts.",1794594933130]