ccrz.ccApiCart.placeAsync
Converts a cart to a corresponding order using asynchronous Apex jobs. This method is
called recursively for processing multiple, small batches of cart items. When this method is
first called, it first executes synchronous logic, and then enqueues recursive calls that
execute asynchronous logic. Only the synchronous logic provides return data.
Compatibility
This reference applies to:
Release | Managed Package Version | API Version |
---|---|---|
B2B Commerce for Visualforce Winter ’21 | 4.13 | 12 |
Signature
global static Map<String, Object> placeAsync(Map<String, Object>)
Service Layer Classes
- Logic Service Provider
- ccrz.ccLogicCartPlaceAsync
Inputs (Required)
Map<String, Object> that must include the following required keys:
- ccrz.ccApi.API_VERSION
- The version of the B2B Commerce for Visualforce API to reference for the method call. We recommend that you use the ccrz.ccApi.CURRENT_VERSION constant whenever possible, and only reference a specific version for compatibility if necessary.
Include either of the following keys, but not both. If you don't include either key, the method returns a ccrz.ccApi.MissingInputException.
- ccrz.ccApiCart.CART_ID
- String that specifies the Salesforce ID of the cart to convert.
- ccrz.ccApiCart.CART_ENCID
- String that specifies the encrypted ID of the cart to convert.
Inputs (Optional)
The input map can also include the following keys:
- ccrz.ccApiCart.ALLOW_PRICING_ON_ASYNC_ORDER
- Boolean
Value Usage true If the ccrz.ccApiCart.ENFORCE_PRICE_VALIDATION_ON_PLACE input is true and the cart's price data isn't current, call the ccrz.ccApiCart.priceAsync method to reprice the cart. false (default) If the cart's price data isn't current, the cart isn't repriced, and the order placement process fails. - ccrz.ccApiCart.CARTITEMLASTID
- String that specifies the Salesforce ID of the final major cart item that was processed during the previous recursive job. This ID is used only during recursive jobs that process cart items.
- ccrz.ccApiCart.CART_PLACE_BATCH_SIZE
- Integer that specifies the number of major cart items to process during each recursive job.
- ccrz.ccApiCart.ENFORCE_PRICE_VALIDATION_ON_PLACE
- Boolean
Value Usage true Evaluate whether to reprice the cart before starting the order placement process. If the cart's price data isn't current, this method doesn't create an order from the cart and returns a ccrz.cc_api_Cart.CartValidationException. false (default) Don't evaluate the cart's price data before starting order placement. - ccrz.ccApiOrder.PARAM_ORDER_STATUS
- String that specifies the status of the corresponding order when it's created. By default, this method sets the value Order Submitted.
- ccrz.ccApiCart.PAYMENTDATA
- JSON-formatted string that describes payment information passed to the ccrz.cc_hk_Payment.processPayment extension point method's ccrz.cc_hk_Payment.PARAM_TRANSACTION_DATA input.
- ccrz.ccApiCart.PAYMENTRESULT
- Map<String, Object> that represents the output from the ccrz.cc_hk_Payment.processPayment extension point method.
- ccrz.ccApiCart.PLACE_ASYNC_FINISH
- Boolean
Value Usage true The current method execution is a recursive, asynchronous call that continues the order placement process after the initial call. false (default) The current method execution is the synchronous portion of the initial call that begins the order placement process. - ccrz.ccApiCart.PRICING_FOR_ORDER_FAILED
- Boolean
Value Usage true An error occurred when pricing the cart during the previous iteration of the recursive, asynchronous call. The ccrz.ccLogicCartPlaceAsync.updateOrderOnError method executes. false (default) No error occurred. - ccrz.ccApiCart.SKIP_VALID_CHECK
- Boolean
Value Usage true During this method's execution, ignore the cart's ccrz__ValidationStatus__c field and attempt to create an order from the cart. false (default) During this method's execution, verify that the cart's ccrz__ValidationStatus__c field is set before creating an order for this cart. When this field is set, all items are valid and have a price, and the buyer is allowed to check out from the Shopping Cart page. - ccrz.ccApiCart.TRANSPAYMENTDATA
- JSON-formatted string that describes payment information returned in the ccrz.cc_hk_Payment.processPayment extension point method's ccrz.cc_hk_Payment.PARAM_TRANSACTION_PROCESSED_DATA output.
Outputs
Map<String, Object> that can include the following keys:
- ccrz.ccApi.API_VERSION
- Integer that indicates which API version was used for the query.
- ccrz.ccApi.SUCCESS
- Boolean
Value Usage true The call completed. false The call encountered errors. - ccrz.ccApiCart.ORDER_ID
- String that specifies the Salesforce ID of the created ccrz__E_Order__c.