[{"data":1,"prerenderedAt":1171},["ShallowReactive",2],{"navigation_docs":3,"-packages-fluent-js-customers":465,"-packages-fluent-js-customers-surround":1166},[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":1159,"extension":1160,"links":1161,"meta":1162,"navigation":1163,"path":298,"seo":1164,"stem":299,"__hash__":1165},"docs\u002F3.packages\u002F5.fluent-js\u002F03.customers.md","Customers and bindings",{"type":469,"value":470,"toc":1154},"minimark",[471,481,486,776,781,796,800,1092,1119,1123,1136,1150],[472,473,474,475,480],"p",{},"Find or create a Vatly customer for your signed-in user. Wire\n",[476,477,479],"a",{"href":478},"\u002Fpackages\u002Ffluent-js\u002Fcoreconcepts#billables-and-bindings","binding storage"," first.",[482,483,485],"h2",{"id":484},"create-and-bind","Create and bind",[487,488,493],"pre",{"className":489,"code":490,"language":491,"meta":492,"style":492},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import type { Vatly } from '@getvatly\u002Ffluent';\n\nexport async function customerFor(vatly: Vatly, hostId: string, email: string) {\n  const existing = await vatly.customers.findByHostCustomerId(hostId);\n  if (existing) return existing;\n  return vatly.customers.createFor(\n    hostId,\n    { email, name: 'Example Customer' },\n    { metadata: { accountId: hostId } },\n    { idempotencyKey: `customer-for:${hostId}` },\n  );\n}\n","ts","",[494,495,496,535,542,598,637,659,679,688,713,736,762,770],"code",{"__ignoreMap":492},[497,498,501,505,508,512,516,519,522,525,529,532],"span",{"class":499,"line":500},"line",1,[497,502,504],{"class":503},"s7zQu","import",[497,506,507],{"class":503}," type",[497,509,511],{"class":510},"sMK4o"," {",[497,513,515],{"class":514},"sTEyZ"," Vatly",[497,517,518],{"class":510}," }",[497,520,521],{"class":503}," from",[497,523,524],{"class":510}," '",[497,526,528],{"class":527},"sfazB","@getvatly\u002Ffluent",[497,530,531],{"class":510},"'",[497,533,534],{"class":510},";\n",[497,536,538],{"class":499,"line":537},2,[497,539,541],{"emptyLinePlaceholder":540},true,"\n",[497,543,545,548,552,555,559,562,566,569,572,575,578,580,583,585,588,590,592,595],{"class":499,"line":544},3,[497,546,547],{"class":503},"export",[497,549,551],{"class":550},"spNyl"," async",[497,553,554],{"class":550}," function",[497,556,558],{"class":557},"s2Zo4"," customerFor",[497,560,561],{"class":510},"(",[497,563,565],{"class":564},"sHdIc","vatly",[497,567,568],{"class":510},":",[497,570,515],{"class":571},"sBMFI",[497,573,574],{"class":510},",",[497,576,577],{"class":564}," hostId",[497,579,568],{"class":510},[497,581,582],{"class":571}," string",[497,584,574],{"class":510},[497,586,587],{"class":564}," email",[497,589,568],{"class":510},[497,591,582],{"class":571},[497,593,594],{"class":510},")",[497,596,597],{"class":510}," {\n",[497,599,601,604,607,610,613,616,619,622,624,627,630,633,635],{"class":499,"line":600},4,[497,602,603],{"class":550},"  const",[497,605,606],{"class":514}," existing",[497,608,609],{"class":510}," =",[497,611,612],{"class":503}," await",[497,614,615],{"class":514}," vatly",[497,617,618],{"class":510},".",[497,620,621],{"class":514},"customers",[497,623,618],{"class":510},[497,625,626],{"class":557},"findByHostCustomerId",[497,628,561],{"class":629},"swJcz",[497,631,632],{"class":514},"hostId",[497,634,594],{"class":629},[497,636,534],{"class":510},[497,638,640,643,646,649,652,655,657],{"class":499,"line":639},5,[497,641,642],{"class":503},"  if",[497,644,645],{"class":629}," (",[497,647,648],{"class":514},"existing",[497,650,651],{"class":629},") ",[497,653,654],{"class":503},"return",[497,656,606],{"class":514},[497,658,534],{"class":510},[497,660,662,665,667,669,671,673,676],{"class":499,"line":661},6,[497,663,664],{"class":503},"  return",[497,666,615],{"class":514},[497,668,618],{"class":510},[497,670,621],{"class":514},[497,672,618],{"class":510},[497,674,675],{"class":557},"createFor",[497,677,678],{"class":629},"(\n",[497,680,682,685],{"class":499,"line":681},7,[497,683,684],{"class":514},"    hostId",[497,686,687],{"class":510},",\n",[497,689,691,694,696,698,701,703,705,708,710],{"class":499,"line":690},8,[497,692,693],{"class":510},"    {",[497,695,587],{"class":514},[497,697,574],{"class":510},[497,699,700],{"class":629}," name",[497,702,568],{"class":510},[497,704,524],{"class":510},[497,706,707],{"class":527},"Example Customer",[497,709,531],{"class":510},[497,711,712],{"class":510}," },\n",[497,714,716,718,721,723,725,728,730,732,734],{"class":499,"line":715},9,[497,717,693],{"class":510},[497,719,720],{"class":629}," metadata",[497,722,568],{"class":510},[497,724,511],{"class":510},[497,726,727],{"class":629}," accountId",[497,729,568],{"class":510},[497,731,577],{"class":514},[497,733,518],{"class":510},[497,735,712],{"class":510},[497,737,739,741,744,746,749,752,755,757,760],{"class":499,"line":738},10,[497,740,693],{"class":510},[497,742,743],{"class":629}," idempotencyKey",[497,745,568],{"class":510},[497,747,748],{"class":510}," `",[497,750,751],{"class":527},"customer-for:",[497,753,754],{"class":510},"${",[497,756,632],{"class":514},[497,758,759],{"class":510},"}`",[497,761,712],{"class":510},[497,763,765,768],{"class":499,"line":764},11,[497,766,767],{"class":629},"  )",[497,769,534],{"class":510},[497,771,773],{"class":499,"line":772},12,[497,774,775],{"class":510},"}\n",[472,777,778,780],{},[494,779,675],{}," rejects an already-bound host. The API may return an existing customer\nfor the email; Fluent checks the binding before attaching it. A binding failure\ncannot undo remote creation. Reconcile the customer before retrying.",[472,782,783,784,787,788,791,792,795],{},"To link a verified existing customer, use ",[494,785,786],{},"vatly.customers.attribute(vatlyId, hostId)",".\nTo create without a host owner, use ",[494,789,790],{},"createUnattributed(profile, extra?, requestOptions?)",";\nit still needs ",[494,793,794],{},"bindings"," to record the ID.",[482,797,799],{"id":798},"read-and-update-identity","Read and update identity",[487,801,803],{"className":489,"code":802,"language":491,"meta":492,"style":492},"import type { Vatly } from '@getvatly\u002Ffluent';\n\nexport async function updateIdentity(vatly: Vatly, customerId: string) {\n  const customer = vatly.customer(customerId);\n  await customer.update({ name: null }); \u002F\u002F Explicitly clear the display name.\n  await customer.sync();                \u002F\u002F Refresh the cached API resource.\n  return customer.identity();          \u002F\u002F { name, email }\n}\n\nexport async function matchingCustomers(vatly: Vatly, email: string) {\n  const ids: string[] = [];\n  for await (const customer of vatly.customers.findByEmail(email)) ids.push(customer.id);\n  return ids;\n}\n",[494,804,805,827,831,863,888,923,942,960,964,968,999,1021,1078,1087],{"__ignoreMap":492},[497,806,807,809,811,813,815,817,819,821,823,825],{"class":499,"line":500},[497,808,504],{"class":503},[497,810,507],{"class":503},[497,812,511],{"class":510},[497,814,515],{"class":514},[497,816,518],{"class":510},[497,818,521],{"class":503},[497,820,524],{"class":510},[497,822,528],{"class":527},[497,824,531],{"class":510},[497,826,534],{"class":510},[497,828,829],{"class":499,"line":537},[497,830,541],{"emptyLinePlaceholder":540},[497,832,833,835,837,839,842,844,846,848,850,852,855,857,859,861],{"class":499,"line":544},[497,834,547],{"class":503},[497,836,551],{"class":550},[497,838,554],{"class":550},[497,840,841],{"class":557}," updateIdentity",[497,843,561],{"class":510},[497,845,565],{"class":564},[497,847,568],{"class":510},[497,849,515],{"class":571},[497,851,574],{"class":510},[497,853,854],{"class":564}," customerId",[497,856,568],{"class":510},[497,858,582],{"class":571},[497,860,594],{"class":510},[497,862,597],{"class":510},[497,864,865,867,870,872,874,876,879,881,884,886],{"class":499,"line":600},[497,866,603],{"class":550},[497,868,869],{"class":514}," customer",[497,871,609],{"class":510},[497,873,615],{"class":514},[497,875,618],{"class":510},[497,877,878],{"class":557},"customer",[497,880,561],{"class":629},[497,882,883],{"class":514},"customerId",[497,885,594],{"class":629},[497,887,534],{"class":510},[497,889,890,893,895,897,900,902,905,907,909,912,914,916,919],{"class":499,"line":639},[497,891,892],{"class":503},"  await",[497,894,869],{"class":514},[497,896,618],{"class":510},[497,898,899],{"class":557},"update",[497,901,561],{"class":629},[497,903,904],{"class":510},"{",[497,906,700],{"class":629},[497,908,568],{"class":510},[497,910,911],{"class":510}," null",[497,913,518],{"class":510},[497,915,594],{"class":629},[497,917,918],{"class":510},";",[497,920,922],{"class":921},"sHwdD"," \u002F\u002F Explicitly clear the display name.\n",[497,924,925,927,929,931,934,937,939],{"class":499,"line":661},[497,926,892],{"class":503},[497,928,869],{"class":514},[497,930,618],{"class":510},[497,932,933],{"class":557},"sync",[497,935,936],{"class":629},"()",[497,938,918],{"class":510},[497,940,941],{"class":921},"                \u002F\u002F Refresh the cached API resource.\n",[497,943,944,946,948,950,953,955,957],{"class":499,"line":681},[497,945,664],{"class":503},[497,947,869],{"class":514},[497,949,618],{"class":510},[497,951,952],{"class":557},"identity",[497,954,936],{"class":629},[497,956,918],{"class":510},[497,958,959],{"class":921},"          \u002F\u002F { name, email }\n",[497,961,962],{"class":499,"line":690},[497,963,775],{"class":510},[497,965,966],{"class":499,"line":715},[497,967,541],{"emptyLinePlaceholder":540},[497,969,970,972,974,976,979,981,983,985,987,989,991,993,995,997],{"class":499,"line":738},[497,971,547],{"class":503},[497,973,551],{"class":550},[497,975,554],{"class":550},[497,977,978],{"class":557}," matchingCustomers",[497,980,561],{"class":510},[497,982,565],{"class":564},[497,984,568],{"class":510},[497,986,515],{"class":571},[497,988,574],{"class":510},[497,990,587],{"class":564},[497,992,568],{"class":510},[497,994,582],{"class":571},[497,996,594],{"class":510},[497,998,597],{"class":510},[497,1000,1001,1003,1006,1008,1010,1013,1016,1019],{"class":499,"line":764},[497,1002,603],{"class":550},[497,1004,1005],{"class":514}," ids",[497,1007,568],{"class":510},[497,1009,582],{"class":571},[497,1011,1012],{"class":629},"[] ",[497,1014,1015],{"class":510},"=",[497,1017,1018],{"class":629}," []",[497,1020,534],{"class":510},[497,1022,1023,1026,1028,1030,1033,1035,1038,1040,1042,1044,1046,1049,1051,1054,1057,1060,1062,1065,1067,1069,1071,1074,1076],{"class":499,"line":772},[497,1024,1025],{"class":503},"  for",[497,1027,612],{"class":503},[497,1029,645],{"class":629},[497,1031,1032],{"class":550},"const",[497,1034,869],{"class":514},[497,1036,1037],{"class":510}," of",[497,1039,615],{"class":514},[497,1041,618],{"class":510},[497,1043,621],{"class":514},[497,1045,618],{"class":510},[497,1047,1048],{"class":557},"findByEmail",[497,1050,561],{"class":629},[497,1052,1053],{"class":514},"email",[497,1055,1056],{"class":629},")) ",[497,1058,1059],{"class":514},"ids",[497,1061,618],{"class":510},[497,1063,1064],{"class":557},"push",[497,1066,561],{"class":629},[497,1068,878],{"class":514},[497,1070,618],{"class":510},[497,1072,1073],{"class":514},"id",[497,1075,594],{"class":629},[497,1077,534],{"class":510},[497,1079,1081,1083,1085],{"class":499,"line":1080},13,[497,1082,664],{"class":503},[497,1084,1005],{"class":514},[497,1086,534],{"class":510},[497,1088,1090],{"class":499,"line":1089},14,[497,1091,775],{"class":510},[472,1093,1094,1095,1098,1099,1102,1103,1106,1107,1110,1111,1114,1115,618],{},"Handles fetch lazily and cache per handle. ",[494,1096,1097],{},"model()",", ",[494,1100,1101],{},"name()",", and ",[494,1104,1105],{},"email()"," read\nthat cache; ",[494,1108,1109],{},"sync()"," refreshes it. Email lookup searches all cursor pages on the\nserver. ",[494,1112,1113],{},"findOneByEmail"," returns the first match or null, not proof of ownership.\nIdentity updates do not change invoice addresses; use the\n",[476,1116,1118],{"href":1117},"\u002Fpackages\u002Ffluent-js\u002Fsubscriptions#update-billing-details","billing-update flow",[482,1120,1122],{"id":1121},"returning-from-checkout","Returning from checkout",[472,1124,1125,1128,1129,1132,1133,618],{},[494,1126,1127],{},"customerIdFromCheckout(checkoutId)"," returns an ID or null for a missing customer\nor 404; other API errors propagate. ",[494,1130,1131],{},"claimCustomerFromCheckout(checkoutId, hostId)","\nbinds that customer. Verify checkout ownership before calling it: an ID in a return\nURL is not proof. See ",[476,1134,1135],{"href":313},"payment confirmation",[472,1137,1138,1139,1142,1143,1149],{},"See ",[476,1140,1141],{"href":310},"customer portal"," for portal links and the\n",[476,1144,1148],{"href":1145,"rel":1146},"https:\u002F\u002Fdocs.vatly.com\u002Fapi-reference\u002Fcustomers",[1147],"nofollow","Customers API reference"," for field details.",[1151,1152,1153],"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);}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}",{"title":492,"searchDepth":537,"depth":537,"links":1155},[1156,1157,1158],{"id":484,"depth":537,"text":485},{"id":798,"depth":537,"text":799},{"id":1121,"depth":537,"text":1122},"Find or create a Vatly customer for your signed-in user.","md",null,{},{"title":68},{"title":467,"description":1159},"X8zjatnT1xStKLDUJodgHUhcT4n8a5451ndPlGvxVUU",[1167,1169],{"title":177,"path":295,"stem":296,"description":1168,"children":-1},"Connect Fluent to your existing tables through storage drivers.",{"title":80,"path":301,"stem":302,"description":1170,"children":-1},"Create a hosted payment page, then redirect the customer to checkout.getUrl().",1794594930883]