Payment Links

A payment link is a shareable URL that will take your customers to a hosted payment page.

When a customer opens a payment link it will generate a new checkout transaction to render the payment page.

Payment links are usable until their expiry date or until a completed transaction is made against them.

The Payment Link Object

{
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"booking": {
"id": "9a33a74f-1e3e-595d-b89f-9da87d289e05",
"email": "tom@felloh.org",
"customer_name": "Tom Jones",
"booking_reference": "FEL-00012",
"departure_date": null,
"return_date": null,
"created_at": "2021-11-17T15:10:37.589Z"
},
"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": "United Kingdom",
"post_code": "NG32 2LW"
},
"email": "tom@felloh.org",
"methods": {
"open_banking": true,
"card": true
},
"amount": 100,
"currency": "GBX",
"customer_name": "Tom Jones",
"description": "Deposit for Bali",
"success_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/success",
"failure_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/failure",
"cancel_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/cancel",
"transactions": [
{
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"amount": 100,
"completed_at": "2021-11-17T15:11:37.581Z",
"created_at": "2021-11-17T15:11:37.581Z"
}
],
"user": {
"id": "e8c243ff-d000-4f81-ba57-94184d44dae2",
"email": "tom@felloh.com"
},
"organisation": {
"id": "X9876",
"name": "Felloh"
},
"type": {
"id": "UNKNOWN",
"created_at": "2023-03-15T16:36:31.797Z"
},
"expires_at": "2021-12-17T15:10:37.589Z",
"created_at": "2021-11-17T15:10:37.589Z"
}

The compact payment link object

{
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"amount": 100,
"currency": "GBX",
"description": "Deposit for Bali",
"expires_at": "2021-12-17T15:10:37.589Z",
"created_at": "2021-11-17T15:10:37.589Z"
}

idstring

Unique identifier for the object

bookingobject

The booking object that the payment link is linked to

customerobject

The customer object that the payment link is linked to

emailstring

The email address of the payee

methods.open_bankingboolean

Whether the customer will be presented with the option to pay by open banking

methods.cardboolean

Whether the customer will be presented with the option to pay by card

amountnumber

The amount that the customer should be charged, in its lowest denomination (for GBP, this would be pence)

currencystring

The currency that the payment link will be charged in | see currency documentation

customer_namestring

The name of the customer that the payment link is for

descriptionstring

Description of what the payment link is for

success_urlstring

The url that the payment link will redirect to on payment success

failure_urlstring

The url that the payment link will redirect to on payment failure

cancel_urlstring

The url that the payment link will redirect to on payment cancellation

transactionsarray

An array containing any compact transaction objects created using the payment link

userobject

The compact user object of the user that created the booking

organisationobject

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

typeobject

The type of that payment link.

created_atdatetime

The datetime at which the payment link object was created within our systems

expires_atdatetime

The datetime at which the payment link will no longer be usable by a customer


Fetch all

POST/agent/payment-links

