Documentation / API / Operations on Customers

GET and COUNT operations available on customers.

Customers Operations

GET

URL

POST https://your-secured-store-url:443/api/v1/customers/get

Filters

Filter Type
id Array of GUID
email Array of String (max 255 chars)
firstname Array of String (max 255 chars)
lastname Array of String (max 255 chars)
company Array of String (max 255 chars)
phone Array of String (max 255 chars)
cellphone Array of String (max 255 chars)
countryid Array of GUID (Countries)
stateid Array of GUID (States)
city Array of String (max 255 chars)
postalcode Array of String (max 255 chars)
credit_min Decimal (max 8 digits and 2 decimals)
credit_max Decimal (max 8 digits and 2 decimals)
guest Boolean
confirmed Boolean
createdon_min DateTime
createdon_max DateTime

Request

Retrieve all the items (max 1000)

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        }
    }

Retrieve specific items by ID

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
            'id' : ['00000000-0000-0000-0000-000000000000', '12345678-1234-1234-1234-123456781234']
        }
    }

Most complete request (just to give you the format of each parameter)

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
		    'id': ['00000000-0000-0000-0000-000000000000', '12345678-1234-1234-1234-123456781234'],
		    'email' : ['example@example.com'],
		    'firstname' : ['Mr'],
		    'lastname' : ['Example'],
		    'company' : ['commerscale'],
		    'phone' : ['4181234567'],
		    'cellphone' : ['4189876543'],
		    'countryid' : ['75b36fa9-4eb5-4a2f-8bd2-2baafd81cfe9'],
		    'stateid' : ['ea150089-6c9f-4c00-81f3-e64e67270fe9'],
		    'city' : ['Quebec'],
		    'postalcode' : ['G1G1G1'],
		    'credit_min' : '0',
		    'credit_max' : '99.99',
		    'guest' : 'false',
		    'confirmed' : 'false',
		    'createdon_min' : '2015-01-01',
		    'createdon_max' : '2020-01-01'
	    },
        'pagination' : {
            'pageNumber' : '1',
            'pageSize' : '1000'
        }
    }

Response

If no error occured, you will receive a response like this one (object type: Customer). Please refer to error messages to learn more about the possible error responses.

[
   {
      "id": "00000000-0000-0000-0000-000000000000",
      "email": "example@example.com",
      "firstname": "Mr",
      "lastname": "Example A",
      "company": "commerscale",
      "addressline1": "123 street A",
      "addressline2": "",
      "phone": "4181234567",
      "cellphone": "4189876543",
      "countryid": "75b36fa9-4eb5-4a2f-8bd2-2baafd81cfe9",
      "countrycode": "CA",
      "countryname": "Canada",
      "stateid": "ea150089-6c9f-4c00-81f3-e64e67270fe9",
      "statecode": "QC",
      "statename": "Quebec",
      "city": "Quebec",
      "postalcode": "G1G1G1",
      "credit": "20.00",
      "guest": "false",
      "confirmed": "false",
      "author": "Mr Example",
      "createdon": "2015-10-15 15:45:36"
   },
   {
      "id": "12345678-1234-1234-1234-123456781234",
      "email": "example@example.com",
      "firstname": "Mr",
      "lastname": "Example B",
      "company": "commerscale",
      "addressline1": "123 street B",
      "addressline2": "",
      "phone": "4181234567",
      "cellphone": "4189876543",
      "countryid": "75b36fa9-4eb5-4a2f-8bd2-2baafd81cfe9",
      "countrycode": "CA",
      "countryname": "Canada",
      "stateid": "ea150089-6c9f-4c00-81f3-e64e67270fe9",
      "statecode": "QC",
      "statename": "Quebec",
      "city": "Quebec",
      "postalcode": "G1G1G1",
      "credit": "20.00",
      "guest": "false",
      "confirmed": "false",
      "author": "Mr Example",
      "createdon": "2016-10-15 15:45:36"
   }
]

COUNT

URL

POST https://your-secured-store-url:443/api/v1/customers/count

Filters

Filter Type
id Array of GUID
email Array of String (max 255 chars)
firstname Array of String (max 255 chars)
lastname Array of String (max 255 chars)
company Array of String (max 255 chars)
phone Array of String (max 255 chars)
cellphone Array of String (max 255 chars)
countryid Array of GUID (Countries)
stateid Array of GUID (States)
city Array of String (max 255 chars)
postalcode Array of String (max 255 chars)
credit_min Decimal (max 8 digits and 2 decimals)
credit_max Decimal (max 8 digits and 2 decimals)
guest Boolean
confirmed Boolean
createdon_min DateTime
createdon_max DateTime

Request

Count the items

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        }
    }

Count specific items by country

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
            'countryid' : ['75b36fa9-4eb5-4a2f-8bd2-2baafd81cfe9']
        }
    }

Most complete request (just to give you the format of each parameter)

{
        'authentication' : {
            'apiKey' : 'jjns7519v1v3ns6xU162'
        },
        'filters' : {
		    'id': ['00000000-0000-0000-0000-000000000000', '12345678-1234-1234-1234-123456781234'],
		    'email' : ['example@example.com'],
		    'firstname' : ['Mr'],
		    'lastname' : ['Example'],
		    'company' : ['commerscale'],
		    'phone' : ['4181234567'],
		    'cellphone' : ['4189876543'],
		    'countryid' : ['75b36fa9-4eb5-4a2f-8bd2-2baafd81cfe9'],
		    'stateid' : ['ea150089-6c9f-4c00-81f3-e64e67270fe9'],
		    'city' : ['Quebec'],
		    'postalcode' : ['G1G1G1'],
		    'credit_min' : '0',
		    'credit_max' : '99.99',
		    'guest' : 'false',
		    'confirmed' : 'false',
		    'createdon_min' : '2015-01-01',
		    'createdon_max' : '2020-01-01'
	    }
    }

Response

If no error occured, you will receive a response like this one. Please refer to error messages to learn more about the possible error responses.

{
   "count": "2"
}