Docschargebeedocs

HomeBillingPaymentsRevRecGrowthReveal
Support

Product Updates


  • Release Notes

Getting Started


  • Overview
  • Chargebee Billing Data Centers
  • Object Relationship Model
  • Understanding Sites
  • Chargebee Tech Glossary
  • Articles and FAQ

Implementing Chargebee


  • Implementation Guide
  • Go-live Checklist
  • Articles and FAQ

AI in Chargebee


  • Chargebee Agents
  • Chargebee Copilot
  • Chargebee MCP Server (Model Context Protocol)

Developer Resources


  • Developer Resources Overview
  • Articles and FAQ

Product Catalog


  • Product Catalog Overview
  • Coupons
  • Articles and FAQ

Subscriptions


  • Working with Subscriptions
  • Billing
  • Orders
  • Articles and FAQ

Customers


  • Managing Customers
  • Account Hierarchy
  • Email Notifications
  • Branding
  • Configure Multiple Languages
  • Articles and FAQ

Entitlements


  • Entitlements Overview
  • Features Overview
  • Feature Management
  • Managing Product Entitlements
  • Subscription Entitlements
  • Customer Entitlements
  • Grandfathering Entitlements
  • Articles and FAQ

Usage Based Billing


  • Understanding Usages
  • Setting up Usage Based Billing
  • Metered Billing
  • Articles and FAQ

Chargebee CPQ


  • Chargebee CPQ
  • Chargebee CPQ for Salesforce
  • Chargebee CPQ for HubSpot

Invoices, Credit Notes, and Quotes


  • Invoices
  • Credit Notes
  • Quotes [Legacy]
  • Transactions
  • Articles and FAQ

Taxes


  • Overview
  • Configuring Taxes
  • Country-specific Taxes
  • Articles and FAQ

Hosted Capabilities


  • Overview
  • Hosted Checkout
  • Hosted Self-Serve Portal
  • Hosted Pages Features
    • Custom Domain
    • Quantity Restrictions
    • Analytics
  • Additional Hosted Pages
  • Payment Components
  • Pricing Table
  • Managing Payments with Chargebee.js
  • Mobile-Optimized Hosted Pages
  • Articles and FAQ

Site Configuration


  • Users & Roles
  • Custom Fields & Metadata
  • Approvals
  • Mandatory Fields
  • File Attachments & Comments
  • Advanced Filter Options
  • Multicurrency Pricing
  • Multi-decimal Support
  • Configuring Reason Codes
  • Events and Webhooks
  • API Keys
  • Time Zone
  • Time Machine
  • Transfer Configurations
  • Articles and FAQ

Multi Business Entity


  • Multi Business Entity Overview
  • Customer Transfer Overview
  • Articles and FAQ

Mobile Subscriptions


  • Overview
  • Omnichannel Subscriptions
  • Omnichannel One-Time Orders
  • Mobile Subscriptions (Legacy)

Reports and Analytics


  • RevenueStory
  • Home Dashboard
  • Frequently Asked Questions
  • FAQs for Classic Reports Sunset
  • Articles and FAQ

Integrations


  • Sales
  • Customer Support and Success
  • Finance
  • Tax
  • Marketing
  • Stitch
  • Collaboration
  • Contract Management
  • Ecommerce Management
  • Articles and FAQ

Data Privacy & Security


  • Two Factor Authentication
  • SAML Single Sign-On
  • System for Cross-Domain Identity Management (SCIM)
  • EU-GDPR
  • Consent Management
  • Personal Data Management
  • Compliance Certificates
  • HIPAA Guidelines
  • PCI Recommendations and Integration Types
  • Articles and FAQ

Data Operations


  • Bulk Operations
  • Migration
  • Articles and FAQ
  1. Billing
  2. Hosted Capabilities
  3. Hosted Pages Features
  4. Quantity Restrictions
  1. Billing
  2. Hosted Capabilities
  3. Hosted Pages Features
  4. Quantity Restrictions

Quantity Restrictions

The interaction between you and your customers in the ever-evolving commerce landscape shapes business practices. The metadata-based quantity restrictions give you control over subscription management. This approach provides precision, enabling you to fine-tune and personalize how customers adjust product quantities. By leveraging metadata, you can balance flexibility and constraints seamlessly.

Chargebee allows you to set restrictions on the quantity of your plans or add-ons. You can enable or disable product-level quantity restrictions across all products through a single setting.

Learn more about meta configurations.

Prerequisites

The following settings must be enabled to apply product-level quantity restrictions:

