Azure 節約プランを購入する

適用対象: パートナー センター

この記事では、パートナー センターで Azure 節約プランを購入するための API エクスペリエンスについて説明し、Azure 節約プランに固有 の要求/応答の例 を示します。

前提条件

パートナー センターの認証に関するページで説明している資格情報。 このシナリオでは、アプリとユーザーの資格情報を使用した認証がサポートされます。

顧客 ID です (customer-tenant-id)。 顧客の ID がわからない場合は、 パートナー センター で [顧客] ワークスペースを選択し、 次に顧客 の一覧から [顧客]、[ アカウント] の順に選択して、その ID を検索できます。 お客様のアカウント ページで、 [顧客のアカウント情報] セクションの Microsoft ID を探します。 Microsoft ID は、顧客 ID (customer-tenant-id) と同じです。

パートナー センター API を使用して顧客の Azure 節約プランを購入するには、少なくとも 1 つのアクティブな Azure サブスクリプションを持つその顧客の Azure プランが必要です。 Azure プランを購入する方法

Azure 節約プランを見つける

Azure 節約プランを購入する前に、次の手順を実行します。

  1. 購入する製品と SKU を特定して取得します。 これを行うには、最初に製品と SKU を一覧表示するか、製品と SKU の ID がわかっている場合は、それらを選択します。 以下の API で Azure 節約プランの値を表示するには、以下の API のルートで顧客 ID が必要であり、その顧客には Azure プランが必要です。

  2. SKU可用性を取得します。 注文を行うときは、可用性の CatalogItemId が必要です。 この値を取得するには、次のいずれかの API を使用します。

Azure 節約プランの場合は、 製品の SKU の一覧を取得する (顧客別) と SKU ID と可用性 API 応答を 使用して SKU を取得 すると、SKU の 最小PurchaseCommitment が返されます。 これは、特定の期間に対して 1 時間あたりに行うことができる最小コミットメントです。 これは Azure 節約プランにのみ適用され、他の製品ファミリには適用されません。

Azure 節約プランを購入する

Azure 節約プランの注文を送信するには、次の手順を実行します。

  1. 購入するカタログ アイテムのコレクションを保持するカートを作成します。 カートを作成すると、カート品目は、同じ注文でまとめて購入できる項目に基づいて自動的にグループ化されます。
  2. カートをご確認ください。 カートをチェックアウトすると 、Order が作成されます。

API 要求では、パートナーはカートを作成または更新し、注文を作成するときに、次のパラメーターを指定する必要があります。 PurchaseCommitment は、Azure 節約プランの新しい値です。

  • スコープ: 使用可能な値には、単一の共有値が含まれます
  • EntitlementId: 単一のスコープに必要な Azure サブスクリプション ID
  • SubscriptionId: 共有スコープに必要な Azure プラン ID
  • PurchaseCommitment: コンピューティング サービスで 1 年または 3 年間コミットされた固定時間単位の金額。

Azure 節約プランには、スコープとサブスクリプション ID/エンタイトルメント ID を含むプロビジョニング コンテキストと、金額、グレイン、通貨を含む購入コミットメントが必要です。

Azure 節約プランの表示と管理

パートナーは、パートナー センターで購入した Azure 節約プランを表示できます。 予約インスタンスと同様に、パートナーは購入後の管理アクションに引き続きAzure portalを使用できます。 Azure 節約プランの管理の詳細については、「 Azure 節約プランの管理 - Microsoft Cost Management」を参照してください。

[ ID によるサブスクリプションの取得 ] と [ 顧客のサブスクリプションの取得 ] API では、 SubscriptionLineItem というデータ モデルが返されます。 サブスクリプションの応答内で、パートナーには Azure 節約プランの次のプロパティが表示されます。

  • unitType: この値はベネフィットです
  • billingType: この値は特典です
  • lineItems: 品目には、特定の Azure 節約プラン サブスクリプション (スコープや PurchaseCommitment など) の購入の詳細が含まれます。
  • productOrderId: 特定の製品購入の識別子 (予約プランや Azure 節約プランなど)。

注意

Azure portalを通じて購入した Azure 節約プランの場合、サブスクリプション API は注文 ID を返しません。

Azure 節約プランの請求書と調整

パートナーは、 CSP での節約プランの調整と課金 に関するページにアクセスして、毎月の課金調整ファイルに節約額がどのように反映されるかを理解できます。

要求/応答の例

API の例を検出する

ID で製品を取得する

応答:

{  
    "id": "DZH318Z09V6F",  
    "title": "Azure savings plan",  
    "description": "Flexible pricing model offering lower prices compared to On-Demand pricing, in exchange for a specific usage commitment",  
    "productType": {  
        "id": "Azure",  
        "displayName": "Azure",  
        "subType": {  
            "id": "SavingsPlan",  
            "displayName": "SavingsPlan"  
        }  
    },  
    "isMicrosoftProduct": true,  
    "publisherName": "Microsoft Corporation",  
    "links": {  
        "skus": {  
            "uri": "/products/DZH318Z09V6F/skus?country=US",  
            "method": "GET",  
            "headers": []  
        },  
        "self": {  
            "uri": "/products/DZH318Z09V6F?country=US",  
            "method": "GET",  
            "headers": []  
        }  
    }  
}  

ID で SKU を取得する

応答:

