public void ProductsQuantityUpdated() { var service = this.BigCommerceFactory.CreateProductsService( this.Config ); var productToUpdate = new BigCommerceProduct { Id = 74, Quantity = "1" }; service.UpdateProducts( new List< BigCommerceProduct > { productToUpdate } ); }
public async Task ProductsQuantityUpdatedAsync() { var service = this.BigCommerceFactory.CreateProductsService( this.Config ); var productToUpdate = new BigCommerceProduct { Id = 74, Quantity = "6" }; await service.UpdateProductsAsync( new List< BigCommerceProduct > { productToUpdate } ); }
private async Task UpdateProductQuantityAsync( BigCommerceProduct product ) { var endpoint = ParamsBuilder.CreateProductUpdateEndpoint( product.Id ); var jsonContent = new { inventory_level = product.Quantity }.ToJson(); await ActionPolicies.SubmitAsync.Do( async () => { await this._webRequestServices.PutDataAsync( BigCommerceCommand.UpdateProduct, endpoint, jsonContent ); //API requirement this.CreateApiDelay().Wait(); } ); }