UpdateInvoice

Description

This method is used to update an existing invoice.

Syntax

InvoiceResponse UpdateInvoice(SecurityToken securityToken, Invoice invoice, string customerId, string subCustomerId, string invoiceNumber, string invoiceInternalId)

Arguments

TypeNameDescription
SecurityToken securityTokenMerchant security token: used to identify merchant and validate transaction. (required)
Invoice invoiceIncludes invoice information, such as invoice number, invoice date, and items. (required)
stringcustomerIdCustomer ID. (required)
stringsubCustomerIdSub-customer ID. (optional)
stringinvoiceNumberInvoice number. (required)
stringinvoiceInternalIdUnique invoice ID assigned by EBizCharge. (required)

Return Value

TypeDescription
InvoiceResponse Returns result of UpdateInvoice request.

Examples

function updateInvoice()
{
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '********-454757-4567457-********',
'UserId' => 'merchant1',
'Password' => 'merchant1'
);
$invoiceDetails = array(
'CustomerId' => 1,
'InvoiceNumber' => '123',
'InvoiceDate' => '05/13/2020',
'Currency' => 'USD',
'InvoiceAmount' => '200',
'InvoiceDueDate' => '05/13/2020',
'AmountDue' => '200',
'PoNum' => 'Po001',
'SoNum' => '',
'TotalTaxAmount' => 0,
'InvoiceUniqueId' => '11',
'InvoiceDescription' => 'testing',
'NotifyCustomer' => 'false',
'Software' => 'Woocommerce'
);
$updateInvoice = array(
'securityToken' => $securityToken,
'invoice' => $invoiceDetails,
'invoiceNumber' => '123',
'customerId' => 1
);
$updateInvoiceResponse = $client->UpdateInvoice($updateInvoice);
$updateInvoiceResult = $obj = $updateInvoiceResponse->UpdateInvoiceResult;
}
Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header />
   <soapenv:Body>
      <ebiz:UpdateInvoice>
         <ebiz:securityToken>
            <ebiz:SecurityId>********-794B-4CEE-B4DF-********</ebiz:SecurityId>
            <ebiz:UserId>businesscentral1</ebiz:UserId>
            <ebiz:Password>businesscentral1</ebiz:Password>
         </ebiz:securityToken>
         <ebiz:invoice>
            <ebiz:MerchantId />
            <ebiz:CustomerId>20000</ebiz:CustomerId>
            <ebiz:SubCustomerId />
            <ebiz:InvoiceNumber>PS-INV103195</ebiz:InvoiceNumber>
            <ebiz:InvoiceInternalId />
            <ebiz:InvoiceDate>2021-03-30</ebiz:InvoiceDate>
            <ebiz:Currency />
            <ebiz:InvoiceAmount>1012.2</ebiz:InvoiceAmount>
            <ebiz:InvoiceDueDate>2021-04-13</ebiz:InvoiceDueDate>
            <ebiz:AmountDue>1012.2</ebiz:AmountDue>
            <ebiz:Items>
               <ebiz:Item>
                  <ebiz:ItemId>1900-S</ebiz:ItemId>
                  <ebiz:Name>PARIS Guest Chair, black</ebiz:Name>
                  <ebiz:Description>PARIS Guest Chair, black</ebiz:Description>
                  <ebiz:UnitPrice>192.80</ebiz:UnitPrice>
                  <ebiz:Qty>5</ebiz:Qty>
                  <ebiz:Taxable>1</ebiz:Taxable>
                  <ebiz:TaxRate>5</ebiz:TaxRate>
                  <ebiz:UnitOfMeasure>Piece</ebiz:UnitOfMeasure>
                  <ebiz:TotalLineAmount>964.00</ebiz:TotalLineAmount>
                  <ebiz:TotalLineTax>48.2</ebiz:TotalLineTax>
                  <ebiz:ItemLineNumber>10000</ebiz:ItemLineNumber>
               </ebiz:Item>
            </ebiz:Items>
            <ebiz:NotifyCustomer>0</ebiz:NotifyCustomer>
            <ebiz:PoNum />
            <ebiz:InvoiceUniqueId />
            <ebiz:InvoiceURL />
            <ebiz:TotalTaxAmount>48.2</ebiz:TotalTaxAmount>
            <ebiz:InvoiceSalesRepId />
            <ebiz:InvoiceIsToBeEmailed>0</ebiz:InvoiceIsToBeEmailed>
            <ebiz:TotalDiscountAmount>0</ebiz:TotalDiscountAmount>
            <ebiz:InvoiceIsToBePrinted>0</ebiz:InvoiceIsToBePrinted>
            <ebiz:InvoiceLastSyncDateTime />
         </ebiz:invoice>
         <ebiz:customerId>20000</ebiz:customerId>
         <ebiz:subCustomerId />
         <ebiz:invoiceNumber>PS-INV103195</ebiz:invoiceNumber>
         <ebiz:invoiceInternalId>********-14A1-4AF7-9D8E-350FB1EE6308</ebiz:invoiceInternalId>
         <ebiz:InvoiceDescription />
         <ebiz:BillingAddress>
            <ebiz:FirstName>Trey</ebiz:FirstName>
            <ebiz:LastName>Research</ebiz:LastName>
            <ebiz:CompanyName>Trey Research</ebiz:CompanyName>
            <ebiz:Address1>153 Thomas Drive</ebiz:Address1>
            <ebiz:Address2 />
            <ebiz:City>Chicago</ebiz:City>
            <ebiz:State>IL</ebiz:State>
            <ebiz:ZipCode>61236</ebiz:ZipCode>
            <ebiz:Country>US</ebiz:Country>
            <ebiz:IsDefault>0</ebiz:IsDefault>
            <ebiz:AddressId>Billing</ebiz:AddressId>
         </ebiz:BillingAddress>
         <ebiz:ShippingAddress>
            <ebiz:FirstName>Trey</ebiz:FirstName>
            <ebiz:LastName>Research</ebiz:LastName>
            <ebiz:CompanyName>Trey Research</ebiz:CompanyName>
            <ebiz:Address1>153 Thomas Drive</ebiz:Address1>
            <ebiz:Address2 />
            <ebiz:City>Chicago</ebiz:City>
            <ebiz:State>IL</ebiz:State>
            <ebiz:ZipCode>61236</ebiz:ZipCode>
            <ebiz:Country>US</ebiz:Country>
            <ebiz:IsDefault>0</ebiz:IsDefault>
            <ebiz:AddressId>Shipping</ebiz:AddressId>
         </ebiz:ShippingAddress>
         <ebiz:InvoiceCustomFields>
            <ebiz:EbizCustomField>
               <ebiz:FieldId>Invoice Discount</ebiz:FieldId>
               <ebiz:FieldCaption>Invoice Discount Value</ebiz:FieldCaption>
               <ebiz:FieldName>Discount Value</ebiz:FieldName>
               <ebiz:FieldValue>0</ebiz:FieldValue>
               <ebiz:FieldDescription>Invoice Discount</ebiz:FieldDescription>
            </ebiz:EbizCustomField>
         </ebiz:InvoiceCustomFields>
      </ebiz:UpdateInvoice>
   </soapenv:Body>
