Számla összegzéseinek lekérése
A következőre vonatkozik: Partnerközpont | A 21Vianet által üzemeltetett Partnerközpont | Partnerközpont Microsoft Cloud for US Government
Az InvoiceSummaries paranccsel lekérheti az ismétlődő és az egyszeri díjak egyenlegét és teljes díjait megjelenítő számlaösszeget. A InvoiceSummaries erőforrás minden pénznemtípushoz tartalmaz egy számlaösszegzést.
Előfeltételek
Hitelesítő adatok a Partnerközpont hitelesítésében leírtak szerint. Ez a forgatókönyv csak az App+User hitelesítő adatokkal való hitelesítést támogatja.
Érvényes számlaazonosító.
C#
Egy InvoiceSummaries gyűjtemény lekérése, amely minden pénznemtípushoz tartalmaz Egy InvoiceSummary értéket:
Az IAggregatePartner.Invoices gyűjtemény használatával hívja meg az Summaries tulajdonságot .
Hívja meg a Get() metódust.
Az egyes InvoiceSummary egyenlegének lekéréséhez lépjen a gyűjtemény adott tagjához tartozó BalanceAmount tulajdonsághoz.
// IAggregatePartner scopedPartnerOperations;
// Get the invoice summaries collection.
var invoiceSummaries = scopedPartnerOperations.Invoices.Summaries.Get();
// Display the balance on the first invoice summary in the collection.
Console.Out.WriteLine("Current Account Balance: {0:C}", invoiceSummaries[0].BalanceAmount);
További információt a következő példakódban talál:
- Minta: Konzolteszt alkalmazás
- Projekt: PartnerSDK.FeatureSample
- Osztály: GetInvoiceSummaries.cs
REST-kérelem
Kérés szintaxisa
Metódus | Kérés URI-ja |
---|---|
GET | {baseURL}/v1/invoices/summaries HTTP/1.1 |
URI-paraméter
Nincsenek.
Kérésfejlécek
További információ: Partnerközpont REST-fejlécei.
A kérés törzse
Nincsenek.
Példa kérésre
GET https://api.partnercenter.microsoft.com/v1/invoices/summaries HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: a45e6643-1caf-4429-8f90-07c03d85bc2b
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
Connection: Keep-Alive
REST-válasz
Ha sikerült, ez a metódus egy InvoiceSummaries erőforrást ad vissza a válasz törzsében.
Sikeres válasz és hibakódok
Minden válaszhoz tartozik egy HTTP-állapotkód, amely jelzi a sikert vagy a hibát, valamint további hibakeresési információkat. Használja a hálózati nyomkövetési eszközt a kód, a hibatípus és a további paraméterek olvasásához. A teljes listát lásd: Hibakódok.
Példa válaszra
HTTP/1.1 200 OK
Content-Length: 256
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: a45e6643-1caf-4429-8f90-07c03d85bc2b
Date: Thu, 24 Mar 2016 05:21:01 GMT
{
"totalCount": 3,
"items": [
{
"balanceAmount": 751094.39,
"currencyCode": "GBP",
"currencySymbol": "£",
"accountingDate": "2018-03-16T00:00:00",
"firstInvoiceCreationDate": "2017-01-21T00:00:00Z",
"lastPaymentDate": "2017-01-01T12:00:00Z",
"lastPaymentAmount": 1000,
"latestInvoiceDate": "2018-03-16T00:00:00",
"details": [
{
"invoiceType": "Recurring",
"summary": {
"balanceAmount": 202955.87,
"currencyCode": "GBP",
"currencySymbol": "£",
"accountingDate": "2017-02-27T00:00:00Z",
"firstInvoiceCreationDate": "2017-01-21T00:00:00Z",
"lastPaymentDate": "2017-01-01T12:00:00Z",
"lastPaymentAmount": 1000,
"latestInvoiceDate": "0001-01-01T00:00:00",
"attributes": {
"objectType": "InvoiceSummary"
}
}
},
{
"invoiceType": "OneTime",
"summary": {
"balanceAmount": 548138.52,
"currencyCode": "GBP",
"currencySymbol": "£",
"accountingDate": "2018-03-16T00:00:00",
"firstInvoiceCreationDate": "2018-03-16T00:00:00",
"lastPaymentDate": "0001-01-01T00:00:00",
"lastPaymentAmount": 0,
"latestInvoiceDate": "2018-03-16T00:00:00",
"attributes": {
"objectType": "InvoiceSummary"
}
}
}
],
"links": {
"self": {
"uri": "/invoices/summary",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "InvoiceSummary"
}
},
{
"balanceAmount": 1230.33,
"currencyCode": "CHF",
"currencySymbol": "CHF",
"accountingDate": "2018-03-16T00:00:00",
"firstInvoiceCreationDate": "2018-03-16T00:00:00",
"lastPaymentDate": "0001-01-01T00:00:00",
"lastPaymentAmount": 0,
"latestInvoiceDate": "2018-03-16T00:00:00",
"details": [
{
"invoiceType": "OneTime",
"summary": {
"balanceAmount": 1230.33,
"currencyCode": "CHF",
"currencySymbol": "CHF",
"accountingDate": "2018-03-16T00:00:00",
"firstInvoiceCreationDate": "2018-03-16T00:00:00",
"lastPaymentDate": "0001-01-01T00:00:00",
"lastPaymentAmount": 0,
"latestInvoiceDate": "2018-03-16T00:00:00",
"attributes": {
"objectType": "InvoiceSummary"
}
}
}
],
"links": {
"self": {
"uri": "/invoices/summary",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "InvoiceSummary"
}
},
{
"balanceAmount": 1001.12,
"currencyCode": "EUR",
"currencySymbol": "€",
"accountingDate": "2018-03-16T00:00:00",
"firstInvoiceCreationDate": "2018-03-16T00:00:00",
"lastPaymentDate": "0001-01-01T00:00:00",
"lastPaymentAmount": 0,
"latestInvoiceDate": "2018-03-16T00:00:00",
"details": [
{
"invoiceType": "OneTime",
"summary": {
"balanceAmount": 1001.12,
"currencyCode": "EUR",
"currencySymbol": "€",
"accountingDate": "2018-03-16T00:00:00",
"firstInvoiceCreationDate": "2018-03-16T00:00:00",
"lastPaymentDate": "0001-01-01T00:00:00",
"lastPaymentAmount": 0,
"latestInvoiceDate": "2018-03-16T00:00:00",
"attributes": {
"objectType": "InvoiceSummary"
}
}
}
],
"links": {
"self": {
"uri": "/invoices/summary",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "InvoiceSummary"
}
}
],
"links": {
"self": {
"uri": "/invoices/summaries",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "Collection"
}
}