Skip to main content

rateplans

Creates, updates, deletes, gets or lists a rateplans resource.

Overview

Namerateplans
TypeResource
Idgoogle.apigee.rateplans

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Name of the rate plan.
apiproductstringName of the API product that the rate plan is associated with.
billingPeriodstringFrequency at which the customer will be billed.
consumptionPricingRatesarrayAPI call volume ranges and the fees charged when the total number of API calls is within a given range. The method used to calculate the final fee depends on the selected pricing model. For example, if the pricing model is BANDED and the ranges are defined as follows: { "start": 1, "end": 100, "fee": 2 }, { "start": 101, "end": 200, "fee": 1.50 }, { "start": 201, "end": 0, "fee": 1 }, } Then the following fees would be charged based on the total number of API calls (assuming the currency selected is USD): * 50 calls cost 50 x $2 = $100 * 150 calls cost 100 x $2 + 50 x $1.5 = $275 * 250 calls cost 100 x $2 + 100 x $1.5 + 50 x $1 = $400 * 500 calls cost 100 x $2 + 100 x $1.5 + 300 x $1 = $650
consumptionPricingTypestringPricing model used for consumption-based charges.
createdAtstring (int64)Output only. Time that the rate plan was created in milliseconds since epoch.
currencyCodestringCurrency to be used for billing. Consists of a three-letter code as defined by the ISO 4217 standard.
descriptionstringDescription of the rate plan.
displayNamestringDisplay name of the rate plan.
endTimestring (int64)Time when the rate plan will expire in milliseconds since epoch. Set to 0 or null to indicate that the rate plan should never expire.
fixedFeeFrequencyinteger (int32)Frequency at which the fixed fee is charged.
fixedRecurringFeeobjectFixed amount that is charged at a defined interval and billed in advance of use of the API product. The fee will be prorated for the first billing period. (id: GoogleTypeMoney)
lastModifiedAtstring (int64)Output only. Time the rate plan was last modified in milliseconds since epoch.
paymentFundingModelstringDEPRECATED: This field is no longer supported and will eventually be removed when Apigee Hybrid 1.5/1.6 is no longer supported. Instead, use the billingType field inside DeveloperMonetizationConfig resource. Flag that specifies the billing account type, prepaid or postpaid.
revenueShareRatesarrayDetails of the revenue sharing model.
revenueShareTypestringMethod used to calculate the revenue that is shared with developers.
setupFeeobjectInitial, one-time fee paid when purchasing the API product. (id: GoogleTypeMoney)
startTimestring (int64)Time when the rate plan becomes active in milliseconds since epoch.
statestringCurrent state of the rate plan (draft or published).

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
organizations_apiproducts_rateplans_getselectorganizationsId, apiproductsId, rateplansIdGets the details of a rate plan.
organizations_apiproducts_rateplans_listselectorganizationsId, apiproductsIdorderBy, startKey, count, expand, stateLists all the rate plans for an API product.
organizations_apiproducts_rateplans_createinsertorganizationsId, apiproductsIdCreate a rate plan that is associated with an API product in an organization. Using rate plans, API product owners can monetize their API products by configuring one or more of the following: - Billing frequency - Initial setup fees for using an API product - Payment funding model (postpaid only) - Fixed recurring or consumption-based charges for using an API product - Revenue sharing with developer partners An API product can have multiple rate plans associated with it but only one rate plan can be active at any point of time. **Note: From the developer's perspective, they purchase API products not rate plans.
organizations_apiproducts_rateplans_updatereplaceorganizationsId, apiproductsId, rateplansIdUpdates an existing rate plan.
organizations_apiproducts_rateplans_deletedeleteorganizationsId, apiproductsId, rateplansIdDeletes a rate plan.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
apiproductsIdstring
organizationsIdstring
rateplansIdstring
countinteger (int32)
expandboolean
orderBystring
startKeystring
statestring

SELECT examples

Gets the details of a rate plan.