{  
    "id": "0001",  
    "productId": "DZH318Z09V6F",  
    "title": "Compute savings plan, 1 Year",  
    "description": "Compute savings plan, 1 Year",  
    "minimumQuantity": 1,  
    "maximumQuantity": 1,  
    "minimumPurchaseCommitment": {  
        "grain": "Hourly",  
        "currencyCode": {  
            "code": "USD",  
            "symbol": "$"  
        },  
        "amount": "0.001"  
    },  
    "isTrial": false,  
    "supportedBillingCycles": [  
        "one_time",  
        "monthly"  
    ],  
    "purchasePrerequisites": [  
        "MicrosoftCloudAgreement"  
    ],  
    "inventoryVariables": [],  
    "provisioningVariables": [],  
    "actions": [  
        "Refund"  
    ],  
    "dynamicAttributes": {  
        "isMicrosoftProduct": true,  
        "armSkuName": "Compute_Savings_Plan",  
        "duration": "1year",  
        "termDuration": "P1Y",  
        "internal": false  
    },  
    "links": {  
        "availabilities": {  
            "uri": "/products/DZH318Z09V6F/skus/0001/availabilities?country=US",  
            "method": "GET",  
            "headers": []  
        },  
        "self": {  
            "uri": "/products/DZH318Z09V6F/skus/0001?country=US",  
            "method": "GET",  
            "headers": []  
        }  
    }  
}

ID で可用性を取得する

応答:

{  
    "id": "DZH318Z0BLD3",  
    "productId": "DZH318Z09V6F",  
    "skuId": "0001",  
    "catalogItemId": "DZH318Z09V6F:0001:DZH318Z0BLD3",  
    "defaultCurrency": {  
        "code": "USD",  
        "symbol": "$"  
    },  
    "segment": "commercial",  
    "country": "US",  
    "isPurchasable": true,  
    "isRenewable": false,  
    "renewalInstructions": [],  
    "terms": [  
        {  
            "duration": "P1Y",  
            "description": "1year"  
        }  
    ],  
    "links": {  
        "self": {  
            "uri": "/products/DZH318Z09V6F/skus/0001/availabilities/DZH318Z0BLD3?country=US",  
            "method": "GET",  
            "headers": []  
        }  
    },  
    "product": {  
        "id": "DZH318Z09V6F",  
        "title": "Azure savings plan",  
        "description": "Flexible pricing model offering lower prices compared to On-Demand pricing, in exchange for a specific usage commitment",  
        "productType": {  
            "id": "Azure",  
            "displayName": "Azure",  
            "subType": {  
                "id": "SavingsPlan",  
                "displayName": "SavingsPlan"  
            }  
        },  
        "isMicrosoftProduct": true,  
        "publisherName": "Microsoft Corporation",  
        "links": {  
            "skus": {  
                "uri": "/products/DZH318Z09V6F/skus?country=US",  
                "method": "GET",  
                "headers": []  
            },  
            "self": {  
                "uri": "/products/DZH318Z09V6F?country=US",  
                "method": "GET",  
                "headers": []  
            }  
        }  
    },  
    "sku": {  
        "id": "0001",  
        "productId": "DZH318Z09V6F",  
        "title": "Compute savings plan, 1 Year",  
        "description": "Compute savings plan, 1 Year",  
        "minimumQuantity": 1,  
        "maximumQuantity": 1,  
        "minimumPurchaseCommitment": {  
            "grain": "Hourly",  
            "currencyCode": {  
                "code": "USD",  
                "symbol": "$"  
            },  
            "amount": "0.001"  
        },  
        "isTrial": false,  
        "supportedBillingCycles": [  
            "one_time",  
            "monthly"  
        ],  
        "purchasePrerequisites": [  
            "MicrosoftCloudAgreement"  
        ],  
        "inventoryVariables": [],  
        "provisioningVariables": [],  
        "actions": [  
            "Refund"  
        ],  
        "dynamicAttributes": {  
            "isMicrosoftProduct": true,  
            "armSkuName": "Compute_Savings_Plan",  
            "duration": "1year",  
            "termDuration": "P1Y",  
            "internal": false  
        },  
        "links": {  
            "availabilities": {  
                "uri": "/products/DZH318Z09V6F/skus/0001/availabilities?country=US",  
                "method": "GET",  
                "headers": []  
            },  
            "self": {  
                "uri": "/products/DZH318Z09V6F/skus/0001?country=US",  
                "method": "GET",  
                "headers": []  
            }  
        }  
    }  
} 

製品の SKU の一覧を取得する (顧客別)

応答:

{  
    "totalCount": 2,  
    "items": [  
        {  
            "id": "0001",  
            "productId": "DZH318Z09V6F",  
            "title": "Compute savings plan, 1 Year",  
            "description": "Compute savings plan, 1 Year",  
            "minimumQuantity": 1,  
            "maximumQuantity": 1,  
            "minimumPurchaseCommitment": {  
                "grain": "Hourly",  
                "currencyCode": {  
                    "code": "USD",  
                    "symbol": "$"  
                },  
                "amount": "0.001"  
            },  
            "isTrial": false,  
            "supportedBillingCycles": [  
                "one_time",  
                "monthly"  
            ],  
            "purchasePrerequisites": [  
                "MicrosoftCloudAgreement"  
            ],  
            "inventoryVariables": [],  
            "provisioningVariables": [],  
            "actions": [  
                "Refund"  
            ],  
            "dynamicAttributes": {  
                "isMicrosoftProduct": true,  
                "armSkuName": "Compute_Savings_Plan",  
                "duration": "1year",  
                "termDuration": "P1Y",  
                "internal": false  
            },  
            "links": {  
                "availabilities": {  
                    "uri": "/products/DZH318Z09V6F/skus/0001/availabilities",  
                    "method": "GET",  
                    "headers": []  
                },  
                "self": {  
                    "uri": "/products/DZH318Z09V6F/skus/0001",  
                    "method": "GET",  
                    "headers": []  
                }  
            }  
        },  
        {  
            "id": "0002",  
            "productId": "DZH318Z09V6F",  
            "title": "Compute savings plan, 3 Years",  
            "description": "Compute savings plan, 3 Years",  
            "minimumQuantity": 1,  
            "maximumQuantity": 1,  
            "minimumPurchaseCommitment": {  
                "grain": "Hourly",  
                "currencyCode": {  
                    "code": "USD",  
                    "symbol": "$"  
                },  
                "amount": "0.001"  
            },  
            "isTrial": false,  
            "supportedBillingCycles": [  
                "one_time",  
                "monthly"  
            ],  
            "purchasePrerequisites": [  
                "MicrosoftCloudAgreement"  
            ],  
            "inventoryVariables": [],  
            "provisioningVariables": [],  
            "actions": [  
                "Refund"  
            ],  
            "dynamicAttributes": {  
                "isMicrosoftProduct": true,  
                "armSkuName": "Compute_Savings_Plan",  
                "duration": "3years",  
                "termDuration": "P3Y",  
                "internal": false  
            },  
            "links": {  
                "availabilities": {  
                    "uri": "/products/DZH318Z09V6F/skus/0002/availabilities?country=US",  
                    "method": "GET",  
                    "headers": []  
                },  
                "self": {  
                    "uri": "/products/DZH318Z09V6F/skus/0002?country=US",  
                    "method": "GET",  
                    "headers": []  
                }  
            }  
        }  
    ],  
    "links": {  
        "self": {  
            "uri": "/products/DZH318Z09V6F/skus?country=US",  
            "method": "GET",  
            "headers": []  
        }  
    },  
    "attributes": {  
        "objectType": "Collection"  
    }  
}  

