UpdateInvoice

Description

The UpdateInvoice method updates an existing Invoice on the EBizCharge platform.

Syntax

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

Arguments

TypeNameReq.Description
SecurityTokensecurityTokenRA unique token that is used to identify a merchant and authenticate the API request.
InvoiceinvoiceR

The invoice to update.

Warning: Omitting a field might clear its value.

Required Fields
  • InvoiceAmount
  • AmountDue
  • NotifyCustomer
  • TotalTaxAmount
  • InvoiceIsToBeEmailed
  • InvoiceIsToBePrinted
  • TotalDiscountAmount
  • TotalShippingAmount

If using the objects below, the following fields are required. Unused obects must be removed from the request.

Item:

  • UnitPrice
  • Qty
  • Taxable
  • TaxRate
  • TotalLineAmount
  • TotalLineTax
  • ItemLineNumber
  • GrossPrice
  • WarrantyDiscount
  • SalesDiscount

Address:

  • IsDefault
Recommended Fields
  • CustomerId
  • InvoiceNumber
  • InvoiceDate - Defaults to 1900-01-01
  • InvoiceDueDate - Defaults to 1900-01-01
  • InvoiceShipDate- Defaults to 1/1/1900 12:00:00 AM
  • PoDate - Defaults to 1900-01-01
stringcustomerIdD

Identifies the Customer associated with the invoice.

Note: Required if the existing object contains a value for customerId.

stringsubCustomerIdD

Identifies the SubCustomer associated with the invoice.

Note: Required if the existing object contains a value for subCustomerId.

stringinvoiceNumberD

Identifies the invoice to update.

Note: Required if the existing object contains a value for invoiceNumber.

stringinvoiceInternalIdD/S

Identifies the invoice to update.

Note: Required if the existing object does not contain values for customerId, subCustomerId, or invoiceNumber, but recommended for all updates.

Return Value

TypeDescription
InvoiceResponseIndicates whether the Invoice was successfully updated.

