[{"data":1,"prerenderedAt":369},["ShallowReactive",2],{"navigation_docs":3,"-guides-customer-portal":132,"-guides-customer-portal-surround":364},[4,30,47,128],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","\u002Fgetting-started","1.getting-started",[9,13,17,21,25],{"title":10,"path":11,"stem":12},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction",{"title":14,"path":15,"stem":16},"Quickstart","\u002Fgetting-started\u002Fquickstart","1.getting-started\u002F2.quickstart",{"title":18,"path":19,"stem":20},"Authentication","\u002Fgetting-started\u002Fauthentication","1.getting-started\u002F3.authentication",{"title":22,"path":23,"stem":24},"Self-Hosting","\u002Fgetting-started\u002Fself-hosting","1.getting-started\u002F4.self-hosting",{"title":26,"path":27,"stem":28},"Build an Integration","\u002Fgetting-started\u002Fbuild-an-integration","1.getting-started\u002F5.build-an-integration",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Sdks","\u002Fsdks","2.sdks",[35,39,43],{"title":36,"path":37,"stem":38},"TypeScript SDK","\u002Fsdks\u002Ftypescript","2.sdks\u002F1.typescript",{"title":40,"path":41,"stem":42},"Python SDK","\u002Fsdks\u002Fpython","2.sdks\u002F2.python",{"title":44,"path":45,"stem":46},"PHP SDK","\u002Fsdks\u002Fphp","2.sdks\u002F3.php",{"title":48,"path":49,"stem":50,"children":51,"page":29},"Guides","\u002Fguides","3.guides",[52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124],{"title":53,"path":54,"stem":55},"Customers","\u002Fguides\u002Fcustomers","3.guides\u002F1.customers",{"title":57,"path":58,"stem":59},"Usage-Based Billing","\u002Fguides\u002Fusage-billing","3.guides\u002F10.usage-billing",{"title":61,"path":62,"stem":63},"Wallets","\u002Fguides\u002Fwallets","3.guides\u002F11.wallets",{"title":65,"path":66,"stem":67},"Coupons, Add-ons and Credit Notes","\u002Fguides\u002Fcoupons-add-ons-credit-notes","3.guides\u002F12.coupons-add-ons-credit-notes",{"title":69,"path":70,"stem":71},"Taxes","\u002Fguides\u002Ftaxes","3.guides\u002F13.taxes",{"title":73,"path":74,"stem":75},"Customer Portal","\u002Fguides\u002Fcustomer-portal","3.guides\u002F14.customer-portal",{"title":77,"path":78,"stem":79},"Ledger","\u002Fguides\u002Fledger","3.guides\u002F15.ledger",{"title":81,"path":82,"stem":83},"Plan Limits and Access","\u002Fguides\u002Fplan-limits-and-access","3.guides\u002F16.plan-limits-and-access",{"title":85,"path":86,"stem":87},"Currencies and Exchange Rates","\u002Fguides\u002Fcurrencies","3.guides\u002F17.currencies",{"title":89,"path":90,"stem":91},"Charge a Customer","\u002Fguides\u002Fcharge-a-customer","3.guides\u002F18.charge-a-customer",{"title":93,"path":94,"stem":95},"One-time Products & Partial Payments","\u002Fguides\u002Fone-time-products-and-partial-payments","3.guides\u002F19.one-time-products-and-partial-payments",{"title":97,"path":98,"stem":99},"Plans & Pricing","\u002Fguides\u002Fplans-and-pricing","3.guides\u002F2.plans-and-pricing",{"title":101,"path":102,"stem":103},"Subscriptions","\u002Fguides\u002Fsubscriptions","3.guides\u002F3.subscriptions",{"title":105,"path":106,"stem":107},"Invoices & Payments","\u002Fguides\u002Finvoices-and-payments","3.guides\u002F4.invoices-and-payments",{"title":109,"path":110,"stem":111},"Payment Providers","\u002Fguides\u002Fpayment-providers","3.guides\u002F5.payment-providers",{"title":113,"path":114,"stem":115},"Analytics","\u002Fguides\u002Fanalytics","3.guides\u002F6.analytics",{"title":117,"path":118,"stem":119},"Webhooks","\u002Fguides\u002Fwebhooks","3.guides\u002F7.webhooks",{"title":121,"path":122,"stem":123},"Sandbox","\u002Fguides\u002Fsandbox","3.guides\u002F8.sandbox",{"title":125,"path":126,"stem":127},"Money Movement","\u002Fguides\u002Fmoney-movement","3.guides\u002F9.money-movement",{"title":129,"path":130,"stem":131},"API Reference","\u002Fapi-reference","4.api-reference",{"id":133,"title":73,"body":134,"description":357,"extension":358,"links":359,"meta":360,"navigation":361,"path":74,"seo":362,"stem":75,"__hash__":363},"docs\u002F3.guides\u002F14.customer-portal.md",{"type":135,"value":136,"toc":353},"minimark",[137,141,146,226,286,314,317,321,349],[138,139,140],"p",{},"The customer portal is a page you link your customers to: it shows their subscriptions, invoices (with PDF downloads) and payments, and lets them pay an open invoice. You create a link for one customer at a time; it carries a short-lived token scoped to that customer only.",[142,143,145],"h2",{"id":144},"create-a-portal-link","Create a portal link",[147,148,153],"pre",{"className":149,"code":150,"language":151,"meta":152,"style":152},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl -X POST https:\u002F\u002Fapi.pimabill.com\u002Fapi\u002Fportal\u002Fcustomers\u002Fusr_98765\u002Fsessions \\\n  -H \"Authorization: Bearer sk_live_a1b2c3d4...\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"expiresInMinutes\": 60 }'\n","bash","",[154,155,156,179,197,211],"code",{"__ignoreMap":152},[157,158,161,165,169,172,175],"span",{"class":159,"line":160},"line",1,[157,162,164],{"class":163},"sBMFI","curl",[157,166,168],{"class":167},"sfazB"," -X",[157,170,171],{"class":167}," POST",[157,173,174],{"class":167}," https:\u002F\u002Fapi.pimabill.com\u002Fapi\u002Fportal\u002Fcustomers\u002Fusr_98765\u002Fsessions",[157,176,178],{"class":177},"sTEyZ"," \\\n",[157,180,182,185,189,192,195],{"class":159,"line":181},2,[157,183,184],{"class":167},"  -H",[157,186,188],{"class":187},"sMK4o"," \"",[157,190,191],{"class":167},"Authorization: Bearer sk_live_a1b2c3d4...",[157,193,194],{"class":187},"\"",[157,196,178],{"class":177},[157,198,200,202,204,207,209],{"class":159,"line":199},3,[157,201,184],{"class":167},[157,203,188],{"class":187},[157,205,206],{"class":167},"Content-Type: application\u002Fjson",[157,208,194],{"class":187},[157,210,178],{"class":177},[157,212,214,217,220,223],{"class":159,"line":213},4,[157,215,216],{"class":167},"  -d",[157,218,219],{"class":187}," '",[157,221,222],{"class":167},"{ \"expiresInMinutes\": 60 }",[157,224,225],{"class":187},"'\n",[147,227,231],{"className":228,"code":229,"language":230,"meta":152,"style":152},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"url\": \"https:\u002F\u002Fapp.pimabill.com\u002Fportal\u002Fusr_98765?token=...\",\n  \"expiresAt\": \"2026-10-25T13:00:00.000Z\"\n}\n","json",[154,232,233,238,262,281],{"__ignoreMap":152},[157,234,235],{"class":159,"line":160},[157,236,237],{"class":187},"{\n",[157,239,240,243,247,249,252,254,257,259],{"class":159,"line":181},[157,241,242],{"class":187},"  \"",[157,244,246],{"class":245},"spNyl","url",[157,248,194],{"class":187},[157,250,251],{"class":187},":",[157,253,188],{"class":187},[157,255,256],{"class":167},"https:\u002F\u002Fapp.pimabill.com\u002Fportal\u002Fusr_98765?token=...",[157,258,194],{"class":187},[157,260,261],{"class":187},",\n",[157,263,264,266,269,271,273,275,278],{"class":159,"line":199},[157,265,242],{"class":187},[157,267,268],{"class":245},"expiresAt",[157,270,194],{"class":187},[157,272,251],{"class":187},[157,274,188],{"class":187},[157,276,277],{"class":167},"2026-10-25T13:00:00.000Z",[157,279,280],{"class":187},"\"\n",[157,282,283],{"class":159,"line":213},[157,284,285],{"class":187},"}\n",[287,288,289,302,308],"ul",{},[290,291,292,293,297,298,301],"li",{},"The path uses ",[294,295,296],"strong",{},"your"," ID for the customer (",[154,299,300],{},"externalId",").",[290,303,304,307],{},[154,305,306],{},"expiresInMinutes"," is between 5 and 10080 (7 days); the default is 60.",[290,309,310,311,313],{},"Create the link from your server when the customer asks for it (for example from a \"Billing\" button in your app), then redirect them to ",[154,312,246],{},".",[138,315,316],{},"Never put an API key in a portal link: the portal refuses API keys, because a link that carried one would give your customer full access to your account.",[142,318,320],{"id":319},"building-your-own-page","Building your own page",[138,322,323,324,327,328,331,332,331,335,331,338,331,341,344,345,348],{},"The portal's data is also available to your own frontend, with the same token, under ",[154,325,326],{},"\u002Fapi\u002Fportal\u002Fcustomers\u002F{externalId}\u002F...",": ",[154,329,330],{},"billing",", ",[154,333,334],{},"subscriptions",[154,336,337],{},"invoices",[154,339,340],{},"payments",[154,342,343],{},"invoices\u002F{invoiceId}\u002Fpdf"," and ",[154,346,347],{},"invoices\u002F{invoiceId}\u002Fcheckout"," (which returns a payment link for an open invoice).",[350,351,352],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}",{"title":152,"searchDepth":181,"depth":181,"links":354},[355,356],{"id":144,"depth":181,"text":145},{"id":319,"depth":181,"text":320},"A secure page where your customers see their plan, invoices and payments, and pay what they owe.","md",null,{},true,{"title":73,"description":357},"05N2CyTL3YJjWh1Udr-XI7QRDbobp9UjfzXQh-7DMQk",[365,367],{"title":69,"path":70,"stem":71,"description":366,"children":-1},"Tax rates applied to invoices, by default or per customer, plan or charge.",{"title":77,"path":78,"stem":79,"description":368,"children":-1},"Every payment, payout, fee and wallet movement as double-entry journal entries, checked for integrity.",1793401245236]