Comprar planos de poupança do Azure
Aplica-se a: Partner Center
Este artigo aborda a experiência da API para comprar planos de poupança do Azure no Partner Center. Ele fornece também exemplos de solicitação/resposta que são específicos para planos de poupança do Azure.
Pré-requisitos
Credenciais conforme descrito em autenticação do Partner Center. Este cenário oferece suporte à autenticação com credenciais App+User.
Um ID de cliente (
customer-tenant-id
). Se não souber o ID do cliente, pode procurá-lo no do Partner Center selecionando a área de trabalho Clientes, selecionando o cliente na lista de clientes e, em seguida, selecionando Conta. Na página Conta do cliente, procure ID da Microsoft na seção Informações da Conta do Cliente. A ID da Microsoft é a mesma que a ID do cliente (customer-tenant-id
).Um plano do Azure e uma assinatura. Para comprar um plano de poupança do Azure para um cliente usando a API do Partner Center, você deve ter um plano do Azure para esse cliente com pelo menos uma assinatura ativa do Azure. Saiba como comprar um plano do Azure.
Descubra um plano de poupança do Azure
Antes de comprar um plano de poupança do Azure, conclua as seguintes etapas:
Identifique e recupere o produto e o SKU que deseja comprar. Você pode listar os produtos e SKUs primeiro. Ou se você já conhece os IDs do produto e SKU, selecione-os.
Para exibir valores para um plano de economia do Azure nas APIs a seguir, uma ID do cliente é necessária na rota para as APIs, e o cliente deve ter um plano do Azure.
Recupere o de disponibilidade de para o SKU. Você precisa do valor
CatalogItemId
da disponibilidade ao fazer o pedido. Para obter esse valor, use uma das seguintes APIs:
Para planos de poupança do Azure, as respostas da API para a ação Obter lista de SKUs de um produto (por cliente) e a ação Verificar a disponibilidade pelo ID retornam um valor minimumPurchaseCommitment
para o SKU. Este valor é o compromisso mínimo que pode ser feito por hora durante um período. É aplicável apenas aos planos de poupança do Azure e não se aplica a outras famílias de produtos.
Comprar um plano de poupança do Azure
Para enviar seu pedido para um plano de economia do Azure, conclua as seguintes etapas:
Crie um carrinho para armazenar a coleção de itens do catálogo que você pretende comprar. Quando cria um carrinho de , os itens de linha do carrinho de são agrupados automaticamente com base no que pode ser comprado junto no mesmo pedido .
Confira o carrinho. Finalizar a compra de um carrinho resulta na criação de um pedido.
Nas solicitações de API, os parceiros devem especificar os seguintes parâmetros ao criar ou atualizar um carrinho e criar um pedido.
PurchaseCommitment
é um novo valor para os planos de poupança do Azure.
-
Scope
: Os valores possíveis incluemsingle
eshared
. -
EntitlementId
: ID de assinatura do Azure, necessária para um único escopo. -
SubscriptionId
: ID do plano do Azure, necessária para um escopo compartilhado. -
PurchaseCommitment
: Montante horário fixo comprometido em serviços de computação por um ou três anos.
Os planos de poupança do Azure exigem um contexto de provisionamento, incluindo escopo e ID de assinatura/ID de direito. Os planos de poupança do Azure também exigem um compromisso de compra, incluindo montante, grão e moeda.
Ver e gerir planos de poupança do Azure
Os parceiros podem ver os planos de poupança do Azure adquiridos no Partner Center. Como as instâncias de reserva, os parceiros podem continuar a usar o portal do Azure para ações de gerenciamento pós-compra. Para obter mais informações sobre como gerenciar planos de economia do Azure, consulte Gerenciar planos de economia do Azure - Microsoft Cost Management.
No Obter uma assinatura por ID e Obter assinaturas APIs de um cliente, um modelo de dados chamado SubscriptionLineItem
é retornado. Na resposta da subscrição, os parceiros veem as seguintes propriedades para os planos de poupança do Azure:
-
unitType
: O valor ébenefit
. -
billingType
: O valor ébenefit
. -
lineItems
: Um item da lista contém as informações de compra de uma subscrição específica do plano de poupança do Azure (por exemplo, âmbito e valorPurchaseCommitment
). -
productOrderId
: Identificador de uma compra de produto específica (por exemplo, reserva ou plano de poupança do Azure).
Observação
Para planos de poupança do Azure adquiridos através do portal do Azure, as APIs de subscrição não devolvem o ID da encomenda.
Gerenciar faturas e reconciliação para um plano de economia do Azure
Para compreender como as poupanças se refletem nos relatórios de reconciliação da faturação mensal, os parceiros podem aceder à faturação do plano de poupança do Azure .
Exemplos de pedidos/respostas
Descubra exemplos de API
Obter um produto pelo identificador
Resposta
{
"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": []
}
}
}
Obter um SKU por ID
Resposta
{
"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": []
}
}
}
Obter disponibilidade por ID
Resposta
{
"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": []
}
}
}
}
Obter uma lista de SKUs para um produto (por cliente)
Resposta
{
"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"
}
}
Obter uma lista de SKUs para um produto (por país/região)
Resposta
{
"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"
}
}
Obtenha uma lista de disponibilidades por SKU (por cliente)
Resposta
{
"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"
}
}
Obtenha uma lista de disponibilidades por SKU (por país/região)
Resposta
{
"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"
}
}
Exemplos de API de compra
Criar um carrinho
Pedido
{
"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"
}
}
]
}
Resposta
{
"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"
}
}
Pegue um carrinho
Resposta
{
"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"
}
}
Atualizar um carrinho
Pedido
{
"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"
}
}
Resposta
{
"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"
}
}
Confira um carrinho
Resposta
{
"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"
}
}
Criar uma encomenda
Pedido
{
"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"
}
}
]
}
Resposta
{
"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"
}
}
Exemplos de API de pedido e assinatura
Obtenha uma encomenda pelo ID
Resposta
{
"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"
}
}
Receba todos os pedidos de um cliente
Resposta
{
"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"
}
}
Obter uma subscrição por ID
Resposta
{
"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"
}
}
Obter subscrições de um cliente
Resposta
{
"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"
}
}