Loading...

Knowledge Base

Search Customers Using the API

When you want to search customer accounts using the API. This article explains search filters, pagination parameters, customer status options, receipt filters, and response details for matching customer records.

Search

Description

Gets details of the Customers that match the Search criteria.

Parameters

NameData TypeRequired / OptionalDescription
auth-useridIntegerRequiredAuthentication Parameter
api-keyStringRequiredAuthentication Parameter
no-of-recordsIntegerRequiredNumber of records to be fetched. This should be a value between 10 to 500.
page-noIntegerRequiredPage number for which details are to be fetched
customer-idArray of IntegersOptionalCustomer Id(s)
reseller-idArray of IntegersOptionalReseller Id of sub-reseller(s) for whom Customer accounts need to be searched
usernameStringOptionalUsername of Customer. Username should be an email address.
nameStringOptionalName of Customer
companyStringOptionalCompany name of Customer
cityStringOptionalCity
stateStringOptionalState
statusStringOptionalStatus of Customer. Values can be Active, Suspended and Deleted.
creation-date-startStringOptionalUNIX TimeStamp for listing of Customer accounts whose Creation Date is greater than creation-date-start
creation-date-endStringOptionalUNIX TimeStamp for listing of Customer accounts whose Creation Date is less than creation-date-end
total-receipt-startFloatOptionalTotal receipts of Customer which is greater than total-receipt-start
total-receipt-endFloatOptionalTotal receipts of Customer which is less than total-receipt-end

HTTP Method

GET

Example Test URL Request

https://test.httpapi.com/api/customers/search.json?auth-userid=0&api-key=key&no-of-records=10&page-no=1

Response

Returns a hash map containing the below details of the Customers that match the search criteria:

  • Number of Customers requested matching the search criteria (recsonpage)

    Following details of each Customer:

    • Customer Id (customer.customerid)

    • Customer Username (customer.username)

    • Reseller Id of the Parent Reseller (customer.resellerid)

    • Name (customer.name)

    • Company (customer.company)

    • City (customer.city)

    • State (customer.state)

    • Country Code (customer.country)

    • Current Status (customer.customerstatus)

    • Total Receipts (customer.totalreceipts)

  • Number of Customers in the System matching the search criteria (recsindb)

In case of any errors, a status key with value as ERROR alongwith an error message will be returned.