製品の SKU の一覧を取得する (国/地域別)

応答:

{  
    "totalCount": 2,  
    "items": [  
        {  
            "id": "0001",  
            "productId": "DZH318Z09V6F",  
            "title": "Compute savings plan, 1 Year",  
            "description": "Compute savings plan, 1 Year",  
            "minimumQuantity": 1,  
            "maximumQuantity": 1,  
            "minimumPurchaseCommitment": {  
                "grain": "Hourly",  
                "currencyCode": {  
                    "code": "USD",  
                    "symbol": "$"  
                },  
                "amount": "0.001"  
            },  
            "isTrial": false,  
            "supportedBillingCycles": [  
                "one_time",  
                "monthly"  
            ],  
            "purchasePrerequisites": [  
                "MicrosoftCloudAgreement"  
            ],  
            "inventoryVariables": [],  
            "provisioningVariables": [],  
            "actions": [  
                "Refund"  
            ],  
            "dynamicAttributes": {  
                "isMicrosoftProduct": true,  
                "armSkuName": "Compute_Savings_Plan",  
                "duration": "1year",  
                "termDuration": "P1Y",  
                "internal": false  
            },  
            "links": {  
                "availabilities": {  
                    "uri": "/products/DZH318Z09V6F/skus/0001/availabilities?country=US",  
                    "method": "GET",  
                    "headers": []  
                },  
                "self": {  
                    "uri": "/products/DZH318Z09V6F/skus/0001?country=US",  
                    "method": "GET",  
                    "headers": []  
                }  
            }  
        },  
        { 
            "id": "0002",  
            "productId": "DZH318Z09V6F",  
            "title": "Compute savings plan, 3 Years",  
            "description": "Compute savings plan, 3 Years",  
            "minimumQuantity": 1,  
            "maximumQuantity": 1,  
            "minimumPurchaseCommitment": {  
                "grain": "Hourly",  
                "currencyCode": {  
                    "code": "USD",  
                    "symbol": "$"  
                },  
                "amount": "0.001"  
            },  
            "isTrial": false,  
            "supportedBillingCycles": [  
                "one_time",  
                "monthly"  
            ],  
            "purchasePrerequisites": [  
                "MicrosoftCloudAgreement"  
            ],  
            "inventoryVariables": [],  
            "provisioningVariables": [],  
            "actions": [  
                "Refund"  
            ],  
            "dynamicAttributes": {  
                "isMicrosoftProduct": true,  
                "armSkuName": "Compute_Savings_Plan",  
                "duration": "3years",  
                "termDuration": "PY",  
                "internal": false  
            },  
            "links": {  
                "availabilities": {  
                    "uri": "/products/DZH318Z09V6F/skus/0002/availabilities?country=US",  
                    "method": "GET",  
                    "headers": []  
                },  
                "self": {  
                    "uri": "/products/DZH318Z09V6F/skus/0002?country=US",  
                    "method": "GET",  
                    "headers": []  
                }  
            }  
        }  
    ],  
    "links": {  
        "self": {  
            "uri": "/products/DZH318Z09V6F/skus?country=US",  
            "method": "GET",  
            "headers": []  
        }  
    },  
    "attributes": {  
        "objectType": "Collection"  
    }  
}

SKU 別の可用性の一覧を取得する (顧客別)

