Skip to content

Latest commit

 

History

History
164 lines (97 loc) · 3.43 KB

plan-api.md

File metadata and controls

164 lines (97 loc) · 3.43 KB

Plan API

Plans are collections of Prices which define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of Products. While Products help you track inventory or provisioning, plans and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing and billing cycle options should be represented by prices grouped together in a plan. This approach lets you change prices without having to change your provisioning scheme.

For example, you might have a single "Gold" product that has prices for $100/month, $1000/year, and $50 once with the alternative billing cycle and pricing options each represented by a different plan and the recurring and one-time prices represented by different prices

Class Name

PlanAPI

Methods

Create Plan

Creates a new plan.

You must provide at least these values in your request:

  • name
Plan plan = zuoraClient.plans().create(params);

Parameters

Parameter Type Tags Description
params PlanCreateRequest Required Plan request object.

Response Type

Plan

Example

PlanCreateRequest params = PlanCreateRequest.builder()
        .name("Monthly Plan")
        .build();
Plan plan = zuoraClient.plans().create(params);

Get Plan

Plan plan = zuoraClient.plans().get(planId);

Parameters

Parameter Type Tags Description
id String Required The unique identifier of a plan.

Response Type

Plan

Example

final String PLAN_ID = "plan_id8";

Plan plan = zuoraClient.plans().get(PLAN_ID);

Update Plan

Plan plan = zuoraClient.plans().update(updatePlanRequest);

Parameters

Parameter Type Tags Description
plan Plan Required Plan request object.

Response Type

Plan

Example

final String PLAN_ID = "plan_id8";
Plan plan = zuoraClient.plans().get(PLAN_ID);

plan.setName("Plan Y")
Plan plan = zuoraClient.plans().update(plan);

Add Price

Adds a price to the plan.

Plan plan = zuoraClient.plans().addPrice(priceCreateRequest);

Parameters

Parameter Type Tags Description
params PriceCreateRequest Required Price create request.

Response Type

Plan

Example

PriceCreateRequest params = PriceCreateRequest.builder()
        .name("Gold")
        .build();
Plan plan = zuoraClient.plans().addPrice(params);

Delete Plan

final String PLAN_ID = "plan_id8";

Plan plan = zuoraClient.plans().delete(PLAN_ID);

Parameters

Parameter Type Tags Description
id String Required The unique identifier of a plan.

Response Type

Plan

Example

final String PLAN_ID = "plan_id8";

Plan plan = zuoraClient.plans().delete(PLAN_ID);