Hi, I’ve spent a bit of time deriving the business rules by tracing out the apigee-drupal codebase, and here’s what I’ve found:
I can freely move a developer among free (business_edition_free) and business (business_edition_business) and basic (business_edition_basic), which are all in the same product package.
It appears that by setting a null endDate and startDate and assigning to a new plan, the old ones are automatically ended.
Here’s an example:
Payload: {“developer”:{“id”:“EMAIL-HERE”},“startDate”:null,“endDate”:null,“ratePlan”:{“id”:“business_edition_free”},“suppressWarning”:true}
When I do this, the old plan (which I created today, so has a start date of 2016-05-19 00:00:00) gets an end date of 2016-05-18 00:00:00. The new plan gets a start date of 2016-05-19 00:00:00. This all happens automatically (either in apigee php sdk or on the apigee server).
However, if I try to do the same thing on a newly created enterprise plan (enterprise_edition_months_4), which is in a different product package, I get the following error:
{ “code”: “mint.startDateLaterThanPlanEndDate”, “message”: “Start date should not be later than plan end date”, “contexts”: }
On a possibly related note: if I try to create a plan with a start date of 2016-05-19 00:00:00, I cannot later manually set the end date to 2016-05-18 00:00:00 because the API is enforcing a rule that the end date cannot be earlier than the start date.
Thanks in advance for your answers!