Newer Version Available

This content describes an older version of this product. View Latest

Create Order From Cart Action

Create single order creation for all items present in the cart. An order is generated for the entire cart as a whole, rather than for individual cart items.

When the custom product name for an order line item has a value, the asset name is set to custom product name.

This action is available in API version 66.0 and later.

This is applicable for Consumer Sales for business-to-consumer (B2C).

Note

Special Access Rules

You need the CME B2C permission set to use this invocable action.

Supported REST HTTP Methods

URI
/services/data/v66.0/actions/standard/createOrderFromCart
Formats
JSON, XML
HTTP Methods
POST
Authentication
Authorization: Bearer token

Inputs

Input Details
cartId
Type
string
Description

Required.

Id of the cart.

contextId
Type
string
Description

Id of the context.

: Both cartId and contextId are supported. At least one of these inputs must be provided. If both are supplied, cartId will take precedence.

Note

Outputs

Output Details
orderId
Type
Description
Id of the order created.

Example

POST

This sample request is for the Create or Update Asset From Order action.

1{
2"inputs": [
3{
4"cartId": "0a6xx000000039BAAQ",
5"contextId" : "0000000c18tc17g001317718435006600be2539f29f441b2942012a67b8be0c4"
6}
7]
8}

This sample response is for the Create Order From Cart action.

Without error sample response:
1[
2    {
3  "errors": [],
4  "orderId": "801xx000003GlM3AAK"
5}
With error sample response:
1{
2"errors": [
3{
4"errorMessage": "We couldn't create the order because the calculation status is invalid. Your Salesforce admin can help with that.",
5"referenceId": null,
6"statusCode": "INVALID_OPERATION"
7}
8],
9"orderId": null
10}