Activate your Subscription

The final step is to activate the subscription. When this is done Upodi will start billing the subscription according to the setup in Product Plan and Product Plan Charges and the quantities supplied to the subscription charges.

curl -X PUT \
  https://api-front.upodi.io/subscriptions/{SubscriptionID}/activate \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {Base64EncodedAPIKey' \
  -H 'X-version: {version}' \
  -H 'Content-Type: application/json' \
//Step 1 - set up Upodi client (If you haven't done so already)
UpodiClient Upodi = new Upodi.SDK.UpodiClient("{APIKey}");

//Step 2 - activate the subscription using the SubscriptionID from the previous step.
Upodi.Subscriptions.Activate("{SubscriptionID}");

The created invoice should look something like this:

{
    "Items": [
        {
            "InvoiceLines": [
                {
                    "Title": "Product A",
                    "Description": "\r\n1 - 5\r\n5 stk.",
                    "SubscriptionChargeID": "guid",
                    "ProductPlanChargeID": "guid",
                    "LineNumber": 1,
                    "Quantity": 1,
                    "TaxExempt": false,
                    "TotalVat": 2.5,
                    "UnitPrice": 10,
                    "TotalPrice": 12.5,
                    "SKU": "1",
                    "Unit": "stk.",
                    "Discount": 0,
                    "DiscountAmount": 0,
                    "TotalPriceBaseCurrency": 12.5,
                    "TotalPriceExchangeRate": 1,
                    "PeriodStart": "2019-03-31T22:01:00Z",
                    "PeriodEnd": "2019-06-29T22:01:00Z",
                    "ID": "guid",
                }
            ],
            "CustomerID": "guid",
            "SubscriptionID": "guid",
            "CurrencyCode": "DKK",
            "TotalAmount": 12.5,
            "Total": 10,
            "TotalVat": 2.5,
            "InvoiceDate": "2019-05-03T09:23:57Z",
            "InvoiceStatus": 10,
            "PaymentStatus": 20,
            "DueDate": "2019-05-04T09:23:57Z",
            "InvoiceNumber": "INV-049797",
            "ID": "guid",
          	...
        }
      ]
}