Charge customers based on actual usage with metered plans.
Metered billing lets you charge customers based on what they consume in a billing period - API calls, active seats, storage used, or any other unit you define. At the end of each period, PayBridgeNP aggregates the usage records and issues an invoice for the accumulated amount.
Create a metered plan
const plan = await paybridgenp.plans.create({ name: "API calls", amount: 50, // unit price: 50 paisa per call intervalUnit: "month", billingScheme: "metered", aggregationMethod: "sum", // sum | max | last_ever});
billingScheme is set at creation and cannot be changed afterwards - switching
a plan between per_unit and metered under live subscriptions would change
what their invoices bill. Create a new plan instead.
A metered plan is defined by two settings:
billingScheme: "metered" - bill on reported usage instead of a flat price
aggregationMethod - how usage is combined over the billing period:
sum - total usage across all records in the period (default)
max - the single highest usage value reported (useful for high-water-mark billing)
last_ever - the most recent value ever reported
The plan amount is the unit price in paisa. The invoice is amount × aggregated_quantity.
Report usage
Call reportUsage after each usage event, or batch at intervals:
await paybridgenp.subscriptions.reportUsage(subscriptionId, { quantity: 100, // number of units consumed action: "increment", // "increment" (default) or "set" idempotencyKey: "evt_abc123", // prevents double-counting on retry});
Use action: "set" to report the absolute current value instead of adding to the running total (useful with max or last_ever aggregation).
Aggregates all usage records for the period using the plan’s aggregationMethod
Multiplies the result by the plan’s amount (unit price)
Generates an invoice for that total
Resets the usage counter for the next period
If no usage was reported in a period, a zero-amount invoice is generated and immediately marked as paid.
Per-seat billing
For per-seat (quantity-based) billing where you charge a flat rate multiplied by the number of seats, use billingScheme: "per_unit" (the default) and update the quantity when seats change:
// Create per-unit planconst plan = await paybridgenp.plans.create({ name: "Team Plan", amount: 149900, // Rs. 1,499 per seat per month intervalUnit: "month", // billingScheme: "per_unit" is the default});// Create subscription with initial seat countconst sub = await paybridgenp.subscriptions.create({ customerId, planId: plan.id, quantity: 5, // 5 seats = Rs. 7,495/month});// Update when seats changeawait paybridgenp.subscriptions.updateQuantity(sub.id, 8);
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"PayBridgeNP","description":"Developer documentation for accepting eSewa, Khalti, and Fonepay payments in Nepal with PayBridgeNP.","colors":{"primary":"#1f5ff7","light":"#5b8cff","dark":"#1a4fdb"},"logo":{"light":"https://mintcdn.com/paybridgenp/ZIhRJeSmyMmWEJYy/logo/light.svg?fit=max\u0026auto=format\u0026n=ZIhRJeSmyMmWEJYy\u0026q=85\u0026s=56ca123bc9be4b9f764c558f7b3adec8","dark":"https://mintcdn.com/paybridgenp/ZIhRJeSmyMmWEJYy/logo/dark.svg?fit=max\u0026auto=format\u0026n=ZIhRJeSmyMmWEJYy\u0026q=85\u0026s=39a925b00c5c7eee6b04bbfb863d3eb5","href":"https://docs.paybridgenp.com/home"},"favicon":"https://mintcdn.com/paybridgenp/OtdaH4FVK3w8XHcC/favicon.svg?fit=max\u0026auto=format\u0026n=OtdaH4FVK3w8XHcC\u0026q=85\u0026s=4afcdaa925cb367387bdc40b9771ef72","api":{"openapi":"openapi.json"},"navbar":{"links":[{"icon":"signal-bars","href":"https://status.paybridgenp.com","label":"Status"},{"icon":"gauge-high","href":"https://dashboard.paybridgenp.com","label":"Dashboard"}],"primary":{"type":"button","label":"Get API Keys","href":"https://dashboard.paybridgenp.com/signup"}},"footer":{"socials":{"github":"https://github.com/paybridgenp","discord":"https://discord.gg/aquta4JwJt","linkedin":"https://linkedin.com/company/paybridgenp","facebook":"https://www.facebook.com/paybridgenp","x":"https://x.com/PayBridge_NP"}},"search":{"prompt":"Search payments, APIs, SDKs, and integrations"},"seo":{"metatags":{"og:site_name":"PayBridgeNP Documentation","twitter:card":"summary_large_image"},"organization":{"name":"PayBridgeNP","url":"https://paybridgenp.com","logo":"https://docs.paybridgenp.com/logo/light.svg","sameAs":["https://github.com/paybridgenp","https://linkedin.com/company/paybridgenp"]},"indexing":"navigable"},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"markdown":{"instructions":["Use hosted checkout for a new payment integration unless the user explicitly needs an SDK or Direct QR flow.","Keep secret API keys on the server. Never place an sk_test_ or sk_live_ key in browser or mobile code.","Never treat a browser return URL as proof of payment. Verify a signed webhook and confirm status, amount, and currency on the server before fulfillment.","Fonepay has no sandbox. A Fonepay payment made from a sandbox project uses the merchant's real Fonepay account and moves real money within the documented caps.","Do not recommend direct integration with Mobile SDK device endpoints. Use the PayBridgeNP Mobile SDK and the merchant-facing session creation API."]},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"paybridgenp","hasAudioNarration":false,"actualSubdomain":"paybridgenp","customDomains":["docs.paybridgenp.com"],"gitSource":{"type":"github","owner":"paybridgenp","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6af309f77a7ae7749a628421","clientVersion":"0.0.4131","searchFilterCounts":[{"language":"default","tag":"API Reference","count":96},{"language":"default","tag":"Billing","count":53},{"language":"default","tag":"Payments","count":43},{"language":"default","tag":"Subscriptions","count":19},{"language":"default","tag":"One-time Invoices","count":14},{"language":"default","tag":"Integrations","count":12},{"language":"default","tag":"Checkout","count":11},{"language":"default","tag":"Dunning","count":8},{"language":"default","tag":"Subscriptions and billing","count":7},{"language":"default","tag":"Customers","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styling.css","content":"/* vietnamese */\n@font-face {\n font-family: 'Bricolage Grotesque';\n font-style: normal;\n font-weight: 500;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/bricolagegrotesque/v9/3y9K6as8bTXq_nANBjzKo3IeZx8z6up5BeSl9D4dj_x9PpZBMlGHInHEVA.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Bricolage Grotesque';\n font-style: normal;\n font-weight: 500;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/bricolagegrotesque/v9/3y9K6as8bTXq_nANBjzKo3IeZx8z6up5BeSl9D4dj_x9PpZBMlGGInHEVA.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Bricolage Grotesque';\n font-style: normal;\n font-weight: 500;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/bricolagegrotesque/v9/3y9K6as8bTXq_nANBjzKo3IeZx8z6up5BeSl9D4dj_x9PpZBMlGIInE.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Bricolage Grotesque';\n font-style: normal;\n font-weight: 600;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/bricolagegrotesque/v9/3y9K6as8bTXq_nANBjzKo3IeZx8z6up5BeSl9D4dj_x9PpZBMlGHInHEVA.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Bricolage Grotesque';\n font-style: normal;\n font-weight: 600;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/bricolagegrotesque/v9/3y9K6as8bTXq_nANBjzKo3IeZx8z6up5BeSl9D4dj_x9PpZBMlGGInHEVA.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Bricolage Grotesque';\n font-style: normal;\n font-weight: 600;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/bricolagegrotesque/v9/3y9K6as8bTXq_nANBjzKo3IeZx8z6up5BeSl9D4dj_x9PpZBMlGIInE.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Bricolage Grotesque';\n font-style: normal;\n font-weight: 700;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/bricolagegrotesque/v9/3y9K6as8bTXq_nANBjzKo3IeZx8z6up5BeSl9D4dj_x9PpZBMlGHInHEVA.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Bricolage Grotesque';\n font-style: normal;\n font-weight: 700;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/bricolagegrotesque/v9/3y9K6as8bTXq_nANBjzKo3IeZx8z6up5BeSl9D4dj_x9PpZBMlGGInHEVA.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Bricolage Grotesque';\n font-style: normal;\n font-weight: 700;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/bricolagegrotesque/v9/3y9K6as8bTXq_nANBjzKo3IeZx8z6up5BeSl9D4dj_x9PpZBMlGIInE.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Schibsted Grotesk';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/schibstedgrotesk/v7/Jqz55SSPQuCQF3t8uOwiUL-taUTtap9Iayoxdg.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Schibsted Grotesk';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/schibstedgrotesk/v7/Jqz55SSPQuCQF3t8uOwiUL-taUTtap9Gayo.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Schibsted Grotesk';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/schibstedgrotesk/v7/Jqz55SSPQuCQF3t8uOwiUL-taUTtap9Iayoxdg.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Schibsted Grotesk';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/schibstedgrotesk/v7/Jqz55SSPQuCQF3t8uOwiUL-taUTtap9Gayo.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Schibsted Grotesk';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/schibstedgrotesk/v7/Jqz55SSPQuCQF3t8uOwiUL-taUTtap9Iayoxdg.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Schibsted Grotesk';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/schibstedgrotesk/v7/Jqz55SSPQuCQF3t8uOwiUL-taUTtap9Gayo.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Schibsted Grotesk';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/schibstedgrotesk/v7/Jqz55SSPQuCQF3t8uOwiUL-taUTtap9Iayoxdg.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Schibsted Grotesk';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/schibstedgrotesk/v7/Jqz55SSPQuCQF3t8uOwiUL-taUTtap9Gayo.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n@media (min-width: 1024px){body:has(#navbar.is-not-custom) div:has(>#sidebar+#content-container){max-width:92rem}body:has(#navbar.is-not-custom) div:has(>#sidebar+#content-container){padding-left:3rem;padding-right:3rem}#sidebar{width:18rem}body:has(#navbar.is-not-custom) #content-area{padding-left:3rem}#content-side-layout #table-of-contents-layout,#content-side-layout #table-of-contents{width:100%}#content-container>div:has(nav[aria-labelledby]){gap:1.875rem}#content-container>div:has(nav[aria-labelledby])>div:first-child{width:15.375rem;max-width:15.375rem}#content-container>div:has(nav[aria-labelledby])>div:first-child>nav{width:100%;max-width:100%}}#page-title{font-size:1.875rem;line-height:2.25rem}#header>.prose{margin-top:0.375rem;font-size:1rem;line-height:1.5rem}#content{margin-top:1.5rem;font-size:0.9375rem;line-height:1.65}#content>h2{margin-top:1.875rem;margin-bottom:0.75rem;font-size:1.25rem;line-height:1.75rem}#content>h3{margin-top:1.5rem;margin-bottom:0.625rem;font-size:1rem;line-height:1.5rem}#content .callout{border-radius:0.75rem;padding:0.75rem 1rem;font-size:0.875rem;line-height:1.375rem}nav[aria-label=\"Pages\"] a,nav[aria-label=\"Pages\"] button{font-size:0.875rem;line-height:1.25rem}nav[aria-label=\"Pages\"] a{padding-top:0.25rem;padding-bottom:0.25rem}#hero-stage{transform-origin:right center;transform:translateY(-50%) scale(0.95)}@media (max-width: 1279px){#hero-stage{transform:translateY(-50%) scale(0.68)}}"}],"page":{"pagePath":"guides/metered-billing","slug":"/guides/metered-billing","pageMetadata":{"sidebarTitle":"Metered billing","title":"Metered Billing","description":"Charge customers based on actual usage with metered plans.","href":"/guides/metered-billing"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Charge customers based on actual usage with metered plans.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Metered billing lets you charge customers based on what they consume in a billing period - API calls, active seats, storage used, or any other unit you define. At the end of each period, PayBridgeNP aggregates the usage records and issues an invoice for the accumulated amount.`}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-metered-plan`,children:`Create a metered plan`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` plan = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` paybridgenp.plans.create({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` name: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"API calls\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` amount: 50, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// unit price: 50 paisa per call`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` intervalUnit: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"month\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` billingScheme: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"metered\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` aggregationMethod: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sum\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// sum | max | last_ever`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`billingScheme`}),` is set at creation and cannot be changed afterwards - switching\na plan between `,_jsx(_components.code,{children:`per_unit`}),` and `,_jsx(_components.code,{children:`metered`}),` under live subscriptions would change\nwhat their invoices bill. Create a new plan instead.`]})}),`\n`,_jsx(_components.p,{children:`A metered plan is defined by two settings:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`billingScheme: \"metered\"`})}),` - bill on reported usage instead of a flat price`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`aggregationMethod`})}),` - how usage is combined over the billing period:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`sum`})}),` - total usage across all records in the period (default)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`max`})}),` - the single highest usage value reported (useful for high-water-mark billing)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`last_ever`})}),` - the most recent value ever reported`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The plan `,_jsx(_components.code,{children:`amount`}),` is the `,_jsx(_components.strong,{children:`unit price`}),` in paisa. The invoice is `,_jsx(_components.code,{children:`amount × aggregated_quantity`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`report-usage`,children:`Report usage`}),`\n`,_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`reportUsage`}),` after each usage event, or batch at intervals:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` paybridgenp.subscriptions.reportUsage(subscriptionId, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` quantity: 100, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// number of units consumed`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` action: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"increment\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// \"increment\" (default) or \"set\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` idempotencyKey: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"evt_abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// prevents double-counting on retry`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`action: \"set\"`}),` to report the absolute current value instead of adding to the running total (useful with `,_jsx(_components.code,{children:`max`}),` or `,_jsx(_components.code,{children:`last_ever`}),` aggregation).`]}),`\n`,_jsx(Heading,{level:`2`,id:`check-current-usage`,children:`Check current usage`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` summary = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` paybridgenp.subscriptions.getUsageSummary(subscriptionId);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// { quantity: 1500, record_count: 15, aggregation_method: \"sum\", period_start, period_end }`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`how-invoicing-works`,children:`How invoicing works`}),`\n`,_jsx(_components.p,{children:`At the end of each billing period, PayBridgeNP:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Aggregates all usage records for the period using the plan’s `,_jsx(_components.code,{children:`aggregationMethod`})]}),`\n`,_jsxs(_components.li,{children:[`Multiplies the result by the plan’s `,_jsx(_components.code,{children:`amount`}),` (unit price)`]}),`\n`,_jsx(_components.li,{children:`Generates an invoice for that total`}),`\n`,_jsx(_components.li,{children:`Resets the usage counter for the next period`}),`\n`]}),`\n`,_jsx(_components.p,{children:`If no usage was reported in a period, a zero-amount invoice is generated and immediately marked as paid.`}),`\n`,_jsx(Heading,{level:`2`,id:`per-seat-billing`,children:`Per-seat billing`}),`\n`,_jsxs(_components.p,{children:[`For per-seat (quantity-based) billing where you charge a flat rate multiplied by the number of seats, use `,_jsx(_components.code,{children:`billingScheme: \"per_unit\"`}),` (the default) and update the quantity when seats change:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Create per-unit plan`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` plan = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` paybridgenp.plans.create({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` name: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Team Plan\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` amount: 149900, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Rs. 1,499 per seat per month`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` intervalUnit: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"month\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // billingScheme: \"per_unit\" is the default`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Create subscription with initial seat count`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sub = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` paybridgenp.subscriptions.create({`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` customerId,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` planId: plan.id,`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` quantity: 5, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// 5 seats = Rs. 7,495/month`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Update when seats change`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` paybridgenp.subscriptions.updateQuantity(sub.id, 8);`})]}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"sidebarTitle":"Metered billing","title":"Metered Billing","description":"Charge customers based on actual usage with metered plans.","href":"/guides/metered-billing"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Create a metered plan","slug":"create-a-metered-plan","depth":2,"children":[]},{"title":"Report usage","slug":"report-usage","depth":2,"children":[]},{"title":"Check current usage","slug":"check-current-usage","depth":2,"children":[]},{"title":"How invoicing works","slug":"how-invoicing-works","depth":2,"children":[]},{"title":"Per-seat billing","slug":"per-seat-billing","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/paybridgenp/841570c3b94facb0/home-theme.js"],"subdomain":"paybridgenp","siteName":"PayBridgeNP","title":"Metered Billing - PayBridgeNP","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-12T01:54:34.068Z","originalFileLocation":"guides/metered-billing.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Charge customers based on actual usage with metered plans.\">\u003cmeta data-mint-head name=\"application-name\" content=\"PayBridgeNP\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/paybridgenp/AAUhk-xvTWUvsSUY/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/paybridgenp/AAUhk-xvTWUvsSUY/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/paybridgenp/AAUhk-xvTWUvsSUY/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/paybridgenp/AAUhk-xvTWUvsSUY/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/paybridgenp/AAUhk-xvTWUvsSUY/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/paybridgenp/AAUhk-xvTWUvsSUY/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/paybridgenp/AAUhk-xvTWUvsSUY/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/paybridgenp/AAUhk-xvTWUvsSUY/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/paybridgenp/AAUhk-xvTWUvsSUY/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Metered Billing - PayBridgeNP\">\u003cmeta data-mint-head property=\"og:description\" content=\"Charge customers based on actual usage with metered plans.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PayBridgeNP Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.paybridgenp.com/guides/metered-billing\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://paybridgenp.mintlify.site/_mintlify/api/og/v2?division=Subscriptions+and+billing\u0026amp;title=Metered+Billing\u0026amp;description=Charge+customers+based+on+actual+usage+with+metered+plans.\u0026amp;theme=2c4bed335107db3779bd0274\u0026amp;signature=64a99d0fd551f860ae09891129ee713d94634d79d72ac428c0c8f93837139a09\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Metered Billing - PayBridgeNP\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Charge customers based on actual usage with metered plans.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://paybridgenp.mintlify.site/_mintlify/api/og/v2?division=Subscriptions+and+billing\u0026amp;title=Metered+Billing\u0026amp;description=Charge+customers+based+on+actual+usage+with+metered+plans.\u0026amp;theme=2c4bed335107db3779bd0274\u0026amp;signature=64a99d0fd551f860ae09891129ee713d94634d79d72ac428c0c8f93837139a09\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/paybridgenp/AAUhk-xvTWUvsSUY/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PayBridgeNP\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1f5ff7\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.paybridgenp.com/guides/metered-billing\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/metered-billing.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://paybridgenp.com/#organization\",\"name\":\"PayBridgeNP\",\"url\":\"https://paybridgenp.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://docs.paybridgenp.com/logo/light.svg\"},\"sameAs\":[\"https://github.com/paybridgenp\",\"https://linkedin.com/company/paybridgenp\"]},{\"@type\":\"WebSite\",\"@id\":\"https://docs.paybridgenp.com#website\",\"name\":\"PayBridgeNP\",\"url\":\"https://docs.paybridgenp.com\",\"publisher\":{\"@id\":\"https://paybridgenp.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.paybridgenp.com/guides/metered-billing#webpage\",\"url\":\"https://docs.paybridgenp.com/guides/metered-billing\",\"name\":\"Metered Billing\",\"description\":\"Charge customers based on actual usage with metered plans.\",\"dateModified\":\"2026-07-12T01:54:34.068Z\",\"isPartOf\":{\"@id\":\"https://docs.paybridgenp.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.paybridgenp.com/guides/metered-billing#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.paybridgenp.com/guides/metered-billing#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Subscriptions and billing\",\"item\":\"https://docs.paybridgenp.com/guides/billing\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Metered Billing\",\"item\":\"https://docs.paybridgenp.com/guides/metered-billing\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.paybridgenp.com/guides/metered-billing#article\",\"headline\":\"Metered Billing\",\"name\":\"Metered Billing\",\"description\":\"Charge customers based on actual usage with metered plans.\",\"url\":\"https://docs.paybridgenp.com/guides/metered-billing\",\"mainEntityOfPage\":{\"@id\":\"https://docs.paybridgenp.com/guides/metered-billing#webpage\"},\"dateModified\":\"2026-07-12T01:54:34.068Z\",\"publisher\":{\"@id\":\"https://paybridgenp.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.paybridgenp.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PayBridgeNP\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"PayBridgeNP\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/guides/metered-billing.md","siteName":"PayBridgeNP","nav":{"global":null,"tabs":[{"tab":"Payments","icon":"credit-card","groups":[{"group":"Getting started","pages":[{"title":"Accept eSewa, Khalti, and Fonepay with one API","sidebarTitle":"Overview","mode":"custom","href":"/home"},{"title":"How PayBridgeNP works","sidebarTitle":"How it works","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"},{"title":"Sandbox testing","href":"/guides/sandbox-testing"},{"title":"Plans and limits","href":"/guides/plans-and-limits"}]},{"group":"Accepting payments","pages":[{"title":"Confirming a payment","href":"/guides/confirming-payments"},{"sidebarTitle":"Webhook verification","title":"Webhook Verification","href":"/guides/webhook-verification"},{"title":"Idempotency","href":"/guides/idempotency"},{"title":"Sync with provider","href":"/guides/payments-sync"}]},{"group":"Checkout","pages":[{"sidebarTitle":"Payment links","title":"Payment Links","href":"/guides/payment-links"},{"sidebarTitle":"Payment buttons","title":"Payment Buttons","href":"/guides/payment-buttons"},{"sidebarTitle":"Embedded checkout","title":"Embedded Checkout","href":"/guides/embedded-checkout"},{"title":"Customer details at checkout","href":"/guides/customer-details"},{"sidebarTitle":"Direct QR","title":"Direct-QR API","href":"/guides/direct-qr"},{"title":"eSewa Intent","href":"/guides/esewa-intent"},{"title":"PayBridgeNP ID","href":"/guides/paybridgenp-id"}]},{"group":"Providers","pages":[{"title":"Provider setup","href":"/guides/provider-setup"},{"sidebarTitle":"Provider fees","title":"Provider Fees","href":"/guides/provider-fees"}]},{"group":"Subscriptions and billing","pages":[{"title":"Billing","href":"/guides/billing"},{"title":"Free trials","description":"Offer a time-based free trial before the first paid invoice. No card on file required.","href":"/guides/trials"},{"sidebarTitle":"Metered billing","title":"Metered Billing","href":"/guides/metered-billing"},{"title":"Coupons and promotion codes","description":"Discount subscriptions with coupons (reusable templates) and promotion codes (customer-facing handles).","href":"/guides/coupons"},{"title":"Tax (Nepal VAT)","href":"/guides/tax-vat"},{"sidebarTitle":"Dunning","title":"Dunning (overdue invoice retries)","href":"/guides/dunning"},{"sidebarTitle":"Proration","title":"Proration","href":"/guides/proration"}]},{"group":"Branding","pages":[{"sidebarTitle":"Custom domain","title":"Custom Domain","href":"/guides/custom-domain"},{"sidebarTitle":"Per-project branding","title":"Per-Project Branding","href":"/guides/per-project-branding"}]},{"group":"Operations","pages":[{"title":"SMS notifications","href":"/guides/sms-notifications"},{"sidebarTitle":"Analytics API","title":"Analytics API","href":"/guides/analytics"}]},{"group":"Integrations","pages":[{"group":"Shopify","icon":"/images/logos/shopify.svg","pages":[{"sidebarTitle":"Overview","title":"Shopify","href":"/integrations/shopify/overview"},{"sidebarTitle":"Install","title":"Install PayBridgeNP on Shopify","href":"/integrations/shopify/install"},{"title":"How the Shopify Integration Works","sidebarTitle":"How it works","href":"/integrations/shopify/how-it-works"},{"title":"Shopify Troubleshooting","sidebarTitle":"Troubleshooting","href":"/integrations/shopify/troubleshooting"}]},{"group":"WooCommerce","icon":"/images/logos/woocommerce.png","pages":[{"sidebarTitle":"Overview","title":"WooCommerce","href":"/integrations/woocommerce/overview"},{"sidebarTitle":"Install","title":"Install the WooCommerce plugin","href":"/integrations/woocommerce/install"},{"title":"How the WooCommerce Integration Works","sidebarTitle":"How it works","href":"/integrations/woocommerce/how-it-works"},{"title":"WooCommerce Troubleshooting","sidebarTitle":"Troubleshooting","href":"/integrations/woocommerce/troubleshooting"}]},{"group":"WHMCS","icon":"/images/logos/whmcs.png","pages":[{"sidebarTitle":"Overview","title":"WHMCS","href":"/integrations/whmcs/overview"},{"sidebarTitle":"Install","title":"Install the WHMCS module","href":"/integrations/whmcs/install"},{"title":"How the WHMCS Integration Works","sidebarTitle":"How it works","href":"/integrations/whmcs/how-it-works"},{"title":"WHMCS Troubleshooting","sidebarTitle":"Troubleshooting","href":"/integrations/whmcs/troubleshooting"}]}]}]},{"tab":"API Reference","icon":"square-terminal","pages":[{"title":"API Reference","href":"/api-reference/overview"}]},{"tab":"Developer Tools","icon":"code","pages":[{"title":"Developer Tools","href":"/sdk/typescript"}]}]},"basePath":"","title":"Metered Billing - PayBridgeNP","buildId":"dpl_5joLUXmnJgwqjrHAS4dxZrQTdxgh","deploymentId":"dpl_5joLUXmnJgwqjrHAS4dxZrQTdxgh","dynamics":[],"chunks":[]}