Billing
ticket
9 endpoints. Start at search to collect IDs, then resolve them through get.
Read operations
search ticket
Provide a set of parameters which will return a list of ids. There is no limit to the number of IDs this will return. You can then supply these ids to the get endpoint in order to retrieve bulk data. Every parameter available supports a simple value OR a powerful query object that gives you access to all basic comparators.
Example
dateAdded={"operator":">","value":"2016-01-01"}Example
dateAdded={"operator\":\"BETWEEN\",\"value\":[\"2016-05-12\",\"2016-05-13\"]}Available operators
><>=<==!=INBETWEENLIKESTARTSWITHENDSWITHCONTAINSEach of the search endpoints allows for an optional parameter 'includeData'. When sent, the API will additionally send the resolved objects for the first 1000 IDs.
Keep in mind when using 'includeData' that if there are more than 1000 items an additional property '{entity}IDsNoDataExported' will specify the items that are not included in the resolved data array.
Parameters
officeIDsintegerNo description in the upstream reference.
ticketIDsintegerNo description in the upstream reference.
statusintegerWhether this ticket/invoice is active: 1 or inactive: 0. Inactive tickets are not added to the customer's balance or A/R aging
customerIDsintegerThe customer who owns this ticket
recurringTemplateSubscriptionIDsintegerWhen a ticket has a recurring template subscription ID it represents a recurring ticket template
dateCreatedstringThe date this ticket was created
invoiceDatestringInvoice date
dateUpdatedstringThe date the ticket was updated
Returns
ticketIDsarrayNo description in the upstream reference.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/ticket/search' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'officeIDs=1' \
--data-urlencode 'ticketIDs=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
get ticket
Get Bulk data for ticket. Accepts an array of ticketIDs. Returns a max of 1000 records.
Parameters
ticketIDsarrayNo description in the upstream reference.
Returns
ticketIDintegerUnique ID
customerIDintegerCustomer ID which this subscription belongs to
billToAccountIDintegerBilling Account which this subscription belongs to
officeIDintegerOffice ID which this subscription belongs to
dateCreatedstringDate this ticket was added / created.
invoiceDatestringInvoice date
dateUpdatedstringThe date the ticket was updated
activeinteger0: pending, 1: active and counts towards customer's outstanding balance, -1: a ticket template.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/ticket/get' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'ticketIDs=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Fetch by id ticket
Get ticket data for single ID -- please provide a specific record ID in the URL structure.
Parameters
No parameters beyond authentication.
Returns
ticketIDintegerUnique ID
customerIDintegerCustomer ID which this subscription belongs to
billToAccountIDintegerBilling Account which this subscription belongs to
officeIDintegerOffice ID which this subscription belongs to
dateCreatedstringDate this ticket was added / created.
invoiceDatestringInvoice date
dateUpdatedstringThe date the ticket was updated
activeinteger0: pending, 1: active and counts towards customer's outstanding balance, -1: a ticket template.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/ticket/{id}' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
getAddOns ticket
Get Addons for a ticket.
Parameters
No parameters beyond authentication.
Returns
itemIDintegerPrimary key for ticketItems
ticketIDintegerForeign key to tickets table. Retrieve via getAddons(subscriptionID).
descriptionstringCustomer Facing text for item.
quantityintegerNumber of products or services to add.
amountdoubleCharge Amount for item.
productIDintegerForeign key to products table.
serviceIDintegerForeign key to services Table.
taxableinteger0 for untaxable, 1 for taxable. Items with negative amounts cannot be taxable.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/ticket/getAddOns' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Write operations
create ticket
Parameters
serviceTaxableinteger1- tax 0 - no tax; Defaults to the value specified for given serviceID. date - string - required Date this invoice should be applied
billToAccountIDintegerForeign key to customers table. serviceCharge - number - required Value in USD.
additionalNotesstringAdd notes about the invoice.
statusstring0 = not active, 1 = active, -1 = ticket template, -3 = lead
templateTypestringR = recurring, I = initial, NA = not applicable/not a template
addonsarrayArray of ticket addon objects, see ticket/createAddon. Send as empty array or false to unset.
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/ticket/create' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'serviceTaxable=1' \
--data-urlencode 'billToAccountID=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
update ticket
Parameters
customerIDintegerForeign key to customers table.
subscriptionIDintegerForeign key to subscription table.
serviceIDintegerForeign key to serviceTypes table.
serviceTaxableinteger1- tax 0 - no tax; Defaults to the value specified for given serviceID.
datestringDate this invoice should be applied
billToAccountIDintegerForeign key to customers table.
serviceChargedoubleValue in USD.
additionalNotesstringAdd notes about the invoice.
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/ticket/update' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'customerID=1' \
--data-urlencode 'subscriptionID=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
createAddOn ticket
Parameters
descriptionstringCustomer Facing text for item.
quantityintegerNumber of products or services to add. amount - number - required Charge Amount for item.
productIDintegerForeign key to products table.
serviceIDintegerForeign key to services Table. taxable - integer - required 0 for untaxable, 1 for taxable. Items with negative amounts cannot be taxable.
creditTointegerForeign key to employees table.
unitIDintegerForeign key to unit table (if applicable for unit specific addons on multi-unit customers)
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/ticket/createAddOn' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'description=value' \
--data-urlencode 'quantity=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
setAddOns ticket
Delete all existing addons and set the addons for the specified ticket to the received array.
Parameters
addonsarrayAddon Entity - see createAddOn params
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/ticket/setAddOns' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'addons=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
updateAddOn ticket
Parameters
descriptionstringCustomer Facing text for item.
quantityintegerNumber of products or services to add.
amountdoubleCharge Amount for item.
productIDintegerForeign key to products table.
serviceIDintegerForeign key to services Table.
taxableinteger0 for untaxable, 1 for taxable. Items with negative amounts cannot be taxable.
creditTointegerForeign key to employees table.
unitIDintegerForeign key to unit table (if applicable for unit specific addons on multi-unit customers) itemID - integer - required Primary key to the ticketItems table.
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/ticket/updateAddOn' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'description=value' \
--data-urlencode 'quantity=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response