この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

ライフサイクル管理される納入商品の生成

Connect REST API を使用して納入商品を作成し、そのライフサイクル中の数量、金額、月間定期収益の追跡を開始する例を確認します。

営業担当がモバイルデバイス管理サブスクリプションを地元の学区に販売したとします。この販売の注文商品には次の値があります。

注文商品
ID: 1234
販売日: 09/05/19 4:00:00pm PST
開始日: 01/01/20 9:00:00am PST
終了日: 12/31/20 8:59:59am PST
金額: $1,200
数量: 10

Generate Asset API をコールして納入商品、納入商品アクションソース、納入商品アクション、納入商品状態期間を生成するインテグレーションを構築します。

エンドポイント
/services/data/v50.0/asset-management/assets/actions/generate
入力
1{
2 "accountId":"001B000001KDI7BIAX",
3 "assetName":"MDM Subscription",
4 "productId":"01tB0000000q2FFIAY",
5 "currencyIsoCode":"USD",
6
7"assetStatePeriods":[ {
8    "startDate":"2020-01-01T09:00:00-08:00",
9    "endDate":"2020-12-31T08:59:59-08:00",
10    "quantity":10.0,
11    "mrr":100.00,
12    "amount":1200.00
13    }],
14    
15"assetAction":{
16    "category":"Initial Sale",
17    "actionDate":"2019-09-05T16:00:00-08:00",
18    "quantityChange":10.0,
19    "mrrChange":100.00,
20    "amount":1200.00
21    },
22    
23"assetActionSources":[{
24    "transactionDate":"2019-09-05T16:00:00-08:00",
25    "startDate":"2020-01-01T09:00:00-08:00",
26    "endDate":"2020-12-31T08:59:59-08:00",
27    "quantity":10.0,
28    "productAmount":1200.00,
29    "referenceEntityItem":"1WLB00000003geJOAQ"
30    }]
31}
出力
納入商品の作成 1

営業担当が数量変動ありの取引でモバイルデバイス管理サブスクリプションを販売したとします。顧客は 1 月 1 日から 6 月 30 日までのライセンスを 10 件、7 月 1 日から 12 月 31 日までのライセンスを 20 件所有しています。1 つの納入商品ですべてのトランザクションを認識したいと考えます。
注文商品
ID: 1234
販売日: 09/05/19 4:00:00pm PST
開始日: 01/01/20 9:00:00am PST
終了日: 06/30/20 8:59:59am PST
金額: $600
数量: 10
注文商品 2
ID: 1235
販売日: 09/05/19 4:00:00pm PST
開始日: 07/01/20 9:00:00am PST
終了日: 12/31/20 8:59:59am PST
金額: $1,200
数量: 20

この場合、2 つの納入商品状態期間のデータを渡す Generate Asset API コールを 1 回行います。最初の納入商品状態期間は 1 月 1 日から 6 月 30 日までで数量が 10 の期間を表します。2 つ目の納入商品状態期間は 07 月 1 日から 12 月 31 日までで数量が 20 の期間を表します。

エンドポイント
/services/data/v50.0/asset-management/assets/actions/generate
入力
1{
2 "accountId":"001B000001KDI7BIAX",
3 "assetName":"MDM Subscription",
4 "productId":"01tB0000000q2FFIAY",
5 "currencyIsoCode":"USD",
6
7"assetStatePeriods":[ {
8    "startDate":"2020-01-01T09:00:00+08:00",
9    "endDate":"2020-06-30T08:59:59+08:00",
10    "quantity":10.0,
11    "mrr":100.00,
12    "amount":600.00
13    },
14    {
15    "startDate":"2020-07-01T09:00:00+08:00",
16    "endDate":"2020-12-31T08:59:59+08:00",
17    "quantity":20.0,
18    "mrr":200.00,
19    "amount":1200.00
20    }],
21    
22"assetAction":{
23    "category":"Initial Sale",
24    "actionDate":"2019-09-05T16:00:00+08:00",
25    "quantityChange":20.0,
26    "mrrChange":200.00,
27    "amount":1800.00
28    },
29    
30"assetActionSources":[{
31    "transactionDate":"2019-09-05T16:00:00+08:00",
32    "startDate":"2020-01-01T09:00:00+08:00",
33    "endDate":"2020-06-30T08:59:59+08:00",
34    "quantity":10.0,
35    "productAmount":600.00,
36    "referenceEntityItem":"1WLB00000003geJOAQ"
37    },
38    {
39    "transactionDate":"2019-09-05T16:00:00+08:00",
40    "startDate":"2020-07-01T09:00:00+08:00",
41    "endDate":"2020-12-31T08:59:59+08:00",
42    "quantity":20.0,
43    "productAmount":1200.00,
44    "referenceEntityItem":"02iB00000007bYhIAI"
45    }]
46}
出力
納入商品の作成 2