Customers & Sales
contract
5 endpoints. Start at search to collect IDs, then resolve them through get.
Read operations
search contract
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.
contractIDsintegerNo description in the upstream reference.
customerIDsintegerNo description in the upstream reference.
subscriptionIDsintegerNo description in the upstream reference.
dateSignedstringThe date the contract was signed.
dateAddedstringThe date the contract was added.
includeDatainteger{0,1} Sends the resolved objects for the first 1000 IDs. If there are more than 1000 items an additional property contractIDsNoDataExported will specify the items that are not included in the resolved contract array.
Returns
contractIDsarrayNo description in the upstream reference.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/contract/search' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'officeIDs=1' \
--data-urlencode 'contractIDs=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
get contract
Get Bulk data for contract. Accepts an array of contractIDs. Returns a max of 1000 records.
Parameters
contractIDsarrayNo description in the upstream reference.
includeDocumentLinkintegerSend as 1 to retrieve a link to the document on AWS with a 15 day TTL.
Returns
contractIDsintegerNo description in the upstream reference.
contractIDintegerNo description in the upstream reference.
customerIDsintegerNo description in the upstream reference.
subscriptionIDsintegerNo description in the upstream reference.
dateSignedstringThe date the contract was signed.
dateAddedstringThe date the contract was added.
documentStateintegerState of the document e.g. WIP, COMPLETED
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/contract/get' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'contractIDs=value' \
--data-urlencode 'includeDocumentLink=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Fetch by id contract
Get contract data for single ID -- please provide a specific record ID in the URL structure.
Parameters
includeDocumentLinkintegerSend as 1 to retrieve a link to the document on AWS with a 15 day TTL.
Returns
contractIDsintegerNo description in the upstream reference.
contractIDintegerNo description in the upstream reference.
customerIDsintegerNo description in the upstream reference.
subscriptionIDsintegerNo description in the upstream reference.
dateSignedstringThe date the contract was signed.
dateAddedstringThe date the contract was added.
documentStateintegerState of the document e.g. WIP, COMPLETED
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/contract/{id}' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'includeDocumentLink=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Write operations
create contract
Create the default contract for the subscriptionID or subscriptionLink sent. If sending a signedFile, upload the file as multipart/form-data with parameter name uploadFile
Parameters
subscriptionIDintegerForeign key to subscriptions table.
subscriptionLinkintegerAlternative to subscriptionID. This is the "SubscriptionID" sent during an API insert through import/main.
emailCustomerintegerSet as 1 to also send a link to the customer via email.
dateSignedstringThe date the contract was signed. Required if uploading a signed document.
base64EncodedFilestringThe Base64 encoded signed contract. Pass this if not sending the file.
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/contract/create' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'subscriptionID=1' \
--data-urlencode 'subscriptionLink=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Destructive operations
delete contract
Delete an uploaded contract
Parameters
contractIDintegerId of the contract to be deleted.
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/contract/delete' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'contractID=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response