rateplans
Creates, updates, deletes, gets or lists a rateplans
resource.
Overview
Name | rateplans |
Type | Resource |
Id | google.apigee.rateplans |
Fields
The following fields are returned by SELECT
queries:
- organizations_apiproducts_rateplans_get
- organizations_apiproducts_rateplans_list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Name of the rate plan. |
apiproduct | string | Name of the API product that the rate plan is associated with. |
billingPeriod | string | Frequency at which the customer will be billed. |
consumptionPricingRates | array | API 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 |
consumptionPricingType | string | Pricing model used for consumption-based charges. |
createdAt | string (int64) | Output only. Time that the rate plan was created in milliseconds since epoch. |
currencyCode | string | Currency to be used for billing. Consists of a three-letter code as defined by the ISO 4217 standard. |
description | string | Description of the rate plan. |
displayName | string | Display name of the rate plan. |
endTime | string (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. |
fixedFeeFrequency | integer (int32) | Frequency at which the fixed fee is charged. |
fixedRecurringFee | object | Fixed 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) |
lastModifiedAt | string (int64) | Output only. Time the rate plan was last modified in milliseconds since epoch. |
paymentFundingModel | string | DEPRECATED: 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. |
revenueShareRates | array | Details of the revenue sharing model. |
revenueShareType | string | Method used to calculate the revenue that is shared with developers. |
setupFee | object | Initial, one-time fee paid when purchasing the API product. (id: GoogleTypeMoney) |
startTime | string (int64) | Time when the rate plan becomes active in milliseconds since epoch. |
state | string | Current state of the rate plan (draft or published). |
Successful response
Name | Datatype | Description |
---|---|---|
nextStartKey | string | Value that can be sent as startKey to retrieve the next page of content. If this field is omitted, there are no subsequent pages. |
ratePlans | array | List of rate plans in an organization. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
organizations_apiproducts_rateplans_get | select | organizationsId , apiproductsId , rateplansId | Gets the details of a rate plan. | |
organizations_apiproducts_rateplans_list | select | organizationsId , apiproductsId | orderBy , startKey , count , expand , state | Lists all the rate plans for an API product. |
organizations_apiproducts_rateplans_create | insert | organizationsId , apiproductsId | 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. | |
organizations_apiproducts_rateplans_update | replace | organizationsId , apiproductsId , rateplansId | Updates an existing rate plan. | |
organizations_apiproducts_rateplans_delete | delete | organizationsId , apiproductsId , rateplansId | Deletes 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.
Name | Datatype | Description |
---|---|---|
apiproductsId | string | |
organizationsId | string | |
rateplansId | string | |
count | integer (int32) | |
expand | boolean | |
orderBy | string | |
startKey | string | |
state | string |
SELECT
examples
- organizations_apiproducts_rateplans_get
- organizations_apiproducts_rateplans_list
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;
Lists all the rate plans for an API product.
SELECT
nextStartKey,
ratePlans
FROM google.apigee.rateplans
WHERE organizationsId = '{{ organizationsId }}' -- required
AND apiproductsId = '{{ apiproductsId }}' -- required
AND orderBy = '{{ orderBy }}'
AND startKey = '{{ startKey }}'
AND count = '{{ count }}'
AND expand = '{{ expand }}'
AND state = '{{ state }}';
INSERT
examples
- organizations_apiproducts_rateplans_create
- Manifest
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
;
# Description fields are for documentation purposes
- name: rateplans
props:
- name: organizationsId
value: string
description: Required parameter for the rateplans resource.
- name: apiproductsId
value: string
description: Required parameter for the rateplans resource.
- name: apiproduct
value: string
description: >
Name of the API product that the rate plan is associated with.
- name: displayName
value: string
description: >
Display name of the rate plan.
- name: description
value: string
description: >
Description of the rate plan.
- name: billingPeriod
value: string
description: >
Frequency at which the customer will be billed.
valid_values: ['BILLING_PERIOD_UNSPECIFIED', 'WEEKLY', 'MONTHLY']
- name: paymentFundingModel
value: string
description: >
DEPRECATED: 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.
valid_values: ['PAYMENT_FUNDING_MODEL_UNSPECIFIED', 'PREPAID', 'POSTPAID']
- name: currencyCode
value: string
description: >
Currency to be used for billing. Consists of a three-letter code as defined by the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) standard.
- name: setupFee
value: object
description: >
Initial, one-time fee paid when purchasing the API product.
- name: fixedRecurringFee
value: object
description: >
Fixed 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.
- name: fixedFeeFrequency
value: integer
description: >
Frequency at which the fixed fee is charged.
- name: consumptionPricingType
value: string
description: >
Pricing model used for consumption-based charges.
valid_values: ['CONSUMPTION_PRICING_TYPE_UNSPECIFIED', 'FIXED_PER_UNIT', 'BANDED', 'TIERED', 'STAIRSTEP']
- name: consumptionPricingRates
value: array
description: >
API 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
- name: revenueShareType
value: string
description: >
Method used to calculate the revenue that is shared with developers.
valid_values: ['REVENUE_SHARE_TYPE_UNSPECIFIED', 'FIXED', 'VOLUME_BANDED']
- name: revenueShareRates
value: array
description: >
Details of the revenue sharing model.
- name: state
value: string
description: >
Current state of the rate plan (draft or published).
valid_values: ['STATE_UNSPECIFIED', 'DRAFT', 'PUBLISHED']
- name: startTime
value: string
description: >
Time when the rate plan becomes active in milliseconds since epoch.
- name: endTime
value: string
description: >
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.
REPLACE
examples
- organizations_apiproducts_rateplans_update
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
- organizations_apiproducts_rateplans_delete
Deletes a rate plan.
DELETE FROM google.apigee.rateplans
WHERE organizationsId = '{{ organizationsId }}' --required
AND apiproductsId = '{{ apiproductsId }}' --required
AND rateplansId = '{{ rateplansId }}' --required;