Compartir a través de


Compra de planes de ahorro de Azure

Se aplica a: Centro de partners

En este artículo se describe la experiencia de API para comprar un plan de ahorro de Azure en el Centro de partners y se proporcionan ejemplos de solicitud y respuesta específicos de los planes de ahorro de Azure.

Requisitos previos

Credenciales tal como se describen en el artículo Autenticación del Centro de partners. Este escenario admite la autenticación con credenciales de aplicación y usuario.

Un id. de cliente (customer-tenant-id). Si no conoce el identificador del cliente, puede buscarlo en el Centro de partners seleccionando el área de trabajo Clientes , el cliente de la lista de clientes y, a continuación, Cuenta. En la página Cuenta del cliente, busca el Id. de Microsoft en la sección Información de la cuenta del cliente. El id. de Microsoft es el mismo que el de cliente (customer-tenant-id).

Para comprar un plan de ahorro de Azure para un cliente mediante la API del Centro de partners, debe tener un plan de Azure para ese cliente con al menos una suscripción de Azure activa. Cómo comprar un plan de Azure.

Detección del plan de ahorro de Azure

Antes de comprar un plan de ahorro de Azure, complete los pasos siguientes:

  1. Identifique y recupere el Producto y la SKU que desea comprar. Para ello, enumere primero los productos y las SKU, o si ya conoce los identificadores del producto y la SKU, selecciónelos. Para ver los valores del plan de ahorro de Azure en las API siguientes, se requiere un identificador de cliente en la ruta para las API siguientes y ese cliente debe tener un plan de Azure.

  2. Recupere la disponibilidad de la SKU. Necesita catalogItemId de la disponibilidad al realizar el pedido. Para obtener este valor, use una de las SIGUIENTES API:

Para los planes de ahorro de Azure, la lista Obtener una lista de SKU para un producto (por cliente) y Obtener una SKU mediante el identificador de SKU y las respuestas de API de disponibilidad devuelven un valor mínimo dePurchaseCommitment para la SKU. Este es el compromiso mínimo que se puede realizar por hora durante un período determinado. Esto solo es aplicable al plan de ahorro de Azure y no se aplica a otras familias de productos.

Compra del plan de ahorro de Azure

Para enviar el pedido del plan de ahorro de Azure, complete los pasos siguientes:

  1. Cree un carro para contener la colección de artículos de catálogo que quiere comprar. Al crear un carro, los artículos de línea del carro se agrupan automáticamente en función de lo que se puede comprar juntos en el mismo pedido.
  2. Echa un vistazo al carro. Desprotear un carro da como resultado la creación de un pedido.

En las solicitudes de API, los asociados deben especificar los parámetros siguientes al crear o actualizar un carro y crear un pedido. PurchaseCommitment es un nuevo valor para los planes de ahorro de Azure.

  • Ámbito: los valores posibles incluyen single, shared
  • EntitlementId: identificador de suscripción de Azure, necesario para un único ámbito
  • SubscriptionId: identificador de plan de Azure, necesario para el ámbito compartido
  • PurchaseCommitment: el importe fijo por hora confirmado en los servicios de proceso durante uno o tres años.

Los planes de ahorro de Azure requieren un contexto de aprovisionamiento, incluidos el ámbito y el identificador de suscripción o el identificador de derecho, y un compromiso de compra, incluida la cantidad, el grano y la moneda.

Visualización y administración del plan de ahorro de Azure

Los partners pueden ver los planes de ahorro de Azure comprados en el Centro de partners. Al igual que las instancias de reserva, los asociados pueden seguir usando Azure Portal para las acciones de administración posteriores a la compra. Para más información sobre cómo administrar el plan de ahorro de Azure, consulte Administración de planes de ahorro de Azure: Microsoft Cost Management.

En obtener una suscripción por identificador y Obtener las API de suscripciones de un cliente , se devuelve un modelo de datos denominado SubscriptionLineItem . En la respuesta de la suscripción, los asociados ven las siguientes propiedades para el plan de ahorro de Azure:

  • unitType: el valor es la ventaja
  • billingType: el valor es la ventaja
  • lineItems: Un elemento de línea contiene los detalles de compra de una suscripción de plan de ahorro de Azure determinada (por ejemplo, ámbito y PurchaseCommitment).
  • productOrderId: Identificador de una compra de productos específica (por ejemplo, Plan de reservas o ahorros de Azure).

Nota:

En el caso del plan de ahorro de Azure adquirido a través de la Azure Portal, las API de suscripción no devolverán el identificador de pedido.

Factura y conciliación del plan de ahorro de Azure

Los partners pueden visitar Conciliación y facturación del plan de ahorro en CSP para comprender cómo se reflejan los ahorros en sus archivos de conciliación de facturación mensuales.

Ejemplos de solicitud y respuesta

Ejemplos de API de detección

Obtener un producto según el id.

Respuesta:

{  
    "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": []  
        }  
    }  
}  

Obtener una SKU según el id.

Respuesta:

{  
    "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": []  
        }  
    }  
}

Obtención de disponibilidad por identificador

Respuesta:

{  
    "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": []  
            }  
        }  
    }  
} 

Obtener una lista de SKU para un producto (por cliente)

Respuesta:

{  
    "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"  
    }  
}  

Obtener una lista de SKU para un producto (por país o región)

Respuesta:

{  
    "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"  
    }  
}

Obtener una lista de disponibilidad por SKU (por cliente)

Respuesta:

 {  
    "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"  
    }  
}

Obtener una lista de disponibilidad por SKU (por país o región)

Respuesta:

{  
    "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"  
    }  
}  

Ejemplos de API de compra

Crear carro

Solicitud:

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

Respuesta:

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

Obtener carro

Respuesta:

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

Carro de actualización

Solicitud:

{  
    "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"  
    }  
}

Respuesta:

{  
    "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"  
    }  
}

Carro de compra

Respuesta:

{  
    "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"  
    }  
}

Crear pedido

Solicitud:

{  
    "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"  
            }  
        }  
    ]  
}

Respuesta:

{  
    "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"  
    }  
}

Ejemplos de API de pedidos y suscripciones

Obtener un pedido según el id.

Respuesta:

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

Obtener todos los pedidos de un cliente

Respuesta:

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

Obtener una suscripción según el id.

Respuesta:

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

Obtener las suscripciones de un cliente

Respuesta:

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