Refunds
A Refund object represents a refund on a transaction.
Refund Model
Properties
- Name
amount- Type
- string
- Description
The amount that the refund is for.
- Name
status.id- Type
- string
- Description
The status of the refund, all statuses can be retrieved using the enums endpoint
- Name
authorisation_code- Type
- string
- Description
A unique code, used to identify a refund.
- Name
authorised_at- Type
- datetime
- Description
The datetime at which the refund was authorised.
- Name
organisation- Type
- object
- Description
The organisation model that the refund is linked to.
- Name
completed_at- Type
- datetime
- Description
The datetime at which the refund was completed.
- Name
transaction- Type
- object
- Description
An object containing a compact version of the transaction model that the refund is linked to.
- Name
created_at- Type
- datetime
- Description
The datetime at which the refund request was created.
- Name
metadata- Type
- object
- Description
A user defined metadata object, that can be used to contain any variables defined by the user.
{
"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"
},
"metadata": {
"internal_id": "abc-1234"
},
"created_at": "2023-09-25T10:14:52.237Z"
}
Fetch All
This endpoint retrieves all refunds. Refunds are sorted by created date.
Parameters
- Name
organisationrequired- Type
- string
- Description
The 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.
- Name
skip- Type
- integer
- Description
See the pagination section for details
- Name
take- Type
- integer
- Description
See the pagination section for details
Returns
Returns an array of refund models
Request
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>`
}
});
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"
},
"metadata": {
"internal_id": "abc-1234"
},
"created_at": "2023-09-25T10:14:52.237Z"
}
],
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}
Authorise One
This endpoint allows a user to authorise a refund. This endpoint is only available to users with the refund:approve permission.
Parameters
- Name
authorizationCode- Type
- string
- Description
The authorisation code of the refund that you want to authorise.
Request
import axios from 'axios';
const authorizationCode = '8004d669-2875-45b6-a2ce-d08ae79029ae';
const response = await axios({
method: 'get',
url: `https://api.felloh.com/agent/refunds/${authorizationCode}/authorise`,
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer <YOUR TOKEN HERE>`
}
});
Response
{
"data": {},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}
Decline One
This endpoint allows a user to decline a refund. This endpoint is only available to users with the refund:approve permission.
Parameters
- Name
authorizationCode- Type
- string
- Description
The authorisation code of the refund that you want to decline.
Request
import axios from 'axios';
const authorizationCode = '8004d669-2875-45b6-a2ce-d08ae79029ae';
const response = await axios({
method: 'get',
url: `https://api.felloh.com/agent/refunds/${authorizationCode}/decline`,
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer <YOUR TOKEN HERE>`
}
});
Response
{
"data": {},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}
