Loan API Documentation: Giggle Finance
- 1 Introduction
- 1.1 Authentication
- 2 Create a Loan Record
- 2.1 End Point URL
- 2.2 Request Method
- 2.3 Request Body
- 2.4 Response
- 2.5 Example POST Request
- 2.5.1 Body
- 2.5.2 Example (Python)
- 2.5.3 Example Response (Success)
- 2.5.4 Example Response (Failure)
- 2.6 Error Handling
- 2.7 Notes
- 3 Read a Loan Record
- 3.1 End Point URL
- 3.2 Request Method
- 3.3 Request Body
- 3.4 Response
- 3.5 Example GET Request
- 3.5.1 Example (Python)
- 3.5.2 Example Response (Success)
- 3.5.3 Example Response (Failure)
- 3.6 Error Handling
- 3.7 Notes
- 4 Update a Loan Record
- 4.1 End Point URL
- 4.2 Request Method
- 4.3 Request Body
- 4.4 Response
- 4.5 Example PATCH Request
- 4.5.1 Body
- 4.5.2 Example (Python)
- 4.5.3 Example Response (Success)
- 4.5.4 Example Response (Failure)
- 4.6 Error Handling
- 4.7 Notes
- 5 DELETE a Loan Record
- 5.1 End Point URL
- 5.2 Request Method
- 5.3 Request Body
- 5.4 Response
- 5.4.1 Example (Python)
- 5.4.2 Example Response (Success)
- 5.4.3 Example Response (Failure)
- 5.5 Error Handling
- 5.6 Notes
- 6 Support
Introduction
The /loans
endpoint allows you to perform Create, Read, Update, and Delete queries for a Loan Record by providing relevant information. This endpoint is accessible through either a GET, POST, PATCH, or DELETE request and requires the use of a valid <api_key>
for authentication purposes. TaskSuite will provide the appropriate key for Giggle Finance.
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 Records.
Create a Loan Record
End Point URL
https://www.giggle.tasksuite.com/webhook/json/v1/loans
Request Method
POST
Request Body
The request body must be a JSON payload with the following fields
Field | Sub-Field | Description | Data Type/Format | Required | |
---|---|---|---|---|---|
1 | loanAmount |
| Total payback amount of the loan. | Float
| X |
2 | loanTerm |
| Term of the loan in number of weeks | Integer | X |
3 | contractDate |
| Date the contract was signed. | String (YYYY-MM-DD) | X |
4 | firstPaymentDate |
| First payment date of the loan. | String (YYYY-MM-DD) | X |
5 | loanClass |
| Class of the Loan | String | X |
6 | loanType |
| Type of loan, (e.g “Instalment”) | String | X |
7 | oFee |
| Origination fee of the loan. | Float | X |
8 | disbursementAmount |
| Total Disbursement amount. | Float | X |
9 | discountAmount |
| Discount Amount | Float | X |
10 | disbursementFee |
| Disbursement Fee | Float | X |
11 | discountDate |
| Employer identification number provided by the employer. | String (YYYY-MM-DD) | X |
12 | renewalIncrement |
| Renewal Number | Integer | X |
13 | applidationId |
| Application ID | Object | X |
14 | fundedDate |
| Date the loan was funded. | String (YYYY-MM-DD) |
|
15 | customerId |
| ID associated with the customer that took out the loan. | Integer
| X |
16 | leadID |
| ID associated with the lead corresponding to this loan. | Integer
| X |
17 | ccrScore |
| Credit Score | Integer | X |
18 | clarityScore |
| Clarity Score | Integer | X |
19 | files |
|
| Object |
|
20 |
| name | File name with the file format. | String |
|
21 |
| data | The raw data of the file. | String (Base64 encoded file content). |
|
Response
The response will indicate the success or failure of the request to the Loans 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.
Example POST Request
The following example is how one would create a loan record in the TaskSuite system.
Body
{
"loanAmount": 1000000.11,
"loanTerm": 52,
"contractDate": "2024-05-22",
"firstPaymentDate": "2024-06-22",
"loanClass": "gold",
"loanType": "instalment",
"oFee": 200.55,
"disbursementAmount": 800000.88,
"discountSavings": 0.00,
"discountDate": "2024-05-27",
"renewalIncrement": 8,
"applicationId": 79834,
"disbursementFee": 25.99,
"fundedDate": "2024-06-13",
"partnerId": 75475,
"leadId": 456312,
"ccrScore": 800,
"clarityScore": 788,
"files": [
{
"name": "signed_contract_1.pdf",
"data": "JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoK..."
},
{
"name": "signed_contract_2.pdf",
"data": "UEsDBBQAAAAIAGWOOU/Wh7XIAgAAAAwAAAJAAAALd..."
},
{
"name": "signed_terms_and_conditions_1.pdf",
"data": "MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRml..."
}
]
}
Example (Python)
import requests
import json
url = "https://www.giggle.tasksuite.com/webhook/json/v1/loans"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <api_key>'
}
payload = json.dumps({
"loanAmount": 1000000.11,
"loanTerm": 52,
"contractDate": "2024-05-22",
"firstPaymentDate": "2024-06-22",
"loanClass": "gold",
"loanType": "instalment",
"oFee": 200.55,
"disbursementAmount": 800000.88,
"discountSavings": 0.00,
"discountDate": "2024-05-27",
"renewalIncrement": 8,
"applicationId": 79834,
"disbursementFee": "25.99",
"fundedDate": "2024-06-13",
"partnerId": 75475,
"leadId": 456312,
"ccrScore": 800,
"clarityScore": 788,
"files": [
{
"name": "signed_contract_1.pdf",
"data": "JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoK..."
},
{
"name": "signed_contract_2.pdf",
"data": "UEsDBBQAAAAIAGWOOU/Wh7XIAgAAAAwAAAJAAAALd..."
},
{
"name": "signed_terms_and_conditions_1.pdf",
"data": "MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRml..."
}
]
})
response = requests.request("POST", url, headers=headers, data=payload)
Example Response (Success)
Example Response (Failure)
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 creation to be successful.
Read a Loan Record
End Point URL
Request Method
GET
Request Body
None
Response
The response will indicate the success or failure of the request to the Loans 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.
Example GET Request
The following is an example of how one would perform a GET request for a loan record in the TaskSuite system.
Example (Python)
Example Response (Success)
Example Response (Failure)
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 access to the Loan record to be successful.
Update a Loan Record
End Point URL
Request Method
PATCH
Request Body
The request body must be a JSON payload with the following fields. Please keep in mind that all fields are optional.
Field | Sub-Field | Description | Data Type/Format | |
---|---|---|---|---|
1 | state |
| The state of the loan. Possible values include
| String |
2 | loanAmount |
| Total payback amount of the loan. | Float
|
3 | loanTerm |
| Term of the loan in number of weeks | Integer |
4 | contractDate |
| Date the contract was signed. | String (YYYY-MM-DD) |
5 | firstPaymentDate |
| First payment date of the loan. | String (YYYY-MM-DD) |
6 | loanClass |
| Class of the Loan | String |
7 | loanType |
| Type of loan, (e.g. “Instalment”) | String |
8 | oFee |
| Origination fee of the loan. | Float |
9 | disbursementAmount |
| Total Disbursement amount. | Float |
10 | discountAmount |
| Discount Amount | Float |
11 | disbursementFee |
| Disbursement Fee | Float |
12 | discountDate |
| Employer identification number provided by the employer. | String (YYYY-MM-DD) |
13 | renewalIncrement |
| Renewal Number | Integer |
14 | fundedDate |
| Date the loan was funded. | String (YYYY-MM-DD) |
15 | ccrScore |
| Credit Score | Integer |
16 | clarityScore |
| Clarity Score | Integer |
17 | files |
|
| Object |
18 |
| fileId | If a file id is provided, it is assumed that this file Id is to be updated and not created. The file with the corresponding id will be searched for and updated. If the intention is to create a new file do not include the file id. |
|
19 |
| name | Name of the file, this name must be unique per loan record. No two files linked to the same loan are permitted to have the same name. | String |
20 |
| data | The raw data of the file. | String (Base64 encoded file content). |
Response
The response will indicate the success or failure of the request to the Contact 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.
Example PATCH Request
The following example is how one would update a loan record in the TaskSuite system.
Body
Example (Python)
Example Response (Success)
Example Response (Failure)
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 access to the Loan record to be successful.
DELETE a Loan Record
End Point URL
Request Method
DELETE
Request Body
None
Response
The response will indicate the success or failure of the request to the Loan 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 with the details of the Loan or an error message.
Example (Python)
Example Response (Success)
Example Response (Failure)
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 access to the Loan record 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.