Docs

Subscriptions Articles & FAQ

subscription, id, not, received, api, transaction, charges, non-recurring, One-time

461783

2022-10-19T11:41:36Z

2025-02-20T05:27:18Z

132

2

0

256406

Subscription Id is not being received in Chargebee response when transaction is created

Subscription Id is not being received in Chargebee response when transaction is created 

Scope

Why subscription ID is not generated for the non-recurring addon via API?

Subscription Id is not being received in Chargebee response when the transaction is created

Summary

A subscription ID will only be generated if the Charges & One-time charges (PC 2.0) or Non-recurring addons (PC 1.0) are linked to a subscription via API/UI. Adding Non-recurring addons/Charges/One-time Charges from the Customer details page (UI) or by using Create invoice for items and one-time charges API only with customer ID will create charges for the customer and therefore subscription ID will not be present on this event.

Entities that can be linked to customer ID or subscription ID

PC 1.0 - Non-recurring addon

PC 2.0 - Charge, One-time charge

Solution

A non-recurring addon (PC 1.0) is a product or service that has been modeled into Chargebee that does not renew with the subscription though it is linked to it. This can be linked to a subscription or to the customer

A Charge (PC 2.0) represents products or services that are non-recurring, either purchased once immediately or scheduled for purchase on specific events which can also be attached to customers without a subscription.

A one-time charge (PC 2.0) is an ad-hoc charge against a customer and can be linked to any particular subscription or customer.

In this example, we have created a Charge linked to the subscription ID.

sample request

curl  https://videoclikz-test.chargebee.com/api/v2/invoices/create_for_charge_items_and_charges \

     -u test_Mu99gW9wCf6kKeiUTP5bcduMEjGYMscuqA:\

     -d subscription_id="AzZTUvTKhlNgE2Am" \

     -d item_prices[item_price_id][0]="Charge-USD" \

     -d item_prices[quantity][0]="2" \


sample response

In this example, we have created a charge linked to the customer

sample request

curl  https://apidocs.chargebee.com/docs/api/invoices?lang=pythonhttps%3A%2F%2Fsumup.de%2Frechnungen%2Flexikon%2Fstornorechnung#create_invoice_for_items_and_one-time_charges \

     -u test_Mu99gW9wCf6kKeiUTP5bcduMEjGYMscuqA:\

     -d customer_id="16Be5OTKhKSGE1ef" \

     -d item_prices[item_price_id][0]="Charge-USD" \

     -d item_prices[quantity][0]="2"


same response

Was this article helpful?
Loading…