Adding your first subscription

Create a Subscription on the Customer:

curl -X POST \
  https://api.upodi.io/v3/subscriptions/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {Base64EncodedAPIKey}' \
  -H 'Content-Type: application/json' \
  -d '{
    "ProductPlanID": "{ProductPlanID}",
    "CustomerID": "{CustomerID}",
  "StartDate": "2019-12-01T00:00:00Z",
}
//Step 1 - set up Upodi client (If you haven't done so already)
UpodiService upodi = new UpodiService("{apiKey}");

//Step 2 - create new subscription. Requires CustomerId, ProductPlanId and StartDate
upodi.Subscriptions.Create("{CustomerId}", "{ProductPlanId}", "{StartDate}");

Note: CustomerId and ProductPlanId are required properties. For a full list of optional properties please refer to the subscription object.

The response will be somewhere along the lines of:

{
    "CustomerID": "guid",
    "ProductPlanID": "guid",
    "AutoRenew": true,
        "StartDate": "2019-12-01T00:00:00Z",
    "EndDate": "2020-12-01T00:00:00Z",
    "ID": "53fbd8c1-8304-4085-92ec-676459df4197"
    ...
}

Save the ID of the subscription. You will need it in the next step.