Testing plans

To facilitate development, Cloud API includes a Test Util API. The Test Util API is an API that provides functionality to facilitate testing during development. You can use the Test Util API to mark a plan as being in use even if it is not associated with any accounts, policies, or producers.

By default, the Test Util API is not enabled. For information on how to enable Test Util API, see Enabling the Test Util API.

Warning: The Test Util API is intended for use in a development environment only. Do not use the Test Util API on a production system.

Endpoints for testing plans

Querying for plan details

You can use the following Test Util endpoint to retrieve details about a specific plan:

  • GET /test-util/v1/plans/{planId}

The only information included in the payload is the plan's id and its inUse field.

Marking a plan as being in use

From a technical standpoint, a plan is considered to be in use if its inUse field is set to true. The actions that can be taken on a plan vary based on whether it is in use. For example, a billing plan cannot be deleted when it is in use.

In a normal BillingCenter environment, a plan becomes in use only once it is assigned to at least one account, policy, or producer.

The Test Util API includes the following endpoint, which can be used to explicitly mark a plan as being in use. This can simplify testing of plan functionality related to being in use as it removes the need to assign the plan to another object (and possibly to create that object as well).

  • POST /test-util/v1/plans/{planId}/mark-in-use

The request requires no request body.

For example, the following request marks billing plan bc:101 as being in use (even if it has not been explicitly assigned to any account).

POST /test-util/v1/plans/bc:101/mark-in-use

<no request payload>

There is no endpoint to mark a plan as not being in use.