SearchInvoices
Description
The SearchInvoices method retrieves Invoice objects from the EBizCharge platform. If no IDs or filters are provided, all Invoice objects are returned.
Syntax
Invoice[] SearchInvoices(SecurityToken securityToken, string customerId, string subCustomerId, string invoiceNumber, string invoiceInternalId, 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 invoices by Customer. |
string | subCustomerId | D | Filters invoices by SubCustomer. |
string | invoiceNumber | O | Filters by invoice number. |
string | invoiceInternalId | O | Filters invoices by the internal Id. |
filters | O | Filters Invoice 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 | Sorts by field name. Supported Sort Parameters
|
boolean | includeItems | R | Whether to include the Item object from the retrieved Invoice. |
Return Value
Supported Search Parameters
| Parameter | Description | Example of Use |
|---|---|---|
| CustomerId | Filters by the ID of the customer. | |
| SubCustomerId | Filters by the ID of the sub-customer. | |
| InvoiceNumber | Filters by the invoice number. | |
| InvoiceInternalId | Filters by the internal ID of the invoice. | |
| InvoiceDate | Filters by the date the invoice was created. | |
| Currency | Filters by the currency code. | |
| InvoiceAmount | Filters by the total amount on the invoice. | |
| InvoiceDueDate | Filters by the the date the invoice is due. | |
| AmountDue | Filters by the amount due on the invoice. | |
| PoNum | Filters by purchase order number. | |
| SoNum | Filters by sales order number. | |
| DivisonID | Filters by the divison ID. | |
| DateUploaded | Filters by the date the invoice was uploaded. | |
| Software | Filters by the integration associated to the invoice. | |
| InvoiceURL | Filters by the URL of the invoice. | |
| TotalTaxAmount | Filters by the total tax amount on the invoice. | |
| InvoiceUniqueId | Filters by the unique ID of the invoice. | |
| InvoiceIsToBeEmailed | Filters by whether the invoice is to be emailed. | |
| InvoiceIsToBePrinted | Filters by whether the invoice is to be printed. | |
| InvoiceClass | Filters by the class of the invoice. | |
| InvoiceFOB | Filters by the FOB of the invoice. | |
Example Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ebiz="http://eBizCharge.ServiceModel.SOAP">
<soapenv:Header/>
<soapenv:Body>
<ebiz:SearchInvoices>
<ebiz:securityTokenCustomer>
<ebiz:SecurityId>*********bf0-91cd-95ccdc**********</ebiz:SecurityId>
<ebiz:UserId/>
<ebiz:Password/>
</ebiz:securityTokenCustomer>
<ebiz:customerId/>
<ebiz:subCustomerId/>
<ebiz:invoiceNumber/>
<ebiz:invoiceInternalId/>
<ebiz:filters>
<!--Zero or more repetitions:-->
<ebiz:SearchFilter>
<ebiz:FieldName>CustomerId</ebiz:FieldName>
<ebiz:ComparisonOperator>eq</ebiz:ComparisonOperator>
<ebiz:FieldValue>CBS</ebiz:FieldValue>
</ebiz:SearchFilter>
</ebiz:filters>
<ebiz:start>1</ebiz:start>
<ebiz:limit>2</ebiz:limit>
<ebiz:sort/>
<ebiz:includeItems>false</ebiz:includeItems>
</ebiz:SearchInvoices>
</soapenv:Body>
</soapenv:Envelope>var client = new eConnect.IeBizServiceClient();
eConnect.SecurityToken securityToken = new eConnect.SecurityToken();
securityToken.UserId = "";
securityToken.SecurityId = "********-90b4-4a38-ad78-********";
securityToken.Password = "";
var filters = new eConnect.SearchFilter[3];
filters[0] = new eConnect.SearchFilter();
filters[1] = new eConnect.SearchFilter();
filters[2] = new eConnect.SearchFilter();
filters[0].FieldName = "InvoiceDueDate";
filters[0].ComparisonOperator = "ge";
filters[0].FieldValue = "2015-11-25";
filters[1].FieldName = "InvoiceDueDate";
filters[1].ComparisonOperator = "le";
filters[1].FieldValue = "2017-11-26";
filters[2].FieldName = "InvoiceAmount";
filters[2].ComparisonOperator = "ge";
filters[2].FieldValue = "1000.00";
eConnect.Invoice[] inv = client.SearchInvoices(securityToken, "", "", "", "", filters, 1, 3, "", false);
for (int i = 0; i < inv.Count(); i++)
{
Console.WriteLine(i.ToString() + " CustomerId: " + inv[i].CustomerId.ToString() );
Console.WriteLine(i.ToString() + " SubCustomerId: " + inv[i].SubCustomerId.ToString());
Console.WriteLine(i.ToString() + " InvoiceNumber: " + inv[i].InvoiceNumber.ToString());
Console.WriteLine(i.ToString() + " InvoiceInternalId: " + inv[i].InvoiceInternalId.ToString());
Console.WriteLine(i.ToString() + " InvoiceDate: " + inv[i].InvoiceDate.ToString());
Console.WriteLine(i.ToString() + " InvoiceAmount: " + inv[i].InvoiceAmount.ToString());
Console.WriteLine(i.ToString() + " InvoiceDueDate: " + inv[i].InvoiceDueDate.ToString());
Console.WriteLine(i.ToString() + " AmountDue: " + inv[i].AmountDue.ToString());
Console.WriteLine(i.ToString() + " TotalTaxAmount: " + inv[i].TotalTaxAmount.ToString());
Console.WriteLine(i.ToString() + " Software: " + inv[i].Software.ToString());
Console.WriteLine(i.ToString() + " InvoiceUniqueId: " + inv[i].InvoiceUniqueId.ToString());
}function searchInvoices()
{
$client = new SoapClient('End point URL');
$securityToken = array(
'SecurityId' => '********-454757-********-********',
'UserId' => 'merchant1',
'Password' => 'merchant1'
);
$searchFilters['SearchFilter'][0] = array(
'FieldName' => 'InvoiceDueDate',
'ComparisonOperator' => 'ge',
'FieldValue' => '2021-01-25'
);
$searchInvoices = $client->SearchInvoices(array(
'securityToken' => $securityToken,
'customerId' => '123',
'invoiceNumber' => '00102566',
'filters' => $searchFilters,
'start' => 0,
'limit' => 10,
));
$invoices = $searchInvoices->SearchInvoicesResult;
}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">
<SearchInvoicesResponse xmlns="http://eBizCharge.ServiceModel.SOAP">
<SearchInvoicesResult>
<Invoice>
<CustomerId>CBS</CustomerId>
<SubCustomerId></SubCustomerId>
<InvoiceNumber>Inv1-103</InvoiceNumber>
<InvoiceInternalId>********-1442-4645-8f89-********</InvoiceInternalId>
<InvoiceDate>2017-01-01</InvoiceDate>
<Currency>USD</Currency>
<InvoiceAmount>1000.0000</InvoiceAmount>
<InvoiceDueDate>2016-04-02</InvoiceDueDate>
<AmountDue>5.0000</AmountDue>
<PoNum>PO001</PoNum>
<SoNum>SO001</SoNum>
<DivisionId>0001</DivisionId>
<Software>QuickBooks</Software>
<NotifyCustomer>false</NotifyCustomer>
<InvoiceURL>https://www.ebizcharge.net/uploads/invoice001.pdf</InvoiceURL>
<TotalTaxAmount>10.0000</TotalTaxAmount>
<InvoiceUniqueId>x123-456-123</InvoiceUniqueId>
</Invoice>
<Invoice>
<CustomerId>CBS</CustomerId>
<SubCustomerId></SubCustomerId>
<InvoiceNumber>Inv1-6666</InvoiceNumber>
<InvoiceInternalId>********-4c91-493b-b5c5-********</InvoiceInternalId>
<InvoiceDate>2017-01-01</InvoiceDate>
<Currency>USD</Currency>
<InvoiceAmount>1000.0000</InvoiceAmount>
<InvoiceDueDate>2016-04-02</InvoiceDueDate>
<AmountDue>52.2500</AmountDue>
<PoNum>PO001</PoNum>
<SoNum>SO001</SoNum>
<DivisionId>0001</DivisionId>
<Software>QuickBooks</Software>
<NotifyCustomer>false</NotifyCustomer>
<InvoiceURL>https://www.ebizcharge.net/uploads/invoice001.pdf</InvoiceURL>
<TotalTaxAmount>10.0000</TotalTaxAmount>
<InvoiceUniqueId>x123-456-123</InvoiceUniqueId>
</Invoice>
</SearchInvoicesResult>
</SearchInvoicesResponse>
</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">
<SearchInvoicesResponse xmlns="http://eBizCharge.ServiceModel.SOAP"/>
</s:Body>
</s:Envelope>Updated 5 months ago
