Skip to main content
GET
/
customers
Retrieve Customers
curl --request GET \
  --url https://api.nuwebgroup.com/v1/customers \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "type": "customers",
      "id": 1,
      "attributes": {
        "name": "John Doe",
        "firstName": "John",
        "surname": "Doe",
        "email": "[email protected]",
        "phone": null,
        "phoneCode": null,
        "fullPhoneNumber": null,
        "img": null,
        "locale": null,
        "dob": "1980-01-01 00:00:00",
        "addressLine1": "16 School Road",
        "addressLine2": "Crookes",
        "cityId": 1,
        "city": "Sheffield",
        "region": "South Yorkshire",
        "country": "United Kingdom",
        "postcode": "S10 8BH",
        "createdAt": "2021-11-22T11:59:00.000000Z",
        "updatedAt": "2021-11-22T11:59:00.000000Z"
      },
      "meta": {
        "lastUpdated": "2021-11-22T11:59:00.000000Z"
      },
      "relationships": {
        "companies": {
          "data": {
            "type": "companies",
            "id": 1
          }
        },
        "cities": {
          "data": {
            "type": "cities",
            "id": 1
          }
        },
        "currencies": {
          "data": {
            "type": "currencies",
            "id": 1
          }
        },
        "dataCaptureResponses": {
          "data": [
            {
              "type": "dataCaptureResponses",
              "id": 1
            },
            {
              "type": "dataCaptureResponses",
              "id": 2
            }
          ]
        },
        "wallets": {
          "data": [
            {
              "type": "wallets",
              "id": 1
            }
          ]
        },
        "authenticationProviders": {
          "data": [
            {
              "type": "authenticationProviders",
              "id": 1
            }
          ]
        }
      },
      "links": {
        "self": "http://api.willms.com/v1/customer?id=5"
      }
    }
  ],
  "links": {
    "first": "http://api.willms.com/v1/customers?page=1",
    "last": "http://api.willms.com/v1/customers?page=5",
    "prev": "http://api.willms.com/v1/customers?page=2",
    "next": "http://api.willms.com/v1/customers?page=5",
    "self": "http://api.willms.com/v1/customers?page=3"
  },
  "meta": {
    "total": 50
  },
  "included": [
    {
      "type": "cities",
      "id": 1,
      "attributes": {
        "name": "Sheffield",
        "region": "South Yorkshire",
        "country": "United Kingdom"
      }
    },
    {
      "type": "companies",
      "id": 1,
      "attributes": {
        "name": "sit",
        "alias": "nostrum",
        "createdAt": "2021-11-22T11:59:00.000000Z",
        "updatedAt": "2021-11-22T11:59:00.000000Z",
        "deletedAt": null
      }
    },
    {
      "type": "currencies",
      "id": 1,
      "attributes": {
        "name": "Pounds",
        "code": "GBP",
        "symbol": "Ā£"
      }
    },
    {
      "type": "dataCaptureResponses",
      "id": 1,
      "attributes": {
        "question": "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium",
        "questionId": 5,
        "questionGroup": "shop",
        "questionCategoryId": null,
        "answer": [
          1
        ],
        "availableOptions": [
          {
            "id": 1,
            "value": "accusantium"
          },
          {
            "id": 2,
            "value": "est"
          },
          {
            "id": 3,
            "value": "aliquid"
          }
        ],
        "orderId": 1,
        "orderItemId": null,
        "metaData": null,
        "createdAt": "2021-01-01T12:00:00.000000Z",
        "updatedAt": "2021-01-01T12:00:00.000000Z"
      }
    },
    {
      "type": "dataCaptureResponses",
      "id": 2,
      "attributes": {
        "question": "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium",
        "questionGroup": "shop",
        "questionCategoryId": null,
        "answer": "quo voluptas nulla pariatur",
        "availableOptions": [],
        "orderId": 1,
        "orderItemId": null,
        "metaData": null,
        "createdAt": "2021-01-01T12:00:00.000000Z",
        "updatedAt": "2021-01-01T12:00:00.000000Z"
      }
    },
    {
      "type": "authenticationProviders",
      "id": 1,
      "attributes": {
        "provider_id": 4,
        "provider_slug": "google",
        "identifier": "ABC123",
        "createdAt": "2021-01-01T12:00:00.000000Z",
        "updatedAt": "2021-01-01T12:00:00.000000Z"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

The 'Bearer' token can be obtained from the token management interface or via the login endpoint using your admin user credentials.

Query Parameters

offset
integer

The offset - e.g 100 for listing customers starting with the 100th customer. Offset will always take precedence over page.

page
integer

The page you wish to retrieve customers. You can only paginate by page if no offset is given.

limit
integer

The number of customers to retrieve per page. The maximum (and default) is 100 per page.

include
enum<string>[]

A list of related resources you wish to include in the response. Values can be a url encoded array, or comma separated string.

The dataCaptureResponses return both the responses to the marketing preferences and the responses to the general data capture questions in the checkout. You can filter these by referring to the questionGroup field in each of the data capture responses (marketing for marketing preference responses, and shop for the customer data capture in the checkout).

The answer value returned in the data capture responses can be a string (generally from responses to free text, checkboxes or select fields), or an array of option ID's selected (generally from, multicheckbox fields and radio buttons).

Available options:
companies,
dataCaptureResponses,
cities,
currencies,
wallets,
authenticationProviders
only
string

A list of attributes that you wish to be returned in the payload. When empty or omitted, all fields will be included by default. Use dot-notation for both top-level resources and child resources, i.e. customers.name,dataCaptureResponses.answer. Can be used in conjunction with except providing both parameters don't reference the same resource.

except
string

A list of attributes that you wish to exclude from the payload. When empty or omitted, all fields will be included by default. Use dot-notation for both top-level resources and child resources, i.e. customers.name,dataCaptureResponses.answer. Can be used in conjunction with only providing both parameters don't reference the same resource.

lastUpdated
string

Date/Time for retrieving customers who's associated database records (customer, user and data capture) have been updated after the given lastUpdated time. Accepted formats:

  • YYYY-MM-DD HH:MM:SS e.g. 2021-01-01 00:00:00
  • YYYY-MM-DDTHH:mm:ss.SSSSSSZ e.g. 2021-01-01T00:00:00.000000Z
Date formats that do not include the timezone must be in UTC.

withTrashed
enum<string>

Controls records returned depending on their deletedAt status. This is a global flag, so will apply to all resources, including relationships such as resources returned under the included attribute.

  • true to include deleted records
  • false to exclude deleted records (or leave blank)

Available options:
true,
false

Response

Successfully retrieved the customers.

data
object[]
meta
object
included
object[]