Example 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>*************-4621-b899-************</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:securityToken>
         <ebiz:invoice>
            <ebiz:MerchantId/>
            <ebiz:CustomerId/>
            <ebiz:SubCustomerId/>
            <ebiz:InvoiceNumber/>
            <ebiz:InvoiceDate/>
            <ebiz:Currency/>
            <ebiz:InvoiceAmount>1550</ebiz:InvoiceAmount>
            <ebiz:InvoiceDueDate/>
            <ebiz:AmountDue>25</ebiz:AmountDue>
            <ebiz:PoNum/>
            <ebiz:SoNum/>
            <ebiz:DivisionId/>
            <ebiz:TypeId/>
            <ebiz:Items>
               <!--Zero or more repetitions:-->
               <ebiz:Item>
                  <ebiz:ItemInternalId/>
                  <ebiz:ItemId/>
                  <ebiz:Name/>
                  <ebiz:Description/>
                  <ebiz:UnitPrice>20.25</ebiz:UnitPrice>
                  <ebiz:Qty>10</ebiz:Qty>
                  <ebiz:Taxable>true</ebiz:Taxable>
                  <ebiz:TaxRate>0</ebiz:TaxRate>
                  <ebiz:UnitOfMeasure/>
                  <ebiz:TotalLineAmount>200.25</ebiz:TotalLineAmount>
                  <ebiz:TotalLineTax>0</ebiz:TotalLineTax>
                  <ebiz:ItemLineNumber>1</ebiz:ItemLineNumber>
                  <ebiz:GrossPrice>0</ebiz:GrossPrice>
                  <ebiz:WarrantyDiscount>0</ebiz:WarrantyDiscount>
                  <ebiz:SalesDiscount>0</ebiz:SalesDiscount>
                  <ebiz:ItemClass/>
                  <ebiz:ItemCustomFields>
                     <!--Zero or more repetitions:-->
                     <ebiz:EbizCustomField>
                        <ebiz:FieldId/>
                        <ebiz:FieldCaption/>
                        <ebiz:FieldName/>
                        <ebiz:FieldValue/>
                        <ebiz:FieldType/>
                        <ebiz:FieldDataType/>
                        <ebiz:FieldDescription/>
                     </ebiz:EbizCustomField>
                  </ebiz:ItemCustomFields>
               </ebiz:Item>
            </ebiz:Items>
            <ebiz:Software/>
            <ebiz:NotifyCustomer>false</ebiz:NotifyCustomer>
            <ebiz:EmailTemplateID/>
            <ebiz:InvoiceURL/>
            <ebiz:TotalTaxAmount>0</ebiz:TotalTaxAmount>
            <ebiz:InvoiceUniqueId/>
            <ebiz:InvoiceDescription/>
            <ebiz:BillingAddress>
               <ebiz:FirstName/>
               <ebiz:LastName/>
               <ebiz:CompanyName/>
               <ebiz:Address1/>
               <ebiz:Address2/>
               <ebiz:City/>
               <ebiz:State/>
               <ebiz:ZipCode/>
               <ebiz:Country/>
               <ebiz:IsDefault>false</ebiz:IsDefault>
               <ebiz:AddressId/>
            </ebiz:BillingAddress>
            <ebiz:ShippingAddress>
               <ebiz:FirstName/>
               <ebiz:LastName/>
               <ebiz:CompanyName/>
               <ebiz:Address1/>
               <ebiz:Address2/>
               <ebiz:City/>
               <ebiz:State/>
               <ebiz:ZipCode/>
               <ebiz:Country/>
               <ebiz:IsDefault>false</ebiz:IsDefault>
               <ebiz:AddressId/>
            </ebiz:ShippingAddress>
            <ebiz:InvoiceCustomerMessage/>
            <ebiz:InvoiceMemo/>
            <ebiz:InvoiceShipDate/>
            <ebiz:InvoiceShipVia/>
            <ebiz:InvoiceTermsId/>
            <ebiz:InvoiceSalesRepId/>
            <ebiz:InvoiceIsToBeEmailed>false</ebiz:InvoiceIsToBeEmailed>
            <ebiz:InvoiceIsToBePrinted>false</ebiz:InvoiceIsToBePrinted>
            <ebiz:DeliveryNumber/>
            <ebiz:TotalDiscountAmount>0</ebiz:TotalDiscountAmount>
            <ebiz:TotalShippingAmount>0</ebiz:TotalShippingAmount>
            <ebiz:LocationId/>
            <ebiz:PoDate/>
            <ebiz:OrderedBy/>
            <ebiz:InvoiceClass/>
            <ebiz:InvoiceFOB/>
            <ebiz:InvoiceTermsDescription/>
            <ebiz:InvoiceCustomFields>
               <!--Zero or more repetitions:-->
               <ebiz:EbizCustomField>
                  <ebiz:FieldId/>
                  <ebiz:FieldCaption/>
                  <ebiz:FieldName/>
                  <ebiz:FieldValue/>
                  <ebiz:FieldType/>
                  <ebiz:FieldDataType/>
                  <ebiz:FieldDescription/>
               </ebiz:EbizCustomField>
            </ebiz:InvoiceCustomFields>
         </ebiz:invoice>
         <ebiz:customerId/>
         <ebiz:subCustomerId/>
         <ebiz:invoiceNumber/>
         <ebiz:invoiceInternalId>*************-4d2a-ae98-************</ebiz:invoiceInternalId>
      </ebiz:UpdateInvoice>
   </soapenv:Body>
</soapenv: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);
Console.WriteLine(Response.InvoiceInternalId);
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;
}

Example 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>*************-4d2a-ae98-************</InvoiceInternalId>
            <Status>Success</Status>
            <StatusCode>1</StatusCode>
            <Error/>
            <ErrorCode>0</ErrorCode>
         </UpdateInvoiceResult>
      </UpdateInvoiceResponse>
   </s:Body>
</s:Envelope>
<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>
            <Status>Error</Status>
            <StatusCode>0</StatusCode>
            <Error>Update Record error The parameterized query '(@MerchantId nchar(50),@prmPayerId nchar(150),@prmCustomerId nch' expects the parameter '@prmInvoiceNumber', which was not supplied.</Error>
            <ErrorCode>3</ErrorCode>
         </UpdateInvoiceResult>
      </UpdateInvoiceResponse>
   </s:Body>
</s:Envelope>