-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReportingSample.cs
More file actions
29 lines (23 loc) · 1.14 KB
/
ReportingSample.cs
File metadata and controls
29 lines (23 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using CSharpAmazonBusinessAPI;
using CSharpAmazonBusinessAPI.Model.Reporting;
namespace CSharpAmazonBusinessAPI.SampleCode;
// Reporting v2025-06-09. `country` defaults to the connection's marketplace.
public class ReportingSample
{
private readonly AmazonBusinessConnection _connection;
public ReportingSample(AmazonBusinessConnection connection)
{
_connection = connection;
}
public Task<GetOrderReportsResponse> GetOrderReportsLast7DaysAsync() =>
_connection.Reporting.GetOrderReportsAsync(
orderStartDate: DateTimeOffset.UtcNow.AddDays(-7),
orderEndDate: DateTimeOffset.UtcNow);
public Task<GetShipmentReportsResponse> GetShipmentReportsAsync(IEnumerable<string> orderIds) =>
_connection.Reporting.GetShipmentReportsAsync(
orderStartDate: DateTimeOffset.UtcNow.AddDays(-30),
orderEndDate: DateTimeOffset.UtcNow,
orderIds: orderIds);
public Task<GetOrderReportsByPurchaseOrderNumberResponse> GetByPurchaseOrderAsync(string poNumber) =>
_connection.Reporting.GetOrderReportsByPurchaseOrderNumberAsync(purchaseOrderNumber: poNumber);
}