chargebee.api_error.InvalidRequestError: currency_code : Not applicable when subscription_id is specified.
This error normally occurs when you pass the currency_code for Charges in PC 2.0. Currency_code is applicable only when we raise unbilled charges for Quick Charges and it has to be the same as Subscription currency.
Referring to the API documentation for ‘Create unbilled charges for item subscription’ the ‘currency_code’ under Input parameters is ‘Required’ and not Optional.
If you would like to add Charges, you need to pass on ‘item_prices[item_price_id][0..n]’ and while doing so, you don’t have to add ‘currency_code’ though you have multi-currency enabled. Chargebee will automatically consider the Subscription’s currency.
Quick charges require currency codes as they are charges that aren’t pre-defined and created manually. You will also see this parameter on the Chargebee UI.
Sample Screenshot of Quick Charges in Chargebee UI:
Hence, in the case of Quick Charges (or) one-time charges, it is required to pass the ‘currency_code’ parameter also the currency code must be the same as the subscription’s currency.
To know more about API docs
What is the difference between Charges and Quick Charges in PC 2.0?
How to view the details of changes to the unbilled charges via the API?
Error: "This API operation is not enabled for this site. Please contact email@example.com to get this enabled"