Nákup plánů Úspory v Azure
Platí pro: Partnerské centrum
Tento článek se zabývá rozhraním API pro nákup plánu úspory v Azure v Partnerském centru a poskytuje příklady požadavků a odpovědí specifických pro plány úspor Azure.
Požadavky
Přihlašovací údaje popsané v ověřování v Partnerském centru Tento scénář podporuje ověřování pomocí přihlašovacích údajů aplikace a uživatele.
ID zákazníka (customer-tenant-id
). Pokud neznáte ID zákazníka, můžete ho vyhledat v Partnerském centru tak , že vyberete pracovní prostor Zákazníci , pak zákazník ze seznamu zákazníků a pak účet. Na stránce Účet zákazníka vyhledejte ID Microsoftu v části Informace o účtu zákazníka. ID Microsoftu je stejné jako ID zákazníka (customer-tenant-id
).
Pokud chcete koupit plán úspory Azure pro zákazníka pomocí rozhraní API Partnerského centra, musíte mít plán Azure pro daného zákazníka s alespoň jedním aktivním předplatným Azure. Jak koupit plán Azure
Seznamte se s plánem Úspory v Azure
Před nákupem plánu úspor Azure proveďte následující kroky:
Identifikujte a načtěte produkt a skladovou položku, které chcete koupit. Můžete to udělat tak, že nejdřív vypisujete produkty a skladové položky, nebo pokud už znáte ID produktu a skladové položky, vyberte je. Pokud chcete zobrazit hodnoty plánu úspor Azure v následujících rozhraních API, vyžaduje se v trase pro následující rozhraní API ID zákazníka a zákazník musí mít plán Azure.
- Získání seznamu produktů (podle země/oblasti)
- Získání seznamu produktů (podle zákazníka)
- Získání produktu pomocí ID produktu
- Získání seznamu skladových položek pro produkt (podle země/oblasti)
- Získání seznamu skladových položek produktu (podle zákazníka)
- Získání skladové položky pomocí ID skladové položky
Načtěte dostupnost skladové položky. Při zadávání objednávky potřebujete Id KataloguItemId dostupnosti. K získání této hodnoty použijte jedno z následujících rozhraní API:
V případě plánů Úspory Azure vrátí seznam skladových položek pro produkt (podle zákazníka) a získání skladové položky pomocí ID skladové položky a odpovědí rozhraní API dostupnosti, které vrátí minimumPurchaseCommitment pro skladovou položku. Jedná se o minimální závazek, který je možné provést za hodinu pro daný termín. To platí jenom pro plán Úspory v Azure a nevztahuje se na jiné produktové řady.
Nákup plánu Úspory v Azure
Pokud chcete odeslat objednávku plánu úspor Azure, proveďte následující kroky:
- Vytvořte košík pro uložení kolekce položek katalogu, které chcete koupit. Při vytváření košíku se řádkové položky košíku automaticky seskupí podle toho, co lze zakoupit společně ve stejné objednávce.
- Podívejte se na košík. Rezervace košíku vede k vytvoření objednávky.
V požadavcích rozhraní API musí partneři při vytváření nebo aktualizaci košíku a vytváření objednávky zadat následující parametry. PurchaseCommitment je nová hodnota pro plány úspor Azure.
- Rozsah: možné hodnoty zahrnují jednu, sdílenou
- EntitlementId: ID předplatného Azure, povinné pro jeden obor
- SubscriptionId: ID plánu Azure, povinné pro sdílený obor
- PurchaseCommitment: Pevná hodinová částka potvrzená u výpočetních služeb po dobu jednoho nebo tří let.
Plány úspor Azure vyžadují kontext zřizování, včetně ID rozsahu a ID předplatného nebo ID nároku a závazku k nákupu, včetně částky, agregace a měny.
Zobrazení a správa plánu úspor v Azure
Partneři můžou zobrazit plány úspor Azure zakoupené v Partnerském centru. Podobně jako u instancí rezervací můžou partneři dál používat Azure Portal k akcím po nákupu. Další informace o správě plánu úspor Azure najdete v tématu Správa plánů úspor Azure – Microsoft Cost Management.
V rozhraní API získání předplatného podle ID a získání předplatných zákazníka se vrátí datový model s názvem SubscriptionLineItem . V rámci odpovědi na předplatné se partnerům zobrazí následující vlastnosti plánu úspor Azure:
- unitType: hodnota je výhoda
- billingType: hodnota je výhoda
- lineItems: Položka řádku obsahuje podrobnosti o nákupu konkrétního předplatného plánu úspory Azure (například rozsah a nákup).
- productOrderId: Identifikátor konkrétního nákupu produktu (například rezervace nebo plán úspory v Azure).
Poznámka:
V případě plánu úspory Azure zakoupeného prostřednictvím webu Azure Portal nebudou rozhraní API předplatného vracet ID objednávky.
Faktura a odsouhlasení pro plán Úspory v Azure
Partneři můžou navštívit odsouhlasení a fakturaci plánu úspor v CSP , abyste pochopili, jak se úspory projeví v souborech s vyrovnáním měsíční fakturace.
Příklady požadavků a odpovědí
Příklady zjišťování rozhraní API
Získání produktu podle ID
Odpověď:
{
"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": []
}
}
}
Získání skladové položky podle ID
Odpověď:
{
"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": []
}
}
}
Získání dostupnosti podle ID
Odpověď:
{
"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": []
}
}
}
}
Získání seznamu skladových položek produktu (podle zákazníka)
Odpověď:
{
"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"
}
}
Získání seznamu skladových položek pro produkt (podle země/oblasti)
Odpověď:
{
"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"
}
}
Získání seznamu dostupnosti podle skladové položky (zákazníkem)
Odpověď:
{
"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"
}
}
Získání seznamu dostupnosti podle skladové položky (podle země/oblasti)
Odpověď:
{
"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"
}
}
Příklady rozhraní API pro nákup
Vytvoření košíku
Žádost:
{
"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"
}
}
]
}
Odpověď:
{
"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"
}
}
Získání košíku
Odpověď:
{
"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"
}
}
Aktualizace košíku
Žádost:
{
"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"
}
}
Odpověď:
{
"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"
}
}
Pokladní košík
Odpověď:
{
"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"
}
}
Vytvoření objednávky
Žádost:
{
"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"
}
}
]
}
Odpověď:
{
"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"
}
}
Příklady rozhraní API pro objednávky a předplatné
Získání objednávky podle ID
Odpověď:
{
"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"
}
}
Získání všech objednávek zákazníka
Odpověď:
{
"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"
}
}
Získání předplatného podle ID
Odpověď:
{
"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"
}
}
Získání předplatných zákazníka
Odpověď:
{
"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"
}
}