import axios from 'axios';
const response = await axios(
{
method: 'post',
url: 'https://api.felloh.com/agent/payment-links',
data: {
organisation: 'X9876',
keyword: 'james.dean@gmail.com',
date_from: '2020-02-01',
date_to: '2021-05-10',
skip: 10,
take: 20
},
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function createPaymentLinks($token) {
$url = "https://api.felloh.com/agent/payment-links";
$data = [
'organisation' => 'X9876',
'keyword' => 'james.dean@gmail.com',
'date_from' => '2020-02-01',
'date_to' => '2021-05-10',
'skip' => 10,
'take' => 20,
];
$client = new Client();
$response = $client->post($url, [
'json' => $data,
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => "Bearer $token",
],
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = "<YOUR TOKEN HERE>";
$response = createPaymentLinks($token);
import requests
import json
def post_agent_payment_links(organisation, keyword, date_from, date_to, skip, take, access_token):
api_url = 'https://api.felloh.com/agent/payment-links'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
data = {
'organisation': organisation,
'keyword': keyword,
'date_from': date_from,
'date_to': date_to,
'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_payment_links('X9876', 'james.dean@gmail.com', '2020-02-01', '2021-05-10', 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 PostAgentPaymentLinks("X9876", "james.dean@gmail.com", "2020-02-01", "2021-05-10", 10, 20, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PostAgentPaymentLinks(string organisation, string keyword, string dateFrom, string dateTo, int skip, int take, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/agent/payment-links";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var requestData = new
{
organisation = organisation,
keyword = keyword,
date_from = dateFrom,
date_to = dateTo,
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": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"booking": {
"id": "9a33a74f-1e3e-595d-b89f-9da87d289e05",
"email": "tom@felloh.org",
"customer_name": "Tom Jones",
"booking_reference": "FEL-00012",
"departure_date": null,
"return_date": null,
"created_at": "2021-11-17T15:10:37.589Z"
},
"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": "United Kingdom",
"post_code": "NG32 2LW"
},
"email": "tom@felloh.org",
"methods": {
"open_banking": true,
"card": true
},
"amount": 100,
"currency": "GBX",
"customer_name": "Tom Jones",
"description": "Deposit for Bali",
"success_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/success",
"failure_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/failure",
"cancel_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/cancel",
"transactions": [
{
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"amount": 100,
"completed_at": "2021-11-17T15:11:37.581Z",
"created_at": "2021-11-17T15:11:37.581Z"
}
],
"user": {
"id": "e8c243ff-d000-4f81-ba57-94184d44dae2",
"email": "tom@felloh.com"
},
"organisation": {
"id": "X9876",
"name": "Felloh"
},
"expires_at": "2021-12-17T15:10:37.589Z",
"created_at": "2021-11-17T15:10:37.589Z"
}
],
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}

This endpoint retrieves all payment links. Payment links are sorted by creation date by default, with the most recent payment links coming first.

HTTP Method

POST

HTTP Endpoint

PRODhttps://api.felloh.com/agent/payment-links

SANDBOXhttps://sandbox.felloh.com/agent/payment-links

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to fetch payment links for. You can find the organisation that you have access to by using the List all organisations method.
keywordfalsestringA customer name, booking reference or email address that you want to filter by.
skipfalseIntegerSee pagination section for details
takefalseIntegerSee pagination section for details
show-child-organisationsfasleBooleanWhether to also show payment links for any of the requested organisations child organisations
date_fromfalsedateThe creation date that you want to get payment links from, in ISO 8601 format
date_tofalsedateThe creation date that you want to get payment links to, in ISO 8601 format
filter_booking_existsfalsebooleanAllows filtering based on whether the payment link has a booking attatched to it. If null, then no filtering. If true, then only payment links with bookings. If False, then only payment links without bookings.
### Response

Returns an array of Payment links


Fetch one

GET/agent/payment-links/226009ab-ffe9-4c80-922b-982e8e7849f8

import axios from 'axios';
const paymentLinkID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
const response = await axios(
{
method: 'get',
url: `https://api.felloh.com/agent/payment-links/${paymentLinkID}`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function getPaymentLink($token, $paymentLinkID) {
$url = "https://api.felloh.com/agent/payment-links/$paymentLinkID";
$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>";
$paymentLinkID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
$response = getPaymentLink($token, $paymentLinkID);
import requests
def get_agent_payment_link(payment_link_id, access_token):
api_url = f'https://api.felloh.com/agent/payment-links/{payment_link_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
payment_link_id = '226009ab-ffe9-4c80-922b-982e8e7849f8'
response_data = get_agent_payment_link(payment_link_id, '<YOUR TOKEN HERE>')
print(response_data)
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
string paymentLinkId = "226009ab-ffe9-4c80-922b-982e8e7849f8";
var response = await GetAgentPaymentLink(paymentLinkId, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> GetAgentPaymentLink(string paymentLinkId, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = $"https://api.felloh.com/agent/payment-links/{paymentLinkId}";
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": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"booking": {
"id": "9a33a74f-1e3e-595d-b89f-9da87d289e05",
"email": "tom@felloh.org",
"customer_name": "Tom Jones",
"booking_reference": "FEL-00012",
"departure_date": null,
"return_date": null,
"created_at": "2021-11-17T15:10:37.589Z"
},
"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": "United Kingdom",
"post_code": "NG32 2LW"
},
"email": "tom@felloh.org",
"methods": {
"open_banking": true,
"card": true
},
"amount": 100,
"currency": "GBX",
"customer_name": "Tom Jones",
"description": "Deposit for Bali",
"success_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/success",
"failure_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/failure",
"cancel_url": "https://pay.felloh.com/b5e1bd24-7379-4d27-b4d8-07120fefc25c/cancel",
"transactions": [
{
"id": "b5e1bd24-7379-4d27-b4d8-07120fefc25c",
"amount": 100,
"completed_at": "2021-11-17T15:11:37.581Z",
"created_at": "2021-11-17T15:11:37.581Z"
}
],
"user": {
"id": "e8c243ff-d000-4f81-ba57-94184d44dae2",
"email": "tom@felloh.com"
},
"organisation": {
"id": "X9876",
"name": "Felloh"
},
"type": {
"id": "UNKNOWN",
"created_at": "2023-03-15T16:36:31.797Z"
}
"expires_at": "2021-12-17T15:10:37.589Z",
"created_at": "2021-11-17T15:10:37.589Z"
},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6"
}
}

This endpoint allows you to retrieve a single payment link

HTTP Method

GET

HTTP Endpoint

PRODhttps://api.felloh.com/agent/payment-links/<PAYMENT LINK ID>

SANDBOXhttps://sandbox.felloh.com/agent/payment-links/<PAYMENT LINK ID>

Path Parameters

ParameterRequiredTypeDescription
idtrueUUIDThe payment link id that you wish to retrieve

Response

Returns a Payment Link Object


Delete one

DELETE/agent/payment-links/226009ab-ffe9-4c80-922b-982e8e7849f8

import axios from 'axios';
const paymentLinkID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
const response = await axios(
{
method: 'delete',
url: `https://api.felloh.com/agent/payment-links/${paymentLinkID}`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function deletePaymentLink($token, $paymentLinkID) {
$url = "https://api.felloh.com/agent/payment-links/$paymentLinkID";
$client = new Client();
$response = $client->delete($url, [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => "Bearer $token",
],
]);
return $response->getStatusCode() === 204;
}
$token = "<YOUR TOKEN HERE>";
$paymentLinkID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
$success = deletePaymentLink($token, $paymentLinkID);
import requests
def delete_agent_payment_link(payment_link_id, access_token):
api_url = f'https://api.felloh.com/agent/payment-links/{payment_link_id}'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
response = requests.delete(api_url, headers=headers)
response.raise_for_status()
return response.text
payment_link_id = '226009ab-ffe9-4c80-922b-982e8e7849f8'
response_data = delete_agent_payment_link(payment_link_id, '<YOUR TOKEN HERE>')
print(response_data)
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
string paymentLinkId = "226009ab-ffe9-4c80-922b-982e8e7849f8";
var response = await DeleteAgentPaymentLink(paymentLinkId, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> DeleteAgentPaymentLink(string paymentLinkId, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = $"https://api.felloh.com/agent/payment-links/{paymentLinkId}";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var httpResponse = await client.DeleteAsync(apiUrl);
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 delete a single payment link

HTTP Method

DELETE

HTTP Endpoint

PRODhttps://api.felloh.com/agent/payment-links/<PAYMENT LINK ID>

SANDBOXhttps://sandbox.felloh.com/agent/payment-links/<PAYMENT LINK ID>

Path Parameters

ParameterRequiredTypeDescription
idtrueUUIDThe payment link id that you wish to delete

Create one

PUT/agent/payment_links/

import axios from 'axios';
const response = await axios(
{
method: 'put',
url: `https://api.felloh.com/agent/payment-links`,
data : JSON.stringify({
customer_name: 'Tom Brady',
email: 'tom@felloh.com',
booking_id: '226009ab-ffe9-4c80-922b-982e8e7849f8',
customer_id: 'cc15e9a7-21bf-4d55-b500-2a24c8e4ed1e',
amount: 20000,
currency: 'GBX',
organisation: 'X1234',
open_banking_enabled: true,
card_enabled: true,
description: 'Final payment for cruise holiday',
expires_at: '2022-07-25',
type: "UNKNOWN",
surcharging_enabled: true,
excluded_card_types: ["AMEX"],
excluded_card_regions: ["INTER"],
}),
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function createPaymentLink($token, $data) {
$url = "https://api.felloh.com/agent/payment-links";
$client = new Client();
$response = $client->put($url, [
'json' => $data,
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => "Bearer $token",
],
]);
return $response->getBody();
}
$token = "<YOUR TOKEN HERE>";
$data = [
'customer_name' => 'Tom Brady',
'email' => 'tom@felloh.com',
'booking_id' => '226009ab-ffe9-4c80-922b-982e8e7849f8',
'customer_id' => 'cc15e9a7-21bf-4d55-b500-2a24c8e4ed1e',
'amount' => 20000,
'currency' => 'GBX',
'organisation' => 'X1234',
'open_banking_enabled' => true,
'card_enabled' => true,
'description' => 'Final payment for cruise holiday',
'expires_at' => '2022-07-25',
'type' => 'UNKNOWN',
'surcharging_enabled' => true,
'excluded_card_types' => ['AMEX'],
'excluded_card_regions' => ['INTER'],
];
$response = createPaymentLink($token, $data);
import requests
import json
def put_agent_payment_link(data, access_token):
api_url = 'https://api.felloh.com/agent/payment-links'
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 = {
"customer_name": "Tom Brady",
"email": "tom@felloh.com",
"booking_id": "226009ab-ffe9-4c80-922b-982e8e7849f8",
"customer_id": "cc15e9a7-21bf-4d55-b500-2a24c8e4ed1e",
"amount": 20000,
"currency": "GBX",
"organisation": "X1234",
"open_banking_enabled": True,
"card_enabled": True,
"description": "Final payment for cruise holiday",
"expires_at": "2022-07-25",
"type": "UNKNOWN",
'surcharging_enabled': True,
'excluded_card_types': ['AMEX'],
'excluded_card_regions': ['INTER'],
}
response_data = put_agent_payment_link(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 PutAgentPaymentLink(new
{
customer_name = "Tom Brady",
email = "tom@felloh.com",
booking_id = "226009ab-ffe9-4c80-922b-982e8e7849f8",
customer_id = "cc15e9a7-21bf-4d55-b500-2a24c8e4ed1e",
amount = 20000,
currency = "GBX",
organisation = "X1234",
open_banking_enabled = true,
card_enabled = true,
description = "Final payment for cruise holiday",
expires_at = "2022-07-25",
type = "UNKNOWN",
surcharging_enabled = true,
excluded_card_types = ["AMEX"],
excluded_card_regions = ["INTER"]
}, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PutAgentPaymentLink(object data, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/agent/payment-links";
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": {
"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 payment link

HTTP Method

PUT

HTTP Endpoint

PRODhttps://api.felloh.com/agent/payment-links

SANDBOXhttps://sandbox.felloh.com/agent/payment-links

Payload

ParameterRequiredTypeDescription
customer_nametruestringThe customers full name.
emailtruestringThe customers email address
organisationtruestringThe organisation ID that you want to create the payment link in.
booking_idfalsestringThe Felloh booking ID that you want to assign the payment link to. This can be assigned later if you wish.
customer_idfalsestringThe customer ID that you want to attach the payment link to. This is only required if you want to autofill the address fields on the card payment form.
amounttrueintegerThe value that you want to charge the customer
open_banking_enabledfalseboolWhether to allow the customer to pay via open banking
card_enabledfalseboolWhether to allow the customer to pay via card
descriptionfalsestringThe description of what the payment is for, which will be show to the customer.
expires_atfalsedateThe date that the payment link will expire, defaults to 30 days from date created.
currencyfalsestringThe currency that transactions will be undertaken in, defaults to GBX, see currency documentation for more information.
typetruestringThe payment link type ID.
authorisation_onlyfalseboolWhether to only authorise the payment (preauth), and not capture it. Defaults to false.
surcharging_enabledfalseboolWether surcharging is enabled for the payment (if surcharging is enabled for organisation). Defaults to true
excluded_card_typesfalsearrayWhether certain card types should be blocked for payment, options to exclude are - AMEX, VISA, MASTER.
excluded_card_regionsfalsearrayWhether certain card regions should be blocked for payment, options to exclude are - DOMESTIC, INTER, INTRA.

Response

ParameterTypeDescription
idUUIDThe ID of the payment link that you have created

Assign to booking

POST/agent/payment-links/{payment_link_id}/assign

import axios from 'axios';
const paymentLinkID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
const bookingID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
const response = await axios(
{
method: 'post',
url: `https://api.felloh.com/agent/payment-links/${paymentLinkID}/assign`,
data : JSON.stringify({
booking_id: bookingID,
}),
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function assignPaymentLink($token, $paymentLinkID, $bookingID) {
$url = "https://api.felloh.com/agent/payment-links/$paymentLinkID/assign";
$client = new Client();
$response = $client->post($url, [
'json' => [
'booking_id' => $bookingID,
],
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => "Bearer $token",
],
]);
return $response->getBody();
}
$token = "<YOUR TOKEN HERE>";
$paymentLinkID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
$bookingID = '226009ab-ffe9-4c80-922b-982e8e7849f8';
$response = assignPaymentLink($token, $paymentLinkID, $bookingID);
import requests
import json
def post_agent_payment_link_assign(payment_link_id, booking_id, access_token):
api_url = f'https://api.felloh.com/agent/payment-links/{payment_link_id}/assign'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
data = {
'booking_id': booking_id
}
response = requests.post(api_url, data=json.dumps(data), headers=headers)
response.raise_for_status()
return response.text
payment_link_id = '226009ab-ffe9-4c80-922b-982e8e7849f8'
booking_id = '226009ab-ffe9-4c80-922b-982e8e7849f8'
response_data = post_agent_payment_link_assign(payment_link_id, booking_id, '<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()
{
string paymentLinkId = "226009ab-ffe9-4c80-922b-982e8e7849f8";
string bookingId = "226009ab-ffe9-4c80-922b-982e8e7849f8";
var response = await PostAgentPaymentLinkAssign(paymentLinkId, new
{
booking_id = bookingId
}, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PostAgentPaymentLinkAssign(string paymentLinkId, object data, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = $"https://api.felloh.com/agent/payment-links/{paymentLinkId}/assign";
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": {},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6"
}
}

This endpoint allows you to assign a payment link to a booking

HTTP Method

POST

HTTP Endpoint

PRODhttps://api.felloh.com/agent/payment-links/{payment_link_id}/assign

SANDBOXhttps://sandbox.felloh.com/agent/payment-links/{payment_link_id}/assign

Payload

ParameterRequiredTypeDescription
booking_idfalsestringThe booking ID that you want to assign the payment link to.