Customers & Sales
subscription
10 endpoints. Start at search to collect IDs, then resolve them through get.
Read · 4
Read operations
search subscription
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.
activeintegerDefault: (0,1). 0: Frozen and no longer being placed in the job pool, 1: Active, -3: Lead
customerIDsintegerCustomer who owns this subcscription
subscriptionIDsintegerUnique Identifier for this Subscription
soldByintegerThe user who is being credited for this sale. Used in stats and commissions reporting
preferredTechintegerThe employee ID of the preferred tech
dateAddedstringDate this subscription was created / added / sold
dateCancelledstringDate this subscription was cancelled
Returns
subscriptionIDsarrayNo description in the upstream reference.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/subscription/search' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'officeIDs=1' \
--data-urlencode 'active=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
get subscription
Get Bulk data for subscription. Accepts an array of subscriptionIDs. Returns a max of 1000 records.
Parameters
subscriptionIDsarrayNo description in the upstream reference.
includeCancellationReasonintegerSend as 1 to retrieve an array of cancellationNotes associated with the subscription.
Returns
subscriptionIDintegerUnique ID
customerIDintegerCustomer ID which this subscription belongs to
billToAccountIDintegerBilling Account which this subscription belongs to
officeIDintegerOffice ID which this subscription belongs to
dateAddedstringDate this subscription was added / created. Sold date.
contractAddedstringDate the last contract was added / created.
activeinteger0: frozen, 1: active and being placed in the job pool.
activeTextintegerFriendly text version of active
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/subscription/get' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'subscriptionIDs=value' \
--data-urlencode 'includeCancellationReason=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Fetch by id subscription
Get subscription data for single ID -- please provide a specific record ID in the URL structure.
Parameters
includeCancellationReasonintegerSend as 1 to retrieve an array of cancellationNotes associated with the subscription.
Returns
subscriptionIDintegerUnique ID
customerIDintegerCustomer ID which this subscription belongs to
billToAccountIDintegerBilling Account which this subscription belongs to
officeIDintegerOffice ID which this subscription belongs to
dateAddedstringDate this subscription was added / created. Sold date.
contractAddedstringDate the last contract was added / created.
activeinteger0: frozen, 1: active and being placed in the job pool.
activeTextintegerFriendly text version of active
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/subscription/{id}' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'includeCancellationReason=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
getInitialAddOns subscription
Parameters
No parameters beyond authentication.
Returns
addOnIDintegerPrimary Key ticketItems.itemID
subscriptionIDintegerForeign key to subscriptions table.
productIDintegerForeign key to products table.
amountdoubleAmount to charge for this addon.
descriptionstringFriendly description of the product.
quantityintegerThe number of items.
taxableinteger1- tax 0 - no tax
creditTointegerEmployee who sold the add-on
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/subscription/getInitialAddOns' \
-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 subscription
create a subscription
Parameters
subscriptionLinkstringSubscription Link for import serviceID - integer - required The service type ID for the regular recurring services customerID - integer - required Customer ID which this subscription belongs to
billToAccountIDintegerBilling Account which this subscription belongs to
activeinteger0: frozen, 1: active and being placed in the job pool.
billingFrequencyintegerFrequency that an invoice is generated for this service. -1/0
frequencyintegerThe frequency that the services get scheduled. -1 represents One-Time, 0 represents 'as needed'. Greater than 0 represents the frequency in days. If it is divisible by 30, it is converted to months -- so 90 would represent 3 months and not necessarily 90 days.
followupDelayintegerHow many days after the initial service to schedule the first recurring service. Set as -1 to use frequency
agreementLengthintegerAgreement Length
preferredTechintegerThe employee ID of the preferred tech - 0 for no preference
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/subscription/create' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'subscriptionLink=value' \
--data-urlencode 'billToAccountID=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
update subscription
Update subscription details
Parameters
subscriptionLinkstringSubscription Link for import
serviceIDintegerThe service type ID for the regular recurring services
customerIDintegerCustomer ID which this subscription belongs to
billToAccountIDintegerBilling Account which this subscription belongs to
activeinteger0: frozen, 1: active and being placed in the job pool.
billingFrequencyintegerFrequency that an invoice is generated for this service. -1/0
frequencyintegerThe frequency that the services get scheduled. -1 represents One-Time, 0 represents 'as needed'. Greater than 0 represents the frequency in days. If it is divisible by 30, it is converted to months -- so 90 would represent 3 months and not necessarily 90 days.
followupDelayintegerHow many days after the initial service to schedule the first recurring service. Set as -1 to use frequency
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/subscription/update' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'subscriptionLink=value' \
--data-urlencode 'serviceID=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
createInitialAddOn subscription
Parameters
serviceIDintegerForeign key to serviceTypes table. amount - number - required Amount to charge for this addon.
quantityintegerThe number of items. Defaults to 1.
taxableinteger1- tax 0 - no tax; Defaults to the value specified for serviceTaxable on initial ticket.
creditTointegerThe employee who will receive credit for selling the add-on for commissions. Defaults to creditTo on Service Subscription.
descriptionstringCustomer facing text for item.
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/subscription/createInitialAddOn' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'serviceID=1' \
--data-urlencode 'quantity=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
setInitialAddOns subscription
Parameters
addonsarrayAddon Entity - see createInitialAddOn params
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/subscription/setInitialAddOns' \
-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
updateInitialAddOn subscription
Parameters
serviceIDintegerForeign key to serviceTypes table. amount - number - required Amount to charge for this addon.
quantityintegerThe number of items. Defaults to 1.
taxableinteger1- tax 0 - no tax; Defaults to the value specified for serviceTaxable on initial ticket.
creditTointegerThe employee who will receive credit for selling the add-on for commissions. Defaults to creditTo on Service Subscription.
descriptionstringCustomer facing text for item. addOnID - integer - required Foreign key to ticketItems table. Retrieve via getInitialAddons(subscriptionID).
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/subscription/updateInitialAddOn' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'serviceID=1' \
--data-urlencode 'quantity=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
updateLeadStage subscription
Parameters
subscriptionLinkintegerAlternative to subscriptionID. This is the "SubscriptionID" sent during an API insert through import/main.
stageIDintegerLead stage ID.
statusinteger0 - Convert To Lead, 1 - Convert to subscription (lead won)
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/subscription/updateLeadStage' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'subscriptionLink=1' \
--data-urlencode 'stageID=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response