応答:

 {  
    "totalCount": 1,  
    "items": [  
        {  
            "id": "DZH318Z0BLD3",  
            "productId": "DZH318Z09V6F",  
            "skuId": "0001",  
            "catalogItemId": "DZH318Z09V6F:0001:DZH318Z0BLD3",  
            "defaultCurrency": {  
                "code": "USD",  
                "symbol": "$"  
            },  
            "segment": "commercial",  
            "country": "US",  
            "isPurchasable": true,  
            "isRenewable": false,  
            "renewalInstructions": [],  
            "terms": [  
                {  
                    "duration": "P1Y",  
                    "description": "1year"  
                }  
            ],  
            "links": {  
                "self": {  
                    "uri": "/products/DZH318Z09V6F/skus/0001/availabilities/DZH318Z0BLD3?country=US",  
                    "method": "GET",  
                    "headers": []  
                }  
            },  
            "product": {  
                "id": "DZH318Z09V6F",  
                "title": "Azure savings plan",  
                "description": "Flexible pricing model offering lower prices compared to On-Demand pricing, in exchange for a specific usage commitment",  
                "productType": {  
                    "id": "Azure",  
                    "displayName": "Azure",  
                    "subType": {  
                        "id": "SavingsPlan",  
                        "displayName": "SavingsPlan"  
                    }  
                },  
                "isMicrosoftProduct": true,  
                "publisherName": "Microsoft Corporation",  
                "links": {  
                    "skus": {  
                        "uri": "/products/DZH318Z09V6F/skus?country=US",  
                        "method": "GET",  
                        "headers": []  
                    }, 
                    "self": {  
                        "uri": "/products/DZH318Z09V6F?country=US",  
                        "method": "GET",  
                        "headers": []  
                    }  
                }  
            },  
            "sku": {  
                "id": "0001",  
                "productId": "DZH318Z09V6F",  
                "title": "Compute savings plan, 1 Year",  
                "description": "Compute savings plan, 1 Year",  
                "minimumQuantity": 1,  
                "maximumQuantity": 1,  
                "minimumPurchaseCommitment": {  
                    "grain": "Hourly",  
                    "currencyCode": {  
                        "code": "USD",  
                        "symbol": "$"  
                    },  
                    "amount": "0.001"  
                },  
                "isTrial": false,  
                "supportedBillingCycles": [  
                    "one_time",  
                    "monthly"  
                ],  
                "purchasePrerequisites": [  
                    "MicrosoftCloudAgreement"  
                ],  
                "inventoryVariables": [],  
                "provisioningVariables": [],  
                "actions": [  
                    "Refund"  
                ],  
                "dynamicAttributes": {  
                    "isMicrosoftProduct": true,  
                    "armSkuName": "Compute_Savings_Plan",  
                    "duration": "1year",  
                    "termDuration": "P1Y",  
                    "internal": false  
                },  
                "links": {  
                    "availabilities": {  
                        "uri": "/products/DZH318Z09V6F/skus/0001/availabilities?country=US",  
                        "method": "GET",  
                        "headers": []  
                    },  
                    "self": {  
                        "uri": "/products/DZH318Z09V6F/skus/0001?country=US",  
                        "method": "GET",  
                        "headers": []  
                    }  
                }  
            }  
        }  
    ],  
    "links": {  
        "self": {  
            "uri": "/products/DZH318Z09V6F/skus/0001/availabilities?country=US",  
            "method": "GET",  
            "headers": []  
        }  
    },  
    "attributes": {  
        "objectType": "Collection"  
    }  
}

SKU 別の可用性の一覧を取得する (国/リージョン別)

応答:

{  
    "totalCount": 1,  
    "items": [  
        {  
            "id": "DZH318Z0BLD3",  
            "productId": "DZH318Z09V6F",  
            "skuId": "0001",  
            "catalogItemId": "DZH318Z09V6F:0001:DZH318Z0BLD3",  
            "defaultCurrency": {  
                "code": "USD",  
                "symbol": "$"  
            },  
            "segment": "commercial",  
            "country": "US",  
            "isPurchasable": true,  
            "isRenewable": false,  
            "renewalInstructions": [],  
            "terms": [  
                {  
                    "duration": "P1Y",  
                    "description": "1year"  
                }  
            ],  
            "links": {  
                "self": {  
                    "uri": "/products/DZH318Z09V6F/skus/0001/availabilities/DZH318Z0BLD3?country=US",  
                    "method": "GET",  
                    "headers": []  
                }  
            },  
            "product": {  
                "id": "DZH318Z09V6F",  
                "title": "Azure savings plan",  
                "description": "Flexible pricing model offering lower prices compared to On-Demand pricing, in exchange for a specific usage commitment",  
                "productType": {  
                    "id": "Azure",  
                    "displayName": "Azure",  
                    "subType": {  
                        "id": "SavingsPlan",  
                        "displayName": "SavingsPlan"  
                    }  
                },  
                "isMicrosoftProduct": true,  
                "publisherName": "Microsoft Corporation",  
                "links": {  
                    "skus": {  
                        "uri": "/products/DZH318Z09V6F/skus?country=US",  
                        "method": "GET",  
                        "headers": []  
                    },  
                    "self": {  
                        "uri": "/products/DZH318Z09V6F?country=US",  
                        "method": "GET",  
                        "headers": []  
                    }  
                }  
            },  
            "sku": {  
                "id": "0001",  
                "productId": "DZH318Z09V6F",  
                "title": "Compute savings plan, 1 Year",  
                "description": "Compute savings plan, 1 Year",  
                "minimumQuantity": 1,  
                "maximumQuantity": 1,  
                "minimumPurchaseCommitment": {  
                    "grain": "Hourly",  
                    "currencyCode": {  
                        "code": "USD",  
                        "symbol": "$"  
                    },  
                    "amount": "0.001"  
                },  
                "isTrial": false,  
                "supportedBillingCycles": [  
                    "one_time",  
                    "monthly"  
                ],  
                "purchasePrerequisites": [  
                    "MicrosoftCloudAgreement"  
                ],  
                "inventoryVariables": [],  
                "provisioningVariables": [],  
                "actions": [  
                    "Refund"  
                ],  
                "dynamicAttributes": {  
                    "isMicrosoftProduct": true,  
                    "armSkuName": "Compute_Savings_Plan",  
                    "duration": "1year",  
                    "termDuration": "P1Y",  
                    "internal": false  
                },  
                "links": {  
                    "availabilities": {  
                        "uri": "/products/DZH318Z09V6F/skus/0001/availabilities?country=US",  
                        "method": "GET",  
                        "headers": []  
                    },  
                    "self": {  
                        "uri": "/products/DZH318Z09V6F/skus/0001?country=US",  
                        "method": "GET",  
                        "headers": []  
                    }  
                }  
            }  
        }  
    ],  
    "links": {  
        "self": {  
            "uri": "/products/DZH318Z09V6F/skus/0001/availabilities?country=US",  
            "method": "GET",  
            "headers": []  
        }  
    },  
    "attributes": {  
        "objectType": "Collection"  
    }  
}  

