Loan Transaction API Documentation: Giggle Finance
- 1 Introduction
- 1.1 Authentication
- 2 Create a Loan Transaction Record
- 2.1 End Point URL
- 2.2 Request Method
- 2.3 Create Loan Transaction
- 2.4 Request Body
- 2.5 Response
- 2.6 Payout: Example POST Request
- 2.6.1 Body
- 2.6.2 Example (Python)
- 2.6.3 Example Response (Success)
- 2.6.4 Example Response (Failure)
- 2.7 Debit: Example POST Request
- 2.7.1 Body
- 2.7.2 Example (Python)
- 2.7.3 Example Response (Success)
- 2.7.4 Example Response (Failure)
- 2.8 Credit: Example POST Request
- 2.8.1 Body
- 2.8.2 Example (Python)
- 2.8.3 Example Response (Success)
- 2.8.4 Example Response (Failure)
- 2.9 Reversal: Example POST Request
- 2.9.1 Body
- 2.9.2 Example URL
- 2.9.3 Example (Python)
- 2.9.4 Example Response (Success)
- 2.9.5 Example Response (Failure)
- 2.10 Settlement: Example POST Request
- 2.10.1 Body
- 2.10.2 Example (Python)
- 2.10.3 Example Response (Success)
- 2.10.4 Example Response (Failure)
- 2.11 Write-Off: Example POST Request
- 2.11.1 Body
- 2.11.2 Example (Python)
- 2.11.3 Example Response (Success)
- 2.11.4 Example Response (Failure)
- 3 Read Transaction Record(s)
- 4 Support
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 | |
---|---|---|---|---|
1 | type | The type of transaction being created. Options: (payout, debit, credit, reversal, settlement, write-off)
| String | X |
2 | date | The date of the transaction. | String (YYYY-MM-DD) | X |
3 | amount | The amount of the transaction. | Float
| 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.