詳細情報:
商品販売モデルを使用した商品の作成
複合グラフ API を使用して、商品販売モデルの詳細も含む商品レコードを作成します。
- リソース
-
https://yourInstance.salesforce.com/services/data/vXX.X/composite/graph - JSON 要求のサンプル
このサンプル要求では、1 回のコールで複数の商品を定義し、それらを販売モデルオプションにリンクする方法を示します。
{ "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 は null にしないでください。 |
| PricingTermUnit | [Months (月)] または [Annual (年間)] を指定します。 Asset Renewal API を使用して納入商品を更新する場合、PricingTermUnit は RenewalTermUnit と一致する必要があります。 |
| SellingModelType | エバーグリーンまたは TermDefined を指定します。 |
| 状況 | 注文で使用する [有効] を指定します。 |
「ProductSellingModel」を参照してください。
商品販売モデルオプションレコード
商品販売モデルオプションレコードは、商品を商品販売モデルにリンクします。
| 商品販売モデルオプション項目 | 要件 |
|---|---|
| Product2Id | 納入商品の商品 ID を指定します。 |
| ProductSellingModelId | 対応する期間指定納入商品、1 回限り納入商品、またはエバーグリーン納入商品の ProductSellingModelId を指定します。 |
| ProrationPolicyId | ProrationPolicyId を null にしないでください。 |
「ProductSellingModelOption」を参照してください。
商品レコード
Product2Id は、注文と納入商品を作成するときに使用されます。
| 商品の項目 | 要件 |
|---|---|
| isActive | True を指定します。 修正、更新、キャンセル (ARC) API を使用するには、商品が有効になっている必要があります。 |
「製品」を参照してください。
