Get All Customers Details via APIs

Introduction 

There are situations when a distributor or reseller needs to synchronize hundreds of customers in a single request.  or example, you may want to run hundreds of API calls to collect reseller and customer details. Then you may want to send additional requests to get, for example, custom properties or data related to tenants. Such a way of making API calls can be ineffective and it can take a lot of time.

However, thanks to GET All Customers API endpoint it is possible to reduce resource usage related to calling multiple endpoints. The endpoint gathers necessary customer details in a single and optimized channel. It is created to handle queries at the distributor, reseller, and customer level.

 

In this article:

 

Overview of the endpoint

The GET All Customers endpoint gives a unified method to get all customer details:

  • Organizational details
  • Addresses
  • Contacts
  • Custom properties
  • Related vendor tenants

With the parameters, the API endpoint looks like this:

GET /api/v2/organizations/details/{orgId}?parameter=parameter_value

 

Parameters - GET method

Below, you can find the parameters you can use with this endpoint:

  • orgID
    • Mandatory parameter
    • The ID number of an organization for which you want to get details (reseller or distributor ID)
  • includeChildOrganizations
    • Optional parameter
    • Default value is True
    • When the distributor ID is passed, this parameter allows to get all resellers and customers related to the distributor.
  • includeAddresses
    • Optional parameter
    • Default value is False
    • When the ID of a distributor is passed, this parameter lets you get values for customerPrimaryAddress and customerBillingAddress
  • includeContacts
    • Optional parameter
    • Default value is False
    • After passing the ID, it provides values for customerPrimaryContact, customerBillingContact, customerAccountManagerContact and customerServiceDeskContact
  • includeCustomProperties
    • Optional parameter
    • When the ID is passed, it populates the fieldscustomerCustomProperties
  • includeTenants
    • Optional parameter
    • When the ID of an organization is passed, it provides values for customerTenants
  • page
    • Optional parameter
  • pageSize
    • Optional parameter
    • Default value is 10000

Parameters - POST method

The parameters that you can use with the POST method are the same as for the GET method described above and are used in the same way:

POST /api/v2/organizations/details?parameter=parameter_value
 NOTE! The main difference between GET and POST described here, is that with GET orgId parameter is used for a tenant (reseller or distributor), while with POST organization Ids in the payload are customer organization IDs. 
  • includeChildOrganizations
    • optional parameter parameter, default value is True
  • includeAddresses
    • optional parameter, the default value is False
  • includeContacts
    • optional parameter, the default value is False
  • includeCustomProperties
    • optional parameter, the default value is False
  • includeTenants
    • optional parameter, the default value is False
  • page
    • optional parameter
  • pageSize
    • optional parameter, default value is 10000

Example use

Below, you can find an example use of the endpoint:

POST https://api.appxite.com/api/v2/organizations/details
X-Referer: https://example.com

Body:
[
"97ab7e3c-74cb-4a72-a2c4-144a8996b7f9",
"e8dee4e8-3674-4063-ad3f-cbee1df74b33",
"125fc22b-08ef-47b4-a339-5c45e49133d5",
"506f98aa-ccf7-41fd-8ccd-eadb48a20dfc",
"3a26270b-d325-4976-b786-ab196d488206"
]

Params

Optional, by default=false
includeAddresses=true
includeContacts=true
includeCustomProperties=true
includeTenants=true


pageSize=10
page=1

includeChildOrganizations=false

 

Example response

This is an example response you can get when using the GET All Customers endpoint:

[
{
"customerId": "11111111-2222-3333-4444-555555555555",
"customerName": "Some Customer Name",
"resellerId": "22222222-3333-4444-5555-666666666666",
"resellerName": "Some Reseller Name",
"customerStatus": "Active",
"customerCountry": "GenericCountry",
"customerErpOrganizationId": "99999",
"customerRegistrationNumber": "123456789",
"customerVatNumber": "123456789",
"customerCurrency": "EUR",
"customerSegment": "Segment1",
"customerTenants": [
{
"vendorId": "77777777-8888-9999-aaaa-bbbbbbbbbbbb",
"vendorName": "Some Vendor's Name",
"DomainName": "genericdomain.example",
"InternalId": "abcdef12-3456-7890-abcd-ef1234567890",
"ExternalId": "G999999999"
},
{
"vendorId": "77777777-8888-9999-aaaa-bbbbbbbbbbb1",
"vendorName": "Another Vendor's Name",
"DomainName": "anothergenericdomain.example",
"InternalId": "abcdef12-3456-7890-abcd-ef1234567891",
"ExternalId": "G999999998"
}
],
"// Addresses": "",
"// \"Type\": \"Primary\"": "",
"customerPrimaryAddress": {
"primaryAddressAddressLine1": "Primary Address Line 1",
"primaryAddressAddressLine2": "Primary Address Line 2",
"primaryAddressCity": "PrimaryCity",
"primaryAddressProvince": "PrimaryProvince",
"primaryAddressPostalCode": "0000AA",
"primaryAddressCountryCode": "GC"
},
"// \"Type\": \"Billing\"": "",
"customerBillingAddress": {
"billingAddressAddressLine1": "Billing Address Line 1",
"billingAddressAddressLine2": "Billing Address Line 2",
"billingAddressCity": "BillingCity",
"billingAddressProvince": "BillingProvince",
"billingAddressPostalCode": "1111BB",
"billingAddressCountryCode": "BE"
},
"// Contacts": "",
"// \"Type\": \"Primary\"": "",
"customerPrimaryContact": {
"primaryContactFirstName": "John",
"primaryContactLastName": "Brown",
"primaryContactRole": "CEO",
"primaryContactEmail": "primary@example.com",
"primaryContactPhone": "+10000000000"
},
"// \"Type\": \"Billing\"": "",
"customerBillingContact": {
"billingContactFirstName": "Jane",
"billingContactLastName": "Jackson",
"billingContactRole": "CFO",
"billingContactEmail": "billing@example.com",
"billingContactPhone": "+10000000001"
},
"// \"Type\": \"AccountManager\"": "",
"customerAccountManagerContact": {
"accountManagerContactFirstName": "Adam",
"accountManagerContactLastName": "Smith",
"accountManagerContactRole": "Account Manager",
"accountManagerContactEmail": "accountmanager@example.com",
"accountManagerContactPhone": "+10000000002"
},
"// \"Type\": \"ServiceDesk\"": "",
"customerServiceDeskContact": {
"serviceDeskContactFirstName": "Bob",
"serviceDeskContactLastName": "Johnson",
"serviceDeskContactRole": "Service Desk Lead",
"serviceDeskContactEmail": "servicedesk@example.com",
"serviceDeskContactPhone": "+10000000003"
},
"customerCustomProperties": [
{
"customPropertyName": "Tax Zone",
"customPropertyValue": "EU_Belgium"
}
],
"customerIndustries": [
"SomeIndustry"
]
}
]

 

NOTE! X-Referer header is required to identify requestor platform URL. It's not possible to use customer from different platform in one payload.

 

Summary

The GET All Customers endpoint provides an effective way to get a complete set of organization details, including addresses, contacts, custom properties, and tenants. You can use it for one or many organizations. The optional parameters allow you to modify the response you get and make it suitable for your business needs and reduce, at the same time, the total number of API requests.

Related Content

Was this article helpful?

0 out of 0 found this helpful

Add comment

Please sign in to leave a comment.