Skip to main content

Get Customer

Retrieves the details of a single customer, including addresses, role, company, product group settings and metafields.

HTTP Request​

  • URL: /customers/{id}
  • Method: GET
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_CUSTOMER or READ_WRITE_CUSTOMER

Path Parameters​

ParameterTypeDescription
idStringRequired. The ID of the customer to retrieve.

cURL Example​

curl --location '<BASE_URL>/customers/66a5023524b16685e42a1eda' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The customer was returned successfully.
  • 400 Bad Request: The access token is missing or invalid, the token does not have the required scope, or the customer ID is not valid.

Sample JSON Response​

{
"success": true,
"data": {
"id": "66a5023524b16685e42a1eda",
"firstName": "Maria",
"lastName": "Lopez",
"email": "maria.lopez@northwindsupply.com",
"phoneNumber": "9735550142",
"notes": "Primary purchasing contact",
"isB2B": true,
"status": "active",
"role": "663a0aff4587085935a4fb94",
"company": "665434c100e82884676936b9",
"verifiedEmail": true,
"newsletter": false,
"paymentAccess": {
"mode": "inherit",
"methods": []
},
"productGroups": {
"groups": [
{ "productGroup": "6702b1f0c6a1e2d3f4a5b6c7", "type": "include" }
],
"restrictStoreProductVisibility": false
},
"address": [
{
"id": "66a5023524b16685e42a1edb",
"firstName": "Maria",
"lastName": "Lopez",
"address1": "1200 Industrial Ave",
"address2": "Suite 4",
"city": "Elizabeth",
"state": { "code": "NJ", "name": "New Jersey" },
"country": { "code": "US", "name": "United States" },
"zipcode": "07202",
"phoneNumber": "9735550142",
"isDefaultAddress": true,
"status": true
}
],
"metaFields": [
{
"_id": "66a5023524b16685e42a1edc",
"metaFieldId": "6650c1a2b3c4d5e6f7a8b9c0",
"code": "erp_contact_id",
"label": "ERP Contact ID",
"valueType": "number",
"displayStorefront": false,
"value": 1254
}
],
"salesReps": [],
"createdBy": {
"id": "66a0f138a8323b0b86b0f1dc",
"name": "ERP Connector",
"type": "api"
},
"createdAt": "2024-07-27T14:20:37.573Z",
"updatedAt": "2024-08-03T10:29:32.489Z"
}
}

Response Details​

Customer Data​

The customer fields are the same as in Get All Customers.

Address Data​

FieldTypeDescription
idStringUnique identifier of the address.
firstNameStringFirst name of the contact person.
lastNameStringLast name of the contact person.
address1StringStreet address.
address2StringAdditional address line.
cityStringCity.
stateObjectState code (for example NJ) and name (for example New Jersey).
countryObjectCountry code (for example US) and name.
zipcodeStringPostal code.
phoneNumberStringPhone number for the address.
isDefaultAddressBooleanWhether this is the default address. Default is false.
statusBooleanWhether the address is active. Default is true.

Notes​

  • If no customer matches the ID, data is an empty object.