External Pricing

External pricing refers to retrieving prices from an external application and applying those prices to products or subscriptions within a platform. The retrieved prices are used as the unit price, and additional discounts, such as price lists, volume discounts, promotions, and user-defined discounts, are then applied on top of the retrieved prices.

Prices are retrieved using the External Pricing endpoint, which receives the purchase details (product, unit, quantity, customer) and returns the price calculated by any custom algorithm the service wants to apply.

This is how you can define which products of your service are priced by calling an external system.

Configure External Pricing via Get Service Definition

The following sections describe the configuration of external pricing for products returned by the Get Service Definition endpoint.

Endpoint Registration

The endpoint used for external pricing can be declared during the Get Service Definition process with the ExternalPricing property. ExternalPricing is an array, and may contain multiple endpoints per Service Manager. The following is an example of external pricing configuration:

{
"ProductTypes": <..>
"ExternalPricing": [
		{
			"ID": "externalpricing_mycompany",
			"Description": "My Company External Pricing",
			"Endpoint": "https://service.mycompany.com/api/pricing/getPrices"
		}
	]
}
  • ID – a unique identifier value for this configuration
  • Description is a simple description of the configuration
  • Endpoint the endpoint used to retrieve prices

For more details on how to implement the External Pricing Endpoint, please see the page: Implementation of the External Pricing Endpoint

Enabling External Pricing on Products

Declare the ExternalPricing property in the definition of the product, under ProductTypes ProductsCollection Products ExternalPricing. Specify the ID of the external pricing configuration, as shown in the following example:

{	
  "ProductTypes": [
		{
			"ID": "myservice",
			<...>
			"ProductsCollection": {
				"Products": [
					{
						"ID": "Product_1_basic",
						"Code": "Product_1",
						"Name": "Basic Product",
						"ExternalPricing": "externalpricing_mycompany",
						"Attributes": [
							{
							  "ID": "edition",
							  "Values": "Basic",
                              "IsPrimaryKey": true,
                              "Update":true
							}
						 ]
						<...>						
					}
			}
		}
	],
	"ExternalPricing": [
		{
			"ID": "externalpricing_mycompany",
			"Description": "My Company External Pricing",
			"Endpoint": "https://service.mycompany.com/api/pricing/getPrices"
		}
        {
			"ID": "externalpricing_globo",
			"Description": "Globo Technologies External Pricing",
			"Endpoint": "https://servicemg.globo.st/api/pricing/getPrices"
		}
	]
}

The products for which external pricing configuration is activated can be found in the BSS by going to Products View Product Pricing Edit. The External Pricing flag should be checked as seen in the figure below:

The value of the External Pricing flag is read-only for products created via Get Service Definition and its value is controlled by the Service Manager.