Customer

An example of a Bank Object

{
"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": "United Kingdom",
"post_code": "NG32 2LW"
}

idinteger

The unique identifier of the entry

customer_namestring

The name of the customer

emailstring

The email address of the customer

address_1string

The first line of the customers address.

address_2string

The second line of the customers address.

citystring

The city of the customer.

countystring

The county of the customer address.

countrystring

The ISO 3166-1 country code of the customer.

post_codestring

The postal code of the customer.


Create one

PUT/agent/customers/

import axios from 'axios';
const response = await axios(
{
method: 'put',
url: `https://api.felloh.com/agent/customers`,
data : JSON.stringify({
organisation: 'X9876',
customer_name: 'Tom Jones',
email: 'tom@felloh.com',
address_1: 'The Old Rectory',
address_2: 'Main Road',
city: 'Belton',
county: 'Lincolnshire',
country: 'United Kingdom',
post_code: 'NG32 2LW'
}),
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
}
);
use GuzzleHttp\Client;
function createCustomer($token, $bookingData) {
$url = 'https://api.felloh.com/agent/customers';
$client = new Client();
$response = $client->put($url, [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $token,
],
'json' => $bookingData,
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = 'YOUR_TOKEN_HERE'; // Replace with the actual token
$customerData = [
'organisation' => 'X9876',
'customer_name' => 'Tom Jones',
'email' => 'tom@felloh.com',
'address_1' => 'The Old Rectory',
'address_2' => 'Main Road',
'city' => 'Belton',
'county' => 'Lincolnshire',
'country' => 'United Kingdom',
'post_code' => 'NG32 2LW'
];
$response = createCustomer($token, $customerData);
import requests
import json
def put_agent_customers(access_token):
api_url = 'https://api.felloh.com/agent/customers'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
data = {
'organisation': 'X9876',
'customer_name': 'Tom Jones',
'email': 'tom@felloh.com',
'address_1': 'The Old Rectory',
'address_2': 'Main Road',
'city': 'Belton',
'county': 'Lincolnshire',
'country': 'United Kingdom',
'post_code': 'NG32 2LW'
}
response = requests.put(api_url, headers=headers, data=json.dumps(data))
response.raise_for_status()
return response.text
response_data = put_agent_customers('<YOUR TOKEN HERE>')
print(response_data)
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var response = await PutAgentCustomers("<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PutAgentCustomers(string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/agent/customers";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var requestData = new
{
organisation = "X9876",
customer_name = "Tom Jones",
email = "tom@felloh.com",
address_1 = "The Old Rectory",
address_2 = "Main Road",
city = "Belton",
county = "Lincolnshire",
country = "United Kingdom",
post_code = "NG32 2LW"
};
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestData), Encoding.UTF8, "application/json");
var httpResponse = await client.PutAsync(apiUrl, content);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}

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"
}
}

This endpoint allows you to create a new customer

HTTP Method

PUT

HTTP Endpoint

PRODhttps://api.felloh.com/agent/customers

SANDBOXhttps://sandbox.felloh.com/agent/customers

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to create the customer for
customer_namefalsestringThe name of the customer
emailfalsestringThe customers email address
address_1falsedateThe first line of the customers address
address_2falsedateThe second line of the customers address
cityfalseIntegerThe city of the customer
countyfalseIntegerThe county of the customer
countryfalseStringThe ISO 3166-1 country code of the customer
post_codefalseStringThe postal code of the customer

Response

ParameterTypeDescription
idUUIDThe ID of the customer that you have created