UpdateSalesOrder

Description

The UpdateSalesOrder method updates an existing SalesOrder on the EBizCharge platform.

Syntax

SalesOrderResponse UpdateSalesOrder(SecurityToken securityToken, SalesOrder salesOrder, string customerId, string subCustomerId, string salesOrderNumber, string salesOrderInternalId)

Arguments

Type

Name

Req.

Description

SecurityToken

securityToken

R

A unique token that is used to identify a merchant and authenticate the API request.

SalesOrder

salesOrder

R

The sales order to update.

Warning: Omitting a field might clear its value.

Required Fields
  • CustomerId
  • Amount
  • AmountDue
  • NotifyCustomer
  • TotalTaxAmount
  • IsToBeEmailed
  • IsToBePrinted

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
  • SalesOrderNumber
  • Date - Default is 1900-01-01
  • DueDate - Default is 1900-01-01

string

customerId

D

Identifies the Customer associated with the SalesOrder being updated.

Note: Required if salesOrderInternalId is not sent.

string

subCustomerId

D

Identifies the SubCustomer associated with the SalesOrder being updated.

Note: Required if salesOrderInternalId is not sent.

string

salesOrderNumber

D

Identifies the SalesOrder being updated.

Note: Required if salesOrderInternalId is not sent.

string

salesOrderInternalId

D

Identifies the SalesOrder being updated.

Note: Required if customerId, subCustomerId, or salesOrderNumber are not sent.

Return Value

TypeDescription
SalesOrderResponseIndicates whether the SalesOrder object 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:UpdateSalesOrder>
         <ebiz:securityToken>
            <ebiz:SecurityId>*************-4621-b899-************</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:securityToken>
         <ebiz:salesOrder>
            <ebiz:MerchantId/>
            <ebiz:CustomerId>CUST-001</ebiz:CustomerId>
            <ebiz:SubCustomerId/>
            <ebiz:SalesOrderNumber>SO-1910</ebiz:SalesOrderNumber>
            <ebiz:Date/>
            <ebiz:Currency/>
            <ebiz:Amount>125.45</ebiz:Amount>
            <ebiz:DueDate/>
            <ebiz:AmountDue>100.25</ebiz:AmountDue>
            <ebiz:PoNum/>
            <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.00</ebiz:Qty>
                  <ebiz:Taxable>true</ebiz:Taxable>
                  <ebiz:TaxRate>0</ebiz:TaxRate>
                  <ebiz:UnitOfMeasure/>
                  <ebiz:TotalLineAmount>200.25</ebiz:TotalLineAmount>
                  <ebiz:TotalLineTax>10.00</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>true</ebiz:NotifyCustomer>
            <ebiz:EmailTemplateID/>
            <ebiz:URL/>
            <ebiz:TotalTaxAmount>20.25</ebiz:TotalTaxAmount>
            <ebiz:UniqueId/>
            <ebiz:Description/>
            <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:CustomerMessage/>
            <ebiz:Memo/>
            <ebiz:ShipDate/>
            <ebiz:ShipVia/>
            <ebiz:SalesRepId/>
            <ebiz:TermsId/>
            <ebiz:IsToBeEmailed>false</ebiz:IsToBeEmailed>
            <ebiz:IsToBePrinted>false</ebiz:IsToBePrinted>
            <ebiz:SalesOrderLastSyncDateTime/>
            <ebiz:SalesOrderCustomFields>
               <!--Zero or more repetitions:-->
               <ebiz:EbizCustomField>
                  <ebiz:FieldId/>
                  <ebiz:FieldCaption/>
                  <ebiz:FieldName/>
                  <ebiz:FieldValue/>
                  <ebiz:FieldType/>
                  <ebiz:FieldDataType/>
                  <ebiz:FieldDescription/>
               </ebiz:EbizCustomField>
            </ebiz:SalesOrderCustomFields>
            <ebiz:LocationId/>
         </ebiz:salesOrder>
         <ebiz:customerId/>
         <ebiz:subCustomerId/>
         <ebiz:salesOrderNumber/>
         <ebiz:salesOrderInternalId>*************-49db-9cd8-************</ebiz:salesOrderInternalId>
      </ebiz:UpdateSalesOrder>
   </soapenv:Body>