SELECT
name,
apiproduct,
billingPeriod,
consumptionPricingRates,
consumptionPricingType,
createdAt,
currencyCode,
description,
displayName,
endTime,
fixedFeeFrequency,
fixedRecurringFee,
lastModifiedAt,
paymentFundingModel,
revenueShareRates,
revenueShareType,
setupFee,
startTime,
state
FROM google.apigee.rateplans
WHERE organizationsId = '{{ organizationsId }}' -- required
AND apiproductsId = '{{ apiproductsId }}' -- required
AND rateplansId = '{{ rateplansId }}' -- required;

INSERT examples

Create a rate plan that is associated with an API product in an organization. Using rate plans, API product owners can monetize their API products by configuring one or more of the following: - Billing frequency - Initial setup fees for using an API product - Payment funding model (postpaid only) - Fixed recurring or consumption-based charges for using an API product - Revenue sharing with developer partners An API product can have multiple rate plans associated with it but only one rate plan can be active at any point of time. **Note: From the developer's perspective, they purchase API products not rate plans.

INSERT INTO google.apigee.rateplans (
data__apiproduct,
data__displayName,
data__description,
data__billingPeriod,
data__paymentFundingModel,
data__currencyCode,
data__setupFee,
data__fixedRecurringFee,
data__fixedFeeFrequency,
data__consumptionPricingType,
data__consumptionPricingRates,
data__revenueShareType,
data__revenueShareRates,
data__state,
data__startTime,
data__endTime,
organizationsId,
apiproductsId
)
SELECT
'{{ apiproduct }}',
'{{ displayName }}',
'{{ description }}',
'{{ billingPeriod }}',
'{{ paymentFundingModel }}',
'{{ currencyCode }}',
'{{ setupFee }}',
'{{ fixedRecurringFee }}',
{{ fixedFeeFrequency }},
'{{ consumptionPricingType }}',
'{{ consumptionPricingRates }}',
'{{ revenueShareType }}',
'{{ revenueShareRates }}',
'{{ state }}',
'{{ startTime }}',
'{{ endTime }}',
'{{ organizationsId }}',
'{{ apiproductsId }}'
RETURNING
name,
apiproduct,
billingPeriod,
consumptionPricingRates,
consumptionPricingType,
createdAt,
currencyCode,
description,
displayName,
endTime,
fixedFeeFrequency,
fixedRecurringFee,
lastModifiedAt,
paymentFundingModel,
revenueShareRates,
revenueShareType,
setupFee,
startTime,
state
;

REPLACE examples

Updates an existing rate plan.

REPLACE google.apigee.rateplans
SET
data__apiproduct = '{{ apiproduct }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__billingPeriod = '{{ billingPeriod }}',
data__paymentFundingModel = '{{ paymentFundingModel }}',
data__currencyCode = '{{ currencyCode }}',
data__setupFee = '{{ setupFee }}',
data__fixedRecurringFee = '{{ fixedRecurringFee }}',
data__fixedFeeFrequency = {{ fixedFeeFrequency }},
data__consumptionPricingType = '{{ consumptionPricingType }}',
data__consumptionPricingRates = '{{ consumptionPricingRates }}',
data__revenueShareType = '{{ revenueShareType }}',
data__revenueShareRates = '{{ revenueShareRates }}',
data__state = '{{ state }}',
data__startTime = '{{ startTime }}',
data__endTime = '{{ endTime }}'
WHERE
organizationsId = '{{ organizationsId }}' --required
AND apiproductsId = '{{ apiproductsId }}' --required
AND rateplansId = '{{ rateplansId }}' --required
RETURNING
name,
apiproduct,
billingPeriod,
consumptionPricingRates,
consumptionPricingType,
createdAt,
currencyCode,
description,
displayName,
endTime,
fixedFeeFrequency,
fixedRecurringFee,
lastModifiedAt,
paymentFundingModel,
revenueShareRates,
revenueShareType,
setupFee,
startTime,
state;

DELETE examples

Deletes a rate plan.

DELETE FROM google.apigee.rateplans
WHERE organizationsId = '{{ organizationsId }}' --required
AND apiproductsId = '{{ apiproductsId }}' --required
AND rateplansId = '{{ rateplansId }}' --required;