Delete monetization data from your organization

You're viewing Apigee Edge documentation.
Go to the Apigee X documentation.
info

Introduction

You may wish to delete monetization data from your organization in the following scenarios:

  • Clear monetization data from a test organization that you would like to reuse. In this case, you must synchronize the Apigee Edge data after you delete the monetization data.
  • Delete your organization. In this case, you must delete the monetization data before you can delete the organization.

Deleting monetization data from an organization permanently removes the following data:

  • API packages
  • Rate plans
  • Developer accepted rate plans
  • Monetization transactions
  • Notification templates
  • Third-party payment providers, if configured

The following sections describe the steps required to delete monetization data from your organization to support the scenarios above:

Enabling the deletion of monetization data from your organization

Before you can delete monetization data from your organization, you must enable the features.isMintOrgDataDeletionAllowed property for your organization.

Enable the property by issuing a POST call to the https://api.enterprise.apigee.com/v1/organizations/org_name API, where org_name is the name of your organization.

curl -u email:password -X POST -H "Content-type:application/json" https://api.enterprise.apigee.com/v1/organizations/{org_name} -d \
'{
  "name" : "{org_name}",
  "properties" : {
    "property" : [ {
      "name" : "features.isMintOrgDataDeletionAllowed",
      "value" : "true"
    }, {
      "name" : "features.topLevelDevelopersAreCompanies",
      "value" : "false"
    } ]
  }
}'

Deleting monetization data

To delete monetization data from your organization, issue a POST request to /organizations/org_name/asyncjobs/deleteorgdata, where org_name is the name of your organization.

For example, the following request deletes monetization data from the myOrg organization:

curl -H "Content-Type:application/json" -X POST \
"https://api.enterprise.apigee.com/v1/mint/organizations/myOrg/asyncjobs/deleteorgdata" \
-u email:password

The following provides an example of the response:

{
  "id": "c6eaa22d-27bd-46cc-be6f-4f77270818cf",
  "log": "",
  "orgId": "myOrg",
  "status": "RUNNING",
  "type": "DELETE_ORG"
}

Viewing the status of the asynchronous delete operation

To view the status of the asynchronous delete operation, issue a GET request to /asyncjobs/{id}, where {id} is the ID of the delete operation returned in the response.

For example, the following request displays the status of the asynchronous delete operation with the id c6eaa22d-27bd-46cc-be6f-4f77270818cf:

curl -X GET \
"https://api.enterprise.apigee.com/v1/mint/asyncjobs/c6eaa22d-27bd-46cc-be6f-4f77270818cf" \
-u email:password

The following provides an example of the response:

{
  "id": "c6eaa22d-27bd-46cc-be6f-4f77270818cf",
  "log": "",
  "orgId": "myOrg",
  "status": "COMPLETED",
  "type": "DELETE_ORG"
}

Synchronizing Apigee Edge data with monetization

If you want to re-use the organization, you must synchronize Apigee Edge data with monetization, as described in Synchronize Apigee Edge data with monetization.

Deleting the organization

If the organization is no longer needed, you can delete it after you have deleted the monetization data, as described in Delete an Organization.