This object represents one of your suppliers, it is mainly used for risk analysis and booking components.
The Supplier Object
{
"id": "226009ab-ffe9-4c80-922b-982e8e7849f8",
"name": "XXX123789",
"created_at": "2022-01-28T10:57:32.456Z"
}
idstring
Unique identifier for the object.
namestring
The name of the supplier
created_atdatetime
The datetime at which the supplier object was created within our systems
POST/agent/suppliers
import axios from 'axios';
const response = await axios(
{
method: 'post',
url: 'https://api.felloh.com/agent/suppliers',
data: {
organisation: 'X9876',
keyword: 'virgin tours',
skip: 10,
take: 20
},
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function searchSuppliers($token, $organization, $keyword, $skip, $take) {
$url = "https://api.felloh.com/agent/suppliers";
$client = new Client();
$response = $client->post($url, [
'json' => [
'organisation' => $organization,
'keyword' => $keyword,
'skip' => $skip,
'take' => $take,
],
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => "Bearer $token",
],
]);
return $response->getBody();
}
$token = "<YOUR TOKEN HERE>";
$organization = 'X9876';
$keyword = 'virgin tours';
$skip = 10;
$take = 20;
$response = searchSuppliers($token, $organization, $keyword, $skip, $take);
import requests
import json
def post_agent_suppliers(data, access_token):
api_url = 'https://api.felloh.com/agent/suppliers'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
response = requests.post(api_url, data=json.dumps(data), headers=headers)
response.raise_for_status()
return response.text
data = {
'organisation': 'X9876',
'keyword': 'virgin tours',
'skip': 10,
'take': 20
}
response_data = post_agent_suppliers(data, '<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 PostAgentSuppliers(new
{
organisation = "X9876",
keyword = "virgin tours",
skip = 10,
take = 20
}, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PostAgentSuppliers(object data, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/agent/suppliers";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json");
var httpResponse = await client.PostAsync(apiUrl, content);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}
RESPONSE
{
"data": [
{
"id": "02c31636-e311-4694-a128-d83abae12e26",
"name": "Virgin Cruises",
"created_at": "2022-01-28T10:57:32.456Z"
},
{
"id": "54969d6f-2695-4314-97a1-63e5696b4807",
"name": "Virgin Holidays",
"created_at": "2022-01-28T10:57:32.456Z"
}
],
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 2
}
}
This endpoint retrieves all suppliers. Suppliers are sorted by name.
HTTP Method
POST
HTTP Endpoint
PRODhttps://api.felloh.com/agent/suppliers
SANDBOXhttps://sandbox.felloh.com/agent/suppliers
Payload
Parameter | Required | Type | Description |
---|
organisation | true | string | The organisation ID that you want to fetch suppliers for. You can find the organisation that you have access to by using the List all organisations method. |
keyword | false | string | A supplier name that you want to filter by. |
skip | false | Integer | See pagination section for details |
take | false | Integer | See pagination section for details |
Response
Returns an array of Supplier Objects
PUT/agent/suppliers/
import axios from 'axios';
const response = await axios(
{
method: 'put',
url: `https://api.felloh.com/agent/suppliers`,
data : JSON.stringify({
organisation: 'X9876',
supplier_name: 'Bicknell Cruises',
}),
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
function updateSupplier($token, $organization, $supplierName) {
$url = "https://api.felloh.com/agent/suppliers";
$client = new Client();
$response = $client->put($url, [
'json' => [
'organisation' => $organization,
'supplier_name' => $supplierName,
],
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => "Bearer $token",
],
]);
return $response->getBody();
}
$token = "<YOUR TOKEN HERE>";
$organization = 'X9876';
$supplierName = 'Bicknell Cruises';
$response = updateSupplier($token, $organization, $supplierName);
import requests
import json
def put_agent_suppliers(data, access_token):
api_url = 'https://api.felloh.com/agent/suppliers'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
response = requests.put(api_url, data=json.dumps(data), headers=headers)
response.raise_for_status()
return response.text
data = {
'organisation': 'X9876',
'supplier_name': 'Bicknell Cruises'
}
response_data = put_agent_suppliers(data, '<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 PutAgentSuppliers(new
{
organisation = "X9876",
supplier_name = "Bicknell Cruises"
}, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PutAgentSuppliers(object data, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/agent/suppliers";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json");
var httpResponse = await client.PutAsync(apiUrl, content);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}
RESPONSE
{
"data": {},
"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 booking
HTTP Method
PUT
HTTP Endpoint
PRODhttps://api.felloh.com/agent/suppliers
SANDBOXhttps://sandbox.felloh.com/agent/suppliers
Payload
Parameter | Required | Type | Description |
---|
organisation | true | string | The organisation ID that you want to create the supplier in. |
supplier_name | true | string | The supplier name that you want to create. |