API の購入の例

カートを作成する

要求:

{  
    "lineItems": [  
        {  
            "id": 0,  
            "catalogItemId": "DZH318Z09V6F:0001:DZH318Z0BLD3",  
            "quantity": 1,  
            "billingCycle": "one_time",  
            "termDuration": "P1Y",  
            "provisioningContext": {  
                "scope": “shared", // scope options are shared, single  
                "subscriptionId": "0350d130-4d3d-4005-aca0-cf84f0ab0d4a", // Azure plan ID, this is required for shared scope 
            },  
            "purchaseCommitment": {  
                "amount": 0.05,  
                "grain": "hourly",  
                "currency": "usd"  
            }  
        }  
    ]  
}

応答:

{  
    "id": "66e3591e-faad-445c-b930-4ccdbf54c43f",  
    "creationTimestamp": "2023-05-18T05:15:16.8466842Z",  
    "lastModifiedTimestamp": "2023-05-18T05:15:16.8467621Z",  
    "expirationTimestamp": "2023-05-25T05:15:23.6893847Z",  
    "lastModifiedUser": "9db12087-fbc3-481c-8965-73d44ff88e27",  
    "status": "Active",  
    "lineItems": [  
        {  
            "id": 0,  
            "catalogItemId": "DZH318Z09V6F:0001:DZH318Z0BLD3",  
            "quantity": 1,  
            "currencyCode": "USD",  
            "billingCycle": "one_time",  
            "termDuration": "P1Y",  
            "provisioningContext": {  
                "scope": "shared",  
                "subscriptionId": "0350d130-4d3d-4005-aca0-cf84f0ab0d4a"  
            },  
            "orderGroup": "0",  
            "purchaseCommitment": {  
                "amount": 0.05,  
                "currency": "usd",  
                "grain": "hourly"  
            }  
        }  
    ],  
    "links": {  
        "self": {  
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/carts/66e3591e-faad-445c-b930-4ccdbf54c43f",  
            "method": "GET",  
            "headers": []  
        }  
    },  
    "attributes": {  
        "objectType": "Cart"  
    }  
}

カートを取得する

応答:

 {  
    "id": "66e3591e-faad-445c-b930-4ccdbf54c43f",  
    "creationTimestamp": "2023-05-18T05:15:16.8466842Z",  
    "lastModifiedTimestamp": "2023-05-18T05:15:16.8467621Z",  
    "expirationTimestamp": "2023-05-25T05:15:23.6893847Z",  
    "lastModifiedUser": "9db12087-fbc3-481c-8965-73d44ff88e27",  
    "status": "Active",  
    "lineItems": [  
        {  
            "id": 0,  
            "catalogItemId": "DZH318Z09V6F:0001:DZH318Z0BLD3",  
            "quantity": 1,  
            "currencyCode": "USD",  
            "billingCycle": "one_time",  
            "termDuration": "P1Y",  
            "provisioningContext": {  
                "scope": "shared",  
                "subscriptionId": "0350d130-4d3d-4005-aca0-cf84f0ab0d4a"  
            },  
            "orderGroup": "0",  
            "purchaseCommitment": {  
                "amount": 0.05,  
                "currency": "usd",  
                "grain": "hourly"  
            }  
        }  
    ],  
    "links": { 
        "self": {  
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/carts/66e3591e-faad-445c-b930-4ccdbf54c43f",  
            "method": "GET",  
            "headers": []  
        }  
    },  
    "attributes": {  
        "objectType": "Cart"  
    }  
}  

カートを更新する

要求:

{  
    "id": "66e3591e-faad-445c-b930-4ccdbf54c43f",  
    "creationTimestamp": "2023-05-18T05:15:16.8466842Z",  
    "lastModifiedTimestamp": "2023-05-18T05:15:16.8467621Z",  
    "expirationTimestamp": "2023-05-25T05:15:23.6893847Z",  
    "lastModifiedUser": "9db12087-fbc3-481c-8965-73d44ff88e27",  
    "status": "Active",  
    "lineItems": [  
        {  
            "id": 0,  
            "catalogItemId": "DZH318Z09V6F:0001:DZH318Z0BLD3",  
            "quantity": 1,  
            "currencyCode": "USD",  
            "billingCycle": "one_time",  
            "termDuration": "P1Y",  
            "provisioningContext": {  
                "scope": “single", // previously was “shared”  
                “entitlementId": "cdd17cc7-14fe-4445-8650-1f52de705851“ // entitlementId equates to subscriptionId key for the scoped Azure subscription 
            },  
            "orderGroup": "0",  
            "purchaseCommitment": {  
                "amount": 0.05,  
                "currency": "usd",  
                "grain": "hourly"  
            }  
        }  
    ],  
    "links": {  
        "self": {  
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/carts/66e3591e-faad-445c-b930-4ccdbf54c43f",  
            "method": "GET",  
            "headers": []  
        }  
    },  
    "attributes": {  
        "objectType": "Cart"  
    }  
}

応答:

