Loan Transaction API Documentation: Giggle Finance

Introduction

The /transactions endpoint allows you to perform Create and Read, queries for a Loan Transaction Record by providing relevant information. This endpoint is accessible through either a GET or POST request and requires the use of a valid <api_key> for authentication purposes. TaskSuite will provide the appropriate key for Giggle Finance. Transactions is a sub-resource of loans, and loans are the top-level resource. There cannot be a transaction without an associated loan.

Authentication

To access this endpoint, you need to include the <api_key> in the header payload. The <api_key> serves as an authentication mechanism to ensure only authorized users can manipulate Loan Transaction Records.

Create a Loan Transaction Record

This endpoint is built with an assumption of a reflective procedure. Meaning that the TaskSuite API does not initiate the transactions, but rather reflects the status and result of transactions.

End Point URL

https://www.giggle.tasksuite.com/webhook/json/v1/loans/<loan_id:int>/transactions

Request Method

POST

Create Loan Transaction

This endpoint will handle the creation of a loan transactions. There are six types of transactions that can occur with the TaskSuite API.

Request Body

The request body must be a JSON payload with the following fields

Field

Description

Data Type/Format

Required

Field

Description

Data Type/Format

Required

1

type

The type of transaction being created.

Options: (payout, debit, credit, reversal, settlement, write-off)

  • payout- Initial payout of the loan.

  • debit - Borrower transfers funds to the lender.

  • credit - Lender transfers funds to the borrower.

  • reversal - Reversal of settled transaction.

  • settlement - Loan is settled prematurely.

  • write-off - Remaining owed amount is written off the account.

String

X

2

date

The date of the transaction.

String (YYYY-MM-DD)

X

3

amount

The amount of the transaction.

Float

  • Only to the hundredths place.

  • (e.g. 2000.22)

X (Unless transaction is reversed or written off)

 

Response

The response will indicate the success or failure of the request to the Loan Transactions endpoint. The details of the response may vary based on the implementation of the API. A typical response will be a JSON object containing a success message or an error message. The response will also include the loan balance.

Payout: Example POST Request

The following example is how one would create a loan transaction record in the TaskSuite system.

Body

{ "type": "payout", "date": "2024-05-22", "amount": 1000.33 }

Example (Python)

import requests import json url = "https://www.giggle.tasksuite.com/webhookjson/v1/loans/<loan_id:int>/transactions" headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer <api_key>' } payload = json.dumps({ "type": "payout", "date": "2024-05-22", "amount": 1000.33, }) response = requests.request("POST", url, headers=headers, data=payload)

Example Response (Success)

Example Response (Failure)

Debit: Example POST Request

The following example is how one would create a loan record in the TaskSuite system.

Body

Example (Python)

Example Response (Success)

Example Response (Failure)

Credit: Example POST Request

The following example is how one would create a loan record in the TaskSuite system.

Body

Example (Python)

Example Response (Success)

Example Response (Failure)

Reversal: Example POST Request

The following example is how one would create a reversal transaction in the TaskSuite system. Include the transaction ID of the transaction that was reversed in the URL of the HTTP request. Do not include the amount in the body of the payload, the “amount” key value pair will not be considered for reversal type transactions.

Body

Example URL

Example (Python)

Example Response (Success)

Example Response (Failure)

Settlement: Example POST Request

The following example is how one would create a settlement transaction in the TaskSuite system. This transaction will mark the loan’s state to ‘settled’.

Body

Example (Python)

Example Response (Success)

Example Response (Failure)

Write-Off: Example POST Request

The following example is how one would create a write-off transaction in the TaskSuite system. This transaction will mark the loan’s state to ‘written-off’.

Body

Example (Python)

Example Response (Success)

Example Response (Failure)


Read Transaction Record(s)

Request Method

GET

Request Body

None

Response

The response will indicate the success or failure of the request to the Loans Transactions endpoint. The details of the response may vary based on the implementation of the API. A typical response will be a JSON object containing a success message or an error message.

Single Transaction Example GET Request

The following is an example of how one would perform a GET request for a loan transaction record in the TaskSuite system. If a specific transaction is required append the transaction ID to the end of the URL route.

End Point URL

Single Transaction Example (Python)

Single Transaction Example Response (Success)

Single Transaction Example Response (Failure)

Batch Transaction Example GET Request

The following is an example of how one would perform a GET request for all transaction records associated with a particular loan in the TaskSuite system. Sorting by date, amount, or transactionId is permitted via query parameters.

End Point URLS

Batch Transaction Example (Python)

Batch Transaction Example Response (Success)

Error Handling

In case of errors, the response will contain an appropriate error message with details on what caused the error. Make sure to handle these errors.

Notes

  • Ensure that the required fields are provided in the request body; otherwise, the API will return an error indicating the missing fields.

  • The <api_key> in the headers must be valid and active for the Loan Transaction creation to be successful.


Support

If there are any errors or discrepancies with this document or the related API endpoints. Please reach out to support@tasksuite.com and a support engineer with handle your query.