You are here:
Create Products with Product Selling Models
Use the composite graph API to create Product records that also contain product selling model details.
- Resource
-
https://yourInstance.salesforce.com/services/data/vXX.X/composite/graph - JSON Request Sample
This sample request demonstrates how to define multiple products and link them to selling model options in a single call.
{ "graphs": [ { "graphId": "1", "compositeRequest": [ { "method": "POST", "referenceId": "refProduct1", "url": "/services/data/vXX.X/sobjects/Product2", "body": { "Name": "InfinitraBytes Firewall", "isActive": true, "ProductCode": "{{accountSeqNumber}}", "Family": "None", "Description": "Firewall software from InfinitraBytes" } }, { "method": "POST", "referenceId": "refProduct2", "url": "/services/data/vXX.X/sobjects/Product2", "body": { "Name": "InfinitraBytes Router", "isActive": true, "ProductCode": "{{accountSeqNumber}}", "Family": "None", "Description": "InfinitraBytes Router hardware subscription" } }, { "method": "POST", "referenceId": "refPSMOption1", "url": "/services/data/vXX.X/sobjects/ProductSellingModelOption", "body": { "ProductSellingModelId": "{{psmTermedId}}", "Product2Id": "@{refProduct1.id}", "ProrationPolicyId": "{{prorationPolicyId}}" } }, { "method": "POST", "referenceId": "refPSMOption2", "url": "/services/data/vXX.X/sobjects/ProductSellingModelOption", "body": { "ProductSellingModelId": "{{psmTermedId}}", "Product2Id": "@{refProduct2.id}", "ProrationPolicyId": "{{prorationPolicyId}}" } } ] } ] }
Make sure that you migrate these records and fields.
Product Selling Model Records
Product Selling Model records are used when creating PricebookEntry records.
| Product Selling Model Field | Requirement |
|---|---|
| PricingTerm | The PricingTerm should not be null. |
| PricingTermUnit | Specify either Months or Annual. The PricingTermUnit should match the RenewalTermUnit for renewing assets by using Asset Renewal API. |
| SellingModelType | Specify either Evergreen or TermDefined. |
| Status | Specify Active for use in orders. |
See ProductSellingModel.
Product Selling Model Option Records
Product Selling Model Option records link products to their product selling models.
| Product Selling Model Option Field | Requirement |
|---|---|
| Product2Id | Specify the product ID of the asset. |
| ProductSellingModelId | Specify the ProductSellingModelId of the corresponding termed, one-time, or evergreen asset. |
| ProrationPolicyId | The ProrationPolicyId should not be null. |
Product Records
The Product2Id is used when creating orders and assets.
| Product Field | Requirement |
|---|---|
| isActive | Specify True. The product should be active to use Amendment, Renewal, or Cancellation (ARC) APIs. |
See Product.

