SearchSalesOrders
Description
The SearchSalesOrder method retrieves SalesOrder objects from the EBizCharge platform. If no IDs or filters are applied, all SalesOrder objects will be returned.
Syntax
SalesOrder[] SearchSalesOrders(SecurityToken securityToken , string customerId, string subCustomerId, string salesOrderNumber, string salesOrderInternalId, SearchFilter[] filters, int start, int limit, string sort, bool includeItems)
Arguments
Type | Name | Description | |
|---|---|---|---|
securityToken | R | A unique token that is used to identify a merchant and authenticate the API request. | |
string | customerId | D | Filters sales orders by Customer. |
string | subCustomerId | O | Filters sales orders by SubCustomer. Note: Must be sent along with the |
string | salesOrderNumber | D | Filters by the sales orders number. Note: Required if |
string | salesOrderInternalId | D | Filters sales orders by internal ID. Note: Required if |
filters | O | Filters SalesOrder objects based on one or more field names, comparison operators, and field values. See supported search parameters below. | |
int | start | R | Index of the first object to return in the array. Note: Must be ≥ 0. |
int | limit | R | Maximum number of objects to return. Note: Must be > 0. |
string | sort | O | Field name to sort the results by. Supported Sort Parameters
|
boolean | includeItems | R | Whether to include the Item object from the retrieved SalesOrder. |
Return Value
| Type | Description |
|---|---|
| SalesOrder[] | On success, returns an array of matching SalesOrder objects. |
Supported Search Parameters
| Parameter | Description | Example of Use |
|---|---|---|
| SalesOrderNumber | Filters by sales order number. | |
| SalesOrderInternalId | Filters by sales order internal ID. | |
| Date | Filters by the date the sales order was created. | |
| Currency | Filters by the currency code used in the order. | |
| Amount | Filters by the total amount of the sales order. | |
| DueDate | Filters by the date the sales order is due. | |
| PoNum | Filters by the purchase order number associated to the sales order. | |
| DivisionId | Filters by the division ID associated to the sales order. | |
| DateUploaded | Filters orders uploaded after a certain date. | |
| Software | Filters by the integration associated to the sales order. | |
| NotifyCustomer | Filters based on whether the customer should be notified about the sales order. | |
| URL | Filters by the URL link to associated sales order document. | |
| TotalTaxAmount | Filters by the total tax amount for the order. | |
| UniqueId | Filters by the external reference or unique ID for the order. | |
| IsToBeEmailed | Filters by whether the sales order should be emailed. | |
| IsToBePrinted | Filters by whether the sales order should be printed. | |
| LocationId | Filters by the location ID of the sales order. | |
Example 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>************-40ea-ba1b-32423************</ebiz:SecurityId>
<ebiz:UserId/>
<ebiz:Password/>
</ebiz:securityToken>
<ebiz:customerId/>
<ebiz:subCustomerId/>
<ebiz:salesOrderNumber/>
<ebiz:salesOrderInternalId>*******0ea-ba1b-beddb>*******</ebiz:salesOrderInternalId>
<ebiz:filters>
<!--Zero or more repetitions:-->
<ebiz:SearchFilter>
<ebiz:FieldName>CustomerId</ebiz:FieldName>
<ebiz:ComparisonOperator>eq</ebiz:ComparisonOperator>
<ebiz:FieldValue>BCustomer</ebiz:FieldValue>
</ebiz:SearchFilter>
</ebiz:filters>
<ebiz:start>0</ebiz:start>
<ebiz:limit>100</ebiz:limit>
<ebiz:sort/>
<ebiz:includeItems>true</ebiz:includeItems>
</ebiz:SearchSalesOrders>
</soapenv:Body>
</soapenv: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();
}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;
}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">
<SearchSalesOrdersResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<SearchSalesOrdersResult>
<SalesOrder>
<CustomerId>BCustomer</CustomerId>
<SubCustomerId/>
<SalesOrderNumber/>
<SalesOrderInternalId>************-40ea-ba1b-32423************</SalesOrderInternalId>
<Date>1900-01-01</Date>
<Currency></Currency>
<Amount>125.4500</Amount>
<DueDate>2019-07-20</DueDate>
<AmountDue>100.2500</AmountDue>
<PoNum>po001</PoNum>
<DivisionId></DivisionId>
<DateUploaded>2025-12-08 22:00:03</DateUploaded>
<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>
<GrossPrice>0.0000</GrossPrice>
<WarrantyDiscount>0.0000</WarrantyDiscount>
<SalesDiscount>0.0000</SalesDiscount>
<ItemClass/>
<ItemCustomFields/>
</Item>
<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>
<GrossPrice>0.0000</GrossPrice>
<WarrantyDiscount>0.0000</WarrantyDiscount>
<SalesDiscount>0.0000</SalesDiscount>
<ItemClass/>
<ItemCustomFields/>
</Item>
</Items>
<Software>qb</Software>
<NotifyCustomer xsi:nil="true"/>
<URL/>
<TotalTaxAmount>20.2500</TotalTaxAmount>
<UniqueId>Sr001</UniqueId>
<TermsId>Net30</TermsId>
<IsToBeEmailed>false</IsToBeEmailed>
<IsToBePrinted>false</IsToBePrinted>
<SalesOrderCustomFields/>
<LocationId/>
</SalesOrder>
</SearchSalesOrdersResult>
</SearchSalesOrdersResponse>
</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">
<SearchSalesOrdersResponse xmlns="http://eBizCharge.ServiceModel.SOAP"/>
</s:Body>
</s:Envelope>Updated 5 months ago