{  
    "id": "66e3591e-faad-445c-b930-4ccdbf54c43f",  
    "creationTimestamp": "2023-05-18T05:15:16.8466842Z",  
    "lastModifiedTimestamp": "2023-05-18T05:15:16.8467621Z",  
    "expirationTimestamp": "2023-05-25T05:15:23.6893847Z",  
    "lastModifiedUser": "9db12087-fbc3-481c-8965-73d44ff88e27",  
    "status": "Active",  
    "lineItems": [  
        {  
            "id": 0,  
            "catalogItemId": "DZH318Z09V6F:0001:DZH318Z0BLD3",  
            "quantity": 1,  
            "currencyCode": "USD",  
            "billingCycle": "one_time",  
            "termDuration": "P1Y",  
            "provisioningContext": {  
                "scope": “single",  
                “entitlementId": "cdd17cc7-14fe-4445-8650-1f52de705851“   
            },  
            "orderGroup": "0",  
            "purchaseCommitment": {  
                "amount": 0.05,  
                "currency": "usd",  
                "grain": "hourly"  
            }  
        }  
    ],  
    "links": {  
        "self": {  
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/carts/66e3591e-faad-445c-b930-4ccdbf54c43f",  
            "method": "GET",  
            "headers": []  
        }  
    },  
    "attributes": {  
        "objectType": "Cart"  
    }  
}

チェックアウト カート

応答:

{  
    "orders": [  
        {  
            "id": "2b912b339251",  
            "alternateId": "2b912b339251",  
            "referenceCustomerId": "6f4ce4d8-f42e-45e0-8661-92ad6ac9d003",  
            "billingCycle": "one_time",  
            "currencyCode": "USD",  
            "currencySymbol": "US$",  
            "lineItems": [  
                {  
                    "lineItemNumber": 0,  
                    "provisioningContext": {  
                        "scope": "single",  
                        "entitlementId": "cdd17cc7-14fe-4445-8650-1f52de705851"  
                    },  
                    "offerId": "DZH318Z09V6F:0001:DZH318Z0BLD3",  
                    "termDuration": "P1Y",  
                    "transactionType": "New",  
                    "friendlyName": "Compute savings plan, 1 Year",  
                    "quantity": 1,  
                    "pricing": {  
                        "listPrice": 438.0,  
                        "discountedPrice": 438.0,  
                        "proratedPrice": 438.0,  
                        "price": 438.0,  
                        "extendedPrice": 438.0  
                    },  
                    "purchaseCommitment": {  
                        "amount": 0.05,  
                        "currency": "usd",  
                        "grain": "hourly"  
                    },  
                    "links": {  
                        "product": {  
                            "uri": "/products/DZH318Z09V6F?country=US",  
                            "method": "GET",  
                            "headers": []  
                        },  
                        "sku": {  
                            "uri": "/products/DZH318Z09V6F/skus/0001?country=US",  
                            "method": "GET",  
                            "headers": []  
                        },  
                        "availability": {  
                            "uri": "/products/DZH318Z09V6F/skus/0001/availabilities/DZH318Z0BLD3?country=US",  
                            "method": "GET",  
                            "headers": []  
                        }  
                    }  
                }  
            ],  
            "creationDate": "2023-05-18T05:16:33.1368156Z",  
            "status": "pending",  
            "transactionType": "UserPurchase",  
            "links": {  
                "self": {  
                    "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b339251",  
                    "method": "GET",  
                    "headers": []  
                },  
                "provisioningStatus": {  
                    "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b339251/provisioningstatus",  
                    "method": "GET",  
                    "headers": []  
                },  
                "patchOperation": {  
                    "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b339251",  
                    "method": "PATCH",  
                    "headers": []  
                }  
            },  
            "totalPrice": 438.0,  
            "client": {},  
            "attributes": {  
                "objectType": "Order"  
            }  
        }  
    ],  
    "additionalInformation": [],  
    "attributes": {  
        "objectType": "CartCheckoutResult"  
    }  
}

注文の作成

要求:

{  
    "BillingCycle": "monthly",  
    "ReferenceCustomerId": "6f4ce4d8-f42e-45e0-8661-92ad6ac9d003",  
    "LineItems": [  
        {  
            "LineItemNumber": 0,  
            "OfferId": "DZH318Z09V6F:0001:DZH318Z0BLD3",  
            "Quantity": 1,  
            "TermDuration": "P1Y",  
            "ProvisioningContext": {  
                "scope": "single",  
                "entitlementId": "cdd17cc7-14fe-4445-8650-1f52de705851"  
            },  
            "PurchaseCommitment": {  
                "amount": 0.05,  
                "currency": "usd",  
                "grain": "hourly"  
            }  
        }  
    ]  
}

応答:

{  
    "id": "2b912b3392fd",  
    "alternateId": "2b912b3392fd",  
    "referenceCustomerId": "6f4ce4d8-f42e-45e0-8661-92ad6ac9d003",  
    "billingCycle": "monthly",  
    "currencyCode": "USD",  
    "currencySymbol": "US$",  
    "lineItems": [  
        {  
            "lineItemNumber": 0,  
            "provisioningContext": {  
                "scope": "single",  
                "entitlementId": "cdd17cc7-14fe-4445-8650-1f52de705851"  
            },  
            "offerId": "DZH318Z09V6F:0001:DZH318Z0BLD3",  
            "termDuration": "P1Y",  
            "transactionType": "New",  
            "friendlyName": "Compute savings plan, 1 Year",  
            "quantity": 1,  
            "pricing": {  
                "listPrice": 438.0,  
                "discountedPrice": 438.0,  
                "proratedPrice": 438.0,  
                "price": 438.0,  
                "extendedPrice": 438.0  
            },  
            "purchaseCommitment": {  
                "amount": 0.05,  
                "currency": "usd",  
                "grain": "hourly"  
            },  
            "links": {  
                "product": {  
                    "uri": "/products/DZH318Z09V6F?country=US",  
                    "method": "GET",  
                    "headers": []  
                },  
                "sku": {  
                    "uri": "/products/DZH318Z09V6F/skus/0001?country=US",  
                    "method": "GET",  
                    "headers": []  
                },  
                "availability": {  
                    "uri": "/products/DZH318Z09V6F/skus/0001/availabilities/DZH318Z0BLD3?country=US",  
                    "method": "GET",  
                    "headers": []  
                }  
            }  
        }  
    ],  
    "creationDate": "2023-05-18TT21:22:26.7034834Z",  
    "status": "pending",  
    "transactionType": "UserPurchase",  
    "links": {  
        "self": {  
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b3392fd",  
            "method": "GET",  
            "headers": []  
        },  
        "provisioningStatus": {  
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b3392fd/provisioningstatus",  
            "method": "GET",  
            "headers": []  
        },  
        "patchOperation": {  
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b3392fd",  
            "method": "PATCH",  
            "headers": []  
        }  
    },  
    "client": {},  
    "attributes": {  
        "objectType": "Order"  
    }  
}

