Set Up Standalone Orders with API
Available in: Salesforce Billing Winter ’21 and later |
Our standalone orders documentation contains required fields and setup instructions unique to standalone orders and order products. For concepts shared between standard orders and standalone orders, we provide links to the original CPQ and Billing topics.
You still need the Salesforce CPQ package installed to create standalone orders and order products. Although it doesn’t use any Salesforce CPQ features or objects, Salesforce Billing runs internal validations against the CPQ package for several features and workflows.
Create your objects by executing the following series of REST API requests in a single POST request. All object creation requests use the following endpoint, replacing VERSION with your required API version, such as v48.0 or v49.0:
/services/data/v48.0/composite
Your JSON request must contain a compositeRequest class that defines both the order and the order item. Here’s a generic example with null values for the minimum required fields. Configurations for certain billing and order product features may require additional fields and entities.
Example
{
"allOrNone" : true,
"compositeRequest" : [{
"method" : "POST",
"url" : "/services/data/VERSION/sobjects/order",
"referenceId" : "refOrder",
"body" : {
"Status" : "Draft" ,
"EffectiveDate" : ""
"Pricebook2Id" : "",
"AccountId" : ""}
},{
"method" : "POST",
"url" : "/services/data/VERSION/sobjects/OrderItem",
"referenceId" : "",
"body" : {
"Quantity" : "",
"Unitprice" : "",
"ServiceDate" : "",
"EndDate" : "",
"SBQQ__ChargeType__c" : "",
"blng__BillableUnitPrice__c" : "",
"SBQQ__OrderedQuantity__c" : "",
"SBQQ__Status__c" : "",
"PricebookEntryId" : "",
"orderId" : ""
}
}]
}