New in Chargebee: Explore Reveal and understand your payment performance end-to-end.Try Now
Docschargebeedocs
HomeBillingPaymentsRevRecGrowthReveal
Support

Product Updates


  • Release Notes

Getting Started


  • Overview
  • Chargebee Billing Data Centers
  • Object Relationship Model
  • Understanding Sites
  • Developer Resources
  • 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)

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

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
  • Additional Hosted Pages
  • Payment Components
  • Managing payments with ChargebeeJS
  • Mobile-Optimized Hosted Pages
  • Articles and FAQ

Site Configuration


  • Users & Roles
  • Custom Fields & Metadata
  • 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

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
  • Order Management
  • Mobile Subscriptions (Legacy)
  • Other Integrations
  • 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. Subscriptions
  3. Articles and FAQ
  4. Working with Subscriptions
  1. Billing
  2. Subscriptions
  3. Articles and FAQ
  4. Working with Subscriptions

How can I apply multiple Manual discounts via API to an existing subscription?

Problem Statement

How can I apply multiple manual discounts to an existing subscription via API? How can I remove a manual discount applied to a subscription via API?

Solution

On Chargebee sites with the latest Product Catalog version, you can apply manual discounts to an existing subscription using the update_subscription_for_items API. You can apply discounts to specific items or to all items (invoice amount).

Note

Manual discounts are available on selective plans. See the plans and pricing page. On previous plans, this feature is available on Enterprise plans.

Steps to Set It Up

To apply a discount on specific items (e.g., 20% on a specific item price):

curl  https://{site-name}.chargebee.com/api/v2/subscriptions/{subscription_id}/update_for_items \
 -u {site_api_key}:
 -d discounts[apply_on][0]="specific_item_price" 
 -d discounts[item_price_id][0]="{item_price_id}" 
 -d discounts[duration_type][0]="{forever/onetime}" 
 -d discounts[percentage][0]=20.0 
 -d discounts[operation_type][0]="add"

Pass discounts[apply_on][0...n] as "specific_item_price" and include the item price ID in discounts[item_price_id][0...n].

To apply a discount on all items (e.g., 20% on invoice amount):

curl  https://{site-name}.chargebee.com/api/v2/subscriptions/{subscription_id}/update_for_items \
 -u {site_api_key}:
 -d discounts[apply_on][0]="invoice_amount" 
 -d discounts[duration_type][0]="forever/onetime" 
 -d discounts[percentage][0]=20.0 
 -d discounts[operation_type][0]="add"

Pass discounts[apply_on][0...n] as "invoice_amount".

To remove a discount: Pass "remove" for discounts[operation_type][0...n] and include the discount ID in discounts[id][0...n]. Use the Retrieve a subscription API to get the correct discount ID.

For full parameter details, see update-subscription-for-items - discounts_apply_on.

Related Articles

What is the Jump to Section under Customer/Subscription details page?
Is it possible to add multiple customers to a single subscription
Unable to create a subscription: "Cannot create the subscription as there is no valid card on file". How do I proceed?
How to move a subscription from one customer to another?
Collect first payment at a later date for a new subscription
Can I change the plan of an existing subscription on behalf of the customer ?
What happens when the number of billing cycle is 0?
How do I create/manage a subscription with users or licences ?
What's the difference between the subscription created, subscription activated and subscription started events?
How to change next billing for multiple subscriptions?
How to get a list of all subscriptions in the customer details page for Reseller type business- (above 20 subscriptions)?
How do I add or remove coupons in Subscriptions?
How can I delete a subscription in Chargebee?
How do I apply Coupons to subscriptions?
How to check the billing amount before an invoice is generated?
How to retrieve the next billing date of a subscription?
Multiple subscriptions per customer
How do I change my subscription status from Non-Renewing to Active?
How to enable Proration Settings in Chargebee
Apply a coupon when creating a subscription
Charge /Invoice one-time fee in Chargebee
Subscription Status as Active when payment failed on renewal
Changing the billing date to a different date
How to change the term end date for a specific subscription?
How to give my customers the credits for the unused period when there is a subscription change?
How to let my customer select a different plan during reactivation from the portal?
'Chargebee::InvalidRequestError "customer[company] : wrong value"'
How to configure backdate subscription and invoices?
Prerequisites for backdating subscription actions
Generate a report that shows add-ons by customer/subscription
How do I set a Free Billing Period (manual free trial) for an existing Active subscription?
How do coupons and taxes work on Chargebee’s checkout page?
Timezone for Subscription filters in Chargebee
Can we apply the setup cost while changing a subscription in Legacy Product Catalog sites?
How to set termination fee for Contract terms?
Will a manual discount be shown in the response of the List Subscriptions API?
Is it possible to receive Apple App Store notifications on my server first and then pass them to Chargebee?
Is there any customer information shared while using App Stores?
'What does this statement mean: "This customer has signed up but has not set up their Self-Serve Portal account."?‌'
Error “Subscription is in contract so you cannot pause” while pausing the subscription
Unable to backdate subscription cancellation when a contract term is applied

Show more

Was this article helpful?