您在此处:
使用产品销售模型创建产品
使用复合图 API 创建还包含产品销售模型详细信息的产品记录。
- 资源
-
https://yourInstance.salesforce.com/services/data/vXX.X/composite/graph - JSON 请求示例
此示例请求演示了如何在一次通话中定义多个产品并将其链接到销售模型选项。
{ "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}}" } } ] } ] }
请确保迁移这些记录和字段。
产品销售模型记录
产品销售模型记录在创建 PricebookEntry 记录时使用。
| 产品销售模型字段 | 要求 |
|---|---|
| PricingTerm | PricingTerm 不应为空。 |
| PricingTermUnit | 指定月或年。 PricingTermUnit 应匹配 RenewalTermUnit,以便使用资产续订 API 续订资产。 |
| SellingModelType | 指定 Evergreen 或 TermDefined。 |
| 状态 | 指定在订单中使用的启用。 |
请参阅 ProductSellingModel。
产品销售模型选项记录
产品销售模型选项记录将产品链接到他们的产品销售模型。
| 产品销售模型选项字段 | 要求 |
|---|---|
| Product2Id | 指定资产的产品 ID。 |
| ProductSellingModelId | 指定相应定期、一次性或 Evergreen 资产的 ProductSellingModelId。 |
| ProrationPolicyId | ProrationPolicyId 不应为空。 |
