SearchSalesOrders

Description

This method allows users to search sales orders.

Syntax

SalesOrder[] SearchSalesOrders(SecurityToken](doc:securitytoken) securityToken , string customerId, string subCustomerId, string salesOrderNumber, string salesOrderInternalId, SearchFilter[] filters, int start, int limit, string sort, bool includeItems).

Arguments

TypeNameDescription
SecurityTokensecurityTokenMerchant security token: used to identify merchant and validate transaction. (required)
StringcustomerIdCustomer ID. (required)
StringsubCustomerIdSub-customer ID. (optional)
StringsalesOrderNumberSales order number. (required)
StringsalesOrderInternalIdUnique internal sales order ID assigned by EBizCharge. (required)
SearchFilterfiltersSearch filters. (optional)
IntstartStart position, defaults to 0 (first payment found). (required)
IntlimitMaximum number of payments to return in result. Default Max 1000. (required)
StringsortField name to sort the results by. (optional)
BoolincludeItemsInclude items

Return Value

TypeDescription
SalesOrder[]Returns an array of sales order matching the specified search parameters.

Examples

public function SearchSalesOrders()
{
    $client = new SoapClient('End point URL');
    $securityToken = array(
        'SecurityId' => '******-454757-4567457-********',
        'UserId' => 'merchant1',
        'Password' => 'merchant1'
    );
    $response = $client->SearchSalesOrders(array(
        'securityToken' => $securityToken,
        'customerId' => '123',
        'salesOrderNumber' => '00102566',
        'salesOrderInternalId' => '45435-45435-543543-435',
        'start' => 0,
        'limit' => 100,
    ));
    $result = $response->SearchSalesOrdersResult;
}
Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
   <soapenv:Header/>
   <soapenv:Body>
      <ebiz:SearchSalesOrders>
         <ebiz:securityToken>
            <ebiz:SecurityId>********-1906-4be3-b01d-********</ebiz:SecurityId>
            <ebiz:UserId>id1</ebiz:UserId>
            <ebiz:Password>pass1</ebiz:Password>
         </ebiz:securityToken>
         <ebiz:customerId/>
         <ebiz:subCustomerId/>
         <ebiz:salesOrderNumber/>
         <ebiz:salesOrderInternalId/>
         <ebiz:filters>
            <ebiz:SearchFilter>
               <ebiz:FieldName>SoftwareId</ebiz:FieldName>
               <ebiz:ComparisonOperator>eq</ebiz:ComparisonOperator>
               <ebiz:FieldValue>qb</ebiz:FieldValue>
            </ebiz:SearchFilter>
         </ebiz:filters>
         <ebiz:start>1</ebiz:start>
         <ebiz:limit>200</ebiz:limit>
         <ebiz:sort/>
         <ebiz:includeItems>true</ebiz:includeItems>
      </ebiz:SearchSalesOrders>
   </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">
      <SearchSalesOrdersResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
         <SearchSalesOrdersResult>
            <SalesOrder>
               <CustomerId>AIM</CustomerId>
               <SubCustomerId/>
               <SalesOrderNumber>729-1</SalesOrderNumber>
               <SalesOrderInternalId>********-9b7f-445d-9078-********</SalesOrderInternalId>
               <Date>2019-07-01</Date>
               <Currency></Currency>
               <Amount>125.4500</Amount>
               <DueDate>2019-07-20</DueDate>
               <AmountDue>100.2500</AmountDue>
               <PoNum>po001</PoNum>
               <DivisionId>01</DivisionId>
               <Items>
                  <Item>
                     <ItemId>01-00097</ItemId>
                     <Name>01-00097</Name>
                     <Description>Wall Mounted Vent-free Gas Fireplace</Description>
                     <UnitPrice>20.2500</UnitPrice>
                     <Qty>10.0000</Qty>
                     <Taxable>true</Taxable>
                     <TaxRate>0.0000</TaxRate>
                     <UnitOfMeasure>EA</UnitOfMeasure>
                     <TotalLineAmount>200.2500</TotalLineAmount>
                     <TotalLineTax>10.0000</TotalLineTax>
                     <ItemLineNumber>1</ItemLineNumber>
                  </Item>
               </Items>
               <Software>qb</Software>
               <NotifyCustomer xsi:nil="true"/>
               <URL/>
               <TotalTaxAmount>20.2500</TotalTaxAmount>
               <UniqueId>Sr001</UniqueId>
               <SalesRepId>Jef04</SalesRepId>
               <TermsId>Net30</TermsId>
               <IsToBeEmailed>true</IsToBeEmailed>
               <IsToBePrinted>false</IsToBePrinted>
            </SalesOrder>
            <SalesOrder>
               <CustomerId>AIM</CustomerId>
               <SubCustomerId/>
               <SalesOrderNumber>SO0009</SalesOrderNumber>
               <SalesOrderInternalId>********-1151-4979-822b-********</SalesOrderInternalId>
               <Date>2019-07-01</Date>
               <Currency></Currency>
               <Amount>125.4500</Amount>
               <DueDate>2019-07-20</DueDate>
               <AmountDue>100.2500</AmountDue>
               <PoNum>po001</PoNum>
               <DivisionId>01</DivisionId>
               <Items>
                  <Item>
                     <ItemId>01-00097</ItemId>
                     <Name>01-00097</Name>
                     <Description>Wall Mounted Vent-free Gas Fireplace</Description>
                     <UnitPrice>20.2500</UnitPrice>
                     <Qty>10.0000</Qty>
                     <Taxable>true</Taxable>
                     <TaxRate>0.0000</TaxRate>
                     <UnitOfMeasure>EA</UnitOfMeasure>
                     <TotalLineAmount>200.2500</TotalLineAmount>
                     <TotalLineTax>10.0000</TotalLineTax>
                     <ItemLineNumber>1</ItemLineNumber>
                  </Item>
               </Items>
               <Software>qb</Software>
               <NotifyCustomer xsi:nil="true"/>
               <URL/>
               <TotalTaxAmount>20.2500</TotalTaxAmount>
               <UniqueId>Sr001</UniqueId>
               <SalesRepId>Jef04</SalesRepId>
               <TermsId>Net30</TermsId>
               <IsToBeEmailed>false</IsToBeEmailed>
               <IsToBePrinted>true</IsToBePrinted>
               <SalesOrderLastSyncDateTime>2019-08-30 16:41:00</SalesOrderLastSyncDateTime>
            </SalesOrder>
            <SalesOrder>
               <CustomerId>AIM</CustomerId>
               <SubCustomerId/>
               <SalesOrderNumber>So101</SalesOrderNumber>
               <SalesOrderInternalId>********-f418-4ccf-bd26-********</SalesOrderInternalId>
               <Date>2019-07-01</Date>
               <Currency></Currency>
               <Amount>125.4500</Amount>
               <DueDate>2019-07-20</DueDate>
               <AmountDue>100.2500</AmountDue>
               <PoNum>po001</PoNum>
               <DivisionId>01</DivisionId>
               <Items>
                  <Item>
                     <ItemId>01-00097</ItemId>
                     <Name>01-00097</Name>
                     <Description>Wall Mounted Vent-free Gas Fireplace</Description>
                     <UnitPrice>20.2500</UnitPrice>
                     <Qty>10.0000</Qty>
                     <Taxable>true</Taxable>
                     <TaxRate>0.0000</TaxRate>
                     <UnitOfMeasure>EA</UnitOfMeasure>
                     <TotalLineAmount>200.2500</TotalLineAmount>
                     <TotalLineTax>10.0000</TotalLineTax>
                     <ItemLineNumber>1</ItemLineNumber>
                  </Item>
               </Items>
               <Software>qb</Software>
               <NotifyCustomer xsi:nil="true"/>
               <URL/>
               <TotalTaxAmount>20.2500</TotalTaxAmount>
               <UniqueId>Sr001</UniqueId>
               <SalesRepId>Jef04</SalesRepId>
               <TermsId>Net30</TermsId>
               <IsToBeEmailed>true</IsToBeEmailed>
               <IsToBePrinted>false</IsToBePrinted>
               <SalesOrderLastSyncDateTime>2019-08-23 22:59:34</SalesOrderLastSyncDateTime>
            </SalesOrder>
            <SalesOrder>
               <CustomerId>AIM</CustomerId>
               <SubCustomerId/>
               <SalesOrderNumber>So106</SalesOrderNumber>
               <SalesOrderInternalId>********-1aa2-4e1e-b02f-********</SalesOrderInternalId>
               <Date>2019-07-01</Date>
               <Currency></Currency>
               <Amount>125.4500</Amount>
               <DueDate>2019-07-20</DueDate>
               <AmountDue>100.2500</AmountDue>
               <PoNum>po001</PoNum>
               <DivisionId>01</DivisionId>
               <Items>
                  <Item>
                     <ItemId>01-00097</ItemId>
                     <Name>01-00097</Name>
                     <Description>Wall Mounted Vent-free Gas Fireplace</Description>
                     <UnitPrice>20.2500</UnitPrice>
                     <Qty>10.0000</Qty>
                     <Taxable>true</Taxable>
                     <TaxRate>0.0000</TaxRate>
                     <UnitOfMeasure>EA</UnitOfMeasure>
                     <TotalLineAmount>200.2500</TotalLineAmount>
                     <TotalLineTax>10.0000</TotalLineTax>
                     <ItemLineNumber>1</ItemLineNumber>
                  </Item>
               </Items>
               <Software>qb</Software>
               <NotifyCustomer xsi:nil="true"/>
               <URL/>
               <TotalTaxAmount>20.2500</TotalTaxAmount>
               <UniqueId>Sr001</UniqueId>
               <SalesRepId>Jef04</SalesRepId>
               <TermsId>Net30</TermsId>
               <IsToBeEmailed>true</IsToBeEmailed>
               <IsToBePrinted>false</IsToBePrinted>
               <SalesOrderLastSyncDateTime>2019-09-20 16:53:32</SalesOrderLastSyncDateTime>
            </SalesOrder>
            <SalesOrder>
               <CustomerId>AIM</CustomerId>
               <SubCustomerId/>
               <SalesOrderNumber>So107</SalesOrderNumber>
               <SalesOrderInternalId>********-56d6-45e3-a7e1-********</SalesOrderInternalId>
               <Date>2019-07-01</Date>
               <Currency></Currency>
               <Amount>125.4500</Amount>
               <DueDate>2019-07-20</DueDate>
               <AmountDue>100.2500</AmountDue>
               <PoNum>po001</PoNum>
               <DivisionId></DivisionId>
               <Items>
                  <Item>
                     <ItemId>01-00098</ItemId>
                     <Name>01-00099</Name>
                     <Description>TV</Description>
                     <UnitPrice>2000.2500</UnitPrice>
                     <Qty>10.0000</Qty>
                     <Taxable>true</Taxable>
                     <TaxRate>0.0000</TaxRate>
                     <UnitOfMeasure>EA</UnitOfMeasure>
                     <TotalLineAmount>2000.2500</TotalLineAmount>
                     <TotalLineTax>10.0000</TotalLineTax>
                     <ItemLineNumber>1</ItemLineNumber>
                  </Item>
                  <Item>
                     <ItemId>01-00097</ItemId>
                     <Name>01-00097</Name>
                     <Description>Wall Mounted Vent-free Gas Fireplace</Description>
                     <UnitPrice>20.2500</UnitPrice>
                     <Qty>10.0000</Qty>
                     <Taxable>true</Taxable>
                     <TaxRate>0.0000</TaxRate>
                     <UnitOfMeasure>EA</UnitOfMeasure>
                     <TotalLineAmount>200.2500</TotalLineAmount>
                     <TotalLineTax>10.0000</TotalLineTax>
                     <ItemLineNumber>1</ItemLineNumber>
                  </Item>
               </Items>
               <Software>qb</Software>
               <NotifyCustomer xsi:nil="true"/>
               <URL/>
               <TotalTaxAmount>20.2500</TotalTaxAmount>
               <UniqueId>Sr001</UniqueId>
               <SalesRepId>Jef04</SalesRepId>
               <TermsId>Net30</TermsId>
               <IsToBeEmailed>false</IsToBeEmailed>
               <IsToBePrinted>false</IsToBePrinted>
            </SalesOrder>
            <SalesOrder>
               <CustomerId>AIM</CustomerId>
               <SubCustomerId/>
               <SalesOrderNumber>ss123</SalesOrderNumber>
               <SalesOrderInternalId>********-fa52-41fb-938f-********</SalesOrderInternalId>
               <Date>2019-07-01</Date>
               <Currency></Currency>
               <Amount>125.4500</Amount>
               <DueDate>2019-07-20</DueDate>
               <AmountDue>100.2500</AmountDue>
               <PoNum>po001</PoNum>
               <DivisionId>01</DivisionId>
               <Items>
                  <Item>
                     <ItemId>01-00097</ItemId>
                     <Name>01-00097</Name>
                     <Description>Wall Mounted Vent-free Gas Fireplace</Description>
                     <UnitPrice>20.2500</UnitPrice>
                     <Qty>10.0000</Qty>
                     <Taxable>true</Taxable>
                     <TaxRate>0.0000</TaxRate>
                     <UnitOfMeasure>EA</UnitOfMeasure>
                     <TotalLineAmount>200.2500</TotalLineAmount>
                     <TotalLineTax>10.0000</TotalLineTax>
                     <ItemLineNumber>1</ItemLineNumber>
                  </Item>
               </Items>
               <Software>qb</Software>
               <NotifyCustomer xsi:nil="true"/>
               <URL/>
               <TotalTaxAmount>20.2500</TotalTaxAmount>
               <UniqueId>Sr001</UniqueId>
               <SalesRepId>Jef04</SalesRepId>
               <TermsId>Net30</TermsId>
               <IsToBeEmailed>true</IsToBeEmailed>
               <IsToBePrinted>true</IsToBePrinted>
            </SalesOrder>
         </SearchSalesOrdersResult>
      </SearchSalesOrdersResponse>
   </s:Body>
</s:Envelope>
public void SearchSalesOrders()
        {
            eBizService apiClient = new eBizService();
            SecurityToken securityToken = new SecurityToken
            {
                SecurityId = "*******-c870-41b8-aa5c-********",
                UserId = "",
                Password = ""
            };
            //Declare the Array of searchfilters
            SearchFilter[] searchFilters = new SearchFilter[1];
            //Declare a SearchFilter
            SearchFilter searchFilter = new SearchFilter();
            searchFilter.FieldName = "DateUploaded";
            searchFilter.ComparisonOperator = "gt";
            searchFilter.FieldValue = "04/01/2022";
            //Add SearchFilter to Array for SearchFilters
            searchFilters[0] = searchFilter;
            //Search Salesorders
            var salesOrders = apiClient.SearchSalesOrders(securityToken, "APIINVCust", "", "", "", searchFilters, 1, 100, "", true);
            Console.WriteLine(salesOrders.Length);
            Console.ReadLine();
        }