Customers

You can use the data from the Customers endpoints to calculate key metrics, such as customer churn.

Overview

When a customer places an order with the connected commerce store their details are added to the Customers dataset.

From the Customers endpoints you can retrieve:

  • A list of all the customers of a commerce company: GET/companies/{companyId}/connections/{connectionId}/data/commerce-customers.
  • The details of an individual customer:
    GET /companies/{companyId}/connections/{connectionId}/data/commerce-customers/{customerId}.

Data model

Field

Type

Decription

id

string

Identifier for the account, unique for the company.

customerName

string

Name of the customer.

emailAddress

string

Email address the customer can be contacted on.

defaultCurrency

string
See currency

Default currency of any transactional data for the customer, for example, orders or payments.

phone

string

Phone number the customer can be contacted on.

addresses

array
See addresses

Addresses associated with the customer.

note

string

Any additional information about the customer.

createdDate

string
See date

Date on which the customer details were created in the commerce or point of sale platform.

modifiedDate

string
See date

Date the customer details were last updated in the Codat system.

sourceModifiedDate

string
See date

Date the customer details were last changed in the commerce or point of sale platform.

Addresses

Address details for a customer.

Field

Type

Description

type

string

Type of customer address:
billing — billing address
delivery — delivery address
unknown — unknown on the type of the address

line1

string

First line of the customer address.

line2

string

Second line of the customer address.

city

string

City of the customer address.

region

string

Region of the customer address.

country

string

Country of the customer address.

postalCode

string

Postal code or zip code of the address.

Example data

{
   "customers":[
      {
         "id":"15",
         "customerName":"Daffy Duck",
         "emailAddress":"[email protected]",
         "defaultCurrency":"GBP",
         "phone":"(877) 492-8687",
         "addresses":[
            {
               "type": "billing",
               "line1":"301 Duck Pond",
               "line2":"28 Green Street",
               "city":"London",
               "region":"England",
               "country":"United Kingdom",
               "postalCode":"WX1X 0BE"
            },
            {
               "type": "delivery",
               "line1":"Bread Street",
               "line2":"Bird Avenue",
               "city":"Paris",
               "region":"France",
               "country":"France",
               "postalCode":"WDF 123"
            }
         ],
         "note":"Regular customer",
         "createdDate":"0001-01-01T00:00:00",
         "modifiedDate":null,
         "sourceModifiedDate":"2020-09-15T23:52:28"
      },      
      {
         "id":"18",
         "customerName":"Tasmanian Devil",
         "emailAddress":"[email protected]",
         "defaultCurrency":"GBP",
         "phone":"+1-202-555-0181",
         "addresses":[
            {
               "type": "billing",
               "line1":"101 Fire Rooms",
               "line2":"Engine Street",
               "city":"London",
               "region":"England",
               "country":"United Kingdom",
               "postalCode":"WC1X 0BE"
            }
         ],
         "note":"Handle with care",
         "createdDate":"0001-01-01T00:00:00",
         "modifiedDate":null,
         "sourceModifiedDate":"2020-04-16T02:41:52"
      },
      {
         "id":"a99f5e0c-a4db-452f-8d2c-8fd15482b384",
         "customerName":"Bugs Bunny",
         "emailAddress":"[email protected]",
         "defaultCurrency":"GBP",
         "phone":"",
         "addresses":[
            {
               "type": "billing",
               "line1":"301 Carrot Street",
               "line2":"Orange Town",
               "city":"Yorkshire",
               "region":"England",
               "country":"United Kingdom",
               "postalCode":"WF1X 0BE"
            },
            {
               "type": "delivery",
               "line1":"424 Field Street",
               "line2":"The Meadow",
               "city":"Paris",
               "region":"France",
               "country":"France",
               "postalCode":"WDF 123"
            }
         ],
         "note":"Regular customer",
         "createdDate":"0001-01-01T00:00:00",
         "modifiedDate":null,
         "sourceModifiedDate":"2020-08-12T14:37:37"
      }
   ]
}

Did this page help you?