</soapenv:Envelope>
public void UpdateSalesOrder()
{
    eBizService apiClient = new eBizService();
    SecurityToken securityToken = new SecurityToken
    {
      SecurityId = "*******-c870-41b8-aa5c-********",
      UserId = "",
      Password = ""
      };
    //Getting Salesorder before updating
    SalesOrder salesOrder = apiClient.GetSalesOrder(securityToken, "APIINVCust", "", "", "********-7dfd-4aad-ae21-********");
    salesOrder.Date = "04/10/2022";
    salesOrder.DueDate = "04/30/2021";
    salesOrder.AmountDue = (decimal)216.27;
    salesOrder.TotalTaxAmount = (decimal)16.02;
    salesOrder.AmountDue = (decimal)216.27;
    salesOrder.PoNum = "PO124";
    salesOrder.NotifyCustomer = true;
    salesOrder.ShipVia = "DHL";
    salesOrder.DateUpdated = "04/22/2022";
    salesOrder.DateUploaded = "04/22/2022";
    //Updating salesorder
    var response = apiClient.UpdateSalesOrder(securityToken, salesOrder, salesOrder.CustomerId, "", "", "********-7dfd-4aad-ae21-********");
    Console.WriteLine(response.Status);
    Console.WriteLine(respons.StatusCode);
    Console.WriteLine(response.Error);
    Console.WriteLine(response.ErrorCode);
    Console.ReadLine();
}
function updateSalesOrder()
{
    $client = new SoapClient('End point URL');
    $securityToken = array(
    'SecurityId' => '******-454757-4567457-********',
    'UserId' => 'merchant1',
    'Password' => 'merchant1'
    );
    $shippingAddress = array(
    'FirstName' => 'Rachel',
    'LastName' => 'Bayswater',
    'Company' => 'Atleka',
    'Address1' => 'ST # 8 HS 9 London',
    'Address2' => 'ST # 1 HS 11 London',
    'City' => 'London',
    'State' => 'London',
    'ZipCode' => 'E1 6AN',
    'Country' => 'UK',
    'Phone' => '233-23445',
    'Fax' => '233-234432',
    'Email' => '[email protected]'
    );
    $billingAddress = array(
    'FirstName' => 'Rachel',
    'LastName' => 'Bayswater',
    'Company' => 'HereNow',
    'Address1' => 'ST # 266 HS 102 London',
    'Address2' => 'ST # 566 HS 21 London',
    'City' => 'London',
    'State' => 'London',
    'ZipCode' => 'E1 6AN',
    'Country' => 'UK',
    'Phone' => '456-23445',
    'Fax' => '456-234432',
    'Email' => '[email protected]'
    );
    $orderDetails = array(
    'CustomerId' => 1,
    'SalesOrderNumber' => 'So107',
    'Date' => '2020-05-01',
    'Currency' => 'USD',
    'Amount' => '200',
    'DueDate' => '2020-05-01',
    'AmountDue' =>'200',
    'PoNum' => 'po001',
    'DateUploaded' => '2020-05-01',
    'DateUpdated' => '2020-05-01',
    'Software' => 'Woocommerce',
    'NotifyCustomer' => true,
    'TotalTaxAmount' => 0,
    'UniqueId' => '123',
    'Description' => 'Sales Order',
    'CustomerMessage' => 'Hello',
    'Memo' => '',
    'ShipDate' => '2020-05-05',
    'ShipVia' => '',
    'IsToBeEmailed' => false,
    'BillingAddress' => $billingAddress,
    'ShippingAddress' => $shippingAddress );
    $updateSalesOrder = array(
    'SecurityToken' => $securityToken,
    'SalesOrder' => $orderDetails,
    'customerId' => 1,
    'SalesOrderNumber' => 1
    );
    $updateSalesOrderResponse = $client->UpdateSalesOrder($updateSalesOrder);
    $updateSalesOrderResult = $updateSalesOrderResponse->UpdateSalesOrderResult;
}

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">
      <UpdateSalesOrderResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <UpdateSalesOrderResult>
            <SalesOrderInternalId>********-1aa2-4e1e-b02f-********</SalesOrderInternalId>
            <Status>Success</Status>
            <StatusCode>1</StatusCode>
            <Error/>
            <ErrorCode>0</ErrorCode>
         </UpdateSalesOrderResult>
      </UpdateSalesOrderResponse>
   </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">
      <UpdateSalesOrderResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <UpdateSalesOrderResult>
            <Status>Error</Status>
            <StatusCode>0</StatusCode>
            <Error/>
            <ErrorCode>3</ErrorCode>
         </UpdateSalesOrderResult>
      </UpdateSalesOrderResponse>
   </s:Body>
</s:Envelope>