Place Order (POST)

Place orders with integrated pricing, configuration, and validation, and manage them throughout their entire lifecycle. Additionally, update an order or insert order items.

You can also group order items based on location, work types, or departments, if groups are enabled for your org. Groups provide a visualization of the products to view large quotes.

This API supports a maximum of 300 transaction line items. To place sales transactions that exceed this limit, use the Place Sales Transaction API. See Place Sales Transaction (POST).

Special Access Rules
You need the PlaceOrder API permission set to use this API.
Resource
/commerce/sales-orders/actions/place
Resource example
https://yourInstance.salesforce.com/services/data/v64.0/commerce/sales-orders/actions/place
Available version
60.0
HTTP methods
POST
Request body for POST
JSON example
{
  "pricingPref": "System",
  "configurationInput": "RunAndAllowErrors",
  "configurationOptions": {
    "validateProductCatalog": true,
    "validateAmendRenewCancel": true,
    "executeConfigurationRules": true,
    "addDefaultConfiguration": true
  },
  "graph": {
    "graphId": "graphId",
    "records": [
      {
        "referenceId": "refOrder",
        "record": {
          "attributes": {
            "type": "Order",
            "method": "POST",
            "Id": "POST"
          }
        }
      },
      {
         "referenceId":"refOrderItem",
         "record":{
         "attributes":{
             "type":"OrderItem",
             "method":"POST"
            },
            "OrderId":"@{refOrder.id}",
            "OrderActionId":"@{refOrderAction.id}",
            "ListPrice":"144.99",
            "Quantity":3,
            "PricebookEntryId":"01uxx0000008yXPAAY",
            "Product2Id":"01txx0000006i2UAAQ",
            "UnitPrice":"199.49"
       }
      }
    ]
  }
}
This example shows a sample request to define grouping of order items.
{
    "pricingPref": "system",
    "graph": {
        "graphId": "placeOrder",
        "records": [
            {
                "referenceId": "refOrder",
                "record": {
                    "attributes": {
                        "type": "Order",
                        "method": "PATCH",
                        "id": "801xx000003GZ9bAAG"
                    }
                }
            },
            {
                "referenceId": "refOlg1",
                "record": {
                    "attributes": {
                        "type": "OrderItemGroup",
                        "method": "POST"
                    },
                    "Name": "New Group",
                    "OrderId": "@{refOrder.id}"
                }
            }
        ]
    }
}
This example shows a sample request to ungroup order items.
{
    "pricingPref": "system",
    "graph": {
        "graphId": "placeOrder",
        "records": [
            {
                "referenceId": "refOrder",
                "record": {
                    "attributes": {
                        "type": "Order",
                        "method": "PATCH",
                        "id": "refOrder"
                    }
                }
            },
            {
                "referenceId": "refOlg1",
                "record": {
                    "attributes": {
                        "type": "OrderItemGroup",
                        "method": "DELETE",
                        "id": "refOlg1",
                        "action": "Ungroup"
                    }
                }
            }
        ]
    }
}
This example shows a sample request to create a new group.
{
    "pricingPref": "system",
    "graph": {
        "graphId": "placeOrder",
        "records": [
            {
                "referenceId": "refOrder",
                "record": {
                    "attributes": {
                        "type": "Order",
                        "method": "PATCH",
                        "id": "refOrder"
                    }
                }
            },
            {
                "referenceId": "refOlg",
                "record": {
                    "attributes": {
                        "type": "OrderItemGroup",
                        "method": "POST"
                    },
                    "Name": "New Group",
                    "OrderId": "@{refOrder.id}"
                }
            }
        ]
    }
}
This example shows a sample request to delete a group.
{
    "contextId": "",
    "correlationId": "",
    "records": [
        {
            "referenceId": "refOrder",
            "record": {
                "attributes": {
                    "type": "Order",
                    "method": "PATCH",
                    "id": "refOrder"
                }
            }
        },
        {
            "referenceId": "refOlg",
            "record": {
                "attributes": {
                    "type": "OrderItemGroup",
                    "method": "DELETE",
                    "id": "refOlg",
                    "action": "DeleteGroup"
                }
            }
        }
    ]
}
This example shows a sample request to group order items based on criteria.
{
    "pricingPref": "system",
    "graph": {
        "graphId": "placeOrder",
        "records": [
            {
                "referenceId": "refOrder",
                "record": {
                    "attributes": {
                        "type": "Order",
                        "method": "PATCH",
                        "id": "refOrder"
                    }
                }
            },
            {
                "referenceId": "g0",
                "record": {
                    "attributes": {
                        "type": "OrderItemGroup",
                        "method": "POST",
                        "action": "GroupBy",
                        "criteria": {
                            "BillingFrequency2": null
                        }
                    },
                    "Name": "Billing Frequency: ",
                    "OrderId": "@{refOrder.id}"
                }
            },
            {
                "referenceId": "g1",
                "record": {
                    "attributes": {
                        "type": "OrderItemGroup",
                        "method": "POST",
                        "action": "GroupBy",
                        "criteria": {
                            "BillingFrequency2": "Monthly"
                        }
                    },
                    "Name": "Billing Frequency: Monthly",
                    "OrderId": "@{refOrder.id}"
                }
            }
        ]
    }
}
Properties
Name Type Description Required or Optional Available Version
catalog​RatesPref String Rate card entries defined in the catalog that must be fetched for order items with usage-based pricing during the order creation process. Valid values are:
  • Fetch—Retrieves the rate card entries defined in the catalog for order items during the order creation process.
  • Skip—Skips the retrieval of rate card entries for order items during the order creation process.

The default value is Skip.

This property is available when the Usage-Based Selling feature is enabled.

Optional 62.0
configuration​Input String Configuration input for the place order process. Valid values are:
  • RunAndAllowErrors—Specifies to run the configuration and to proceed order ingestion upon encountering any configuration errors.
  • RunAndBlockErrors—Specifies to run configuration and to block order ingestion upon encountering any configuration errors.
  • Skip—Specifies to skip configuration.

The default value is RunAndBlockErrors.

Optional 60.0
configuration​Options Configuration Options Input​[] Configuration options during the ingestion process. Optional 60.0
graph Object Graph Input The sObject graph of the order payload to be ingested. You can perform create, update, or delete operations on objects from the Sales Transaction context definition by using this property. Additionally, perform create, update, or delete operations on custom objects and fields in your extended context definition. Required 60.0
pricing​Pref String Pricing preference during the create order process. Valid values are:
  • Force—Specifies to force pricing during the order ingestion process.
  • Skip—Specifies to skip pricing during the order ingestion process.
  • System—Specifies the system to determine whether a pricing calculation is required.

The default value is System.

Optional 60.0
Response body for POST
Place Order