Customers & Sales
customer
7 endpoints. Start at search to collect IDs, then resolve them through get.
Read operations
search customer
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.
activeintegerWhether or not this customer is 'Active': 1 or 'Inactive': 0.
customerIDsintegerUnique Identifier
dateAddedstringThe date this customer was created or added.
dateCancelledstringThe date this customer was cancelled.
dateUpdatedstringLast date this customer record was updated.
aPayintegerAuto Pay status: 0-Not on Auto Pay, 1-Auto Pay CC, 2-AutoPay ACH
lnamestringCustomer's last name
Returns
customerIDsarrayNo description in the upstream reference.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/customer/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 customer
Get Bulk data for customer. Accepts an array of customerIDs. Returns a max of 1000 records.
Parameters
customerIDsarrayNo description in the upstream reference.
includeCancellationReasonintegerSend as 1 to retrieve an array of cancellationNotes associated with each customer.
includeSubscriptionsintegerSend as 1 to retrieve an array of subscriptions associated with each customer.
includeCustomerFlagintegerSend as 1 to retrieve an array of flags associated with each customer.
includeAdditionalContactsintegerSend as 1 to retrieve an array of additional contacts associated with each customer.
includePortalLoginintegerSend as 1 to retrieve additional properties portalLogin (full URL for customer login) and portalLoginExpires (datetime in PST). Portal token guarenteed valid for 3 days or longer.
Returns
customerIDintegerUnique Identifier
billToAccountIDintegerBilling Account which this subscription belongs to
officeIDintegerThe ID of the office this customer belongs to.
fnamestringThe first name of the customer
lnamestringThe last name of the customer.
companyNamestringThe company name of the customer.
spousestringSpouse or alternate contact.
commercialAccountinteger0: Not Commercial, 1: Commercial
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/customer/get' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'customerIDs=value' \
--data-urlencode 'includeCancellationReason=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Fetch by id customer
Get customer 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 each customer.
includeSubscriptionsintegerSend as 1 to retrieve an array of subscriptions associated with each customer.
includeCustomerFlagintegerSend as 1 to retrieve an array of flags associated with each customer.
includeAdditionalContactsintegerSend as 1 to retrieve an array of additional contacts associated with each customer.
includePortalLoginintegerSend as 1 to retrieve additional properties portalLogin (full URL for customer login) and portalLoginExpires (datetime in PST). Portal token guarenteed valid for 3 days or longer.
Returns
customerIDintegerUnique Identifier
billToAccountIDintegerBilling Account which this subscription belongs to
officeIDintegerThe ID of the office this customer belongs to.
fnamestringThe first name of the customer
lnamestringThe last name of the customer.
companyNamestringThe company name of the customer.
spousestringSpouse or alternate contact.
commercialAccountinteger0: Not Commercial, 1: Commercial
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/customer/{id}' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'includeCancellationReason=1' \
--data-urlencode 'includeSubscriptions=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Write operations
create customer
create a customer
Parameters
billToAccountIDintegerNo description in the upstream reference.
fnamestringFirst name
lnamestringLast name
spousestringNo description in the upstream reference.
addressstringAddress string
citystringCity string
statestring2 letter state code
zipstringZip code
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/customer/create' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'billToAccountID=1' \
--data-urlencode 'fname=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
update customer
Update customer details
Parameters
billToAccountIDintegerNo description in the upstream reference.
fnamestringFirst name
lnamestringLast name
spousestringNo description in the upstream reference.
addressstringAddress string
citystringCity string
statestring2 letter state code
zipstringZip code
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/customer/update' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'billToAccountID=1' \
--data-urlencode 'fname=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
createPaymentProfile customer
Create a payment profile using a CreditCardToken and CreditCardTokenID from braintree/element
Parameters
CreditCardTokenstringRequired for braintree and element. Not required for nmi
CreditCardTokenIDstringRequired for braintree and nmi. Not required for element
Returns
idintegerPrimary Key for paymentProfiles
customerIDintegerCustomer associated with the payment profile
profileIDstringCredit card token associated with the payment processor
paymentProfileIDstringCredit card token id associated with the payment processor
createdByintegerEmployeeID who added the payment profile
dateCreatedstringDate created
billingNamestringBilling name
billingAddress1stringBilling Address
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/customer/createPaymentProfile' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'CreditCardToken=value' \
--data-urlencode 'CreditCardTokenID=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
updatePaymentProfile customer
Update billing information of existing payment profile for a customer
Parameters
billingNamestringBilling name associated with payment profile
billingAddress1stringBilling address associated with payment profile
billingCitystringBilling city associated with payment profile
billingStatestringBilling state associated with payment profile
billingZipintegerBilling zip code associated with payment profile
billingCountryIDstringBilling country code associated with payment profile
Returns
idintegerPrimary Key for paymentProfiles
customerIDintegerCustomer associated with the payment profile
profileIDstringCredit card token associated with the payment processor
paymentProfileIDstringCredit card token id associated with the payment processor
createdByintegerEmployeeID who added the payment profile
dateCreatedstringDate created
billingNamestringBilling name
billingAddress1stringBilling Address
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/customer/updatePaymentProfile' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'billingName=value' \
--data-urlencode 'billingAddress1=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response