Enable Apigee monetization

This page applies to Apigee and Apigee hybrid.

View Apigee Edge documentation.

Before you can use Apigee monetization, you must purchase and enable it in your organization. Apigee monetization is supported for Apigee and Apigee hybrid environments.

Purchase Apigee monetization

To purchase Apigee monetization for Subscription organizations, contact Apigee Sales, then enable Apigee monetization in your organization.

Apigee monetization is not available with Pay-as-you-go organizations.

Apigee eval organizations automatically include an Apigee monetization trial for the trial period. You do not need to contact Apigee Sales to add monetization. Proceed to Enable Apigee monetization in your organization.

Enable Apigee monetization in your organization

To enable Apigee monetization in an existing organization, issue a POST request to the following API, passing the add-on configuration in your request body:

https://apigee.googleapis.com/v1/organizations/ORG_NAME:setAddons

For example:

curl "https://apigee.googleapis.com/v1/organizations/ORG_NAME:setAddons" \
  -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-type: application/json" \
  -d '{
    "addonsConfig": {
      "monetizationConfig": {
          "enabled": "true"
      }
      <Include existing add-on configuration>
    }
  }'

Where $TOKEN is set to your OAuth 2.0 access token, as described in Obtaining an OAuth 2.0 access token. For information about the curl options used in this example, see Using curl. For a description of environment variables you can use, see Setting environment variables for Apigee API requests.

The following provides an example of the response showing that the operation is in progress:

{
  "name": "organizations/ORG_NAME/operations/1ae3ed56-b38f-4cc1-ba33-e7d89557075d",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.apigee.v1.OperationMetadata",
    "operationType": "UPDATE",
    "targetResourceName": "organizations/ORG_NAME",
    "state": "IN_PROGRESS"
  }
}

For more information, see the Configure organization add-ons API.

View the organization profile to confirm that monetization has been enabled. For example:

curl "https://apigee.googleapis.com/v1/organizations/ORG_NAME" \
  -X GET \
  -H "Authorization: Bearer $TOKEN"

The following provides an example of the response showing monetization is enabled.

{
    "name": ORG_NAME,
    ...
    "addonsConfig": {
    "monetizationConfig": {
      "enabled": true
    }
  }
}

Disable Apigee monetization in your organization

To disable Apigee monetization in your organization, issue a POST request to the following API, passing the add-on configuration in your request body:

https://apigee.googleapis.com/v1/organizations/ORG_NAME:setAddons

For example:

curl "https://apigee.googleapis.com/v1/organizations/ORG_NAME:setAddons" \
  -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-type: application/json" \
  -d '{
    "addonsConfig": {
      "monetizationConfig": {
          "enabled": "false"
      }
     <Include existing add-on configuration>
    }
  }'

The following provides an example of the response showing that the operation is in progress:

{
  "name": "organizations/ORG_NAME/operations/06274ffb-8940-41da-836d-781cba190437",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.apigee.v1.OperationMetadata",
    "operationType": "UPDATE",
    "targetResourceName": "organizations/ORG_NAME",
    "state": "IN_PROGRESS"
  }
}

For more information, see the Configure organization add-ons API.

View the organization profile to confirm that monetization has been disabled. For example:

curl "https://apigee.googleapis.com/v1/organizations/ORG_NAME" \
  -X GET \
  -H "Authorization: Bearer $TOKEN"

The following provides an example of the response showing monetization is enabled.

{
    "name": ORG_NAME,
    ...
    "addonsConfig": {
    "monetizationConfig": {
      "enabled": false
    }
  }
}

Troubleshoot Apigee monetization enablement

If you have not purchased Apigee monetization and you attempt to enable it, the following error is returned:

{
  "error": {
    "code": 400,
    "message": "failed to validate addons config: [Apigee Monetization] addon(s) are not entitled to the subscription",
    "status": "FAILED_PRECONDITION"
  }
}