Bagikan melalui


Membeli paket penghematan Azure

Berlaku untuk: Pusat Mitra

Artikel ini membahas pengalaman API untuk membeli paket penghematan Azure di Pusat Mitra dan memberikan contoh permintaan/respons khusus untuk paket penghematan Azure.

Prasyarat

Kredensial seperti yang dijelaskan dalam autentikasi Pusat Mitra. Skenario ini mendukung autentikasi dengan kredensial App+User.

ID pelanggan (customer-tenant-id). Jika Anda tidak mengetahui ID pelanggan, Anda dapat mencarinya di Pusat Mitra dengan memilih ruang kerja Pelanggan , lalu pelanggan dari daftar pelanggan, lalu Akun. Pada halaman Akun pelanggan, cari ID Microsoft di bagian Info Akun Pelanggan. ID Microsoft sama dengan ID pelanggan (customer-tenant-id).

Untuk membeli paket penghematan Azure untuk pelanggan menggunakan API Pusat Mitra, Anda harus memiliki paket Azure untuk pelanggan tersebut dengan setidaknya satu langganan Azure aktif. Cara membeli paket Azure.

Menemukan paket penghematan Azure

Sebelum membeli paket penghematan Azure, selesaikan langkah-langkah berikut:

  1. Identifikasi dan ambil Produk dan SKU yang ingin Anda beli. Anda dapat melakukan ini dengan mencantumkan produk dan SKU terlebih dahulu, atau jika Anda sudah mengetahui ID produk dan SKU, memilihnya. Untuk melihat nilai paket penghematan Azure di API di bawah ini, ID pelanggan diperlukan dalam rute untuk API di bawah ini, dan pelanggan tersebut harus memiliki Paket Azure.

  2. Ambil ketersediaan untuk SKU. Anda memerlukan CatalogItemId ketersediaan saat menempatkan pesanan. Untuk mendapatkan nilai ini, gunakan salah satu API berikut:

Untuk paket penghematan Azure, Dapatkan daftar SKU untuk produk (menurut pelanggan) dan Dapatkan SKU menggunakan ID SKU dan respons API ketersediaan mengembalikan minimumPurchaseCommitment untuk SKU. Ini adalah komitmen minimum yang dapat dibuat per jam untuk jangka waktu tertentu. Ini hanya berlaku untuk paket penghematan Azure dan tidak berlaku untuk keluarga produk lainnya.

Membeli paket penghematan Azure

Untuk mengirimkan pesanan paket penghematan Azure Anda, selesaikan langkah-langkah berikut:

  1. Buat kelir untuk menyimpan koleksi item katalog yang ingin Anda beli. Saat Anda membuat Kelir, item garis kelistrikan secara otomatis dikelompokkan berdasarkan apa yang dapat dibeli bersama dalam Pesanan yang sama.
  2. Lihat kemudinya. Memeriksa kelir menghasilkan pembuatan Pesanan.

Dalam permintaan API, mitra harus menentukan parameter berikut saat membuat atau memperbarui kelir dan membuat pesanan. PurchaseCommitment adalah nilai baru untuk paket penghematan Azure.

  • Cakupan: nilai yang mungkin mencakup tunggal, bersama
  • EntitlementId: ID langganan Azure, diperlukan untuk cakupan tunggal
  • SubscriptionId: ID paket Azure, diperlukan untuk cakupan bersama
  • PurchaseCommitment: Jumlah per jam tetap yang diterapkan pada layanan komputasi selama satu atau tiga tahun.

Paket penghematan Azure memerlukan konteks provisi, termasuk cakupan dan ID langganan/ID pemberian izin, dan komitmen pembelian, termasuk jumlah, biji-bijian, dan mata uang.

Menampilkan dan mengelola paket penghematan Azure

Mitra dapat melihat paket penghematan Azure yang dibeli di Pusat Mitra. Seperti Instans Reservasi, mitra dapat terus menggunakan portal Azure untuk tindakan manajemen pasca-pembelian. Untuk informasi selengkapnya tentang mengelola paket penghematan Azure, lihat Mengelola paket penghematan Azure - Microsoft Cost Management.

Di API Dapatkan langganan menurut ID dan Dapatkan langganan pelanggan, model data yang disebut SubscriptionLineItem dikembalikan. Dalam respons langganan, mitra melihat properti berikut untuk paket penghematan Azure:

  • unitType: nilainya adalah manfaat
  • billingType: nilainya adalah manfaat
  • lineItems: Item baris berisi detail pembelian langganan paket penghematan Azure tertentu (misalnya, cakupan dan PurchaseCommitment).
  • productOrderId: Pengidentifikasi untuk pembelian produk tertentu (misalnya, Reservasi atau paket penghematan Azure).

Catatan

Untuk paket penghematan Azure yang dibeli melalui portal Azure, API langganan tidak akan mengembalikan ID pesanan.

Faktur dan rekonsiliasi untuk paket penghematan Azure

Mitra dapat mengunjungi Rekonsiliasi dan penagihan rencana penghematan di CSP untuk memahami bagaimana penghematan tercermin dalam file rekonsiliasi penagihan bulanan mereka.

Contoh permintaan/respons

Menemukan contoh API

Mendapatkan produk berdasarkan ID

Respons:

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

Mendapatkan SKU berdasarkan ID

Respons:

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

Dapatkan ketersediaan berdasarkan ID

Respons:

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

Mendapatkan daftar SKU untuk produk (menurut pelanggan)

Respons:

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

Mendapatkan daftar SKU untuk produk (menurut negara/wilayah)

Respons:

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

Dapatkan daftar ketersediaan oleh SKU (menurut pelanggan)

Respons:

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

Dapatkan daftar ketersediaan menurut SKU (menurut negara/wilayah)

Respons:

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

Contoh API pembelian

Membuat kelir

Permintaan:

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

Respons:

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

Dapatkan kelir

Respons:

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

Perbarui kelir

Permintaan:

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

Respons:

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

Kelir checkout

Respons:

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

Membuat pesanan

Permintaan:

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

Respons:

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

Contoh API pesanan dan langganan

Mendapatkan pesanan berdasarkan ID

Respons:

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

Mendapatkan semua pesanan pelanggan

Respons:

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

Mendapatkan langganan menurut ID

Respons:

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

Mendapatkan langganan pelanggan

Respons:

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