Worked on the Disbursement Request and Disbursement Response

This commit is contained in:
Azeez Muibi
2025-03-19 16:59:56 +01:00
parent d06a257660
commit 16d886294f
+290 -29
View File
@@ -2,7 +2,7 @@
"openapi": "3.0.3",
"info": {
"title": "Swagger Simbrella FirstAdvance - OpenAPI 3.0",
"description": "This is a Simbrella FirstAdvance Backend Server with the OpenAPI 3.0 specification. \n\n\nSome useful links:\n- [Web Simulated Demo Page](https://digifi-salaryloan.chiefsoft.net/)\n- [Web Management Support Portal](https://digifi-office.chiefsoft.net/auth/login)",
"description": "This is a Simbrella FirstAdvance Backend Server with the OpenAPI 3.0 specification.\n\nSome useful links:\n- [Web Simulated Demo Page](https://digifi-salaryloan.chiefsoft.net/)\n- [Web Management Support Portal](https://digifi-office.chiefsoft.net/auth/login)",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "support@chiefsoft.com"
@@ -29,7 +29,7 @@
},
{
"name": "SelectOffer",
"description": "This method is used the send the offer the customer selected to Simbrella.",
"description": "This method is used to send the offer the customer selected to Simbrella.",
"externalDocs": {
"description": "Find out more",
"url": "https://www.simbrellang.net"
@@ -74,6 +74,14 @@
"description": "Find out more",
"url": "https://www.simbrellang.net"
}
},
{
"name": "LoanRequest",
"description": "Request from Simbrella to FirstBank to process a loan",
"externalDocs": {
"description": "Find out more",
"url": "https://www.simbrellang.net"
}
}
],
"paths": {
@@ -405,6 +413,53 @@
}
]
}
},
"/Disbursement": {
"post": {
"tags": [
"LoanRequest"
],
"summary": "Request from Simbrella to FirstBank to process a loan",
"description": "This request should be executed as an atomic operation. Providing a loan and collecting the upfront fees operation should be executed within the same transaction.",
"operationId": "disburseLoanRequest",
"requestBody": {
"description": "Post JSON to disburse loan",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DisbursementRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DisbursementResponse"
}
}
}
},
"400": {
"description": "Invalid request parameters"
},
"404": {
"description": "Resource not found"
},
"422": {
"description": "Validation exception"
}
},
"security": [
{
"apiKey": []
}
]
}
}
},
"components": {
@@ -497,27 +552,33 @@
"minamount": {
"type": "number",
"format": "double",
"example": 5000
"example": 5000,
"description": "Minimum amount of loan"
},
"maxamount": {
"type": "number",
"format": "double",
"example": 20000
"example": 20000,
"description": "Maximum amount of loan"
},
"productId": {
"type": "integer",
"example": 101
"example": 101,
"description": "Product identifier"
},
"offerid": {
"type": "integer",
"example": 101
"example": 101,
"description": "Offer identifier"
},
"Tenor": {
"type": "integer",
"example": 30
"example": 30,
"description": "Loan tenor in days"
}
}
}
},
"description": "Array of eligible offers"
},
"resultCode": {
"type": "string",
@@ -602,7 +663,8 @@
"outstandingDebtAmount": {
"type": "number",
"format": "double",
"example": 0
"example": 0,
"description": "Outstanding debt amount"
},
"requestId": {
"type": "string",
@@ -631,77 +693,97 @@
"properties": {
"offerId": {
"type": "string",
"example": "14451"
"example": "14451",
"description": "Unique offer identifier"
},
"productId": {
"type": "string",
"example": "2030"
"example": "2030",
"description": "Product identifier"
},
"amount": {
"type": "number",
"format": "double",
"example": 10000.0
"example": 10000.0,
"description": "Amount of loan customer is eligible for"
},
"upfrontPayment": {
"type": "number",
"format": "double",
"example": 1000.0
"example": 1000.0,
"description": "Amount to be deducted upfront"
},
"interestRate": {
"type": "number",
"format": "double",
"example": 3.0
"example": 3.0,
"description": "% of interest rate"
},
"Interest": {
"type": "number",
"format": "double",
"example": 300.0,
"description": "Amount of Interest"
},
"ManagementRate": {
"type": "number",
"format": "double",
"example": 1.0
"example": 1.0,
"description": "% of Management Fee"
},
"ManagementFee": {
"type": "number",
"format": "double",
"example": 1.0
"example": 1.0,
"description": "Amount of Management Fee"
},
"InsuranceRate": {
"type": "number",
"format": "double",
"example": 1.0
"example": 1.0,
"description": "% of Amount of Insurance"
},
"InsuranceFee": {
"type": "number",
"format": "double",
"example": 100.0
"example": 100.0,
"description": "Amount of Insurance"
},
"VATRate": {
"type": "number",
"format": "double",
"example": 7.5
"example": 7.5,
"description": "% of Amount of VAT"
},
"VATamount": {
"type": "number",
"format": "double",
"example": 100.0
"example": 100.0,
"description": "Amount of VAT"
},
"recommendedRepaymentDates": {
"type": "array",
"items": {
"type": "string"
},
"example": [
"2022-11-30"]
"example": ["2022-11-30"],
"description": "Array of recommended payment dates for all installments in yyyy-mm-dd format"
},
"installmentAmount": {
"type": "number",
"format": "double",
"example": 11000.0
"example": 11000.0,
"description": "Amount to be paid each month (upfrontPayment not included)"
},
"totalRepaymentAmount": {
"type": "number",
"format": "double",
"example": 11000.0
"example": 11000.0,
"description": "Total amount to be paid by customer. All installment amounts + upfront payment"
}
}
}
},
"description": "Array of offers"
},
"resultCode": {
"type": "string",
@@ -719,10 +801,12 @@
"type": "object",
"required": [
"$type",
"requestId",
"transactionId",
"customerId",
"accountId",
"productId",
"lienAmount",
"requestedAmount",
"collectionType",
"loanType",
@@ -742,7 +826,7 @@
"transactionId": {
"type": "string",
"example": "Tr201712RK9232P115",
"description": "Unique ID of customers USSD session. Must be consistent throughout whole USSD journey"
"description": "Unique ID of customer's USSD session"
},
"customerId": {
"type": "string",
@@ -784,7 +868,7 @@
"loanType": {
"type": "integer",
"example": 0,
"description": "Type of loan. 0 - simple; 1 - refinance"
"description": "Type of loan. 0 simple; 1 refinance"
},
"channel": {
"type": "string",
@@ -812,7 +896,7 @@
"transactionId": {
"type": "string",
"example": "Tr201712RK9232P115",
"description": "Unique ID of customers USSD session. Must be consistent throughout whole USSD journey"
"description": "Unique ID of customer's USSD session"
},
"customerId": {
"type": "string",
@@ -840,7 +924,7 @@
"description": "Description of provided result code"
}
}
},
},
"LoanInformationRequest": {
"type": "object",
"required": [
@@ -1205,6 +1289,177 @@
"description": "Description of provided result code"
}
}
},
"DisbursementRequest": {
"type": "object",
"required": [
"requestId",
"debtId",
"transactionId",
"customerId",
"accountId",
"productId",
"provideAmount",
"countryId"
],
"properties": {
"requestId": {
"type": "string",
"example": "202111170001371256908",
"description": "Unique identifier of request"
},
"transactionId": {
"type": "string",
"example": "T001",
"description": "Unique ID of customer's USSD session"
},
"debtId": {
"type": "string",
"example": "273194670",
"description": "Unique identifier of a loan in Simbrella system"
},
"customerId": {
"type": "string",
"example": "CN621868",
"description": "Unique identifier of a user"
},
"accountId": {
"type": "string",
"example": "2017821799",
"description": "Specific identifier of a user's account"
},
"productId": {
"type": "string",
"example": "101",
"description": "Identifier of a product to be provided to a user"
},
"provideAmount": {
"type": "number",
"format": "double",
"example": 100000.0,
"description": "Amount of loan to be provided on a specific account of a user"
},
"collectAmountInterest": {
"type": "number",
"format": "double",
"example": 5000.0,
"description": "Interest Amount to be collected immediately after loan is provided"
},
"collectAmountMgtFee": {
"type": "number",
"format": "double",
"example": 1000.0,
"description": "Management Fee Amount to be collected immediately after loan is provided"
},
"collectAmountInsurance": {
"type": "number",
"format": "double",
"example": 1000.0,
"description": "Insurance Amount to be collected immediately after loan is provided"
},
"collectAmountVAT": {
"type": "number",
"format": "double",
"example": 75.0,
"description": "VAT Amount to be collected immediately after loan is provided"
},
"countryId": {
"type": "string",
"example": "01",
"description": "Set to static value '01'"
},
"comment": {
"type": "string",
"example": "Testing LoanRequest",
"description": "Any additional comment for provided loan operation"
}
}
},
"DisbursementResponse": {
"type": "object",
"required": [
"requestId",
"debtId",
"transactionId",
"customerId",
"accountId",
"productId",
"provideAmount",
"resultCode",
"resultDescription"
],
"properties": {
"requestId": {
"type": "string",
"example": "202111170001371256908",
"description": "Unique identifier of request"
},
"transactionId": {
"type": "string",
"example": "T001",
"description": "Unique ID of customer's USSD session"
},
"debtId": {
"type": "string",
"example": "273194670",
"description": "Unique identifier of a loan in Simbrella system"
},
"customerId": {
"type": "string",
"example": "CN621868",
"description": "Unique identifier of a user"
},
"accountId": {
"type": "string",
"example": "2017821799",
"description": "Specific identifier of a user's account"
},
"productId": {
"type": "string",
"example": "101",
"description": "Identifier of a product to be provided to a user"
},
"provideAmount": {
"type": "number",
"format": "double",
"example": 100000.0,
"description": "Amount of loan to be provided on a specific account of a user"
},
"collectAmountInterest": {
"type": "number",
"format": "double",
"example": 5000.0,
"description": "Interest Amount to be collected immediately after loan is provided"
},
"collectAmountMgtFee": {
"type": "number",
"format": "double",
"example": 1000.0,
"description": "Management Fee Amount to be collected immediately after loan is provided"
},
"collectAmountInsurance": {
"type": "number",
"format": "double",
"example": 1000.0,
"description": "Insurance Amount to be collected immediately after loan is provided"
},
"collectAmountVAT": {
"type": "number",
"format": "double",
"example": 75.0,
"description": "VAT Amount to be collected immediately after loan is provided"
},
"resultCode": {
"type": "string",
"example": "00",
"description": "Result code of executed transaction"
},
"resultDescription": {
"type": "string",
"example": "Loan Request Completed Successfully!",
"description": "Description of provided result code"
}
}
}
},
"securitySchemes": {
@@ -1212,6 +1467,12 @@
"type": "http",
"scheme": "basic",
"description": "Basic Authentication method is implemented. Each request should contain Authorization header with Base64 encoded username:password"
},
"apiKey": {
"type": "apiKey",
"in": "header",
"name": "appID",
"description": "API Key authentication method is implemented. Each request should contain appID and apiKey headers."
}
}
}