public static Invoice Update(APIContext apiContext, Invoice invoice, bool notifyMerchant = true)
{
// Validate the arguments to be used in the request
ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
ArgumentValidator.Validate(invoice, "invoice");
var queryParameters = new QueryParameters();
queryParameters["notify_merchant"] = notifyMerchant.ToString();
// Configure and send the request
var pattern = "v1/invoicing/invoices/{0}";
var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { invoice.id }) + queryParameters.ToUrlFormattedString();
return PayPalResource.ConfigureAndExecute<Invoice>(apiContext, HttpMethod.PUT, resourcePath, invoice.ConvertToJson());
}