PlaceOrderExecutor Class

Contains methods to place an order with details of the graph request, pricing preferences, and configuration options.

CommerceOrders

  • PlaceOrderExecutor Methods

    Learn more about the methods available with the PlaceOrderExecutor class.

  • PlaceOrderExecutor Example Implementation

    Place orders with integrated pricing, configuration, and validation, and manage them throughout their entire lifecycle. To place an order from Apex, refer to the example implementation of the PlaceOrderExecutor class.

Learn more about the methods available with the PlaceOrderExecutor class.

The PlaceOrderExecutor class includes these methods.

Use the method in the PlaceOrderExecutor class to execute the Place Order Apex API request by assigning the properties for graph request, pricing reference, and configuration options.

public static commerceorders.PlaceOrderResult execute(commerceorders.GraphRequest graphRequest, commerceorders.PricingPreferenceEnum pricingPreferenceEnum, commerceorders.ConfigurationInputEnum configurationInputEnum, commerceorders.ConfigurationOptionsInput configurationOptionsInput)

graphRequest

Type: commerceorders.GraphRequest

The sObject graph values of the order payload to be ingested.

pricingPreferenceEnum

Type: commerceorders.PricingPreferenceEnum

Pricing preference during the order process.

configurationInputEnum

Type: commerceorders.ConfigurationInputEnum

Configuration input for the place order process.

configurationOptionsInput

Type: commerceorders.ConfigurationOptionsInput

Configuration options during the ingestion process.

Type: commerceorders.PlaceOrderResult

Use the method in the PlaceOrderExecutor class to execute the Place Order Apex API request by assigning the properties for graph request, pricing reference, and configuration options. This method also includes the property to define fetching of rate card entries.

public static commerceorders.PlaceOrderResult execute(commerceorders.GraphRequest graphRequest, commerceorders.PricingPreferenceEnum pricingPreferenceEnum, commerceorders.CatalogRatesPreferenceEnum catalogRatesPreferenceEnum, commerceorders.ConfigurationInputEnum configurationInputEnum, commerceorders.ConfigurationOptionsInput configurationOptionsInput)

graphRequest

Type: commerceorders.GraphRequest

The sObject graph values of the order payload to be ingested.

pricingPreferenceEnum

Type: commerceorders.PricingPreferenceEnum

Pricing preference during the order process.

catalogRatesPreference

Type: commerceorders.CatalogRatesPreferenceEnum

The rate card entries defined in the catalog that must be fetched for order items, with usage-based pricing during the order creation process. The CatalogRatesPreferenceEnum enum is available when the Usage-Based Selling feature is enabled.

configurationInputEnum

Type: commerceorders.ConfigurationInputEnum

Configuration input for the place order process.

configurationOptionsInput

Type: commerceorders.ConfigurationOptionsInput

Configuration options during the ingestion process.

Type: commerceorders.PlaceOrderResult

Use the method in the PlaceOrderExecutor class to execute the Place Order Apex API request by assigning the properties for graph request.

public static commerceorders.PlaceOrderResult execute(commerceorders.GraphRequest graphRequest)

graphRequest

Type: commerceorders.GraphRequest

The sObject graph values of the order payload to be ingested.

Type: commerceorders.PlaceOrderResult

Place orders with integrated pricing, configuration, and validation, and manage them throughout their entire lifecycle. To place an order from Apex, refer to the example implementation of the PlaceOrderExecutor class.

commerceorders

Customize this example to suit your requirements. Create the list of records to be ingested by using these steps. Replace the respective IDs with the values that are present in your org. For example, replace the value of ${Pricebook2Id} field with the price book ID that’s present in the org.

  • Create the list of records by constructing the Map<String, Object> map of field values of an order.

  • To create a record object from the field values, create an instance of the RecordResource class.

  • To associate the Record object with a reference identifier, create an instance of the RecordWithReferenceRequest class.

  • Invoke the Place Order Apex API.

    The CatalogRatesPreferenceEnum enum is available when the Usage-Based Selling feature is enabled.

  • To contain all record objects, create an instance of the GraphRequest class.