ProductSpecifications-productSpecificationId-offerings-offeringId-prices:GET
GET /productSpecifications/{productSpecificationId}/offerings/{offeringId}/prices
Retrieves prices for a particular product specification offering.
Contents |
Request
GET /productSpecifications/{productSpecificationId}/offerings/{offeringId}/prices
URI Parameters
- filterType
- Indicates that the result should be filtered by price type.
- The legal values for this parameter are 'fee', 'discount' and 'usage_fee'
- fee - all product specification and its service specifications prices (e.g. setup fee, recurring fee, etc.)
- discount - all product specification and its service specifications discounts
- usage_fee - all product specification and its service specifications usage prices
- This parameter CANNOT be used with values containing any wildcards (*)
- This parameter is optional
- filterRecurrences
- Indicates that the result should be filtered by the number of recurrences
- This parameter is optional.
- The values for this parameter can be specified using a wildcard(*).
- filterRelatedServiceSpecification
- Indicates that the result should be filtered by linked service specification URI.
- A value of indicates that only results with relatedServiceSpecification= should be returned.
- This parameter is optional
- This parameter CANNOT be used with values containing any wildcards (*)
- filterName
- Indicates that the result should be filtered by name
- This parameter is optional
- This parameter CANNOT be used with values containing any wildcards (*)
- sortField
- Indicates which field should be used for sorting.
- Legal values are 'name', 'type', 'recurrences' and 'relatedServiceSpecification'.
- This parameter is optional
- sortOrder
- Indicates the order in which the result should be sorted.
- Legal values are 'asc' and 'desc'
- This parameter is optional. If 'sortField' was specified and 'sortOrder' was omitted, then the result will be sorted in ascending order.
- pageSize
- Indicates the number of prices to be included on each page of the result (if pagination is desired)
- This parameter is optional. If 'page' is specified and 'pageSize' is omitted, then the result will show 100 prices per page.
- page
- Indicates the 1-based index of the page to view.
- The value must be an integer between 1 and the maximum number of pages (returned in the 'last' element of the 'links' attribute of the result)
- This parameter is optional, but if 'pageSize' was specified, then 'page' is also required.
Response
Returns a list of prices for a particular product specification offering Id.
Status Code
- 200 OK
- Success
- 400 Bad Request
- Returned if incorrect parameters are specified for filtering, sorting or pagination. The response body will contain details about the nature of the error.
- 404 Not Found
- Returned if the product specification Id or the offering Id could not be found.
- 502 Bad Gateway
- Returned there is any internal API error.
Response Body
{ "list": [ { "type": "fee" "name": "recurring", "amount": 1125.0, "billingPeriod": 3, "recurrences": -1, "relatedServiceSpecification": "https://api.hostway.com/serviceSpecifications/{serviceSpecificationId}", }, { "type" : "usage_fee", "name" : "mfg_mailbox_standard", "billingPeriod" : 1, "relatedServiceSpecification" : "https://api.hostway.com/serviceSpecifications/{serviceSpecificationId}", "unit" : "mfg_mailbox_standard", "rates" : [ { "start" : 1, "end" : 3, "amountPerUnit" : 0.0 }, { "start" : 3, "end" : -1, "amountPerUnit" : 1.0 } ] } ], "links": [ { "rel": "self", "href": "https://api.hostway.com/productSpecifications/{productSpecificationId}/offerings/{offeringId}/prices?pageSize={pageSize}&page=3" }, { "rel": "first", "href": "https://api.hostway.com/productSpecifications/{productSpecificationId}/offerings/{offeringId}/prices?pageSize={pageSize}&page=1" }, { "rel": "previous", "href": "https://api.hostway.com/productSpecifications/{productSpecificationId}/offerings/{offeringId}/prices?pageSize={pageSize}&page=2" }, { "rel": "next", "href": "https://api.hostway.com/productSpecifications/{productSpecificationId}/offerings/{offeringId}/prices?pageSize={pageSize}&page=4" }, { "rel": "last", "href": "https://api.hostway.com/productSpecifications/{productSpecificationId}/offerings/{offeringId}/prices?pageSize={pageSize}&page=12" }, ] }
Parameters
- list - list
- List of product offering price details. Each element of the list has the following attributes:
- type - string
- This can be either 'fee', 'discount' or 'usage_fee'. A fee represents a fee that will be charged. A discount represents a downward adjustment of the amount of a fee.
An usage fee represents a fee that will be charged based on usage rate.
- name - string
- A name for the price. This is NOT guaranteed to be unique.
- billingPeriod - integer
- The billing frequency in months.
- recurrences - integer
- The number of time this price will recur. A value of -1 means that the price will recur throughout the entire lifetime of the provisioned product.
- This parameter is available for fee and discount types only
- relatedServiceSpecification - string
- The URI of the service specification (associated with the product) to which this price is linked. If this is an empty string, then the price is linked to the product itself.
- unit - string
- unit based on which a service is charged for.
- This parameter is available for usage_fee type only
- rates - dictionary
- tiers of usage on which a service is charged for. Each tier has:
- start - integer
- number of unit for which a service begins to be charged with the current tier's price. The start of a tier is inclusive for the current tier.
- end - integer
- number of unit for which a service begins to be charged with the next tier's price. The end of a tier is exclusive for the current tier. If the end parameter is -1, then we have no limit for the tier.
- amountPerUnit - float
- Price per an usage unit to be charged.
Examples
Get usage tiers for a given service specification of a product
Request
GET http://127.0.0.1:6543/productSpecifications/core.plan.linux.webstart/offerings/USD-1/prices?filterRelatedservicespecification=/serviceSpecifications/core.email.openxchange.xmail&filterType=usage_fee
Response
HTTP/1.0 200 OK
{ "list" : [ { "name" : "mfg_mailbox_standard", "billingPeriod" : 1, "rates" : [ { "start" : 1, "end" : 3, "amountPerUnit" : 0.0 }, { "start" : 3, "end" : -1, "amountPerUnit" : 1.0 } ], "relatedServiceSpecification" : "http://127.0.0.1:6543/serviceSpecifications/core.email.openxchange.xmail", "type" : "usage_fee", "unit" : "mfg_mailbox_standard" }, { "name" : "mfg_mailbox_activesync", "billingPeriod" : 1, "rates" : [ { "start" : 1, "end" : -1, "amountPerUnit" : 2.0 } ], "relatedServiceSpecification" : "http://127.0.0.1:6543/serviceSpecifications/core.email.openxchange.xmail", "type" : "usage_fee", "unit" : "mfg_mailbox_activesync" }, { "name" : "mfg_mailbox_premium", "billingPeriod" : 1, "rates" : [ { "start" : 1, "end" : -1, "amountPerUnit" : 3.0 } ], "relatedServiceSpecification" : "http://127.0.0.1:6543/serviceSpecifications/core.email.openxchange.xmail", "type" : "usage_fee", "unit" : "mfg_mailbox_premium" } ], "links" : [ { "href" : "http://127.0.0.1:6543/productspecifications/core.plan.linux.webstart/offerings/USD-1/prices?filterRelatedservicespecification=/serviceSpecifications/core.email.openxchange.xmail&filterType=usage_fee", "rel" : "self" } ] }
Get usage tiers for a given service specification of a product filtered by an usage rate's name
Request
http://127.0.0.1:6543/productSpecifications/core.plan.linux.webstart/offerings/USD-1/prices?filterRelatedservicespecification=/serviceSpecifications/core.email.openxchange.xmail&filterType=usage_fee&filterName=mfg_mailbox_standard
Response
HTTP/1.0 200 OK
{ "list" : [ { "name" : "mfg_mailbox_standard", "billingPeriod" : 1, "rates" : [ { "start" : 1, "end" : 3, "amountPerUnit" : 0.0 }, { "start" : 3, "end" : -1, "amountPerUnit" : 1.0 } ], "relatedServiceSpecification" : "http://127.0.0.1:6543/serviceSpecifications/core.email.openxchange.xmail", "type" : "usage_fee", "unit" : "mfg_mailbox_standard" } ], "links" : [ { "href" : "http://127.0.0.1:6543/productspecifications/core.plan.linux.webstart/offerings/USD-1/prices?filterRelatedservicespecification=/serviceSpecifications/core.email.openxchange.xmail&filterType=usage_fee&filterName=mfg_mailbox_standard", "rel" : "self" } ] }
See also