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

Type

Name

Description

SecurityToken

securityToken

Merchant security token: used to identify merchant and validate transaction. (required)

String

MerchantId

Merchant ID. (required)

String

customerId

Customer ID. (required)

String

subCustomerID

Sub-customer ID. (optional)

String

salesOrderNumber

Sales order number ID. (required)

String

salesOrderInternalId

Unique internal sales order ID assigned by EBizCharge. (required)

DateTime

Date

Date. (optional)

String

Currency

Currency. (optional)

String

Amount

Amount. (required)

String

DueDate

Due Date. (optional)

String

AmountDue

Amount Due. (required)

String

PoNum

Purchase Order Number. (optional)

String

DivisionId

Division ID. (optional)

String

TypeId

Type ID. (optional)

String

UploadedBy

Uploaded By. (optional)

String

UpdatedBy

Updated By. (optional)

DateTime

DateUploaded

Date Uploaded. (optional)

DateTime

DateUpdated

Date Updated. (optional)

Bool

isDeleted

Is Deleted. (optional)

String

DeletedBy

Deleted By.(optional)

String

DateDeleted

Date Deleted. (optional)

Item

Item

Items. (optional)

String

Software

Software. (optional)

Bool

NotifyCustomer

Notify Customer. (optional)

String

EmailTemplateID

Email Template ID. (optional)

String

URL

URL. (optional)

String

TotalTaxAmount

Total Tax Amount. (optional)

String

Description

Description. (optional)

Address

Billingddress

Billing Address. (optional)

Address

ShippingAddress

Shipping Address. (optional)

String

CustomerMessage

Customer Message.(optional)

String

Memo

Memo. (optional)

DateTime

ShipDate

Ship Date. (optional)

String

ShipVia

Ship Via. (optional)

String

SalesRepId

Sales Rep ID. (optional)

String

TermsId

Terms ID. (optional)

String

IsToBeEmailed

Is to be emailed. (optional)

String

IsToBePrinted

Is to be printed. (optional)

String

SalesOrderLastSyncDateTime

Sales Order Last Sync Date Time. (optional)

SalesOrderCustomFields

SalesOrderCustomFields

Sales Order Custom Fields. (optional)

String

LocationId

Location ID. (optional)

Return Value

Type

Description

SalesOrderResponse

Returns 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();
        }