Cannot delete product used in package_has_product.

Not applicable

I am trying to delete a product, I have removed all Developer Apps, but get this error message...Cannot delete product used in package_has_product. If I go down a level to packages, I see the Package, but no delete button? If there is a management API, it is not obvious.

Solved Solved
0 4 132
1 ACCEPTED SOLUTION

adas
New Member

@john.l.dohoney I think the package id is mpcssignature-wess. When you do the get, look for the <id> not the name.

try this:

curl -v https://api.enterprise.apigee.com/v1/mint/organizations/productdev/monetization-packages/mpcssignatu... -u username:password

You can use the same id, to fire the DELETE call too.

View solution in original post

4 REPLIES 4

adas
New Member

@john.l.dohoney I think your org is monetization enabled. When you make a GET /v1/o/{org} call you should see the following property flag in the response:

<Property name="features.isMonetizationEnabled">true</Property>

Now coming back to the original issue. When your org is monetization enabled, you cannot DELETE a package from the UI. There's an API that you could use to DELETE a package, but that only only be done if your package doesn't have any "published rateplan" associated with it.

DELETE /v1/mint/organizations/{org}/monetization-packages/{package_id}

Let me know, if this answers your question. Please accept the answer if it does help you resolve your query.

Thanks for the response, Monetization is indeed enabled.

I tried this command to delete the monetization plan (no rate plans attached)

$ curl -i -H "Authorization:Basic $APIGEE_MANAGEMENT_USER" -X DELETE https://api.enterprise.apigee.com/v1/mint/organizatons/productdev/monetization-packages/MPCSSignatur...
(response)
{
  "code" : "mint.resourceDoesNotExist",
  "message" : "MonetizationPackage with id [productdev@@@mpcssignature] does not
 exist",
  "contexts" : [ ]
}

Prior to this I ran this GET to make sure I had the spelling correct of the plan to delete:

 $ curl -i -H "Authorization:Basic $APIGEE_MANAGEMENT_USER" -X GET https://api.enterprise.apigee.com/v1/mint/organizatons/productdev/monetization-packages | grep MPCS 
(response) 

"description" : "MPCS-Test",
    "displayName" : "MPCS-Test",
    "name" : "MPCS-Test",
      "displayName" : "MPCS-Test",
      "name" : "MPCS-Test",
    "description" : "MPCSSignature",
    "displayName" : "MPCSSignature",
    "name" : "MPCSSignature",
      "displayName" : "MPCS-Signature",
      "name" : "MPCS-Signature",

Is there another step?

Thanks for hanging with me

John

Perfect, the id worked

adas
New Member

@john.l.dohoney I think the package id is mpcssignature-wess. When you do the get, look for the <id> not the name.

try this:

curl -v https://api.enterprise.apigee.com/v1/mint/organizations/productdev/monetization-packages/mpcssignatu... -u username:password

You can use the same id, to fire the DELETE call too.