Skip to main content
GET
/
customer
Retrieve Customer
curl --request GET \
  --url https://api.nuwebgroup.com/v1/customer \
  --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"
    }
  },
  "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"
      }
    },
    {
      "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": "wallets",
      "id": 1,
      "attributes": {
        "id": 94,
        "company_id": 1,
        "user_id": 9,
        "currency_id": 32,
        "currency_code": "GBP",
        "currency_name": "Pounds",
        "currency_symbol": "Ā£",
        "available_balance": 2500,
        "refundable_balance_online": 2000,
        "refundable_balance_offline": 2500,
        "createdAt": "2021-01-01T12:00:00.000000Z",
        "updatedAt": "2021-01-01T12:00:00.000000Z"
      }
    },
    {
      "type": "authenticationProviders",
      "id": 1,
      "attributes": {
        "provider": 1,
        "provider_slug": "open_id",
        "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

id
integer

The customer's ID. This is required if the email, reference, nfcId or barcode fields are empty.

email
string

The customer's email address. This is required if the id, reference, nfcId or barcode fields are empty.

barcode
string

A barcode from one of the customer's order items. This is required if the id, reference, nfcId or email fields are empty.

reference
string

A customer order reference. This is required if the id, barcode, nfcId or email fields are empty.

nfcId
string

an NFC tag ID. This is required if the id, barcode, reference or email fields are empty.

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
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
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.

Response

Successfully retrieved the customer.

data
object
included
object[]