Credit Notes

The credit note object represents credit notes created against a booking.

An example of the credit note object

{
"id": "59e904da-e2da-446b-867c-4403503b482f",
"short_id": "0BN07IX6VJ",
"customer_name": "Adam Clark",
"amount": 5000,
"description": "An example credit note",
"currency": "GBX",
"organisation": {
"id": "X1234",
"name": "Felloh",
"image": "organisation/x1234.png",
"legacy_id": "e4ebe1d6-d907-477c-a107-e26c74cf6034",
"created_at": "2022-01-15T00:48:41.255Z",
"updated_at": "2022-07-27T11:43:42.977Z"
},
"created_at": "2022-10-28T11:53:14.675Z",
"booking_applied_to": {
"id": "c25af1be-b643-4ef7-b66f-55124eaa224f",
"booking_reference": "testing321",
"created_at": "2022-10-20T08:39:15.843Z",
"customer_name": "Lorna",
"departure_date": "2022-11-11",
"return_date": "2022-12-31",
"email": "test@felloh.com",
"gross_amount": 10000
},
"booking_created_from": {
"id": "f5c48838-a45a-4c4e-b267-36c8c17b0551",
"booking_reference": "test-19126",
"created_at": "2022-08-05T14:58:20.458Z",
"customer_name": "Adam Clark",
"departure_date": null,
"return_date": null,
"email": "test@felloh.com",
"gross_amount": 120000
}
}

iduuid

The unique uuid of the credit note

short_idstring

A shorter more user friendly ID that you can share with your customers

customer_namestring

The name of the customer that the credit note is for

amountinteger

The amount that the credit note is for

descriptionstring

A description of what the credit note was for

currencystring

The currency that the credit note is in | see currency documentation for more information

organisationobject

A compact organisation object representing the organisation owner of the payment link.

booking_applied_toobject

The booking object that the credit note was applied to

booking_created_fromobject

The booking object that the credit note was created from


Fetch all

POST/agent/credit-notes

import axios from 'axios';
const response = await axios(
{
method: 'post',
url: 'https://api.felloh.com/agent/credit-notes',
data: {
organisation: 'X9876',
skip: 10,
take: 20
},
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
}
);
use GuzzleHttp\Client;
function getCreditNotes($token, $skip, $take) {
$url = 'https://api.felloh.com/agent/credit-notes';
$client = new Client();
$response = $client->post($url, [
'json' => [
'organisation' => 'X9876',
'skip' => $skip,
'take' => $take,
],
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $token,
],
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = 'YOUR_TOKEN_HERE'; // Replace with the actual token
$skip = 10; // Specify the number of credit notes to skip
$take = 20; // Specify the number of credit notes to take
$response = getCreditNotes($token, $skip, $take);
import requests
import json
def post_agent_credit_notes(organisation, skip, take, access_token):
api_url = 'https://api.felloh.com/agent/credit-notes'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
data = {
'organisation': organisation,
'skip': skip,
'take': take
}
response = requests.post(api_url, headers=headers, data=json.dumps(data))
response.raise_for_status()
return response.text
response_data = post_agent_credit_notes('X9876', 10, 20, '<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 PostAgentCreditNotes("X9876", 10, 20, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PostAgentCreditNotes(string organisation, int skip, int take, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/agent/credit-notes";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var requestData = new
{
organisation = organisation,
skip = skip,
take = take
};
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestData), Encoding.UTF8, "application/json");
var httpResponse = await client.PostAsync(apiUrl, content);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}

RESPONSE

{
"data": [
{
"id": "59e904da-e2da-446b-867c-4403503b482f",
"short_id": "0BN07IX6VJ",
"customer_name": "Adam Clark",
"amount": 5000,
"description": "An example credit note",
"currency": "GBX",
"organisation": {
"id": "X1234",
"name": "Felloh",
"image": "organisation/x1234.png",
"legacy_id": "e4ebe1d6-d907-477c-a107-e26c74cf6034",
"created_at": "2022-01-15T00:48:41.255Z",
"updated_at": "2022-07-27T11:43:42.977Z"
},
"created_at": "2022-10-28T11:53:14.675Z",
"booking_applied_to": {
"id": "c25af1be-b643-4ef7-b66f-55124eaa224f",
"booking_reference": "testing321",
"created_at": "2022-10-20T08:39:15.843Z",
"customer_name": "Lorna",
"departure_date": "2022-11-11",
"return_date": "2022-12-31",
"email": "test@felloh.com",
"gross_amount": 10000
},
"booking_created_from": {
"id": "f5c48838-a45a-4c4e-b267-36c8c17b0551",
"booking_reference": "test-19126",
"created_at": "2022-08-05T14:58:20.458Z",
"customer_name": "Adam Clark",
"departure_date": null,
"return_date": null,
"email": "test@felloh.com",
"gross_amount": 120000
}
}
],
"errors": [],
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "84901a6e-e78b-4d96-b657-d37ca6b445c4",
"count": 1
}
}

