Koppelingen voor factuurramingen ophalen
Van toepassing op: Partnercentrum | Partnercentrum beheerd door 21Vianet | Partnercentrum voor Microsoft Cloud voor de Amerikaanse overheid
U kunt schattingskoppelingen krijgen om details op te vragen voor niet-gefactureerde afstemmingsregelitems.
Vereisten
Referenties zoals beschreven in verificatie in partnercentrum. Dit scenario ondersteunt verificatie met zowel zelfstandige app- als app+gebruikersreferenties.
Een factuur-id. Hiermee wordt de factuur geïdentificeerd waarvoor de regelitems moeten worden opgehaald.
C#
In de volgende voorbeeldcode ziet u hoe u de schattingskoppelingen kunt ophalen om niet-gefactureerde regelitems voor een bepaalde valuta op te vragen. Het antwoord bevat de schattingskoppelingen voor elke periode (bijvoorbeeld de huidige en vorige maand).
// IAggregatePartner partnerOperations;
// string curencyCode;
// all the operations executed on this partner operation instance will share the same correlation Id but will differ in request Id
IPartner scopedPartnerOperations = partnerOperations.With(RequestContextFactory.Instance.Create(Guid.NewGuid()));
// read estimate links for currencycode
var estimateLinks = scopedPartnerOperations.Invoices.Estimates.Links.ByCurrency(curencyCode).Get();
Zie het volgende voor een vergelijkbaar voorbeeld:
- Voorbeeld: Consoletest-app
- Project: Voorbeelden van partnercentrum-SDK
- Klasse: GetEstimatesLinks.cs
REST-aanvraag
Aanvraagsyntaxis
Methode | Aanvraag-URI |
---|---|
GET | {baseURL}/v1/invoices/estimates/links?currencycode={currencycode} HTTP/1.1 |
URI-parameters
Gebruik de volgende URI en queryparameter bij het maken van de aanvraag.
Naam | Type | Vereist | Beschrijving |
---|---|---|---|
currencyCode | tekenreeks | Ja | De valutacode voor de niet-gefactureerde regelitems. |
Aanvraagheaders
Zie Rest-headers in Partnercentrum voor meer informatie.
Aanvraagtekst
Geen.
Aanvraagvoorbeeld
GET https://api.partnercenter.microsoft.com/v1/invoices/estimates/links?currencycode=usd HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 1234ecb8-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
Belangrijk
Vanaf juni 2023 wordt de nieuwste Versie van Partner Center .NET SDK 3.4.0 gearchiveerd. U kunt de SDK-release downloaden van GitHub, samen met een leesmij-bestand dat nuttige informatie bevat.
Partners worden aangemoedigd om de REST API's van partnercentrum te blijven gebruiken.
REST-antwoord
Als dit lukt, bevat het antwoord de koppelingen om niet-gefactureerde schattingen op te halen.
Geslaagde antwoorden en foutcodes
Elk antwoord wordt geleverd met een HTTP-statuscode die aangeeft dat de fout is geslaagd of mislukt en aanvullende informatie over foutopsporing. Gebruik een hulpprogramma voor netwerktracering om deze code, het fouttype en aanvullende parameters te lezen. Zie rest-foutcodes in Partnercentrum voor de volledige lijst.
Responsvoorbeeld
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/10.0
MS-CorrelationId: bbbb1111-cc22-3333-44dd-555555eeeeee
MS-RequestId: 1b18689e-3fe3-4fdb-d09e-39d13941390b
X-Locale: en-US
X-SourceFiles: =?UTF-8?B?RDpcU291cmNlc1xSUEUuUGFydG5lci5TZXJ2aWNlLkJpbGxpbmdTZXJ2aWNlXHYxLjFcV2ViQXBpc1xCaWxsaW5nU2VydmljZS5WMi5XZWJcdjFcaW52b2ljZXNcZXN0aW1hdGVzXGxpbmtz?=
X-Powered-By: ASP.NET
Date: Thu, 14 Mar 2019 18:15:06 GMT
Content-Length: 1857
{
"totalCount": 4,
"items": [
{
"type": "daily_rated_usage",
"title": "Daily rated usage unbilled",
"description": "This invoice line items includes unbilled consumption based data only.",
"period": "Current",
"link": {
"uri": "/invoices/unbilled/lineitems?provider=Marketplace&invoicelineitemtype=UsageLineItems¤cycode=USD&period=current&size=2000",
"method": "GET",
"headers": []
}
},
{
"type": "daily_rated_usage",
"title": "Daily rated usage unbilled",
"description": "This invoice line items includes unbilled consumption based data only.",
"period": "Previous",
"link": {
"uri": "/invoices/unbilled/lineitems?provider=Marketplace&invoicelineitemtype=UsageLineItems¤cycode=USD&period=previous&size=2000",
"method": "GET",
"headers": []
}
},
{
"type": "non_consumption",
"title": "Unbilled reconciliation line items",
"description": "This includes reconciliation line items for unbilled data only.",
"period": "Current",
"link": {
"uri": "/invoices/unbilled/lineitems?provider=all&invoicelineitemtype=billinglineitems¤cycode=USD&period=current&size=2000",
"method": "GET",
"headers": []
}
},
{
"type": "non_consumption",
"title": "Unbilled reconciliation line items",
"description": "This includes reconciliation line items for unbilled data only.",
"period": "Previous",
"link": {
"uri": "/invoices/unbilled/lineitems?provider=all&invoicelineitemtype=billinglineitems¤cycode=USD&period=previous&size=2000",
"method": "GET",
"headers": []
}
}
],
"attributes": {
"objectType": "Collection"
}
}