获取发票明细项目
适用于:合作伙伴中心 | 由世纪互联运营的合作伙伴中心 | Microsoft Cloud for US Government 合作伙伴中心
可以使用以下方法获取指定发票的发票行项(也称为已关闭计费行项)的集合详细信息。
除了 bug 修复之外,此 API 不再更新。 建议更新应用程序以调用 一次性 API,而不是 市场。 一次性 API 提供更多功能,并不断更新。
若要查询所有商业消费行项,最好使用一次性 API 而不是市场。
此 API 还支持用于 Microsoft Azure(MS-AZR-0145P)订阅和 Office 套餐的 Azure 和 Office 提供程序类型,确保向后兼容。
感谢你的注意,我们希望此信息对你有所帮助。
注意
2025 年 1 月 21 日之后,可以继续使用此 API,但不能用于每个计费周期。 下面介绍如何根据需求选择正确的版本:
目标:从 2024 年 2 月到 2024 年 12 月检索计费周期的发票明细项目。
操作:除非已切换到 API v2 GA,否则请使用此 API,直到 2025 年 1 月 21 日。
目标:在 2024 年 2 月之前检索计费周期的发票明细项目。
操作:仅使用此 API。
目标:从 2024 年 2 月起检索计费周期的发票行项,但仅在 2025 年 1 月 21 日之后。
操作:仅使用 API v2 GA。
若要无缝过渡到新 API,请遵循以下链接:计费发票对帐 API v2 (GA)。
感谢你的注意,我们期待着你继续成功使用我们的计费 API。
先决条件
合作伙伴中心身份验证中所述的凭据。 此方案支持使用独立应用和 App+User 凭据进行身份验证。
要获取其行项的发票的 ID。
C#
若要获取指定发票的行项,请执行以下操作:
调用 ById 方法以获取指定发票的发票操作的接口。
使用发票对象的 InvoiceDetails 属性获取对 InvoiceDetail 对象的集合的访问权限,每个对象都包含 BillingProvider 和 InvoiceLineItemType。 BillingProvider 标识发票详细信息(如 Office、Azure、OneTime)和 InvoiceLineItemType 指定类型(例如 BillingLineItem)。
以下示例代码使用 foreach 循环来处理 InvoiceDetails 集合。 为每个 InvoiceDetail 实例检索单独的行项集合。
获取对应于 InvoiceDetail 实例的行项集合:
将实例的 BillingProvider 和 InvoiceLineItemType 传递给 By 方法。
创建枚举器以遍历集合,如以下示例所示。
// IAggregatePartner partnerOperations;
// int invoicePageSize;
// string invoiceId;
// Retrieve the invoice.
var invoiceOperations = partnerOperations.Invoices.ById(invoiceId);
var invoice = invoiceOperations.Get();
foreach (var invoiceDetail in invoice.InvoiceDetails)
{
Console.WriteLine(string.Format("Getting invoice line item for product {0} and line item type {1}",
invoiceDetail.BillingProvider,
invoiceDetail.InvoiceLineItemType));
// Is this an unpaged or paged request?
bool isUnPaged = (this.invoicePageSize <= 0);
// If the scenario is unpaged, get all the invoice line items, otherwise get the first page.
var invoiceLineItemsCollection =
(isUnPaged)
? invoiceOperations.By(invoiceDetail.BillingProvider, invoiceDetail.InvoiceLineItemType).Get()
: invoiceOperations.By(invoiceDetail.BillingProvider, invoiceDetail.InvoiceLineItemType).Get(this.invoicePageSize, 0);
// Create an enumerator for traversing the line items collection.
var invoiceLineItemEnumerator =
partnerOperations.Enumerators.InvoiceLineItems.Create(invoiceLineItemsCollection);
while (invoiceLineItemEnumerator.HasValue)
{
// invoiceLineItemEnumerator.Current contains a collection
// of line items.
Console.WriteLine(String.Format("invoiceLineItemEnumerator.Current has {0} line items.",
invoiceLineItemEnumerator.Current.TotalCount));
//
// Insert code here to work with the line items.
//
Console.WriteLine();
Console.Write("Press any key to retrieve the next invoice line items page");
Console.ReadKey();
// Get the next list of invoice line items.
invoiceLineItemEnumerator.Next();
}
}
请参阅另一个示例:
- 示例: 控制台测试应用
- 项目: 合作伙伴中心 SDK 示例
- 类: GetInvoiceLineItems.cs
REST 请求
请求语法
在方案中使用计费提供程序的相应语法发出请求。
Office
当计费提供程序为 Office 时,以下语法适用。
方法 | 请求 URI |
---|---|
GET | {baseURL}/v1/invoices/{invoice-id}/lineitems?provider=office&invoicelineitemtype=billinglineitems&size={size}&offset={offset} HTTP/1.1 |
Microsoft Azure (MS-AZR-0145P) 订阅
当计费提供程序具有Microsoft Azure(MS-AZR-0145P)订阅时,以下语法适用。
方法 | 请求 URI |
---|---|
GET | {baseURL}/v1/invoices/{invoice-id}/lineitems?provider=azure&invoicelineitemtype=billinglineitems&size={size}&offset={offset} HTTP/1.1 |
GET | {baseURL}/v1/invoices/{invoice-id}/lineitems?provider=azure&invoicelineitemtype=usagelineitems&size={size}&offset={offset} HTTP/1.1 |
一次性
将这些语法用于 OneTime 计费提供程序。 它们涵盖 Azure 预留、Azure 节省计划、软件、Azure 计划、商业市场和Microsoft/Dynamics 365产品等费用。
方法 | 请求 URI |
---|---|
GET | {baseURL}/v1/invoices/{invoice-id}/lineitems?provider=onetime&invoicelineitemtype=billinglineitems&size={size} HTTP/1.1 |
GET | {baseURL}/v1/invoices/{invoice-id}/lineitems/onetime/billinglineitems&size={size}?seekOperation=Next |
以前的语法
强烈建议更新应用程序以使用 一次性 API 而不是 市场 API。 一次性 API 提供增强的功能并接收正在进行的更新,确保应用程序保持最新状态。
对于所有商业消耗行项,请使用 一次性 API 进行查询。 这种转换不仅简化了流程,而且还提供了更可靠的功能。
请记住,除了基本 bug 修复之外,市场 API 不再接收更新。 进行此更改现在有助于保持领先,并受益于最新的功能和改进。
方法 | 请求 URI | 语法用例说明 |
---|---|---|
GET | {baseURL}/v1/invoices/{invoice-id}/lineitems/{billing-provider}/{invoice-line-item-type} HTTP/1.1 | 可以使用此语法返回给定发票的每个行项的完整列表。 |
GET | {baseURL}/v1/invoices/{invoice-id}/lineitems/{billing-provider}/{invoice-line-item-type}?size={size}&offset={offset} HTTP/1.1 | 若要有效处理大型发票,请指定大小和 从 零开始的偏移量以返回分页的行项列表。 |
GET | {baseURL}/v1/invoices/{invoice-id}/lineitems/OneTime/{invoice-line-item-type}?seekOperation=Next | 可以将此语法用于具有 OneTime 计费提供程序值的发票,并将 seekOperation 设置为 Next 以获取发票行项的下一页。 |
URI 参数
创建请求时,请使用以下 URI 和查询参数。
名称 | 类型 | 必需 | 说明 |
---|---|---|---|
invoice-id | string | 是 | 标识发票的字符串。 |
billing-provider | string | 是 | 计费提供程序:“Office”、“Azure”、“OneTime”在旧版中,我们为 Office 和 Azure 事务提供了单独的数据模型。 但是,在现代中,我们在通过“OneTime”值筛选的所有产品中都有一个单一数据模型。 |
invoice-line-item-type | string | 是 | 发票详细信息的类型:“BillingLineItems”、“UsageLineItems” |
size | 数字 | 否 | 要返回的最多项目数。 默认最大大小 = 2000 |
offset | 数字 | 否 | 要返回的初始行项的从零开始的索引。 |
seekOperation | string | 否 | 如果 计费提供程序 等于 OneTime,请将 seekOperation 设置为“ 下一步 ”以获取发票行项的下一页。 |
hasPartnerEarnedCredit | 布尔 | 否 | 此参数返回应用合作伙伴赚取的信用额度的行项。 它仅适用于 OneTime 计费提供程序类型, InvoiceLineItemType = UsageLineItems。 |
请求标头
有关详细信息,请参阅合作伙伴中心 REST 标头。
请求正文
无。
REST 响应
如果成功,响应将包含行项详细信息的集合。
对于行项 ChargeType,“购买”值将映射到“新建”。 “退款”值映射到“取消”。
响应的成功和错误代码
每个响应都有一个 HTTP 状态代码,指示成功或失败和其他调试信息。 使用网络跟踪工具读取此代码、错误类型和额外参数。 如需完整列表,请参阅合作伙伴中心 REST 错误代码。
REST 请求-响应示例
请求-响应示例 1
在此示例中,详细信息如下所示:
- BillingProvider: Office
- InvoiceLineItemType: BillingLineItems
请求示例 1
GET https://api.partnercenter.microsoft.com/v1/invoices/1234000000/lineitems?provider=Office&nvoicelineitemtype=BillingLineItems&size=2&offset=0 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Host: api.partnercenter.microsoft.com
重要
截至 2023 年 6 月,最新的合作伙伴中心 .NET SDK 版本 3.4.0 现已存档。 可以从 GitHub 下载 SDK 版本,以及包含有用信息的自述文件。
建议合作伙伴继续使用合作伙伴中心 REST API。
响应示例 1
HTTP/1.1 200 OK
Content-Length: 2484
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CV: bpqyomePDUqrSSYC.0
MS-ServerId: 202010406
Date: Thu, 07 Sep 2017 23:31:09 GMT
{
"totalCount": 2,
"items": [{
"partnerId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"customerId": "74221236-D09C-4870-AC1D-33E155E9AEBE",
"customerName": "TSTAGIN1CUST190",
"mpnId": 4391507,
"tier2MpnId": -1,
"orderId": "567735045559164136",
"subscriptionId": "4KIKawEAAAAAAAEA",
"syndicationPartnerSubscriptionNumber": "1F58ACD7-FE51-4705-9567-D009C9ADA150",
"offerId": "AAA5B3F0-0EE2-431B-A42F-3F18F3C6D540",
"durableOfferId": "2F707C7C-2433-49A5-A437-9CA7CF40D3EB",
"offerName": "EXCHANGE ONLINE (PLAN 2)",
"domainName": "TStagin1Cust190.onmicrosoft.com",
"billingCycleType": "MONTHLY",
"subscriptionName": "EXCHANGE ONLINE (PLAN 2)",
"subscriptionDescription": "EXCHANGE ONLINE (PLAN 2)",
"subscriptionStartDate": "2017-05-12T00:00:00",
"subscriptionEndDate": "2018-06-10T00:00:00",
"chargeStartDate": "2017-05-12T00:00:00",
"chargeEndDate": "2017-06-09T00:00:00",
"chargeType": "New",
"unitPrice": 0.0,
"quantity": 3,
"amount": 0.0,
"totalOtherDiscount": 0.0,
"subtotal": 0.0,
"tax": 0.0,
"totalForCustomer": 0.0,
"currency": "USD",
"invoiceLineItemType": "billing_line_items",
"billingProvider": "office",
"attributes": {
"objectType": "LicenseBasedLineItem"
}
}, {
"partnerId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"customerId": "74221236-D09C-4870-AC1D-33E155E9AEBE",
"customerName": "TSTAGIN1CUST190",
"mpnId": 4391507,
"tier2MpnId": -1,
"orderId": "567735045564795186",
"subscriptionId": "Ik4YawEAAAAAAAEA",
"syndicationPartnerSubscriptionNumber": "D8A8F773-9D3E-4244-8797-3182075F09FA",
"offerId": "618B53FE-9B99-428B-9745-F706AEAF3979",
"durableOfferId": "69C67983-CF78-4102-83F6-3E5FD246864F",
"offerName": "SHAREPOINT ONLINE (PLAN 2)",
"domainName": "TStagin1Cust190.onmicrosoft.com",
"billingCycleType": "MONTHLY",
"subscriptionName": "SHAREPOINT ONLINE (PLAN 2)",
"subscriptionDescription": "SHAREPOINT ONLINE (PLAN 2)",
"subscriptionStartDate": "2017-05-13T00:00:00",
"subscriptionEndDate": "2018-06-10T00:00:00",
"chargeStartDate": "2017-05-13T00:00:00",
"chargeEndDate": "2017-06-09T00:00:00",
"chargeType": "New",
"unitPrice": 0.0,
"quantity": 1,
"amount": 0.0,
"totalOtherDiscount": 0.0,
"subtotal": 0.0,
"tax": 0.0,
"totalForCustomer": 0.0,
"currency": "USD",
"invoiceLineItemType": "billing_line_items",
"billingProvider": "office",
"attributes": {
"objectType": "LicenseBasedLineItem"
}
}
],
"links": {
"self": {
"uri": "/invoices/1234000000/lineitems?provider=Office&nvoicelineitemtype=BillingLineItems&size=2&offset=0",
"method": "GET",
"headers": []
},
"next": {
"uri": "/invoices/1234000000/lineitems?provider=Office&nvoicelineitemtype=BillingLineItems&size=2&offset=",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "Collection"
}
}
请求-响应示例 2
在以下示例中,详细信息如下所示:
- BillingProvider: Azure
- InvoiceLineItemType: BillingLineItems
请求示例 2
GET https://api.partnercenter.microsoft.com/v1/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=BillingLineItems&size=2&offset=0 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Host: api.partnercenter.microsoft.com
响应示例 2
HTTP/1.1 200 OK
Content-Length: 2484
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CV: bpqyomePDUqrSSYC.0
MS-ServerId: 202010406
Date: Thu, 07 Sep 2017 23:31:09 GMT
{
"totalCount": 2,
"items": [
{
"detailLineItemId": 1,
"sku": "7UD-00001",
"includedQuantity": 0,
"overageQuantity": 745,
"listPrice": 0.085,
"currency": "USD",
"pretaxCharges": 63.33,
"taxAmount": 6.34,
"postTaxTotal": 69.67,
"pretaxEffectiveRate": 0.08500671,
"postTaxEffectiveRate": 0.09351677,
"chargeType": "Assess usage fee for current cycle",
"invoiceLineItemType": "billing_line_items",
"partnerId": "1F5CCB06-8E36-4A74-A74C-FCAA9E000000",
"partnerName": "TEST_TEST_Big foot consulting",
"partnerBillableAccountId": "1010578050",
"customerId": "65726577-c208-40fd-9735-8c85ac000000",
"domainName": "600test.onmicrosoft.com",
"customerCompanyName": "601 tests",
"mpnId": 4390934,
"tier2MpnId": -1,
"invoiceNumber": "1234000000",
"subscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"subscriptionName": "Microsoft Azure",
"subscriptionDescription": "Microsoft Azure",
"billingCycleType": "Monthly",
"orderId": "568297985427000000",
"serviceName": "Azure App Service",
"serviceType": "Standard Plan",
"resourceGuid": "505db374-df8a-44df-9d8c-13c14b61dee1",
"resourceName": "S1",
"region": "",
"consumedQuantity": 745,
"chargeStartDate": "2019-08-02T00:00:00",
"chargeEndDate": "2019-09-01T00:00:00",
"unit": "1 Hour",
"billingProvider": "azure",
"attributes": {
"objectType": "UsageBasedLineItem"
}
},
{
"detailLineItemId": 1,
"sku": "7UD-00001",
"includedQuantity": 0,
"overageQuantity": 0.000882,
"listPrice": 0.0383,
"currency": "USD",
"pretaxCharges": 0,
"taxAmount": 0,
"postTaxTotal": 0,
"pretaxEffectiveRate": 0,
"postTaxEffectiveRate": 0,
"chargeType": "Assess usage fee for current cycle",
"invoiceLineItemType": "billing_line_items",
"partnerId": "1F5CCB06-8E36-4A74-A74C-FCAA9E87E26A",
"partnerName": "TEST_TEST_Big foot consulting",
"partnerBillableAccountId": "1010578050",
"customerId": "65726577-c208-40fd-9735-8c85ac9cac68",
"domainName": "600test.onmicrosoft.com",
"customerCompanyName": "601 tests",
"mpnId": 4390934,
"tier2MpnId": -1,
"invoiceNumber": "1234000000",
"subscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"subscriptionName": "Microsoft Azure",
"subscriptionDescription": "Microsoft Azure",
"billingCycleType": "Monthly",
"orderId": "568297985427000000",
"serviceName": "Storage",
"serviceType": "Standard Page Blob",
"resourceGuid": "d23a5753-ff85-4ddf-af28-8cc5cf2d3882",
"resourceName": "LRS Data Stored",
"region": "",
"consumedQuantity": 0.000882,
"chargeStartDate": "2019-08-02T00:00:00",
"chargeEndDate": "2019-09-01T00:00:00",
"unit": "1 GB/Month",
"billingProvider": "azure",
"attributes": {
"objectType": "UsageBasedLineItem"
}
}
],
"links": {
"self": {
"uri": "/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=BillingLineItems&size=2&offset=0",
"method": "GET",
"headers": []
},
"next": {
"uri": "/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=BillingLineItems&size=2&offset=2",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "Collection"
}
}
请求-响应示例 3
在以下示例中,详细信息如下所示:
- BillingProvider: Azure
- InvoiceLineItemType: UsageLineItems
请求示例 3
GET https://api.partnercenter.microsoft.com/v1/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=UsageLineItems&size=2&offset=0 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Host: api.partnercenter.microsoft.com
响应示例 3
HTTP/1.1 200 OK
Content-Length: 2484
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CV: bpqyomePDUqrSSYC.0
MS-ServerId: 202010406
Date: Thu, 07 Sep 2017 23:31:09 GMT
{
"totalCount": 2,
"items": [
{
"customerBillableAccount": "1439508127",
"usageDate": "2019-08-05T00:00:00",
"invoiceLineItemType": "usage_line_items",
"partnerId": "1F5CCB06-8E36-4A74-A74C-FCAA9E000000",
"partnerName": "TEST_TEST_BIG FOOT CONSULTING",
"partnerBillableAccountId": "1010578050",
"customerId": "9E9B71BA-3442-458B-B519-E1CCF72FBB54",
"domainName": "test600.onmicrosoft.com",
"customerCompanyName": "600 TEST",
"mpnId": 4390934,
"tier2MpnId": -1,
"invoiceNumber": "1234000000",
"subscriptionId": "bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f",
"subscriptionName": "MICROSOFT AZURE",
"subscriptionDescription": "MICROSOFT AZURE",
"billingCycleType": "MONTHLY",
"orderId": "568297985577171353",
"serviceName": "STORAGE",
"serviceType": "STANDARD PAGE BLOB",
"resourceGuid": "9CC63CF8-6593-410A-B0E7-26A4EF71E8B3",
"resourceName": "DISK DELETE OPERATIONS",
"region": "",
"consumedQuantity": 2.9616,
"chargeStartDate": "2019-08-05T00:00:00",
"chargeEndDate": "2019-09-04T00:00:00",
"unit": "10K",
"billingProvider": "azure",
"attributes": {
"objectType": "DailyUsageLineItem"
}
},
{
"customerBillableAccount": "1307536861",
"usageDate": "2019-08-10T00:00:00",
"invoiceLineItemType": "usage_line_items",
"partnerId": "1F5CCB06-8E36-4A74-A74C-FCAA9E000000",
"partnerName": "TEST_TEST_BIG FOOT CONSULTING",
"partnerBillableAccountId": "1010578050",
"customerId": "EB53B7BD-267E-440E-B3C0-8F0B40000000",
"domainName": "brandontest.onmicrosoft.com",
"customerCompanyName": "BRANDON'S TEST",
"mpnId": 4390934,
"tier2MpnId": -1,
"invoiceNumber": "1234000000",
"subscriptionId": "cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a",
"subscriptionName": "MICROSOFT AZURE",
"subscriptionDescription": "MICROSOFT AZURE",
"billingCycleType": "MONTHLY",
"orderId": "568297985605838583",
"serviceName": "VIRTUAL MACHINES",
"serviceType": "D/DS SERIES WINDOWS",
"resourceGuid": "62C64B6C-4033-4E20-AB33-9E81271AC12A",
"resourceName": "D1/DS1",
"region": "US WEST",
"consumedQuantity": 24,
"chargeStartDate": "2019-08-05T00:00:00",
"chargeEndDate": "2019-09-04T00:00:00",
"unit": "1 HOUR",
"billingProvider": "azure",
"attributes": {
"objectType": "DailyUsageLineItem"
}
}
],
"links": {
"self": {
"uri": "/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=UsageLineItems&size=2&offset=0",
"method": "GET",
"headers": []
},
"next": {
"uri": "/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=UsageLineItems&size=2&offset=2",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "Collection"
}
}
请求-响应示例 4
在以下示例中,详细信息如下所示:
- BillingProvider: OneTime
- InvoiceLineItemType: BillingLineItems
请求示例 4
GET https://api.partnercenter.microsoft.com/v1/invoices/G000024135/lineitems/OneTime/BillingLineItems?size=2&offset=0 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Host: api.partnercenter.microsoft.com
响应示例 4
HTTP/1.1 200 OK
Content-Length: 2484
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CV: bpqyomePDUqrSSYC.0
MS-ServerId: 202010406
Date: Thu, 07 Sep 2017 23:31:09 GMT
{
"continuationToken": "d19617b8-fbe5-4684-a5d8-0230972fb0cf,0705c4a9-39f7-4261-ba6d-53e24a9ce47d_a4ayc/80/OGda4BO/1o/V0etpOqiLx1JwB5S3beHW0s=,0d81c700-98b4-4b13-9129-ffd5620f72e7",
{
"totalCount": 3,
"items": [
{
"partnerId": "934f3416-bc2f-47f3-b492-77e517d4e572",
"customerId": "c139c4bf-2e8b-4ab5-8bed-d9f50dcca7a2",
"customerName": "Test_Test_Office R2 Reduce Seats Validation",
"customerDomainName": "testcustomerr2t2reduce.onmicrosoft.com",
"customerCountry": "US",
"invoiceNumber": "G000773581",
"mpnId": "5357564",
"resellerMpnId": "4649221",
"orderId": "94e858b6d855",
"orderDate": "2021-05-20T18:30:06.6045692Z",
"productId": "CFQ7TTC0LH0R",
"skuId": "0002",
"availabilityId": "CFQ7TTC0K5RQ",
"productName": "Microsoft 365 Phone System - Virtual User",
"skuName": "Microsoft 365 Phone System - Virtual User",
"productQualifiers": [
"AddOn",
"Trial"
],
"chargeType": "new",
"unitPrice": "0",
"effectiveUnitPrice": "0",
"unitType": "",
"quantity": "25",
"subtotal": "0",
"taxTotal": "0",
"totalForCustomer": "0",
"currency": "USD",
"publisherName": "Microsoft Corporation",
"publisherId": "",
"subscriptionDescription": "",
"subscriptionId": "dddd3d3d-ee4e-ff5f-aa6a-bbbbbb7b7b7b",
"subscriptionStartDate": "2021-05-20T00:00:00Z",
"subscriptionEndDate": "2021-06-19T00:00:00Z",
"chargeStartDate": "2021-05-20T00:00:00Z",
"chargeEndDate": "2021-06-19T00:00:00Z",
"termAndBillingCycle": "One-Month commitment for trial",
"alternateId": "94e858b6d855",
"referenceId": "0cf1202a-5b7d-4219-966e-93c637113708",
"priceAdjustmentDescription": "",
"discountDetails": "",
"pricingCurrency": "USD",
"pcToBCExchangeRate": "1",
"pcToBCExchangeRateDate": "2021-05-01T00:00:00",
"billableQuantity": "25",
"meterDescription": "",
"billingFrequency": "",
"reservationOrderId": "99f246cf-ed96-41b4-b0cd-0aa43eb1fe91",
"invoiceLineItemType": "billing_line_items",
"billingProvider": "one_time",
"promotionId": "",
"attributes": {
"objectType": "OneTimeInvoiceLineItem"
}
},
{
"partnerId": "934f3416-bc2f-47f3-b492-77e517d4e572",
"customerId": "835a59a7-3172-47b5-bdef-d9cc65f4d0e4",
"customerName": "TEST_TEST Test Promotions 01",
"customerDomainName": "kyletestpromos01.onmicrosoft.com",
"customerCountry": "US",
"invoiceNumber": "G000773581",
"mpnId": "5357564",
"resellerMpnId": "0",
"orderId": "5f9d52bb1408",
"orderDate": "2021-05-20T18:48:30.6168285Z",
"productId": "CFQ7TTC0HL8W",
"skuId": "0001",
"availabilityId": "CFQ7TTC0K59S",
"productName": "Power BI Premium Per User",
"skuName": "Power BI Premium Per User",
"productQualifiers": [],
"chargeType": "new",
"unitPrice": "16",
"effectiveUnitPrice": "14.4",
"unitType": "",
"quantity": "50",
"subtotal": "720",
"taxTotal": "73",
"totalForCustomer": "793",
"currency": "USD",
"publisherName": "Microsoft Corporation",
"publisherId": "",
"subscriptionDescription": "",
"subscriptionId": "eeee4efe-ff5f-aa6a-bb7b-cccccc8c8c8c",
"subscriptionStartDate": "2021-05-20T00:00:00Z",
"subscriptionEndDate": "2022-05-19T00:00:00Z",
"chargeStartDate": "2021-05-20T00:00:00Z",
"chargeEndDate": "2021-06-19T00:00:00Z",
"termAndBillingCycle": "One-Year commitment for monthly/yearly billing",
"alternateId": "5f9d52bb1408",
"referenceId": "28b535e0-68f4-40b5-84f7-8ed9241eb149",
"priceAdjustmentDescription": "[\"Price for given billing period\",\"You are getting a discount due to a pre-determined override.\",\"You are getting a discount for being a partner.\",\"You are getting a price guarantee for your price.\",\"Price for given term\"]",
"discountDetails": "",
"pricingCurrency": "USD",
"pcToBCExchangeRate": "1",
"pcToBCExchangeRateDate": "2021-05-01T00:00:00",
"billableQuantity": "50",
"meterDescription": "",
"billingFrequency": "Monthly",
"reservationOrderId": "8fdebb4a-7110-496e-9570-623e4c992797",
"invoiceLineItemType": "billing_line_items",
"billingProvider": "one_time",
"promotionId": "39NFJQT1X27N:0002:39NFJQT1Q5KL",
"attributes/objectType": "OneTimeInvoiceLineItem",
"attributes": {
"objectType": "OneTimeInvoiceLineItem"
}
},
{
"partnerId": "934f3416-bc2f-47f3-b492-77e517d4e572",
"customerId": "c139c4bf-2e8b-4ab5-8bed-d9f50dcca7a2",
"customerName": "Test_Test_Office R2 Reduce Seats Validation",
"customerDomainName": "testcustomerr2t2reduce.onmicrosoft.com",
"customerCountry": "US",
"invoiceNumber": "T000773581",
"mpnId": "1234567",
"resellerMpnId": 0,
"orderId": "HJVtMZMkgQ2miuCiNv0RSr51zQDans0m1",
"orderDate": "2019-02-04T17:59:52.9460102Z",
"productId": "DZH318Z0BXWC",
"skuId": "0002",
"availabilityId": "DZH318Z0BP8B",
"productName": "Test WAF-as-a-Service",
"skuName": "Test WaaS - Medium Plan",
"chargeType": "New",
"unitPrice": 820,
"effectiveUnitPrice": 820,
"unitType": "",
"quantity": 1,
"subtotal": 820,
"taxTotal": 0,
"totalForCustomer": 0,
"currency": "USD",
"publisherName": "Test Networks, Inc.",
"publisherId": "21223810",
"subscriptionDescription": "",
"subscriptionId": "ffff5f5f-aa6a-bb7b-cc8c-dddddd9d9d9d",
"subscriptionStartDate": "2019-02-01T00:00:00Z",
"subscriptionEndDate": "2020-01-31T00:00:00Z",
"chargeStartDate": "2019-02-04T09:22:40.1767993-08:00",
"chargeEndDate": "2019-03-03T09:22:40.1767993-08:00",
"termAndBillingCycle": "1 Year Subscription",
"alternateId": "123456ad566",
"priceAdjustmentDescription": "[\"15.0% Partner earned credit for services managed\"]",
"discountDetails": "",
"pricingCurrency": "USD",
"pcToBCExchangeRate": 1,
"pcToBCExchangeRateDate": "2019-08-01T00:00:00Z",
"billableQuantity": 3.1618,
"meterDescription": "Bandwidth - Data Transfer In (GB) - Zone 2",
"reservationOrderId": "883d475b-0000-1234-0000-8818752f1234",
"attributes": {
"objectType": "OneTimeInvoiceLineItem"
}
},
{
"partnerId": "6480d686-cfb4-424d-a945-6b9b9f4badc2",
"customerId": "org:9060d13d-c5ed-482e-b059-a15a38cbb28e",
"customerName": "recipientCustomerName",
"customerDomainName": "recipientCustomerDomain",
"customerCountry": "US",
"invoiceNumber": "1234000000",
"mpnId": "4870137",
"resellerMpnId": 0,
"orderId": "VdqkP11Bu4DlcjP5rLeQabcdefg-1234",
"orderDate": "2021-01-29T19:50:13.9869095Z",
"productId": "CFQ7TTC01234",
"skuId": "0001",
"availabilityId": "CFQ7TTC0ABCD",
"productName": "Office 365 E3",
"skuName": "Office 365 E3",
"chargeType": "new",
"unitPrice": 16,
"effectiveUnitPrice": 16,
"unitType": "",
"quantity": 1,
"subtotal": 16,
"taxTotal": 1.61,
"totalForCustomer": 17.61,
"currency": "USD",
"publisherName": "Microsoft Corporation",
"publisherId": "",
"subscriptionDescription": "",
"subscriptionId": "aaaa6a6a-bb7b-cc8c-dd9d-eeeeee0e0e0e",
"chargeStartDate": "2021-01-29T00:00:00Z",
"chargeEndDate": "2021-02-27T00:00:00Z",
"termAndBillingCycle": "One-Year commitment for monthly/yearly billing",
"priceAdjustmentDescription": "[\"1 month billing/",\"You are getting a discount for being a partner.\",\"You are getting a price guarantee for your price.\",\"Yearly Duration\"]",
"discountDetails": "",
"pricingCurrency": "USD",
"pcToBCExchangeRate": 1,
"pcToBCExchangeRateDate": "0001-01-01T00:00:00",
"billableQuantity": 1,
"meterDescription": "",
"billingFrequency": "Monthly",
"reservationOrderId": "e770c049-89c7-4ec1-b366-123456789000",
"invoiceLineItemType": "billing_line_items",
"billingProvider": "one_time" ,
"attributes": {
"objectType": "OneTimeInvoiceLineItem"
}
}
],
"links": {
"self": {
"uri": "/invoices/G000773581/lineitems?provider=OneTime&nvoicelineitemtype=BillingLineItems&size=2",
"method": "GET",
"headers": []
},
"next": {
"uri": "/invoices/G000773581/lineitems?provider=OneTime&nvoicelineitemtype=BillingLineItems&size=2?seekOperation=Next",
"method": "GET",
"headers": [
{
"key": "MS-ContinuationToken",
"value": "d19617b8-fbe5-4684-a5d8-0230972fb0cf,0705c4a9-39f7-4261-ba6d-53e24a9ce47d_a4ayc/80/OGda4BO/1o/V0etpOqiLx1JwB5S3beHW0s=,0d81c700-98b4-4b13-9129-ffd5620f72e7"
}
]
}
},
"attributes": {
"objectType": "Collection"
}
}
请求-响应示例 5
在以下示例中,使用继续标记进行分页。 详细信息如下所示:
- BillingProvider: OneTime
- InvoiceLineItemType: BillingLineItems
- SeekOperation: 下一步
请求示例 5
GET https://api.partnercenter.microsoft.com/v1/invoices/G000024135/lineitems/OneTime/BillingLineItems?seekOperation=Next HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-ContinuationToken: d19617b8-fbe5-4684-a5d8-0230972fb0cf,0705c4a9-39f7-4261-ba6d-53e24a9ce47d_a4ayc/80/OGda4BO/1o/V0etpOqiLx1JwB5S3beHW0s=,0d81c700-98b4-4b13-9129-ffd5620f72e7
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Host: api.partnercenter.microsoft.com
响应示例 5
HTTP/1.1 200 OK
Content-Length: 2484
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CV: bpqyomePDUqrSSYC.0
MS-ServerId: 202010406
Date: Thu, 07 Sep 2017 23:31:09 GMT
{
"totalCount": 2,
"items": [
{
"partnerId": "934f3416-bc2f-47f3-b492-77e517d4e572",
"customerId": "c139c4bf-2e8b-4ab5-8bed-d9f50dcca7a2",
"customerName": "Test_Test_Office R2 Reduce Seats Validation",
"customerDomainName": "testcustomerr2t2reduce.onmicrosoft.com",
"customerCountry": "US",
"invoiceNumber": "G000773581",
"mpnId": "5357564",
"resellerMpnId": "4649221",
"orderId": "94e858b6d855",
"orderDate": "2021-05-20T18:30:06.6045692Z",
"productId": "CFQ7TTC0LH0R",
"skuId": "0002",
"availabilityId": "CFQ7TTC0K5RQ",
"productName": "Microsoft 365 Phone System - Virtual User",
"skuName": "Microsoft 365 Phone System - Virtual User",
"productQualifiers": [
"AddOn",
"Trial"
],
"chargeType": "new",
"unitPrice": "0",
"effectiveUnitPrice": "0",
"unitType": "",
"quantity": "25",
"subtotal": "0",
"taxTotal": "0",
"totalForCustomer": "0",
"currency": "USD",
"publisherName": "Microsoft Corporation",
"publisherId": "",
"subscriptionDescription": "",
"subscriptionId": "dddd3d3d-ee4e-ff5f-aa6a-bbbbbb7b7b7b",
"subscriptionStartDate": "2021-05-20T00:00:00Z",
"subscriptionEndDate": "2021-06-19T00:00:00Z",
"chargeStartDate": "2021-05-20T00:00:00Z",
"chargeEndDate": "2021-06-19T00:00:00Z",
"termAndBillingCycle": "One-Month commitment for trial",
"alternateId": "94e858b6d855",
"referenceId": "0cf1202a-5b7d-4219-966e-93c637113708",
"priceAdjustmentDescription": "",
"discountDetails": "",
"pricingCurrency": "USD",
"pcToBCExchangeRate": "1",
"pcToBCExchangeRateDate": "2021-05-01T00:00:00",
"billableQuantity": "25",
"meterDescription": "",
"billingFrequency": "",
"reservationOrderId": "99f246cf-ed96-41b4-b0cd-0aa43eb1fe91",
"invoiceLineItemType": "billing_line_items",
"billingProvider": "one_time",
"promotionId": "",
"attributes": {
"objectType": "OneTimeInvoiceLineItem"
}
},
{
"partnerId": "934f3416-bc2f-47f3-b492-77e517d4e572",
"customerId": "835a59a7-3172-47b5-bdef-d9cc65f4d0e4",
"customerName": "TEST_TEST Test Promotions 01",
"customerDomainName": "kyletestpromos01.onmicrosoft.com",
"customerCountry": "US",
"invoiceNumber": "G000773581",
"mpnId": "5357564",
"resellerMpnId": "0",
"orderId": "5f9d52bb1408",
"orderDate": "2021-05-20T18:48:30.6168285Z",
"productId": "CFQ7TTC0HL8W",
"skuId": "0001",
"availabilityId": "CFQ7TTC0K59S",
"productName": "Power BI Premium Per User",
"skuName": "Power BI Premium Per User",
"productQualifiers": [],
"chargeType": "new",
"unitPrice": "16",
"effectiveUnitPrice": "14.4",
"unitType": "",
"quantity": "50",
"subtotal": "720",
"taxTotal": "73",
"totalForCustomer": "793",
"currency": "USD",
"publisherName": "Microsoft Corporation",
"publisherId": "",
"subscriptionDescription": "",
"subscriptionId": "eeee4efe-ff5f-aa6a-bb7b-cccccc8c8c8c",
"subscriptionStartDate": "2021-05-20T00:00:00Z",
"subscriptionEndDate": "2022-05-19T00:00:00Z",
"chargeStartDate": "2021-05-20T00:00:00Z",
"chargeEndDate": "2021-06-19T00:00:00Z",
"termAndBillingCycle": "One-Year commitment for monthly/yearly billing",
"alternateId": "5f9d52bb1408",
"referenceId": "28b535e0-68f4-40b5-84f7-8ed9241eb149",
"priceAdjustmentDescription": "[\"Price for given billing period\",\"You are getting a discount due to a pre-determined override.\",\"You are getting a discount for being a partner.\",\"You are getting a price guarantee for your price.\",\"Price for given term\"]",
"discountDetails": "",
"pricingCurrency": "USD",
"pcToBCExchangeRate": "1",
"pcToBCExchangeRateDate": "2021-05-01T00:00:00",
"billableQuantity": "50",
"meterDescription": "",
"billingFrequency": "Monthly",
"reservationOrderId": "8fdebb4a-7110-496e-9570-623e4c992797",
"invoiceLineItemType": "billing_line_items",
"billingProvider": "one_time",
"promotionId": "39NFJQT1X27N:0002:39NFJQT1Q5KL",
"attributes/objectType": "OneTimeInvoiceLineItem",
"attributes": {
"objectType": "OneTimeInvoiceLineItem"
}
},
{
"partnerId": "934f3416-bc2f-47f3-b492-77e517d4e572",
"customerId": "c139c4bf-2e8b-4ab5-8bed-d9f50dcca7a2",
"customerName": "Test_Test_Office R2 Reduce Seats Validation",
"customerDomainName": "testcustomerr2t2reduce.onmicrosoft.com",
"customerCountry": "US",
"invoiceNumber": "T000773581",
"mpnId": "1234567",
"resellerMpnId": 0,
"orderId": "HJVtMZMkgQ2miuCiNv0RSr51zQDans0m1",
"orderDate": "2019-02-04T17:59:52.9460102Z",
"productId": "DZH318Z0BXWC",
"skuId": "0002",
"availabilityId": "DZH318Z0BP8B",
"productName": "Test WAF-as-a-Service",
"skuName": "Test WaaS - Medium Plan",
"chargeType": "New",
"unitPrice": 820,
"effectiveUnitPrice": 820,
"unitType": "",
"quantity": 1,
"subtotal": 820,
"taxTotal": 0,
"totalForCustomer": 0,
"currency": "USD",
"publisherName": "Test Networks, Inc.",
"publisherId": "21223810",
"subscriptionDescription": "",
"subscriptionId": "ffff5f5f-aa6a-bb7b-cc8c-dddddd9d9d9d",
"subscriptionStartDate": "2019-02-01T00:00:00Z",
"subscriptionEndDate": "2020-01-31T00:00:00Z",
"chargeStartDate": "2019-02-04T09:22:40.1767993-08:00",
"chargeEndDate": "2019-03-03T09:22:40.1767993-08:00",
"termAndBillingCycle": "1 Year Subscription",
"alternateId": "123456ad566",
"priceAdjustmentDescription": "[\"15.0% Partner earned credit for services managed\"]",
"discountDetails": "",
"pricingCurrency": "USD",
"pcToBCExchangeRate": 1,
"pcToBCExchangeRateDate": "2019-08-01T00:00:00Z",
"billableQuantity": 3.1618,
"meterDescription": "Bandwidth - Data Transfer In (GB) - Zone 2",
"reservationOrderId": "883d475b-0000-1234-0000-8818752f1234",
"attributes": {
"objectType": "OneTimeInvoiceLineItem"
}
},
{
"partnerId": "6480d686-cfb4-424d-a945-6b9b9f4badc2",
"customerId": "org:9060d13d-c5ed-482e-b059-a15a38cbb28e",
"customerName": "recipientCustomerName",
"customerDomainName": "recipientCustomerDomain",
"customerCountry": "US",
"invoiceNumber": "1234000000",
"mpnId": "4870137",
"resellerMpnId": 0,
"orderId": "VdqkP11Bu4DlcjP5rLeQabcdefg-1234",
"orderDate": "2021-01-29T19:50:13.9869095Z",
"productId": "CFQ7TTC01234",
"skuId": "0001",
"availabilityId": "CFQ7TTC0ABCD",
"productName": "Office 365 E3",
"skuName": "Office 365 E3",
"chargeType": "new",
"unitPrice": 16,
"effectiveUnitPrice": 16,
"unitType": "",
"quantity": 1,
"subtotal": 16,
"taxTotal": 1.61,
"totalForCustomer": 17.61,
"currency": "USD",
"publisherName": "Microsoft Corporation",
"publisherId": "",
"subscriptionDescription": "",
"subscriptionId": "aaaa6a6a-bb7b-cc8c-dd9d-eeeeee0e0e0e",
"chargeStartDate": "2021-01-29T00:00:00Z",
"chargeEndDate": "2021-02-27T00:00:00Z",
"termAndBillingCycle": "One-Year commitment for monthly/yearly billing",
"priceAdjustmentDescription": "[\"1 month billing/",\"You are getting a discount for being a partner.\",\"You are getting a price guarantee for your price.\",\"Yearly Duration\"]",
"discountDetails": "",
"pricingCurrency": "USD",
"pcToBCExchangeRate": 1,
"pcToBCExchangeRateDate": "0001-01-01T00:00:00",
"billableQuantity": 1,
"meterDescription": "",
"billingFrequency": "Monthly",
"reservationOrderId": "e770c049-89c7-4ec1-b366-123456789000",
"invoiceLineItemType": "billing_line_items",
"billingProvider": "one_time" ,
"attributes": {
"objectType": "OneTimeInvoiceLineItem"
}
}
],
"links": {
"self": {
"uri": "/invoices/G000773581/lineitems?provider=OneTime&nvoicelineitemtype=BillingLineItems&size=2",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "Collection"
}
}