private static void TestInventoryAdjustments(int goodsOwnerId, InventoryAdjustmentsClient inventoryAdjustmentsClient) { Console.WriteLine("Running inventory adjustment examples..."); Console.WriteLine(""); // If the warehouse makes a mistake and needs to correct it (e.g. an item is dropped and needs to be scrapped), // the resulting transaction is called an "inventory transaction". // You can query for all transactions made during a certain period: var from = new DateTimeOffset(new DateTime(2019, 11, 1, 11, 0, 0)); var to = new DateTimeOffset(new DateTime(2019, 11, 1, 12, 0, 0)); var getInventoryAdjustments = inventoryAdjustmentsClient.GetAll(goodsOwnerId, from, to); }
static void Main(string[] args) { // Ongoing WMS is a Warehouse Management System based in Sweden. // This file demonstrates one way of integrating with the WMS' REST API. // For more information, please see: // https://developer.ongoingwarehouse.com/REST/v1/index.html // https://www.ongoingwarehouse.com/ // These are the credentials and other information which are required to connect to the API. // Ask the warehouse to generate them for you - https://docs.ongoingwarehouse.com/Manuals/API-Access var userName = "******"; var password = "******"; var baseUrl = "https://api.ongoingsystems.se/apidemo/"; var goodsOwnerId = 162; // Set up all the client objects. var client = new System.Net.Http.HttpClient(); client.DefaultRequestHeaders.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes($"{userName}:{password}"))); var articlesClient = new ArticlesClient(client) { BaseUrl = baseUrl }; var ordersClient = new OrdersClient(client) { BaseUrl = baseUrl }; var purchaseOrderClient = new PurchaseOrdersClient(client) { BaseUrl = baseUrl }; var inventoryAdjustmentsClient = new InventoryAdjustmentsClient(client) { BaseUrl = baseUrl }; var transporterContractsClient = new TransporterContractsClient(client) { BaseUrl = baseUrl }; // Run the tests. TestArticles(goodsOwnerId, articlesClient); TestOrders(goodsOwnerId, ordersClient); TestPurchaseOrders(goodsOwnerId, purchaseOrderClient); TestInventoryAdjustments(goodsOwnerId, inventoryAdjustmentsClient); TestTransporterContracts(goodsOwnerId, transporterContractsClient); Console.WriteLine("Press Enter to exit."); Console.Read(); }