Billing Central Apex API Developer Reference

ffbc.ProductsService

global with sharing class ProductsService

This class provides service functionality for the Product standard object.

Methods

getSummariesForPriceBook

global static List<ffbc.ProductsService.ProductSummary> getSummariesForPriceBook(ffbc.ProductsService.ProductSummaryRequest request)

Queries all active products for their ID, name and pricing information for the price book and currency provided. This may optionally be further filtered using a collection of ffbc__Filter__mdt records - see the documentation on the request for more details.

Input Parameters

Name Type Description
request ffbc.ProductsService.ProductSummaryRequest The request object containing the parameters for which to retrieve product summary information.

Return Value

The list of product summaries.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

/**
 * This sample shows an example of using the ffbc.ProductsService.getSummariesForPriceBook method to retrieve
 * product summaries as would be shown on the Billing Central Enhanced UIs.
 */

Id pricebookId;

ffbc.ProductsService.ProductSummaryRequest request = new ffbc.ProductsService.ProductSummaryRequest('USD', pricebookId);
request.WithPricingStructures = true;
request.FilterPurpose = 'Enhanced UI Add Product Drop-Down';
return ffbc.ProductsService.getSummariesForPriceBook(request);

load

global static List<ffbc.ProductsService.Product> load(Set<Id> productIds)

Queries products with the IDs provided, including fields that are related to Billing Central.

Input Parameters

Name Type Description
productIds Set<Id> The products to query.

Return Value

The list of products.

ffbc.ProductsService.Product

global with sharing class Product

This class models a product, including fields that are related to creating and editing Billing Central object types.

Properties

Name Type Description
Id Id Read only. The Salesforce Id of the Product SObject being represented.
Description String Read only. The Description of the Product SObject being represented.
Name String Read only. The Name of the Product SObject being represented.
BillingType ffbc.BillingService.BillingType Read only. The Billing Type of the Product SObject being represented.

ffbc.ProductsService.ProductSummary

global with sharing class ProductSummary

This class models a product, including the ID, name, unit price, and pricing structure for a specific price book and currency.

Properties

Name Type Description
Id Id Read only. The Salesforce Id of the Product being summarised
UnitPrice Decimal Read only. The Unit Price of the Product being summarised
Name String Read only. The Name of the Product being summarised
PricingStructure ffbc.ProductsService.PricingStructureSummary Read only. A summary of the pricing structure associated with the product by a price book structure entry.

ffbc.ProductsService.PricingStructureSummary

global with sharing class PricingStructureSummary

This class is a wrapper for summarised pricing structure information.

Properties

Name Type Description
Id Id Read only. The ID of the Pricing Structure.
MinimumUnitPrice Decimal Read only. The minimum unit price of the Pricing Structure's Quantity Breaks.
MaximumUnitPrice Decimal Read only. The maximum unit price of the Pricing Structure's Quantity Breaks.
PricingType ffbc.PricingStructuresService.Type Read only. The type of pricing to be used in billing.

ffbc.ProductsService.ProductSummaryRequest

global with sharing class ProductSummaryRequest

This class provides the parameters that determine the product summary information to be retrieved.

Properties

Name Type Description
CurrencyIsoCode String The ISO code of the currency for which the product summary information will be returned. In single currency Salesforce orgs this is ignored.
PriceBookId Id The ID of the price book from which to retrieve the unit price and pricing structure.
WithPricingStructures Boolean The flag that determines whether pricing structure information is retrieved for each product. If false, the pricing structure summaries on the products are null.
FilterPurpose String An optional key that can be used to apply additional filters to the products returned. This will be used to find ffbc__Filter__mdt records for Product2 where the ffbc__Purpose__c fields match the given value. If not specified, no additional filtering will be applied.

Methods

ProductSummaryRequest

global ProductSummaryRequest()

The default constructor for this object.

© Copyright 2009–2023 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.