BETA: Please note that the current endpoints are considered beta. It is possible there may be changes before these endpoints are finalised.

Customer Lists

List Customer Lists

Get all customer lists

get /organizations/{organizationId}/customer-lists

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID
afterstringqueryThe cursor to use for pagination. Do not use this field manually it will be automatically provided in the response headers (see Paging guide).

Responses

200: OK response.CustomerList[]
[
  {
    "createdAt": "2021-10-20T14:51:16Z",
    "id": "01FCCGYZA9JPQ97HBSTKW0KT7P",
    "memberCount": 100,
    "name": "Loyal Customers"
  },
  {
    "createdAt": "2021-10-20T14:51:16Z",
    "id": "01FCCGYZA9JPQ97HBSTKW0KT7P",
    "memberCount": 100,
    "name": "Loyal Customers"
  },
  {
    "createdAt": "2021-10-20T14:51:16Z",
    "id": "01FCCGYZA9JPQ97HBSTKW0KT7P",
    "memberCount": 100,
    "name": "Loyal Customers"
  },
  {
    "createdAt": "2021-10-20T14:51:16Z",
    "id": "01FCCGYZA9JPQ97HBSTKW0KT7P",
    "memberCount": 100,
    "name": "Loyal Customers"
  }
]
404: not_found: Not Found response.

Create a Customer List

Creates a new customer list

post /organizations/{organizationId}/customer-lists

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID

Request Body

CustomerListPayload
{
  "name": "Loyal Customers"
}

Responses

201: Created response.CustomerList
{
  "createdAt": "2021-10-20T14:51:16Z",
  "id": "01FCCGYZA9JPQ97HBSTKW0KT7P",
  "memberCount": 100,
  "name": "Loyal Customers"
}

Get a Customer List

Get a customer list

get /organizations/{organizationId}/customer-lists/{listId}

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID
listIdstringpathList ID

Responses

200: OK response.CustomerList
{
  "createdAt": "2021-10-20T14:51:16Z",
  "id": "01FCCGYZA9JPQ97HBSTKW0KT7P",
  "memberCount": 100,
  "name": "Loyal Customers"
}
404: not_found: Not Found response.

Update a Customer List

Updates an existing customer list. Only permitted for lists created by this client.

put /organizations/{organizationId}/customer-lists/{listId}

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID
listIdstringpathThe ID of the list to update

Request Body

CustomerListPayload
{
  "name": "Loyal Customers"
}

Responses

200: OK response.CustomerList
{
  "createdAt": "2021-10-20T14:51:16Z",
  "id": "01FCCGYZA9JPQ97HBSTKW0KT7P",
  "memberCount": 100,
  "name": "Loyal Customers"
}
404: not_found: Not Found response.
409: conflict: Conflict response.

Delete a Customer List

Delete a customer list. Only permitted for lists created by this client.

delete /organizations/{organizationId}/customer-lists/{listId}

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID
listIdstringpathList ID

Responses

204: No Content response.
404: not_found: Not Found response.
409: conflict: Conflict response.

List Members of a Customer List

Lists all members on a customer list

get /organizations/{organizationId}/customer-lists/{listId}/members

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID
afterstringqueryThe cursor to use for pagination. Do not use this field manually it will be automatically provided in the response headers (see Paging guide).
listIdstringpathList ID

Responses

200: OK response.CustomerListMember[]
[
  {
    "addedAt": "2020-10-20T15:32:16Z",
    "email": "john@example.com",
    "firstName": "John",
    "id": "01FCCGYZA9JPQ97HBSTKW0KT7P",
    "lastName": "Smith",
    "phoneNumber": "+61411222333"
  },
  {
    "addedAt": "2020-10-20T15:32:16Z",
    "email": "john@example.com",
    "firstName": "John",
    "id": "01FCCGYZA9JPQ97HBSTKW0KT7P",
    "lastName": "Smith",
    "phoneNumber": "+61411222333"
  }
]
404: not_found: Not Found response.

Add a Member to a Customer List

Adds a member to a list

put /organizations/{organizationId}/customer-lists/{listId}/members/{customerId}

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID
listIdstringpathList ID
customerIdstringpathID of customer to add to list

Responses

204: No Content response.
404: not_found: Not Found response.
409: read_only: Conflict response.

Remove a Member from a Customer List

Removes a member to a list

delete /organizations/{organizationId}/customer-lists/{listId}/members/{customerId}

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID
listIdstringpathList ID
customerIdstringpathID of customer to remove from list

Responses

204: No Content response.
404: not_found: Not Found response.
409: read_only: Conflict response.

Replace Members in a Customer List

Sets the members of a list to the provided customers

put /organizations/{organizationId}/customer-lists/{listId}/members

Parameters

NameTypeInDescription
organizationIdstringpathOrganization ID
listIdstringpathList ID

Request Body

CustomerListSetMembersPayload
{
  "customerIds": [
    "01FCCGYZA9JPQ97HBSTKW0KT7P",
    "01FCCGYZA9JPQ97HBSTKW0KT7Q"
  ]
}

Responses

204: No Content response.
404: not_found: Not Found response.
409: read_only: Conflict response.

Models

CustomerList

A customer list

NameTypeDescription
idstring Unique ID of the customer list
namestring The name of the customer list
createdAtstring The date and time that the customer list was created
memberCountinteger(optional) The number of customers currently on the customer list

CustomerListMember

NameTypeDescription
idstring Unique ID of the Customer
addedAtstring(optional) The date that the customer was added as a member of the list
emailstring(optional) The Customers email address
firstNamestring Customer first name or given name
lastNamestring Customer last name or surname
phoneNumberstring(optional) The Customers mobile phone number

CustomerListPayload

NameTypeDescription
namestring

CustomerListSetMembersPayload

NameTypeDescription
customerIdsstring[] Customer IDs. Sending an empty array will clear the list

In this article