注文とサブスクリプションの API の例

ID で注文を取得する

応答:

{
    "id": "2b912b3392fd",
    "alternateId": "2b912b3392fd",
    "referenceCustomerId": "6f4ce4d8-f42e-45e0-8661-92ad6ac9d003",
    "billingCycle": "monthly",
    "currencyCode": "USD",
    "currencySymbol": "US$",
    "lineItems": [
        {
            "lineItemNumber": 0,
            "subscriptionId": "005a9b31-3ba0-4ead-b4fe-ad11e072f7e7",
            "provisioningContext": {
                "scope": "single",
                "entitlementId": "cdd17cc7-14fe-4445-8650-1f52de705851"
            },
            "offerId": "DZH318Z09V6F:0001:DZH318Z0BLD3",
            "termDuration": "P1Y",
            "transactionType": "New",
            "friendlyName": "Compute savings plan, 1 Year",
            "quantity": 1,
            "purchaseCommitment": {
                "amount": 0.05,
                "currency": "usd",
                "grain": "hourly"
            },
            "links": {
                "product": {
                    "uri": "/products/DZH318Z09V6F?country=US",
                    "method": "GET",
                    "headers": []
                },
                "sku": {
                    "uri": "/products/DZH318Z09V6F/skus/0001?country=US",
                    "method": "GET",
                    "headers": []
                },
                "availability": {
                    "uri": "/products/DZH318Z09V6F/skus/0001/availabilities/DZH318Z0BLD3?country=US",
                    "method": "GET",
                    "headers": []
                }
            }
        }
    ],
    "creationDate": "2023-05-18TT21:22:26.7034834Z",
    "status": "completed",
    "transactionType": "UserPurchase",
    "links": {
        "self": {
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b3392fd",
            "method": "GET",
            "headers": []
        },
        "provisioningStatus": {
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b3392fd/provisioningstatus",
            "method": "GET",
            "headers": []
        },
        "patchOperation": {
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b3392fd",
            "method": "PATCH",
            "headers": []
        }
    },
    "client": {},
    "attributes": {
        "objectType": "Order"
    }
}

顧客のすべての注文を取得する

応答:

{
    "totalCount": 1,
    "items": [
        {
            "id": "2b912b3392fd",
            "alternateId": "2b912b3392fd",
            "referenceCustomerId": "6f4ce4d8-f42e-45e0-8661-92ad6ac9d003",
            "billingCycle": "monthly",
            "currencyCode": "USD",
            "currencySymbol": "US$",
            "lineItems": [
                {
                    "lineItemNumber": 0,
                    "subscriptionId": "005a9b31-3ba0-4ead-b4fe-ad11e072f7e7",
                    "provisioningContext": {
                        "scope": "single",
                        "entitlementId": "cdd17cc7-14fe-4445-8650-1f52de705851"
                    },
                    "offerId": "DZH318Z09V6F:0001:DZH318Z0BLD3",
                    "termDuration": "P1Y",
                    "transactionType": "New",
                    "friendlyName": "Compute savings plan, 1 Year",
                    "quantity": 1,
                    "purchaseCommitment": {
                        "amount": 0.05,
                        "currency": "usd",
                        "grain": "hourly"
                    },
                    "links": {
                        "product": {
                            "uri": "/products/DZH318Z09V6F?country=US",
                            "method": "GET",
                            "headers": []
                        },
                        "sku": {
                            "uri": "/products/DZH318Z09V6F/skus/0001?country=US",
                            "method": "GET",
                            "headers": []
                        },
                        "availability": {
                            "uri": "/products/DZH318Z09V6F/skus/0001/availabilities/DZH318Z0BLD3?country=US",
                            "method": "GET",
                            "headers": []
                        }
                    }
                }
            ],
            "creationDate": "2023-05-18TT21:22:26.7034834Z",
            "status": "completed",
            "transactionType": "UserPurchase",
            "links": {
                "self": {
                    "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b3392fd",
                    "method": "GET",
                    "headers": []
                },
                "provisioningStatus": {
                    "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b3392fd/provisioningstatus",
                    "method": "GET",
                    "headers": []
                },
                "patchOperation": {
                    "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders/2b912b3392fd",
                    "method": "PATCH",
                    "headers": []
                }
            },
            "client": {},
            "attributes": {
                "objectType": "Order"
            }
        }
    ],
    "links": {
        "self": {
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/orders",
            "method": "GET",
            "headers": []
        }
    },
    "attributes": {
        "objectType": "Collection"
    }
}

ID でサブスクリプションを取得する

応答:

