Optional: Add Optional Charges (Add-on charges)

📘

Optional

This step is optional and only applicable if you have Products in your Product Plan with the Charge Setup option Optional Charge (Add-on). This type of product is not automatically available on the subscription, but has to be added. On the other hand you can have more than one of these with the same Product Plan Charge.

Locate the Product Plan Charge ID needed

In order to add an optional charge you need to have the Product Plan Charge ID of that particular product. Maybe you already have this, but you probably want to find it dynamically.

curl --location --request GET 'https://api.upodi.io/v3/productplans/query?$expand=ProductPlanCharges' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {Base64EncodedAPIKey}' \
var plans = upodi.ProductPlans.Get(new Guid("{ProductPlanID}"));

Here you can find all the available Product Plan Charges, and those with Charge Setup 1 can be added as Add-On charges.

{
    "Items": [
        {
            "ProductPlanCharges": [
                {
                    "ProductPlanID": "82a2f098-1c25-477c-ad3a-d911117de1a4",
                    "FullName": "something",
                    "InvoiceText": "something",
                    "PricingModel": 16,
                    "ChargeType": 16,
                    "BillingPeriod": 300,
                    "BillingPeriodInterval": 1,
                    "BillingPeriodAlignment": 8,
                    "DefaultAmount": 1.0,
                    "Taxable": true,
                    "ProductChargeType": 0,
                    "AddOnProductChargeID": null,
                    "ChargeSetup": 0,
                    "SKU": "1001",
                    "AnchorCode": null,
                    "ID": "0daba6ed-9269-41e7-9c88-0d2390ea2f3c"
                },
                {
                    "ProductPlanID": "82a2f098-1c25-477c-ad3a-d911117de1a4",
                    "FullName": "Something add-on",
                    "InvoiceText": "Something add-on",
                    "PricingModel": 16,
                    "ChargeType": 16,
                    "BillingPeriod": 300,
                    "BillingPeriodInterval": 1,
                    "BillingPeriodAlignment": 8,
                    "DefaultAmount": 1.0,
                    "Taxable": true,
                    "ProductChargeType": 0,
                    "AddOnProductChargeID": null,
                    "ChargeSetup": 1,
                    "SKU": "3444-D",
                    "AnchorCode": null,
                    "UoMID": null,
                    "ID": "6a469c72-01be-4d71-bfff-498085a890ab"
                }
            ],
            "SKU": null,
            "FullName": "Normal recurring",
            "CurrencyCode": "DKK",
            "ActiveCurrencies": "DKK",
            "Description": null,
            "Status": 1,
            "ChangeHandle": 0,
            "ID": "82a2f098-1c25-477c-ad3a-d911117de1a4",
        }
    ]
}

Note the ID of the charge you want to add.

Add An Optional Charge to the Subscription

curl --request PUT \
  --url https://api.upodi.io/v3/subscriptions/{SubscriptionID}/addoptionalcharge \
  --header 'Accept: application/json; charset=utf-8' \
  --header 'Content-Type: application/json' \
  --data '{  "productplanchargeid": "6a469c72-01be-4d71-bfff-498085a890ab",  "chargealignment": 0}'
var req = new Upodi.Messaging.AddChargeAddonRequest(){ ChargeAlignment = 0, ProductPlanChargeId = new Guid("6a469c72-01be-4d71-bfff-498085a890ab")};
upodi.Subscriptions.AddChargeAddOn(new Guid("a84d5f93-b055-42c8-85e9-2eca59792416"), req);

Now the charge is added, and upon activation the quantity will be billed