Introducing the Chargebee CLI

How do I delete an item or item price in Product Catalog 2.0?

Problem Statement

You need to delete a plan, addon, or charge price point in Product Catalog 2.0, or you see the error cannot delete as items are linked.

Solution

Deleting an item price for a plan, addon, or charge may require removing linked subscriptions, quotes, or invoices first when you use the Chargebee UI. When you use the Delete an item price API, Chargebee archives the price point when a subscription or invoice is attached instead of permanently deleting it. See Delete an item price using the API for archive-versus-delete behavior, API response fields, and dependency checks.

To delete a plan price point that has a subscription, an invoice, and a quote linked to it, delete the quote and the invoice first, then the subscription, and then the item price.

Example 1: A plan with a monthly price point is still linked to a subscription, invoice, and transactions.

Step 1: Delete the subscription and related invoice and transaction using the bulk operation

The bulk operation is scheduled and can take time depending on the volume of records.

Check the operation logs if the scheduled action is completed.

Step 2: Delete the price point now then delete the plan item

Example 2: If a plan has addons or charges attached for specific conditions, remove those before you delete the plan. Otherwise Chargebee archives the plan and does not delete it.

Product Catalog 2.0 includes differential pricing.

If you try to delete an addon and Chargebee archives it, check the differential pricing linked to that addon. Unlink the differential pricing, then delete the addon.

Example 3:

Step 1: Delete the addon

But this addon has the price points in USD currency for monthly and yearly frequency

Differential pricing is also set for a plan.

Step 2: Remove the differential pricing first then you will be able to delete the price point of the addon and now you can delete the addon as well.