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
| 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. (BILLING_PERIOD_UNSPECIFIED, WEEKLY, MONTHLY) |
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. (CONSUMPTION_PRICING_TYPE_UNSPECIFIED, FIXED_PER_UNIT, BANDED, TIERED, STAIRSTEP) |
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. (PAYMENT_FUNDING_MODEL_UNSPECIFIED, PREPAID, POSTPAID) |
revenueShareRates | array | Details of the revenue sharing model. |
revenueShareType | string | Method used to calculate the revenue that is shared with developers. (REVENUE_SHARE_TYPE_UNSPECIFIED, FIXED, VOLUME_BANDED) |
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). (STATE_UNSPECIFIED, DRAFT, PUBLISHED) |
| 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 | startKey, count, expand, orderBy, 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 startKey = '{{ startKey }}'
AND count = '{{ count }}'
AND expand = '{{ expand }}'
AND orderBy = '{{ orderBy }}'
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__fixedFeeFrequency,
data__setupFee,
data__description,
data__consumptionPricingRates,
data__paymentFundingModel,
data__startTime,
data__consumptionPricingType,
data__revenueShareRates,
data__endTime,
data__revenueShareType,
data__state,
data__displayName,
data__fixedRecurringFee,
data__billingPeriod,
data__currencyCode,
organizationsId,
apiproductsId
)
SELECT
'{{ apiproduct }}',
{{ fixedFeeFrequency }},
'{{ setupFee }}',
'{{ description }}',
'{{ consumptionPricingRates }}',
'{{ paymentFundingModel }}',
'{{ startTime }}',
'{{ consumptionPricingType }}',
'{{ revenueShareRates }}',
'{{ endTime }}',
'{{ revenueShareType }}',
'{{ state }}',
'{{ displayName }}',
'{{ fixedRecurringFee }}',
'{{ billingPeriod }}',
'{{ currencyCode }}',
'{{ 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: "{{ organizationsId }}"
description: Required parameter for the rateplans resource.
- name: apiproductsId
value: "{{ apiproductsId }}"
description: Required parameter for the rateplans resource.
- name: apiproduct
value: "{{ apiproduct }}"
description: |
Name of the API product that the rate plan is associated with.
- name: fixedFeeFrequency
value: {{ fixedFeeFrequency }}
description: |
Frequency at which the fixed fee is charged.
- name: setupFee
description: |
Initial, one-time fee paid when purchasing the API product.
value:
currencyCode: "{{ currencyCode }}"
units: "{{ units }}"
nanos: {{ nanos }}
- name: description
value: "{{ description }}"
description: |
Description of the rate plan.
- name: consumptionPricingRates
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
value:
- end: "{{ end }}"
start: "{{ start }}"
fee:
currencyCode: "{{ currencyCode }}"
units: "{{ units }}"
nanos: {{ nanos }}
- name: paymentFundingModel
value: "{{ paymentFundingModel }}"
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: startTime
value: "{{ startTime }}"
description: |
Time when the rate plan becomes active in milliseconds since epoch.
- name: consumptionPricingType
value: "{{ consumptionPricingType }}"
description: |
Pricing model used for consumption-based charges.
valid_values: ['CONSUMPTION_PRICING_TYPE_UNSPECIFIED', 'FIXED_PER_UNIT', 'BANDED', 'TIERED', 'STAIRSTEP']
- name: revenueShareRates
description: |
Details of the revenue sharing model.
value:
- start: "{{ start }}"
sharePercentage: {{ sharePercentage }}
end: "{{ end }}"
- name: endTime
value: "{{ endTime }}"
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.
- name: revenueShareType
value: "{{ revenueShareType }}"
description: |
Method used to calculate the revenue that is shared with developers.
valid_values: ['REVENUE_SHARE_TYPE_UNSPECIFIED', 'FIXED', 'VOLUME_BANDED']
- name: state
value: "{{ state }}"
description: |
Current state of the rate plan (draft or published).
valid_values: ['STATE_UNSPECIFIED', 'DRAFT', 'PUBLISHED']
- name: displayName
value: "{{ displayName }}"
description: |
Display name of the rate plan.
- name: fixedRecurringFee
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.
value:
currencyCode: "{{ currencyCode }}"
units: "{{ units }}"
nanos: {{ nanos }}
- name: billingPeriod
value: "{{ billingPeriod }}"
description: |
Frequency at which the customer will be billed.
valid_values: ['BILLING_PERIOD_UNSPECIFIED', 'WEEKLY', 'MONTHLY']
- name: currencyCode
value: "{{ currencyCode }}"
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.
REPLACE examples
- organizations_apiproducts_rateplans_update
Updates an existing rate plan.
REPLACE google.apigee.rateplans
SET
data__apiproduct = '{{ apiproduct }}',
data__fixedFeeFrequency = {{ fixedFeeFrequency }},
data__setupFee = '{{ setupFee }}',
data__description = '{{ description }}',
data__consumptionPricingRates = '{{ consumptionPricingRates }}',
data__paymentFundingModel = '{{ paymentFundingModel }}',
data__startTime = '{{ startTime }}',
data__consumptionPricingType = '{{ consumptionPricingType }}',
data__revenueShareRates = '{{ revenueShareRates }}',
data__endTime = '{{ endTime }}',
data__revenueShareType = '{{ revenueShareType }}',
data__state = '{{ state }}',
data__displayName = '{{ displayName }}',
data__fixedRecurringFee = '{{ fixedRecurringFee }}',
data__billingPeriod = '{{ billingPeriod }}',
data__currencyCode = '{{ currencyCode }}'
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
;