Guides and Examples
...
Credits
Credits Overview
8 min
the nue credits api enables you to build customer facing experiences that provide real time visibility into prepaid credit balances, consumption patterns, and credit burndown these endpoints are essential for creating transparent, self service portals for customers using usage based billing with committed credits understanding credits in nue nue supports two primary credit models for usage based billing credit burndown (prepaid) customers prepay for credits that are consumed as they use your services customer purchases credits customer buys a credit package upfront (e g , $120,000 in prepaid credits) credits are issued credits are immediately added to the customer's credit pool usage consumes credits as the customer uses your service, credits burn down real time tracking customer can monitor their remaining balance and consumption rate ideal for customers who want to lock in pricing and avoid monthly invoicing usage based services with predictable consumption patterns customers seeking budget certainty committed credits (post paid) customers commit to a minimum spend over a period and receive discounted rates customer commits customer agrees to spend a minimum amount (e g , $120,000 annually) usage is tracked credits are tracked as services are consumed billed periodically customer is invoiced monthly/quarterly based on actual usage commitment reconciliation at period end, ensure minimum commitment is met ideal for enterprise customers with significant usage volumes customers who want flexibility without upfront payment negotiated discount agreements based on committed spend customer use cases for real time credits data 1\ self service credit balance dashboard enable customers to monitor their prepaid credit investments in real time what customers need to see current available balance across all credit pools total credits purchased vs consumed pending credits (future dated commitments) credit expiration dates and amounts at risk why it matters customers can plan their usage to maximize value reduces support inquiries about "how many credits do i have left?" builds trust through transparency api endpoints to use get /customers/{customerid}/account credit pools show all credit pools and balances get /customers/{customerid}/credit stats display aggregated statistics 2\ credit consumption analytics help customers understand their spending patterns and optimize usage what customers need to see daily/weekly/monthly credit consumption trends consumption by product or service burn rate projections (when will credits run out?) comparison to previous periods why it matters customers can identify cost optimization opportunities enables proactive purchasing decisions before credits run out helps customers validate they're getting expected value api endpoints to use get /customers/{customerid}/credit flows retrieve consumption history get /customers/{customerid}/credit flows?includes=product show consumption by product 3\ credit expiration alerts notify customers about credits approaching expiration what customers need to see credits expiring in next 30/60/90 days total value at risk of expiration recommendations to use or extend credits why it matters prevents customers from losing prepaid value drives engagement and usage reduces disputes and refund requests api endpoints to use get /customers/{customerid}/credit flows filter for credits with upcoming expiration dates get /customers/{customerid}/account credit pools check credit pool details including validity periods 4\ usage forecasting and recommendations provide intelligent insights to help customers manage their credit commitments what customers need to see projected credit depletion date based on current burn rate recommendations to increase/decrease usage alerts when consumption deviates from expected patterns why it matters helps customers avoid service interruptions enables better budgeting and planning creates opportunities for upsell conversations api endpoints to use get /customers/{customerid}/credit stats get aggregated consumption metrics get /customers/{customerid}/credit flows analyze consumption patterns over time 5\ multi pool credit management for customers with multiple credit pools (e g , different regions, products, or commitment tiers) what customers need to see breakdown by credit pool which pools are being consumed fastest recommendations to rebalance usage across pools why it matters customers with complex agreements need granular visibility prevents inefficient credit utilization supports multi product or multi region deployments api endpoints to use get /customers/{customerid}/account credit pools list all pools get /customers/{customerid}/credit stats?accountpoolids=\[ ] compare statistics across pools available endpoints endpoint use case get /customers/{customerid}/account credit pools display current credit pool balances and details get /customers/{customerid}/credit flows show transaction history and consumption patterns get /customers/{customerid}/credit stats present aggregated statistics and health metrics