This endpoint retrieves all credit notes for an organisation.

HTTP Method

POST

HTTP Endpoint

PRODhttps://api.felloh.com/agent/credit-notes

SANDBOXhttps://sandbox.felloh.com/agent/credit-notes

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to fetch credit notes for. You can find the organisation that you have access to by using the List all organisations method.
skipfalseIntegerSee pagination section for details
takefalseIntegerSee pagination section for details

Response

Returns an array of Credit Notes Objects


Fetch one

GET/agent/credit-notes/226009ab-ffe9-4c80-922b-982e8e7849f8

import axios from 'axios';
const creditNoteID = '59e904da-e2da-446b-867c-4403503b482f';
const response = await axios(
{
method: 'get',
url: `https://api.felloh.com/agent/credit-notes/${creditNoteID}`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function getCreditNoteById($token, $creditNoteID) {
$url = 'https://api.felloh.com/agent/credit-notes/' . $creditNoteID;
$client = new Client();
$response = $client->get($url, [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $token,
],
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = 'YOUR_TOKEN_HERE'; // Replace with the actual token
$creditNoteID = '59e904da-e2da-446b-867c-4403503b482f'; // Replace with the actual credit note ID
$response = getCreditNoteById($token, $creditNoteID);
import requests
def get_agent_credit_note(credit_note_id, access_token):
api_url = f'https://api.felloh.com/agent/credit-notes/{credit_note_id}'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
response = requests.get(api_url, headers=headers)
response.raise_for_status()
return response.text
credit_note_id = '59e904da-e2da-446b-867c-4403503b482f'
response_data = get_agent_credit_note(credit_note_id, '<YOUR TOKEN HERE>')
print(response_data)
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
string creditNoteId = "59e904da-e2da-446b-867c-4403503b482f";
var response = await GetAgentCreditNote(creditNoteId, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> GetAgentCreditNote(string creditNoteId, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = $"https://api.felloh.com/agent/credit-notes/{creditNoteId}";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var httpResponse = await client.GetAsync(apiUrl);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}

RESPONSE

{
"data": {
"id": "59e904da-e2da-446b-867c-4403503b482f",
"short_id": "0BN07IX6VJ",
"customer_name": "Adam Clark",
"amount": 5000,
"description": "An example credit note",
"currency": "GBX",
"organisation": {
"id": "X1234",
"name": "Felloh",
"image": "organisation/x1234.png",
"legacy_id": "e4ebe1d6-d907-477c-a107-e26c74cf6034",
"created_at": "2022-01-15T00:48:41.255Z",
"updated_at": "2022-07-27T11:43:42.977Z"
},
"created_at": "2022-10-28T11:53:14.675Z",
"booking_applied_to": {
"id": "c25af1be-b643-4ef7-b66f-55124eaa224f",
"booking_reference": "testing321",
"created_at": "2022-10-20T08:39:15.843Z",
"customer_name": "Lorna",
"departure_date": "2022-11-11",
"return_date": "2022-12-31",
"email": "lorna@felloh.com",
"gross_amount": 10000
},
"booking_created_from": {
"id": "f5c48838-a45a-4c4e-b267-36c8c17b0551",
"booking_reference": "test-19126",
"created_at": "2022-08-05T14:58:20.458Z",
"customer_name": "Adam Clark",
"departure_date": null,
"return_date": null,
"email": "ad@mclark.co",
"gross_amount": 120000
}
}
}

This endpoint allows you to retrieve a single credit note based on its ID.

HTTP Method

GET

HTTP Endpoint

PRODhttps://api.felloh.com/agent/credit-notes/<CREDIT NOTE ID>

SANDBOXhttps://sandbox.felloh.com/agent/credit-notes/<CREDIT NOTE ID>

Path Parameters

ParameterRequiredTypeDescription
idtrueUUIDThe credit note id that you wish to retrieve

Response

Returns a Credit Note Object