{
    "id": "a67afaf0-2f79-4c12-8fd1-6005ed24bb28",
    "offerId": "DZH318Z09V6F:0001:DZH318Z0BLD3",
    "offerName": "Compute savings plan, 1 Year",
    "friendlyName": "Compute_Savings_Plan_123",
    "productType": {
        "id": "Azure",
        "displayName": "Azure",
        "subType": {
            "id": "SavingsPlan",
            "displayName": "SavingsPlan"
        }
    },
    "quantity": 1,
    "unitType": "Benefit",
    "hasPurchasableAddons": false,
    "creationDate": "2023-05-18T05:19:22.5478955Z",
    "effectiveStartDate": "2023-05-18T05:19:21.3362111Z",
    "commitmentEndDate": "2024-05-17T00:00:00Z",
    "billingCycleEndDate": "2024-05-17T00:00:00Z",
     "status": "active",
    "autoRenewEnabled": true,
    "isTrial": false,
    "billingType": "benefit",
    "billingCycle": "one_time",
    "termDuration": "P1Y",
    "renewalTermDuration": "",
    "isMicrosoftProduct": true,
    "partnerId": "",
    "attentionNeeded": false,
    "actionTaken": false,
    "contractType": "subscription",
    "links": {
        "product": {
            "uri": "/products/DZH318Z09V6F?country=US",
            "method": "GET",
            "headers": []
        },
"sku": {
            "uri": "/products/DZH318Z09V6F/skus/0001?country=US",
            "method": "GET",
            "headers": []
        },
        "availability": {
            "uri": "/products/DZH318Z09V6F/skus/0001/availabilities/DZH318Z0BLD3?country=US",
            "method": "GET",
            "headers": []
        },
        "self": {
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/subscriptions/a67afaf0-2f79-4c12-8fd1-6005ed24bb28",
            "method": "GET",
            "headers": []
        }
    },
    "publisherName": "Microsoft Corporation",
    "lineItems": [
        {
            "id": "2131a68b-9796-4557-b628-354539ed66dc",
            "friendlyName": "Compute_Savings_Plan_123",
            "scope": {
                "type": "single",
                "entitlementId": "cdd17cc7-14fe-4445-8650-1f52de705851"
            },
            "autoRenewEnabled": true,
            "status": "active",
            "purchaseCommitment": {
                "amount": 0.05,
                "currency": "usd",
                "grain": "Hourly"
            }
        }
    ],
    "productOrderId": "2131a68b-9796-4557-b628-354539ed66dc",
    "orderId": "2b912b339251",
    "attributes": {
        "objectType": "Subscription"
    }
}

顧客のサブスクリプションを取得する

応答:

{
    "totalCount": 1,
    "items": [
        {
            "id": "a67afaf0-2f79-4c12-8fd1-6005ed24bb28",
            "offerId": "DZH318Z09V6F:0001:DZH318Z0BLD3",
            "offerName": "Compute savings plan, 1 Year",
            "friendlyName": "Compute_Savings_Plan_123",
            "productType": {
                "id": "Azure",
                "displayName": "Azure",
                "subType": {
                    "id": "SavingsPlan",
                    "displayName": "SavingsPlan"
                }
            },
            "quantity": 1,
            "unitType": "Benefit",
            "hasPurchasableAddons": false,
            "creationDate": "2023-05-18T05:19:22.5478955Z",
            "effectiveStartDate": "2023-05-18T05:19:21.3362111Z",
            "commitmentEndDate": "2024-05-17T00:00:00Z",
            "commitmentEndDateTime": "2024-05-17T23:59:59Z",
            "billingCycleEndDate": "2024-05-17T00:00:00Z",
            "billingCycleEndDateTime": "2024-05-17T23:59:59Z",
            "status": "active",
            "autoRenewEnabled": true,
            "isTrial": false,
            "billingType": "benefit",
            "billingCycle": "one_time",
            "termDuration": "P1Y",
            "renewalTermDuration": "",
            "isMicrosoftProduct": true,
            "partnerId": "",
            "attentionNeeded": false,
            "actionTaken": false,
            "contractType": "subscription",
            "links": {
                "product": {
                    "uri": "/products/DZH318Z09V6F?country=US",
                    "method": "GET",
                    "headers": []
                },
                "sku": {
                    "uri": "/products/DZH318Z09V6F/skus/0001?country=US",
                    "method": "GET",
                    "headers": []
                },
                "availability": {
                    "uri": "/products/DZH318Z09V6F/skus/0001/availabilities/DZH318Z0BLD3?country=US",
                    "method": "GET",
                    "headers": []
                },
                "self": {
                    "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/subscriptions/a67afaf0-2f79-4c12-8fd1-6005ed24bb28",
                    "method": "GET",
                    "headers": []
                }
            },
            "publisherName": "Microsoft Corporation",
            "lineItems": [
                {
                    "id": "2131a68b-9796-4557-b628-354539ed66dc",
                    "friendlyName": "Compute_Savings_Plan_123",
                    "scope": {
                        "type": "single",
                        "entitlementId": "cdd17cc7-14fe-4445-8650-1f52de705851"
                    },
                    "autoRenewEnabled": true,
                    "status": "active",
                    "purchaseCommitment": {
                        "amount": 0.05,
                        "currency": "usd",
                        "grain": "Hourly"
                    }
                }
            ],
            "productOrderId": "2131a68b-9796-4557-b628-354539ed66dc",
            "orderId": "2b912b339251",
            "attributes": {
                "objectType": "Subscription"
            }
        }
    ],
    "links": {
        "self": {
            "uri": "/customers/6f4ce4d8-f42e-45e0-8661-92ad6ac9d003/subscriptions",
            "method": "GET",
            "headers": []
        }
    },
    "attributes": {
        "objectType": "Collection"
    }
}