Refunds

A Refund object represents a refund on a transaction.


Refund Model

Properties

  • Name
    id
    Type
    uuid
    Description

    Unique identifier for the refund.

  • Name
    amount
    Type
    integer
    Description

    The amount that the refund is for, in the lowest denomination of the currency.

  • Name
    description
    Type
    string
    Description

    The description supplied when the refund was requested.

  • 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.

{
  "id": "7c3f2a1e-5b7d-4c1a-9e2f-3d4b5a6c7d8e",
  "amount": 90,
  "description": "Customer cancelled excursion",
  "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"
}

POST/agent/refunds

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

    Number of records to return. Defaults to 25, maximum 25. See the pagination section for details.

Returns

Returns an array of refund models

Request

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>`
  }
});

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
  }
}

GET/agent/refunds/:authorisation_code/authorise

Authorise One

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

Path Parameters

  • Name
    authorisation_code
    Type
    string
    Description

    The authorisation code of the refund that you want to authorise. The refund must be in the PENDING_AUTHORISATION status.

Request

GET
/agent/refunds/:authorisation_code/authorise
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
  }
}

GET/agent/refunds/:authorisation_code/decline

Decline One

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

Path Parameters

  • Name
    authorisation_code
    Type
    string
    Description

    The authorisation code of the refund that you want to decline. The refund must be in the PENDING_AUTHORISATION status.

Request

GET
/agent/refunds/:authorisation_code/decline
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
  }
}