Comprar planos de poupança do Azure
Aplica-se a: Partner Center
Este artigo aborda a experiência da API para comprar o plano de poupança do Azure no Partner Center e fornece exemplos de pedido/resposta específicos para os planos de poupança do Azure.
Pré-requisitos
Credenciais conforme descrito na 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 Partner Center selecionando a área de trabalho Clientes e, em seguida, o cliente na lista de clientes e, em seguida, Conta. Na página Conta do cliente, procure a 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
).
Para comprar um plano de poupança do Azure para um cliente que utilize a API do Partner Center, tem de ter um plano do Azure para esse cliente com pelo menos uma subscrição ativa do Azure. Como comprar um plano do Azure.
Descubra o 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 a SKU que deseja comprar. Você pode fazer isso listando os produtos e SKUs primeiro, ou se você já sabe os IDs do produto e SKU, selecionando-os. Para exibir os valores do plano de economia do Azure nas APIs abaixo, é necessária uma ID do cliente na rota para as APIs abaixo e esse cliente deve ter um Plano do Azure.
Recupere a disponibilidade para o SKU. Você precisa do CatalogItemId da disponibilidade ao fazer o pedido. Para obter esse valor, use uma das seguintes APIs:
Para planos de poupança do Azure, Obter uma lista de SKUs para um produto (por cliente) e Obter uma SKU usando a ID de SKU e as respostas da API de disponibilidade retornam um mínimoPurchaseCommitment para a SKU. Este é o compromisso mínimo que pode ser feito por hora durante um determinado período. Isso só é aplicável ao plano de economia do Azure e não se aplica a outras famílias de produtos.
Comprar o plano de poupança do Azure
Para enviar seu pedido de 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 você cria um carrinho, os itens da linha do carrinho são agrupados automaticamente com base no que pode ser comprado juntos no mesmo pedido.
- Confira o carrinho. O check-out 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.
- Escopo: os valores possíveis incluem único, compartilhado
- EntitlementId: ID de assinatura do Azure, necessária para escopo único
- SubscriptionId: ID do plano do Azure, necessário para o escopo compartilhado
- PurchaseCommitment: O valor 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, e um compromisso de compra, incluindo valor, grão e moeda.
Ver e gerir o plano 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 o plano de economia do Azure, consulte Gerenciar planos de economia do Azure - Microsoft Cost Management.
Nas APIs Obter uma assinatura por ID e Obter assinaturas de um cliente, um modelo de dados chamado SubscriptionLineItem é retornado. Na resposta da subscrição, os parceiros veem as seguintes propriedades para o plano de poupança do Azure:
- unitType: o valor é benefício
- billingType: o valor é benefício
- lineItems: um item de linha contém os detalhes de compra de uma assinatura específica do plano de poupança do Azure (por exemplo, escopo e PurchaseCommitment).
- productOrderId: Identificador de uma compra de produto específica (por exemplo, Reservas ou plano de poupança do Azure).
Nota
Para o plano de poupança do Azure adquirido através do portal do Azure, as APIs de subscrição não devolverão o ID da encomenda.
Fatura e reconciliação para o plano de poupança do Azure
Os parceiros podem visitar Conciliação e faturamento do plano de poupança no CSP para entender como as economias são refletidas em seus arquivos de reconciliação de faturamento mensal.
Exemplos de pedidos/respostas
Descubra exemplos de API
Obter um produto por ID
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 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"
}
}
Obter 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 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"
}
}
Carrinho de compras
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 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
Obter encomenda por 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"
}
}