[{"data":1,"prerenderedAt":1409},["ShallowReactive",2],{"navigation_docs":3,"-packages-fluent-js-orders":465,"-packages-fluent-js-orders-surround":1404},[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":474,"extension":1398,"links":1399,"meta":1400,"navigation":1401,"path":307,"seo":1402,"stem":308,"__hash__":1403},"docs\u002F3.packages\u002F5.fluent-js\u002F06.orders.md","Orders and invoices",{"type":469,"value":470,"toc":1393},"minimark",[471,475,480,753,769,773,791,1068,1085,1094,1098,1105,1346,1353,1371,1389],[472,473,474],"p",{},"Fetch an order's invoice link, lines, and totals after checking the caller owns it.",[476,477,479],"h2",{"id":478},"read-the-order-and-invoice","Read the order and invoice",[481,482,487],"pre",{"className":483,"code":484,"language":485,"meta":486,"style":486},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import type { Vatly } from '@getvatly\u002Ffluent';\n\nexport async function invoice(vatly: Vatly, orderId: string) {\n  const order = vatly.order(orderId);\n  const model = await order.model();\n  return {\n    id: model.id,\n    status: model.status,\n    total: model.total,\n    lines: await order.lines(),\n    invoiceUrl: await order.invoiceUrl(),\n  };\n}\n","ts","",[488,489,490,529,536,583,614,639,647,665,682,699,720,741,747],"code",{"__ignoreMap":486},[491,492,495,499,502,506,510,513,516,519,523,526],"span",{"class":493,"line":494},"line",1,[491,496,498],{"class":497},"s7zQu","import",[491,500,501],{"class":497}," type",[491,503,505],{"class":504},"sMK4o"," {",[491,507,509],{"class":508},"sTEyZ"," Vatly",[491,511,512],{"class":504}," }",[491,514,515],{"class":497}," from",[491,517,518],{"class":504}," '",[491,520,522],{"class":521},"sfazB","@getvatly\u002Ffluent",[491,524,525],{"class":504},"'",[491,527,528],{"class":504},";\n",[491,530,532],{"class":493,"line":531},2,[491,533,535],{"emptyLinePlaceholder":534},true,"\n",[491,537,539,542,546,549,553,556,560,563,566,569,572,574,577,580],{"class":493,"line":538},3,[491,540,541],{"class":497},"export",[491,543,545],{"class":544},"spNyl"," async",[491,547,548],{"class":544}," function",[491,550,552],{"class":551},"s2Zo4"," invoice",[491,554,555],{"class":504},"(",[491,557,559],{"class":558},"sHdIc","vatly",[491,561,562],{"class":504},":",[491,564,509],{"class":565},"sBMFI",[491,567,568],{"class":504},",",[491,570,571],{"class":558}," orderId",[491,573,562],{"class":504},[491,575,576],{"class":565}," string",[491,578,579],{"class":504},")",[491,581,582],{"class":504}," {\n",[491,584,586,589,592,595,598,601,604,607,610,612],{"class":493,"line":585},4,[491,587,588],{"class":544},"  const",[491,590,591],{"class":508}," order",[491,593,594],{"class":504}," =",[491,596,597],{"class":508}," vatly",[491,599,600],{"class":504},".",[491,602,603],{"class":551},"order",[491,605,555],{"class":606},"swJcz",[491,608,609],{"class":508},"orderId",[491,611,579],{"class":606},[491,613,528],{"class":504},[491,615,617,619,622,624,627,629,631,634,637],{"class":493,"line":616},5,[491,618,588],{"class":544},[491,620,621],{"class":508}," model",[491,623,594],{"class":504},[491,625,626],{"class":497}," await",[491,628,591],{"class":508},[491,630,600],{"class":504},[491,632,633],{"class":551},"model",[491,635,636],{"class":606},"()",[491,638,528],{"class":504},[491,640,642,645],{"class":493,"line":641},6,[491,643,644],{"class":497},"  return",[491,646,582],{"class":504},[491,648,650,653,655,657,659,662],{"class":493,"line":649},7,[491,651,652],{"class":606},"    id",[491,654,562],{"class":504},[491,656,621],{"class":508},[491,658,600],{"class":504},[491,660,661],{"class":508},"id",[491,663,664],{"class":504},",\n",[491,666,668,671,673,675,677,680],{"class":493,"line":667},8,[491,669,670],{"class":606},"    status",[491,672,562],{"class":504},[491,674,621],{"class":508},[491,676,600],{"class":504},[491,678,679],{"class":508},"status",[491,681,664],{"class":504},[491,683,685,688,690,692,694,697],{"class":493,"line":684},9,[491,686,687],{"class":606},"    total",[491,689,562],{"class":504},[491,691,621],{"class":508},[491,693,600],{"class":504},[491,695,696],{"class":508},"total",[491,698,664],{"class":504},[491,700,702,705,707,709,711,713,716,718],{"class":493,"line":701},10,[491,703,704],{"class":606},"    lines",[491,706,562],{"class":504},[491,708,626],{"class":497},[491,710,591],{"class":508},[491,712,600],{"class":504},[491,714,715],{"class":551},"lines",[491,717,636],{"class":606},[491,719,664],{"class":504},[491,721,723,726,728,730,732,734,737,739],{"class":493,"line":722},11,[491,724,725],{"class":606},"    invoiceUrl",[491,727,562],{"class":504},[491,729,626],{"class":497},[491,731,591],{"class":508},[491,733,600],{"class":504},[491,735,736],{"class":551},"invoiceUrl",[491,738,636],{"class":606},[491,740,664],{"class":504},[491,742,744],{"class":493,"line":743},12,[491,745,746],{"class":504},"  };\n",[491,748,750],{"class":493,"line":749},13,[491,751,752],{"class":504},"}\n",[472,754,755,756,759,760,763,764,768],{},"The handle fetches once and caches the API resource. ",[488,757,758],{},"sync()"," refreshes it.\n",[488,761,762],{},"invoiceUrl()"," returns null if no link exists. These reads need no local order or\nline repository. Use ",[765,766,767],"a",{"href":313},"webhooks"," to persist payments and fulfill orders.",[476,770,772],{"id":771},"link-order-lines-to-subscriptions","Link order lines to subscriptions",[472,774,775,776,779,780,783,784,787,788,600],{},"Each line's ",[488,777,778],{},"relatedResources.subscriptionId"," names the subscription it belongs\nto. Signup, renewal and immediate-update lines all use it. Signup lines keep\n",[488,781,782],{},"productType: 'subscription_plan'"," with the plan in ",[488,785,786],{},"productId",". Renewals use\n",[488,789,790],{},"'subscription'",[481,792,794],{"className":483,"code":793,"language":485,"meta":486,"style":486},"import type { Order } from '@getvatly\u002Fsdk';\n\nexport function subscriptionLinks(order: Order) {\n  const linked = new Set\u003Cstring>();\n  const unresolved: string[] = [];\n  for (const line of order.lines) {\n    const id = line.relatedResources?.subscriptionId;\n    if (id) linked.add(id);\n    else if (line.productType === 'subscription_plan') unresolved.push(line.id);\n  }\n  return { subscriptionIds: [...linked], unresolvedLineIds: unresolved };\n}\n",[488,795,796,820,824,845,873,895,924,949,976,1025,1030,1064],{"__ignoreMap":486},[491,797,798,800,802,804,807,809,811,813,816,818],{"class":493,"line":494},[491,799,498],{"class":497},[491,801,501],{"class":497},[491,803,505],{"class":504},[491,805,806],{"class":508}," Order",[491,808,512],{"class":504},[491,810,515],{"class":497},[491,812,518],{"class":504},[491,814,815],{"class":521},"@getvatly\u002Fsdk",[491,817,525],{"class":504},[491,819,528],{"class":504},[491,821,822],{"class":493,"line":531},[491,823,535],{"emptyLinePlaceholder":534},[491,825,826,828,830,833,835,837,839,841,843],{"class":493,"line":538},[491,827,541],{"class":497},[491,829,548],{"class":544},[491,831,832],{"class":551}," subscriptionLinks",[491,834,555],{"class":504},[491,836,603],{"class":558},[491,838,562],{"class":504},[491,840,806],{"class":565},[491,842,579],{"class":504},[491,844,582],{"class":504},[491,846,847,849,852,854,857,860,863,866,869,871],{"class":493,"line":585},[491,848,588],{"class":544},[491,850,851],{"class":508}," linked",[491,853,594],{"class":504},[491,855,856],{"class":504}," new",[491,858,859],{"class":551}," Set",[491,861,862],{"class":504},"\u003C",[491,864,865],{"class":565},"string",[491,867,868],{"class":504},">",[491,870,636],{"class":606},[491,872,528],{"class":504},[491,874,875,877,880,882,884,887,890,893],{"class":493,"line":616},[491,876,588],{"class":544},[491,878,879],{"class":508}," unresolved",[491,881,562],{"class":504},[491,883,576],{"class":565},[491,885,886],{"class":606},"[] ",[491,888,889],{"class":504},"=",[491,891,892],{"class":606}," []",[491,894,528],{"class":504},[491,896,897,900,903,906,909,912,914,916,918,921],{"class":493,"line":641},[491,898,899],{"class":497},"  for",[491,901,902],{"class":606}," (",[491,904,905],{"class":544},"const",[491,907,908],{"class":508}," line",[491,910,911],{"class":504}," of",[491,913,591],{"class":508},[491,915,600],{"class":504},[491,917,715],{"class":508},[491,919,920],{"class":606},") ",[491,922,923],{"class":504},"{\n",[491,925,926,929,932,934,936,938,941,944,947],{"class":493,"line":649},[491,927,928],{"class":544},"    const",[491,930,931],{"class":508}," id",[491,933,594],{"class":504},[491,935,908],{"class":508},[491,937,600],{"class":504},[491,939,940],{"class":508},"relatedResources",[491,942,943],{"class":504},"?.",[491,945,946],{"class":508},"subscriptionId",[491,948,528],{"class":504},[491,950,951,954,956,958,960,963,965,968,970,972,974],{"class":493,"line":667},[491,952,953],{"class":497},"    if",[491,955,902],{"class":606},[491,957,661],{"class":508},[491,959,920],{"class":606},[491,961,962],{"class":508},"linked",[491,964,600],{"class":504},[491,966,967],{"class":551},"add",[491,969,555],{"class":606},[491,971,661],{"class":508},[491,973,579],{"class":606},[491,975,528],{"class":504},[491,977,978,981,984,986,988,990,993,996,998,1001,1003,1005,1008,1010,1013,1015,1017,1019,1021,1023],{"class":493,"line":684},[491,979,980],{"class":497},"    else",[491,982,983],{"class":497}," if",[491,985,902],{"class":606},[491,987,493],{"class":508},[491,989,600],{"class":504},[491,991,992],{"class":508},"productType",[491,994,995],{"class":504}," ===",[491,997,518],{"class":504},[491,999,1000],{"class":521},"subscription_plan",[491,1002,525],{"class":504},[491,1004,920],{"class":606},[491,1006,1007],{"class":508},"unresolved",[491,1009,600],{"class":504},[491,1011,1012],{"class":551},"push",[491,1014,555],{"class":606},[491,1016,493],{"class":508},[491,1018,600],{"class":504},[491,1020,661],{"class":508},[491,1022,579],{"class":606},[491,1024,528],{"class":504},[491,1026,1027],{"class":493,"line":701},[491,1028,1029],{"class":504},"  }\n",[491,1031,1032,1034,1036,1039,1041,1044,1047,1049,1052,1054,1057,1059,1061],{"class":493,"line":722},[491,1033,644],{"class":497},[491,1035,505],{"class":504},[491,1037,1038],{"class":606}," subscriptionIds",[491,1040,562],{"class":504},[491,1042,1043],{"class":606}," [",[491,1045,1046],{"class":504},"...",[491,1048,962],{"class":508},[491,1050,1051],{"class":606},"]",[491,1053,568],{"class":504},[491,1055,1056],{"class":606}," unresolvedLineIds",[491,1058,562],{"class":504},[491,1060,879],{"class":508},[491,1062,1063],{"class":504}," };\n",[491,1065,1066],{"class":493,"line":743},[491,1067,752],{"class":504},[472,1069,1070,1072,1073,1076,1077,1080,1081,1084],{},[488,1071,940],{}," is null on historical and unrelated lines, such as one-off\nproducts, and older payloads may omit it. ",[488,1074,1075],{},"{ subscriptionId: null }"," means a\nsignup's subscription is not available yet. It does not mean creation failed.\nFetch the order again later with ",[488,1078,1079],{},"vatly.order(id).sync()",", because a stored\n",[488,1082,1083],{},"order.paid"," snapshot keeps the value it was signed with. An ID does not prove\nthe subscription is active or that access is owed. Check its status and owner first.",[472,1086,1087,1089,1090,1093],{},[488,1088,1083],{}," handling stores the whole signed order, including these links, in\nyour ",[488,1091,1092],{},"orders"," repository. Fluent does not query orders by subscription. Index the\nstored line IDs yourself if you need that.",[476,1095,1097],{"id":1096},"money-and-reversals","Money and reversals",[472,1099,1100,1101,1104],{},"Use ",[488,1102,1103],{},"toMinorUnits"," for bigint arithmetic; keep the currency with the amount.",[481,1106,1108],{"className":483,"code":1107,"language":485,"meta":486,"style":486},"import { toMinorUnits } from '@getvatly\u002Fsdk';\nimport type { Vatly } from '@getvatly\u002Ffluent';\n\nexport async function reversalSummary(vatly: Vatly, orderId: string) {\n  const order = vatly.order(orderId);\n  const model = await order.model();\n  return {\n    totalMinor: toMinorUnits(model.total),\n    reversedMinor: await order.reversedSubtotal(),\n    refundableMinor: await order.refundableSubtotal(),\n    fullyReversed: await order.isFullyReversed(),\n    partiallyReversed: await order.isPartiallyReversed(),\n  };\n}\n",[488,1109,1110,1131,1153,1157,1188,1210,1230,1236,1257,1277,1297,1317,1337,1341],{"__ignoreMap":486},[491,1111,1112,1114,1116,1119,1121,1123,1125,1127,1129],{"class":493,"line":494},[491,1113,498],{"class":497},[491,1115,505],{"class":504},[491,1117,1118],{"class":508}," toMinorUnits",[491,1120,512],{"class":504},[491,1122,515],{"class":497},[491,1124,518],{"class":504},[491,1126,815],{"class":521},[491,1128,525],{"class":504},[491,1130,528],{"class":504},[491,1132,1133,1135,1137,1139,1141,1143,1145,1147,1149,1151],{"class":493,"line":531},[491,1134,498],{"class":497},[491,1136,501],{"class":497},[491,1138,505],{"class":504},[491,1140,509],{"class":508},[491,1142,512],{"class":504},[491,1144,515],{"class":497},[491,1146,518],{"class":504},[491,1148,522],{"class":521},[491,1150,525],{"class":504},[491,1152,528],{"class":504},[491,1154,1155],{"class":493,"line":538},[491,1156,535],{"emptyLinePlaceholder":534},[491,1158,1159,1161,1163,1165,1168,1170,1172,1174,1176,1178,1180,1182,1184,1186],{"class":493,"line":585},[491,1160,541],{"class":497},[491,1162,545],{"class":544},[491,1164,548],{"class":544},[491,1166,1167],{"class":551}," reversalSummary",[491,1169,555],{"class":504},[491,1171,559],{"class":558},[491,1173,562],{"class":504},[491,1175,509],{"class":565},[491,1177,568],{"class":504},[491,1179,571],{"class":558},[491,1181,562],{"class":504},[491,1183,576],{"class":565},[491,1185,579],{"class":504},[491,1187,582],{"class":504},[491,1189,1190,1192,1194,1196,1198,1200,1202,1204,1206,1208],{"class":493,"line":616},[491,1191,588],{"class":544},[491,1193,591],{"class":508},[491,1195,594],{"class":504},[491,1197,597],{"class":508},[491,1199,600],{"class":504},[491,1201,603],{"class":551},[491,1203,555],{"class":606},[491,1205,609],{"class":508},[491,1207,579],{"class":606},[491,1209,528],{"class":504},[491,1211,1212,1214,1216,1218,1220,1222,1224,1226,1228],{"class":493,"line":641},[491,1213,588],{"class":544},[491,1215,621],{"class":508},[491,1217,594],{"class":504},[491,1219,626],{"class":497},[491,1221,591],{"class":508},[491,1223,600],{"class":504},[491,1225,633],{"class":551},[491,1227,636],{"class":606},[491,1229,528],{"class":504},[491,1231,1232,1234],{"class":493,"line":649},[491,1233,644],{"class":497},[491,1235,582],{"class":504},[491,1237,1238,1241,1243,1245,1247,1249,1251,1253,1255],{"class":493,"line":667},[491,1239,1240],{"class":606},"    totalMinor",[491,1242,562],{"class":504},[491,1244,1118],{"class":551},[491,1246,555],{"class":606},[491,1248,633],{"class":508},[491,1250,600],{"class":504},[491,1252,696],{"class":508},[491,1254,579],{"class":606},[491,1256,664],{"class":504},[491,1258,1259,1262,1264,1266,1268,1270,1273,1275],{"class":493,"line":684},[491,1260,1261],{"class":606},"    reversedMinor",[491,1263,562],{"class":504},[491,1265,626],{"class":497},[491,1267,591],{"class":508},[491,1269,600],{"class":504},[491,1271,1272],{"class":551},"reversedSubtotal",[491,1274,636],{"class":606},[491,1276,664],{"class":504},[491,1278,1279,1282,1284,1286,1288,1290,1293,1295],{"class":493,"line":701},[491,1280,1281],{"class":606},"    refundableMinor",[491,1283,562],{"class":504},[491,1285,626],{"class":497},[491,1287,591],{"class":508},[491,1289,600],{"class":504},[491,1291,1292],{"class":551},"refundableSubtotal",[491,1294,636],{"class":606},[491,1296,664],{"class":504},[491,1298,1299,1302,1304,1306,1308,1310,1313,1315],{"class":493,"line":722},[491,1300,1301],{"class":606},"    fullyReversed",[491,1303,562],{"class":504},[491,1305,626],{"class":497},[491,1307,591],{"class":508},[491,1309,600],{"class":504},[491,1311,1312],{"class":551},"isFullyReversed",[491,1314,636],{"class":606},[491,1316,664],{"class":504},[491,1318,1319,1322,1324,1326,1328,1330,1333,1335],{"class":493,"line":743},[491,1320,1321],{"class":606},"    partiallyReversed",[491,1323,562],{"class":504},[491,1325,626],{"class":497},[491,1327,591],{"class":508},[491,1329,600],{"class":504},[491,1331,1332],{"class":551},"isPartiallyReversed",[491,1334,636],{"class":606},[491,1336,664],{"class":504},[491,1338,1339],{"class":493,"line":749},[491,1340,746],{"class":504},[491,1342,1344],{"class":493,"line":1343},14,[491,1345,752],{"class":504},[472,1347,1348,1349,1352],{},"Money uses decimal strings, not floats. Convert bigints to strings before returning\nJSON. Reversal predicates read the cached API resource, not local reversal lists.\n",[488,1350,1351],{},"isReversed()"," includes partial reversals. A paid order stays paid after a reversal.",[472,1354,1355,1358,1359,1362,1363,1366,1367,1370],{},[488,1356,1357],{},"order.refunds()"," and ",[488,1360,1361],{},"order.chargebacks()"," read your wired reversal repositories.\nWithout a driver they return an empty list. Use ",[488,1364,1365],{},"vatly.api.orders"," and\n",[488,1368,1369],{},"vatly.api.refunds"," to create refunds or query remote reversals. Check API state\nbefore retrying a refund whose outcome is unknown.",[472,1372,1373,1374,664,1379,1383,1384,1388],{},"For fields and refund rules, see ",[765,1375,96],{"href":1376,"rel":1377},"https:\u002F\u002Fdocs.vatly.com\u002Fapi-reference\u002Forders",[1378],"nofollow",[765,1380,100],{"href":1381,"rel":1382},"https:\u002F\u002Fdocs.vatly.com\u002Fapi-reference\u002Frefunds",[1378],", and\n",[765,1385,108],{"href":1386,"rel":1387},"https:\u002F\u002Fdocs.vatly.com\u002Fapi-reference\u002Fchargebacks",[1378]," in the API reference.",[1390,1391,1392],"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 .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":486,"searchDepth":531,"depth":531,"links":1394},[1395,1396,1397],{"id":478,"depth":531,"text":479},{"id":771,"depth":531,"text":772},{"id":1096,"depth":531,"text":1097},"md",null,{},{"title":96},{"title":467,"description":474},"p8Nb73-_rKhEEtkqQpZJ7yQ1WnTpS591TxNpfF42kxw",[1405,1407],{"title":88,"path":304,"stem":305,"description":1406,"children":-1},"Change an existing subscription with vatly.subscription(localRecord).",{"title":193,"path":310,"stem":311,"description":1408,"children":-1},"Send a signed-in customer to their invoices and subscription controls.",1794594931101]