Moving a developer to a different product package

Not applicable

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:

POST https://api.enterprise.apigee.com/v1//mint/organizations/ORG-NAME-HERE/developers/EMAIL-HERE/develop...

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!

5 1 352
1 REPLY 1

rajanish
Participant III

Hi David,

From error it looks like plan you are trying to accept has already ended. In case you have modified the rateplan by creating future plan, the id of the rateplan will be changed. You will have to use new rateplan id to accept the rateplan.

You can get rateplan id by using api

GET https://api.enterprise.apigee.com/v1/mint/organizations/{ORG-NAME-HERE}/monetization-packages/{MONET...

if you have accessing through Edge UI, you can find it in address bar when you open rateplan (last part of url)

To get pkg id

GET https://api.enterprise.apigee.com/v1/mint/organizations/{ORG-NAME-HERE}/monetization-packages/{MONET...