UpdateSalesOrder

Description

This method allows to update an existing sales order.

Syntax

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

Arguments

TypeNameDescription
SecurityTokensecurityTokenMerchant security token: used to identify merchant and validate transaction. (required)
StringMerchantIdMerchant ID. (required)
StringcustomerIdCustomer ID. (required)
StringsubCustomerIDSub-customer ID. (optional)
StringsalesOrderNumberSales order number ID. (required)
StringsalesOrderInternalIdUnique internal sales order ID assigned by EBizCharge. (required)
DateTimeDateDate. (optional)
StringCurrencyCurrency. (optional)
StringAmountAmount. (required)
StringDueDateDue Date. (optional)
StringAmountDueAmount Due. (required)
StringPoNumPurchase Order Number. (optional)
StringDivisionIdDivision ID. (optional)
StringTypeIdType ID. (optional)
StringUploadedByUploaded By. (optional)
StringUpdatedByUpdated By. (optional)
DateTimeDateUploadedDate Uploaded. (optional)
DateTimeDateUpdatedDate Updated. (optional)
BoolisDeletedIs Deleted. (optional)
StringDeletedByDeleted By.(optional)
StringDateDeletedDate Deleted. (optional)
ItemItemItems. (optional)
StringSoftwareSoftware. (optional)
BoolNotifyCustomerNotify Customer. (optional)
StringEmailTemplateIDEmail Template ID. (optional)
StringURLURL. (optional)
StringTotalTaxAmountTotal Tax Amount. (optional)
StringDescriptionDescription. (optional)
AddressBillingddressBilling Address. (optional)
AddressShippingAddressShipping Address. (optional)
StringCustomerMessageCustomer Message.(optional)
StringMemoMemo. (optional)
DateTimeShipDateShip Date. (optional)
StringShipViaShip Via. (optional)
StringSalesRepIdSales Rep ID. (optional)
StringTermsIdTerms ID. (optional)
StringIsToBeEmailedIs to be emailed. (optional)
StringIsToBePrintedIs to be printed. (optional)
StringSalesOrderLastSyncDateTimeSales Order Last Sync Date Time. (optional)
SalesOrderCustomFieldsSalesOrderCustomFieldsSales Order Custom Fields. (optional)
StringLocationIdLocation ID. (optional)

Return Value

TypeDescription
SalesOrderResponseReturns result of UpdateSalesOrder request.
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;
}

Examples

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>********-1906-4be3-b01d-********</ebiz:SecurityId>
            <ebiz:UserId/>
            <ebiz:Password/>
         </ebiz:securityToken>
         <ebiz:salesOrder>
            <ebiz:CustomerId>AIM</ebiz:CustomerId>
            <ebiz:SubCustomerId/>
            <ebiz:SalesOrderNumber>So106</ebiz:SalesOrderNumber>
            <ebiz:Date>2019-07-01</ebiz:Date>
            <ebiz:Currency/>
            <ebiz:Amount>125.45</ebiz:Amount>
            <ebiz:DueDate>2019-07-20</ebiz:DueDate>
            <ebiz:AmountDue>100.25</ebiz:AmountDue>
            <ebiz:PoNum>po001</ebiz:PoNum>
            <ebiz:DivisionId>01</ebiz:DivisionId>
            <ebiz:TypeId>01</ebiz:TypeId>
            <ebiz:Items>
               <ebiz:Item>
                  <ebiz:ItemInternalId>?</ebiz:ItemInternalId>
                  <ebiz:ItemId>01-00097</ebiz:ItemId>
                  <ebiz:Name>01-00097</ebiz:Name>
                  <ebiz:Description>Wall Mounted Vent-free Gas Fireplace</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>EA</ebiz:UnitOfMeasure>
                  <ebiz:TotalLineAmount>200.25</ebiz:TotalLineAmount>
                  <ebiz:TotalLineTax>10.00</ebiz:TotalLineTax>
                  <ebiz:ItemLineNumber>1</ebiz:ItemLineNumber>
               </ebiz:Item>
            </ebiz:Items>
            <ebiz:Software>qb</ebiz:Software>
            <ebiz:NotifyCustomer>true</ebiz:NotifyCustomer>
            <ebiz:EmailTemplateID/>
            <ebiz:URL/>
            <ebiz:TotalTaxAmount>20.25</ebiz:TotalTaxAmount>
            <ebiz:UniqueId>Sr001</ebiz:UniqueId>
            <ebiz:Description>Sales Order</ebiz:Description>
            <ebiz:BillingAddress>
               <ebiz:FirstName>Rachel</ebiz:FirstName>
               <ebiz:LastName>Bayswater</ebiz:LastName>
               <ebiz:CompanyName>CBS</ebiz:CompanyName>
               <ebiz:Address1>55 Golden </ebiz:Address1>
               <ebiz:Address2/>
               <ebiz:Address3/>
               <ebiz:City>Abyss</ebiz:City>
               <ebiz:State>CA</ebiz:State>
               <ebiz:ZipCode>56789</ebiz:ZipCode>
               <ebiz:Country/>
               <ebiz:IsDefault>0</ebiz:IsDefault>
               <ebiz:AddressId>?</ebiz:AddressId>
            </ebiz:BillingAddress>
            <ebiz:ShippingAddress>
               <ebiz:FirstName>Rachel</ebiz:FirstName>
               <ebiz:LastName>Bayswater</ebiz:LastName>
               <ebiz:CompanyName>CBS</ebiz:CompanyName>
               <ebiz:Address1>55 Golden</ebiz:Address1>
               <ebiz:Address2/>
               <ebiz:Address3/>
               <ebiz:City>Abyss</ebiz:City>
               <ebiz:State>CA</ebiz:State>
               <ebiz:ZipCode>56789</ebiz:ZipCode>
               <ebiz:Country/>
               <ebiz:IsDefault>0</ebiz:IsDefault>
               <ebiz:AddressId></ebiz:AddressId>
            </ebiz:ShippingAddress>
            <ebiz:CustomerMessage>Customer Message</ebiz:CustomerMessage>
            <ebiz:Memo>Hello memo123</ebiz:Memo>
            <ebiz:ShipDate>2019-07-08</ebiz:ShipDate>
            <ebiz:ShipVia>UPS-1</ebiz:ShipVia>
            <ebiz:SalesRepId>Jef04</ebiz:SalesRepId>
            <ebiz:TermsId>Net30</ebiz:TermsId>
            <ebiz:IsToBeEmailed>1</ebiz:IsToBeEmailed>
            <ebiz:IsToBePrinted>0</ebiz:IsToBePrinted>
         </ebiz:salesOrder>
         <ebiz:customerId>AIM</ebiz:customerId>
         <ebiz:subCustomerId/>
         <ebiz:salesOrderNumber>So106</ebiz:salesOrderNumber>
       </ebiz:UpdateSalesOrder>
   </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">
      <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>
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();
        }