public void ProductOptionsQuantityUpdated() { var service = this.BigCommerceFactory.CreateProductsService( this.Config ); var productToUpdate = new BigCommerceProductOption { ProductId = 74, Id = 4, Quantity = "6" }; service.UpdateProductOptions( new List< BigCommerceProductOption > { productToUpdate } ); }
public async Task ProductOptionsQuantityUpdatedAsync() { var service = this.BigCommerceFactory.CreateProductsService( this.Config ); var productToUpdate = new BigCommerceProductOption { ProductId = 75, Id = 4, Quantity = "6" }; await service.UpdateProductOptionsAsync( new List< BigCommerceProductOption > { productToUpdate } ); }
private async Task UpdateProductOptionQuantityAsync( BigCommerceProductOption productOption ) { var endpoint = ParamsBuilder.CreateProductOptionUpdateEndpoint( productOption.ProductId, productOption.Id ); var jsonContent = new { inventory_level = productOption.Quantity }.ToJson(); await ActionPolicies.SubmitAsync.Do( async () => { await this._webRequestServices.PutDataAsync( BigCommerceCommand.UpdateProduct, endpoint, jsonContent ); //API requirement this.CreateApiDelay().Wait(); } ); }