LANGUAGE JavascriptPHP

Refunds

This object represents a refund on a transaction.

The Supplier Object

{
"amount": 90,
"status": {
"id": "PENDING_AUTHORISATION"
},
"authorisation_code": "19b6698d-d614-45e0-ae90-6a3ea0662431",
"authorised_at": null,
"organisation": {
"id": "X000",
"name": "Felloh"
},
"completed_at": null,
"transaction": {
"id": "62132923-778d-45e0-a9bd-648913eeafdf",
"amount": 100,
"message": "Transaction succeeded",
"created_at": "2023-08-01T10:19:10.904Z",
"completed_at": "2023-08-01T10:20:17.000Z",
"currency": "GBX",
"provider_reference": "ASFEHYVVAEOSDCJIFUNZJVZURTWTILCSOBGLZMAE.prod01-vm-tx05",
},
"created_at": "2023-09-25T10:14:52.237Z"
}

amountstring

The amount that the refund is for.

status.idstring

The status of the refund, all statuses can be retrieved using the enums endpoint.

authorisation_codestring

A unique code, used to identify a refund.

authorised_atdatetime

The datetime at which the refund was authorised.

organisationobject

The organisation object that the refund is linked to.

completed_atdatetime

The datetime at which the refund was completed.

transactionobject

An object containing a compact transaction object that the refund is linked to.

created_atdatetime

The datetime t which the refund request was created.


Fetch all

POST/agent/refunds

import axios from 'axios';
const response = await axios(
{
method: 'post',
url: 'https://api.felloh.com/agent/refunds',
data: {
organisation: 'X9876',
skip: 10,
take: 20
},
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function searchSuppliers($token, $organization, $skip, $take) {
$url = "https://api.felloh.com/agent/refunds";
$client = new Client();
$response = $client->post($url, [
'json' => [
'organisation' => $organization,
'skip' => $skip,
'take' => $take,
],
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => "Bearer $token",
],
]);
return $response->getBody();
}
$token = "<YOUR TOKEN HERE>";
$organization = 'X9876';
$skip = 10;
$take = 20;
$response = searchSuppliers($token, $organization, $skip, $take);

RESPONSE

{
"data": [
{
"amount": 90,
"status": {
"id": "PENDING_AUTHORISATION"
},
"authorisation_code": "19b6698d-d614-45e0-ae90-6a3ea0662431",
"authorised_at": null,
"organisation": {
"id": "X000",
"name": "Felloh"
},
"completed_at": null,
"transaction": {
"id": "62132923-778d-45e0-a9bd-648913eeafdf",
"amount": 100,
"message": "Transaction succeeded",
"created_at": "2023-08-01T10:19:10.904Z",
"completed_at": "2023-08-01T10:20:17.000Z",
"currency": "GBX",
"provider_reference": "ASFEHYVVAEOSDCJIFUNZJVZURTWTILCSOBGLZMAE.prod01-vm-tx05",
},
"created_at": "2023-09-25T10:14:52.237Z"
},
{
"amount": 100,
"status": {
"id": "COMPLETED"
},
"authorisation_code": "8004d669-2875-45b6-a2ce-d08ae79029ae",
"authorised_at": "2023-09-22T15:32:21.251Z",
"organisation": {
"id": "X000",
"name": "Felloh"
},
"completed_at": "2023-09-22T15:32:21.251Z",
"transaction": {
"id": "d090d15b-2632-4375-a66f-afa278b61ae7",
"amount": 100,
"message": "Transaction succeeded",
"created_at": "2023-08-01T12:56:57.764Z",
"completed_at": "2023-08-01T12:57:23.000Z",
"currency": "GBX",
"provider_reference": "QPDAQHYSIMDKKYRYJVVQQPDAQHYSIMDKKYRYJVVQ.prod01-vm-tx11",
},
"created_at": "2023-09-22T14:10:37.136Z"
}
],
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 2
}
}

This endpoint retrieves all refunds. Refunds are sorted by created date.

HTTP Method

POST

HTTP Endpoint

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

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

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to fetch refunds 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 Refund Objects


Authorise a refund

GET/agent/refunds/357ad3f2-5cc4-4098-bb17-191104aacee5/authorise

import axios from 'axios';
const authroisationCode = '8004d669-2875-45b6-a2ce-d08ae79029ae';
const response = await axios(
{
method: 'get',
url: `https://api.felloh.com/agent/refunds/${authroisationCode}/authorise`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function authoriseRefund($token, $authroisationCode) {
$url = "https://api.felloh.com/agent/refunds/${authroisationCode}/authorise";
$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>";
$authroisationCode = '8004d669-2875-45b6-a2ce-d08ae79029ae';
$response = authoriseRefund($token, $authroisationCode);

RESPONSE

{
"data": {},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}

This endpoint allows a user to authorise a refund. This endpoint is only available to users with the refund:approve permission.

HTTP Method

GET

HTTP Endpoint

PRODhttps://api.felloh.com/agent/refunds/<AUTHORISATION CODE>/authorise

SANDBOXhttps://sandbox.felloh.com/agent/refunds/<AUTHORISATION CODE>/authorise

Payload

ParameterRequiredTypeDescription
authroisationCodetruestringThe authorisation code of the refund that you want to authorise.

Response

Returns an empty 200 response if successful


Decline a refund

GET/agent/refunds/357ad3f2-5cc4-4098-bb17-191104aacee5/decline

import axios from 'axios';
const authroisationCode = '8004d669-2875-45b6-a2ce-d08ae79029ae';
const response = await axios(
{
method: 'get',
url: `https://api.felloh.com/agent/refunds/${authroisationCode}/decline`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function declineRefund($token, $authroisationCode) {
$url = "https://api.felloh.com/agent/refunds/${authroisationCode}/decline";
$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>";
$authroisationCode = '8004d669-2875-45b6-a2ce-d08ae79029ae';
$response = declineRefund($token, $authroisationCode);

RESPONSE

{
"data": {},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}

This endpoint allows a user to decline a refund. This endpoint is only available to users with the refund:approve permission.

HTTP Method

GET

HTTP Endpoint

PRODhttps://api.felloh.com/agent/refunds/<AUTHORISATION CODE>/decline

SANDBOXhttps://sandbox.felloh.com/agent/refunds/<AUTHORISATION CODE>/decline

Payload

ParameterRequiredTypeDescription
authroisationCodetruestringThe authorisation code of the refund that you want to decline.

Response

Returns an empty 200 response if successful