Table of Contents | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Introduction
The /customers
endpoint allows you to perform Create, Read, Update, and Delete queries for a Customer 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 Customer Records.
...
Create a Customer Record
End Point URL
Code Block |
---|
https://www.giggle.tasksuite.com/webhook/json/v1/json/customers |
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 | Recommended | |
---|---|---|---|---|---|---|
1 | active | Either “true” or “false” indicating whether the customer is active or not. | Boolean | X | ||
2 | customerType | Either “person” or “company” indicating the type of customer record. | String | X | ||
3 | ssn | The Social Security Number of the contact person. | String | |||
4 | dob | The Date of Birth of the customer | String (YYYY-MM-DD) | X | ||
5 | name | The first name of the customer. | String | X | ||
6 | surname | The last name of the customer. | String | X | ||
7 | accessUserName | The first and last name of the customer. | String (firstname_lastname) E.G: john_doe | X | ||
8 | Email address of the customer. | String (johndoe@email.com) | X | |||
9 | companyName | Name of the company the customer is affiliated with. | String | X | ||
10 | ein | Employer identification number provided by the employer. | String
| X
| ||
11 | giggleId | The unique identifier provided by Giggle for this Customer | Integer
| X | ||
12 | address | The address of the Customer | Object | X | ||
13 | street1 | Street address of the customer. | String | X | ||
14 | street2 | Additional address details (e.g. suite number) | String | X | ||
15 | country | Country Code where the Customer’s address resides. | String
| X | ||
16 | state | State of the customer’s address. | String | X | ||
17 | city | City of the customer’s address. | String | X | ||
18 | zip | Zip Code of the customer’s address. | String | X | ||
19 | phone | Object | ||||
20 | number | Phone number of the user | string
| X | ||
21 | type | The type of phone the user has. | String
| X | ||
22 | carrierVerified | This is true if the carrier associated with this phone number is verified. true or false | Boolean | X | ||
23 | carrierName | The name of the carrier for this phone number | String | X |
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 POST Request
The following example is how one would create a customer record in the TaskSuite system.
Body
Code Block | ||
---|---|---|
| ||
{ "active": true, "customerType": "person", "ssn": 123456789, "dob": "2000-01-30", "name": "John", "surname": "Doe", "accessUserName": "john_doe", "email": "john.doe@email.com", "companyName": "ABC Company L.L.C", "ein": 123456789, "giggleId": 89043762, "address": { "street1": "123 Main St.", "street2": "Suite 5.", "country": "USA", "city": "Austin", "state": "TX", "zip": "22222" }, "phone": { "number": "123-456-7890", "type": "mobile", "carrierVerified": true, "carrierName": "AT&T" } } |
Example (Python)
Code Block | ||
---|---|---|
| ||
import requests import json url = "https://www.giggle.tasksuite.com/webhook/json/v1/json/customers" headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer <api_key>' } payload = json.dumps({ "active": true, "customerType": "person", "ssn": 123456789, "dob": "2000-01-30", "name": "John", "surname": "Doe", "accessUserName": "john_doe", "email": "john.doe@email.com", "companyName": "ABC Company L.L.C", "ein": 123456789, "giggleId": 89043762, "address": { "street1": "123 Main St.", "street2": "Suite 5.", "country": "USA", "city": "Austin", "state": "TX", "zip": "22222" }, "phone": { "number": "123-456-7890", "type": "mobile", "carrierVerified": true, "carrierName": "AT&T" } }) response = requests.request("POST", url, headers=headers, data=payload) |
Example Response (Success)
Code Block | ||
---|---|---|
| ||
{ "statusCode": 200, "status": "OK", "message": "Customer Successfully Created", "error": false, "giggleId": 123456 } |
Example Response (Failure)
Code Block | ||
---|---|---|
| ||
{ "statusCode": 400, "description": "Did not provide 'ssn'", "name": "Bad Request" } |
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 Customer creation to be successful.
...
Read a Customer Record
End Point URL
Code Block |
---|
https://www.giggle.tasksuite.com/webhook/json/v1/json/customers/<giggle_id:int> |
Request Method
GET
Request Body
None
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 with the details of the Customer or an error message. This request will include the customer data as well as any loan data associated with the customer.
Example GET Request
The following is an example of how one would perform a GET request in the TaskSuite system.
Example (Python)
Code Block |
---|
import requests import json url = "https://www.giggle.tasksuite.com/webhook/json/v1/json/customers/<giggle_id:int>" headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer <api_key>' } response = requests.request("GET", url, headers=headers) |
Example Response (Success)
Code Block | ||
---|---|---|
| ||
{ "customerData": { "giggleId": 123456, "active": true, "customerType": "person", "name": "John", "surname": "Doe", "age": 21, "city": "Austin", "companyName": "ABC Company L.L.C", "address": { "street1": "123 Main St.", "street2": "Suite 5.", "city": "Austin", "State": "TX", "zip": "22222", "country": "US", }, "phone": { "number": "1234567890", "type": "mobile", "carrierVerified": true, "carrierName": "AT&T", }, "dob": "2000-01-30", "ein": "123456789", }, "loanData": [ { "id": 768943, "state": "draft", "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, "daysOverDue": 12, "amountOverdue": 1987.32, "contractBalance": 421123.33, }, { "id": 768944, "state": "active", "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": 456313, "ccrScore": 800, "clarityScore": 788, "daysOverDue": 12, "amountOverdue": 1987.32, "contractBalance": 421123.33, } ] } |
Example Response (Failure)
Code Block | ||
---|---|---|
| ||
{ "statusCode": 400, "description": "Giggle ID <ID> not found.", "name": "Bad Request" } |
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 Customer record to be successful.
...
Update a Customer Record
End Point URL
Code Block |
---|
https://www.giggle.tasksuite.com/webhook/json/v1/json/customers/<giggle_id:int> |
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 | active | Either “true” or “false” indicating whether the customer is active or not. | Boolean | |
2 | customerType | Either “person” or “company” indicating the type of customer record. | String | |
3 | ssn | The Social Security Number of the contact person. | Integer | |
4 | dob | The Date of Birth of the customer | String (YYYY-MM-DD) | |
5 | name | The first name of the customer. | String | |
6 | surname | The last name of the customer. | String | |
7 | accessUserName | The first and last name of the customer. | String (firstname_lastname) E.G: john_doe | |
8 | Email address of the customer. | String | ||
9 | companyName | Name of the company the customer is affiliated with. | String | |
10 | ein | Employer identification number provided by the employer. | String
| |
11 | address | The address of the Customer | Object | |
12 | street1 | Street address of the customer. | String | |
13 | street2 | Additional address details (e.g. suite number) | String | |
14 | country | Country Code where the Customer’s address resides. | String
| |
15 | state | State of the customer’s address. | String | |
16 | city | City of the customer’s address. | String | |
17 | zip | Zip Code of the customer’s address. | String | |
18 | phone | Object | ||
19 | number | Phone number of the user | Integer
| |
20 | type | The type of phone the user has. | String
| |
21 | carrierVerified | This is true if the carrier associated with this phone number is verified. true or false | Boolean | |
22 | carrierName | The name of the carrier for this phone number | String |
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 customer record in the TaskSuite system.
Body
Code Block | ||
---|---|---|
| ||
{ "active": true, "customerType": "person", "ssn": "123456789", "dob": "2000-01-30", "name": "John", "surname": "Doe", "accessUserName": "john_doe", "email": "john.doe@email.com", "companyName": "ABC Company L.L.C", "ein": "123456789", "address": { "street1": "123 Main St.", "street2": "Suite 5.", "country": "USA", "city": "Austin", "state": "TX", "zip": "22222", }, "phone": { "number": "123-456-7890", "type": "mobile", "carrierVerified": true, "carrierName": "AT&T", } } |
Example (Python)
Code Block | ||
---|---|---|
| ||
import requests import json url = "https://www.giggle.tasksuite.com/webhook/json/v1/json/customers/<giggle_id:int>" headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer <api_key>' } payload = json.dumps({ "active": true, "customerType": "person", "ssn": 123456789, "dob": "2000-01-30", "name": "John", "surname": "Doe", "accessUserName": "john_doe", "email": "john.doe@email.com", "companyName": "ABC Company L.L.C", "ein": 123456789, "address": { "street1": "123 Main St.", "street2": "Suite 5.", "country": "USA", "city": "Austin", "state": "TX", "zip": "22222", }, "phone": { "number": "123-456-7890", "type": "mobile", "carrierVerified": true, "carrierName": "AT&T", } }) response = requests.request("PATCH", url, headers=headers, data=payload) |
Example Response (Success)
Code Block |
---|
{
"statusCode": 200,
"status": "OK",
"message": "Customer Successfully Updated",
"error": false,
"giggleId": 123456,
} |
Example Response (Failure)
Code Block | ||
---|---|---|
| ||
{ "statusCode": 400, "description": "Giggle ID <ID> not found.", "name": "Bad Request" } |
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 Customer record to be successful.
...
Delete a Customer Record
End Point URL
Code Block |
---|
https://www.giggle.tasksuite.com/webhook/json/v1/json/customers/<giggle_id:int> |
Request Method
DELETE
Request Body
None
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 with the details of the Customer or an error message.
Example DELETE Request
The following is an example of how one would perform a GET request in the TaskSuite system.
Example (Python)
Code Block |
---|
import requests import json url = "https://www.giggle.tasksuite.com/webhook/json/v1/json/customers/<giggle_id:int>" headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer <api_key>' } response = requests.request("DELETE", url, headers=headers) |
Example Response (Success)
Code Block |
---|
{
"statusCode": 200,
"status": "OK",
"message": "Customer Successfully Deleted",
"error": false,
"giggleId": 123456,
} |
Example Response (Failure)
Code Block |
---|
{ "statusCode": 400, "description": "Giggle ID <ID> not found.", "name": "Bad Request" } |
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 Customer 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.