</soapenv:Envelope>

Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <UpdateInvoiceResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <UpdateInvoiceResult>
            <InvoiceInternalId>*******-14a1-4af7-9d8e-350fb1ee6308</InvoiceInternalId>
            <Status>Success</Status>
            <StatusCode>1</StatusCode>
            <Error/>
            <ErrorCode>0</ErrorCode>
         </UpdateInvoiceResult>
      </UpdateInvoiceResponse>
   </s:Body>
</s:Envelope>
var client = new IeBizServiceClient();
SecurityToken securityToken = new SecurityToken();

securityToken.UserId = "";
securityToken.SecurityId = "********-90b4-4a38-ad78-********";
securityToken.Password = "";

 Invoice invoice = new Invoice();
 invoice.CustomerId = "C-E&000002"; 
 invoice.InvoiceNumber = "00102565";
 invoice.InvoiceDate = "04/02/2016";
 invoice.InvoiceDueDate = "08/12/2016";
 invoice.InvoiceAmount = (decimal)2000.45;
 invoice.AmountDue = (decimal)200.45;
 invoice.DivisionId = "001";
 InvoiceResponse Response = client.UpdateInvoice(securityToken, invoice, "C-E&000002", "10001-1", "INV001", "");

Console.WriteLine(Response.Status);
Console.WriteLine(Response.StatusCode);
Console.WriteLine(Response.Error);
Console.WriteLine(Response.ErrorCode);