Customers
The customers API endpoint is an essential feature within the Felloh API, designed to group customer data, empowering businesses to efficiently handle customer interactions. This endpoint serves as a central repository for customer-related information, enabling seamless integrations and enriching the overall customer experience.
Customer Model
Properties
- Name
id- Type
- uuid
- Description
The unique identifier of the customer entry.
- Name
customer_name- Type
- string
- Description
The name of the customer.
- Name
email- Type
- string
- Description
The email address of the customer.
- Name
address_1- Type
- string
- Description
The first line of the customer's address.
- Name
address_2- Type
- string
- Description
The second line of the customer's address.
- Name
city- Type
- string
- Description
The city of the customer.
- Name
county- Type
- string
- Description
The county of the customer address.
- Name
country- Type
- string
- Description
The ISO 3166-1 country code of the customer.
- Name
post_code- Type
- string
- Description
The postal code of the customer.
{
"id": "cc15e9a7-21bf-4d55-b500-2a24c8e4ed1e",
"customer_name": "Tom Jones",
"email": "tom@felloh.org",
"address_1": "The Old Rectory",
"address_2": "Main Road",
"city": "Belton",
"county": "Lincolnshire",
"country": "UK",
"post_code": "NG32 2LW"
}
Fetch All
This endpoint retrieves all customers. Customers are sorted by creation date, with the most recent customers coming first.
Parameters
- Name
organisationrequired- Type
- string
- Description
The organisation ID that you want to fetch bookings for. You can find the organisation that you have access to by using the List all organisations method.
- Name
keyword- Type
- string
- Description
Customer name or email address that you want to filter by.
- Name
skip- Type
- integer
- Description
Pagination offset. See the pagination section for details.
- Name
take- Type
- integer
- Description
Number of records to return. See the pagination section for details.
- Name
show-child-organisations- Type
- boolean
- Description
Whether to also show customer for any of the requested organisation's child organisations.
Returns
Returns an array of Custoemr Models
Request
import axios from 'axios';
const response = await axios.post(
'https://api.felloh.com/agent/customers',
{
organisation: 'X9876',
keyword: 'james.dean@gmail.com',
skip: 10,
take: 20
},
{
headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer <YOUR TOKEN HERE>` }
}
);
Response
{
"data": [
{
"id": "cc15e9a7-21bf-4d55-b500-2a24c8e4ed1e",
"customer_name": "Tom Jones",
"email": "tom@felloh.org",
"address_1": "The Old Rectory",
"address_2": "Main Road",
"city": "Belton",
"county": "Lincolnshire",
"country": "UK",
"post_code": "NG32 2LW"
}
],
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}
Create One
This endpoint allows you to create a new customer.
Parameters
- Name
organisationrequired- Type
- string
- Description
The organisation ID for which you want to create the customer.
- Name
customer_name- Type
- string
- Description
The full name of the customer.
- Name
email- Type
- string
- Description
The customer's email address.
- Name
address_1- Type
- string
- Description
The first line of the customer's address.
- Name
address_2- Type
- string
- Description
The second line of the customer's address.
- Name
city- Type
- string
- Description
The city where the customer resides.
- Name
county- Type
- string
- Description
The county where the customer's address is located.
- Name
country- Type
- string
- Description
The ISO 3166-1 country code.
- Name
post_code- Type
- string
- Description
The postal code of the customer's address.
Returns
- Name
id- Type
- uuid
- Description
The ID of the customer that was created.
Request
import axios from 'axios';
const response = await axios.put(
'https://api.felloh.com/agent/customers',
{
organisation: 'X9876',
customer_name: 'Tom Jones',
email: 'tom@felloh.com',
address_1: 'The Old Rectory',
address_2: 'Main Road',
city: 'Belton',
county: 'Lincolnshire',
country: 'UK',
post_code: 'NG32 2LW'
},
{
headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer <YOUR TOKEN HERE>` }
}
);
Response
{
"data": {
"id": "226009ab-ffe9-4c80-922b-982e8e7849f8"
},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6"
}
}
