購買 Azure 節省方案
適用於:合作夥伴中心
本文涵蓋在合作夥伴中心購買 Azure 節省方案的 API 體驗,並提供 Azure 節省方案特有的要求/回應範例 。
必要條件
認證,如合作夥伴中心驗證所述。 此案例支援使用應用程式加上使用者的認證來進行驗證。
客戶識別碼 (customer-tenant-id
)。 如果您不知道客戶的標識碼,您可以在合作夥伴中心中選取 [客戶] 工作區,然後從客戶清單中查看客戶,然後從 [帳戶]。 在客戶的 [帳戶] 頁面上,尋找 [客戶帳戶資訊] 區段中的 [Microsoft 識別碼]。 Microsoft 識別碼與客戶識別碼 (customer-tenant-id
) 相同。
若要使用合作夥伴中心 API 為客戶購買 Azure 節省方案,您必須擁有至少一個作用中 Azure 訂用帳戶的客戶 Azure 方案。 如何購買 Azure 方案。
探索 Azure 節省方案
購買 Azure 節省方案之前,請先完成下列步驟:
識別並擷取您想要購買的產品和SKU。 您可以先列出產品和 SKU,或如果您已經知道產品和 SKU 的識別碼,請加以選取。 若要在下列 API 中檢視 Azure 節省方案值,下列 API 的路由中需要客戶標識碼,且該客戶必須有 Azure 方案。
擷取 SKU 的可用性。 當您下訂單時,您需要 可用性的 CatalogItemId 。 若要取得此值,請使用下列其中一個 API:
針對 Azure 節省方案, 取得產品 SKU 清單(依客戶) 和 使用 SKU 標識符 和可用性 API 回應取得 SKU,會傳回 SKU 的 minimumPurchaseCommitment 。 這是一個指定字詞每小時可以做出的最低承諾。 這僅適用於 Azure 節省方案,不適用於其他產品系列。
購買 Azure 節省方案
若要提交 Azure 節省方案訂單,請完成下列步驟:
在 API 要求中,合作夥伴必須在建立或更新購物車及建立訂單時指定下列參數。 PurchaseCommitment 是 Azure 節省方案的新價值。
- 範圍:可能的值包括單一、共用
- EntitlementId:單一範圍所需的 Azure 訂用帳戶標識碼
- SubscriptionId:共用範圍所需的 Azure 方案標識碼
- PurchaseCommitment:計算服務上認可的固定每小時金額一或三年。
Azure 節省方案需要布建內容,包括範圍和訂用帳戶標識碼/權利標識符,以及購買承諾,包括金額、穀物和貨幣。
檢視和管理 Azure 節省方案
合作夥伴可以檢視在合作夥伴中心購買的 Azure 節省方案。 如同保留實例,合作夥伴可以繼續使用 Azure 入口網站 進行購買后管理動作。 如需管理 Azure 節省方案的詳細資訊,請參閱 管理 Azure 節省方案 - Microsoft成本管理。
在依 標識碼 取得訂用帳戶和 取得客戶的訂 用帳戶 API 中,會傳回名為 SubscriptionLineItem 的數據模型。 在訂用帳戶回應中,合作夥伴會看到下列 Azure 節省方案的屬性:
- unitType: 值為權益
- billingType: 此值為權益
- lineItems: 明細專案包含特定 Azure 儲蓄方案訂用帳戶的購買詳細數據(例如範圍和 PurchaseCommitment)。
- productOrderId: 特定產品購買的標識碼(例如保留或 Azure 節省方案)。
注意
針對透過 Azure 入口網站 購買的 Azure 節省方案,訂用帳戶 API 不會傳回訂單標識碼。
Azure 節省方案的發票和對帳
合作夥伴可以流覽 CSP 中節省計畫的協調和計費,以瞭解其每月帳單對帳檔案中的節省成本如何反映。
要求/回應範例
探索 API 範例
依照識別碼取得產品
回應:
{
"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": []
}
}
}
依標識碼取得可用性
回應:
{
"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": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e", // 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": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"
},
"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": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"
},
"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": "2b912b3392fd",
"alternateId": "2b912b3392fd",
"referenceCustomerId": "6f4ce4d8-f42e-45e0-8661-92ad6ac9d003",
"billingCycle": "monthly",
"currencyCode": "USD",
"currencySymbol": "US$",
"lineItems": [
{
"lineItemNumber": 0,
"subscriptionId": "bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f",
"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": "bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f",
"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": "cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a",
"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/cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a",
"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": "cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a",
"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/cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a",
"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"
}
}