Navigate to Settings > Configure Chargebee > Checkout & Self-Serve Portal > Configuration > Checkout:

  • Allow customers to edit quantity for plans.
  • Allow customers to change add-on and charge quantity.
image

Enabling quantity restrictions

Enabling this option allows Chargebee to read the configuration and set the quantity based on it.

Customize plan or add-on quantity based on meta configuration on your Chargebee site:

Navigate to Settings > Configure Chargebee > Checkout & Self-Serve Portal > Advanced settings and enable Customize plan/addon quantity based on meta configuration.

image

Set up metadata for your item price

Once you have enabled Customize plan/addon quantity based on meta configuration, follow these steps:

  1. Navigate to Product Catalog > Plans.
  2. Under the Pricing list, select the corresponding item price. The JSON metadata set at the item price level will be considered, not at the item level.
    image
  3. Click Add for JSON metadata.
    image
  4. On the Add JSON Metadata page, add the necessary code to restrict the quantity.
    image
  5. Click Add once done.

Configure the checkout to allow only specific quantities

To configure the checkout to allow only specific quantities, enter the values you want to allow in the checkout and set the type as fixed.

Sample JSON:

{ 
  "quantity_meta": {
    "type": "fixed",
    "values": [5, 6, 7, 8, 9, 10]
  }
}

Sample checkout screen:

image

Configure limited quantity range in checkout

To allow a quantity limited to a specific range in your checkout, provide the min (minimum), max (maximum), and step values along with the type as range.

Sample JSON:

{
  "quantity_meta": {
    "type": "range",
    "min": 10,
    "max": 100,
    "step": 10
  }
}

Each time your customer increases the quantity, it will increment by the step value configured in the JSON.

Enter a valid quantity meta and click Add to save the metadata.

min, max, and step must be of type Number.

Edit the metadata

To edit the metadata:

  1. Navigate to Product Catalog > Plans.
  2. Select the plan, then the item price, and click the ellipsis menu.
  3. Select the Edit option and make the necessary changes.
  4. Click Update once done.
image

Once these quantity restrictions are added, you can open the checkout for the corresponding item price to test your changes.

Changes in checkout based on quantity meta

The following metadata types are supported for quantity restrictions:

  • Fixed
  • Range

Checkout changes based on the metadata type in the JSON for an item price. Let's see the changes in checkout for each metadata type.

Changes in checkout when quantity meta is of type fixed

When the quantity meta is of type fixed, the checkout process undergoes the following changes:

  • Quantity restriction: Restrict quantities to a set of numbers listed in the checkout for selection.
  • Dropdown display: The dropdown will list valid quantity values configured in the JSON metadata within the product card's specific plan, addon, or charge section.
  • Invalid quantity handling: If you create a hosted page with a quantity not present in the values array, the quantity will reset to the least or minimum value (not necessarily the first value).
  • Configuration setting: These checks on quantity will occur when the Customize plan/addon quantity based on meta configuration setting is enabled.

Changes in checkout when quantity meta is of type range

When the quantity meta is of type range, the checkout process is adjusted as follows:

  • Quantity restriction: Set the quantity directly from the checkout page to restrict quantities to a range of numbers.
  • Stepper display: The quantity is displayed with a stepper, allowing customers to increment or decrement the quantity as needed.
  • Invalid quantity handling: If an invalid quantity is passed via API or Plan URL, the value will reset to the minimum configured value within the defined range.
  • Step increment: Each time a customer increments or decrements the quantity via the stepper, it is increased or decreased by the step value you set.
  • Custom error display: If a customer enters an invalid value in the quantity text box, a custom error message will guide them. The error message can be customized. Learn more about working with labels to add a custom error.

Sample error screens:

image
image

When the Quantity Meta is of type range, the Checkout process is adjusted as follows:

  • Quantity Restriction: You can set the quantity directly from the Checkout page to restrict the quantities to a range of numbers.

  • Stepper Display: The quantity is displayed with a stepper, allowing customers to increment or decrement the quantity as needed.

  • Invalid Quantity Handling: The value will be reset to the minimum configured value within the defined range if an invalid quantity is passed via API or Plan URL,

  • Step Increment: Each time a customer increments or decrements the quantity via the stepper, it is increased or decreased by the step value you set.

  • Custom Error Display: If a customer enters an invalid value in the quantity text box, a custom error message will be displayed to guide them. The error message can be customized. Learn more about working with labels to add a custom error.

Sample Error Screens

image
image

Was this article helpful?