Untitled Page
API Overview
Example
Customers  
Companies  
Technicians  
Technician Groups  
Tickets  
Ticket History  
Ticket Attachments  
Billing Line Items  
Billing Invoices  
Time Tracking  
Knowledge Base Articles  
Scheduling  
Asset Managements  
 
get_invoices
Input Variable Input Value Description
cid String value Required A valid customer ID to limit the returned values by. You may use * as a wildcard.
start_tid String value The first invoice ID to return. The returned records will start with this value and go to the last record, unless you include the end_tid and/or count variables. Example: If you include start_tid=45 in your request, only invoices with an ID of 45 or higher will be returned.
end_tid String value The last invoice ID to return. The returned records will end at this value, unless you include the count variable. Example: If you include end_tid=45 in your request, all records from 1 to 45 will be returned. If you were to also include "count=5", only the first 5 records would be returned.
start_cid String value This can be a single letter or the first few letters of a customer ID. The returned records will have a customer ID that starts with this value and go to the last record, unless you include the end_cid and/or count variables. Example: If you include start_cid=j in your request, only invoices with a customer ID starting with j or later in the alphabet will be returned.
end_cid String value This can be a single letter or the first few letters of a customer ID. The returned records will stop at invoices that have a customer ID that starts with this value. It can be used in conjunction with start_cid or alone. When used alone the returned records will start with first record in the database. Example: If you include end_cid=j in your request, only invoices with a customer ID starting with j or earlier in the alphabet will be returned.
start_date String value as date/time The first invoice date/time to return. The returned records will start with this value and go to the last record, unless you include the end_date and/or count variables. Example: If you include start_date=2/1/2014 00:00:00 in your request, only invoices with a date of 2/1/2014 00:00:00 or later will be returned.
end_date String value The last invoice date/time to return. The returned records will end with this value. Example: If you include end_date=2/1/2014 00:00:00 in your request, only invoices with a date of 2/1/2014 00:00:00 or earlier will be returned.
date_type String value This defines which date field to use when using the start_date and end_date variables. Valid values are "I, "F" and "T" (without the quotes). "I" is for the date/time the invoice was created. "F" and "T" for the FROM and TO date range for the invoice. "I" is the default value.
include_line_items String value This defines whether or not to include a sub-section that contains the invoice data. Valid values are "N" and "Y" (without the quotes).
count Integer value This would be the number of records to return.
count_only String value Defines whether or not to return only the number of records. This is used in conjunction with the "page" variable or just to get the total number of records. Accepted values are "N" and "Y" (without the quotes). The default value is "N", and if this variable is excluded the detailed data is returned.
page Integer value This would be the number of the "page" of records to return. You must use a wildcard like "id=*" to get paged records, and you must also include the "count" variable". Example: &id=*&count=10&page=1.
order String value Defines the sort order of the returned records. You will need to examine the database to determine the exact field names to sort by. You may also include " ASC" (ascending) and " DESC" (descending) in the value for the sort direction (note the preceding blank space). For example, to sort by ID in descending order you would include the following in the URL: &order=ID DESC. You can optionally include the "order_direction" variable separately.
order_direction String value Defines the sort order direction of the returned records. Accepted values are "ASC" (ascending) and "DESC" (descending). THe default values is "ASC". For example, to sort by ID in descending order you would include the following in the URL: &order=ID&order_direction=DESC.

Output Variable URL Encoded Description
invoice_id No Unique ID of the invoice.
customer_id Yes The customer ID associated with the invoice.
ticket_id No The ticket ID associated with the invoice.
company_id No The company ID associated with the invoice.
company_name Yes The company name associated with the invoice.
invoice_date No The date/time the invoice was generated.
from_date No The FROM date for the invoice date range.
to_date No The TO date for the invoice date range.
sub_total No The sub-total cost for the invoice.
tax No The tax percentage that was applied to the invoice.
total No The total cost for the invoice.
billing_type No The type of billing method that was used to generate the costs. Possible return types are "FT" (fixed cost per ticket), "FJ" (fixed cost per job) and "V" (variable per job).
status No The invoice status of the invoice. Possible return values are "PENDING" and "PAID".
jobs No A comma delimited list of the line item IDs associated with the invoice.
Example Usage
http://localhost/API/default.aspx?key=your key here&action=get_invoices&id=*
Example Response
XML:
<?xml version="1.0"?>
<invoices>
	<invoice>
		<invoice_id>1</invoice_id>
		<customer_id>demo</customer_id>
		<company_id></company_id>
		<company_name></company_name>
		<invoice_date>3/31/2014 6:30:55 PM</invoice_date>
		<from_date>3/1/2014</from_date>
		<to_date>3/31/2014</to_date>
		<sub_total>0</sub_total>
		<tax>0</tax>
		<total>4</total>
		<billing_type>V</billing_type>
		<status>PENDING</status>
		<jobs>1|</jobs>
	</invoice>
</invoices>
JSON:
{
	"invoices": [
		{
			"invoice_id" : "1",
			"customer_id" : "demo",
			"company_id" : "5",
			"company_name" : "",
			"invoice_date" : "3/31/2014 6:30:55 PM",
			"from_date" : "3/1/2014",
			"to_date" : "3/31/2014",
			"sub_total" : "0",
			"tax" : "0",
			"total" : "4",
			"billing_type" : "V",
			"status" : "PENDING",
			"jobs" : "1|"
		}
	]
}
URL DELIMITED:
invoice_id=1&customer_id=demo&company_id=5&company_name=&invoice_date=3/31/2014 6:30:55 PM
&from_date=3/1/2014&to_date=3/31/2014&sub_total=0&tax=0&total=4
&billing_type=V&status=PENDING&jobs=1|