Middleware API Documentation
Version |
Date |
Author |
Description |
1.0 |
09-Feb-2023 |
Barzan T.S |
|
1.1 |
05-JUN-2023 |
Barzan T.S |
Added Policy Print out API |
1.2 |
30-JUL-2023 |
Barzan T.S |
Update Create Quotation, Added Customer History |
Index
Contents
2. Generate Authentication Token
10. System Lookups
11. General Notes
12. Policy Printout
Rest API Service
Following is the API URL to which will use in your App. Integration layer to send/receive data from Solidarity Core DB.
URL UAT: https://apiUAT.solidarity.com.jo
URL Production: https://api.solidarity.com.jo
2. Generate Authentication Token
Authentication the user with the system and obtain the String.
Request
Method |
POST |
URL |
api/auth/getToken |
Request JSON |
{ "username": "UserName will shared through email", "password": "Password will shared through email" } |
Note |
*Password should be passed Encrypted as shared through email. |
Response
Status |
200 |
Response |
String data [Token] |
Response data [Token] must be sent with all client requests. The [Token] helps the server to validate the request source. [Token] has an expiration limit, and it will be expired in 20 mins.
Insert Quotation Data and Holder Information
Request
Method |
POST |
URL |
api/Quotations/Travel/Create |
Authentication |
In Request Header <Bearer: [Token]> |
Request JSON |
{ "nationalid": "Base64string Encode Value(“988xxxxxxx”)", "passportno": "Base64string Encode Value(“ABC123”)", "gender": "1", "nationality": "1", "fullname": " Base64string Encode Value(“Barzan”)", "email": " Base64string Encode Value(“email@domain.com”)", "mobile": " Base64string Encode Value(“96279xxxxx”)", "dobday": "01", "dobmonth": "01", "dobyear": "1988", "fulladdress": "Amman", "coverage":"1", "geozone": "1", "destination": "1", "period": "1", "startday": "09", "startmonth": "02", "startyear": "2023", “imagebase64”:”base64Data”, “imagename”:”imagename.png” } |
Note |
*All critical data should be passed base64 Encode *Gender, nationality, geozone, destination, and period should be passed based on lookups below *Should pass a valid email and mobile number *Image Allowed .jpg, .jpeg, .png |
Response
Status |
200 |
Response |
{ "responseCode": "201 Created", "responseMessage": "Quotation Created", "dataCount": 1, "data": [ { "quotationID": 1 } ], "schemaCount": 1, "schema": [ { "name": "QuotationID", "type": "Int32" } ] } |
Note |
*Save the quotationID to use it in other Methods |
To Update quotation info and/or customer info.
Request
Method |
POST |
URL |
api/Quotations/Travel/Update |
Authentication |
In Request Header <Bearer: [Token]> |
Request JSON |
{ "quotationid": "1", "nationalid": "Base64string Encode Value(“988xxxxxxx”)", "passportno": "Base64string Encode Value(“ABC123”)", "gender": "1", "nationality": "1", "fullname": "Base64string Encode Value(“Barzan”)", "email": "Base64string Encode Value(“email@domain.com”)", "mobile": "Base64string Encode Value(“96279xxxxxx”)", "dobday": "01", "dobmonth": "01", "dobyear": "1988", "fulladdress": "Amman", "geozone": "1", "destination": "1", "period": "1", "startday": "05", "startmonth": "03", "startyear": "2023" } |
Note |
*All critical data should be passed base64 Encode *Gender, nationality, geozone, destination, and period should be passed based on lookups below *Should pass a valid email and mobile number |
Response
Status |
200 |
Response |
{ "responseCode": "200 Updated", "responseMessage": "Quotation Updated", "dataCount": 1, "data": [ { "quotationID": 7 } ], "schemaCount": 1, "schema": [ { "name": "QuotationID", "type": "Int32" } ]} |
To Check Customer Order before Pay
Request
Method |
POST |
URL |
api/Quotations/Travel/ReviewOrder |
Authentication |
In Request Header <Bearer: [Token]> |
Request JSON |
{ "quotationid":"" } |
Note |
*You can get the quotationID from [Create Travel Quotation] |
Response
Status |
200 |
Response |
{ "responseCode": "200 OK", "responseMessage": "Data Found", "dataCount": 1, "data": [ { "quotationID": "9", "fullName": "b3NhbWEgaXNhbQ==", "email": "b3NhQGRkLmNvbQ==", "mobile": "OTYyNzkxNjE4Nzky", "dob": "1988-01-01T00:00:00", "geoArea": "Worldwide", "destination": "Qatar", "totalDays": "7", "periodName": "7 Days", "startDate": "2023-03-02T00:00:00", "endDate": "2023-03-09T00:00:00", "netPremium": "0.0 JOD" } ], "schemaCount": 12, "schema": [ { "name": "QuotationID", "type": "String" },… ] } |
6. Create Policy [set transaction]
After approving the quotation, use the following method to add quotation transactions and create an official policy.
Request
Method |
POST |
URL |
api/Transaction/Travel/Create |
Authentication |
In Request Header <Bearer: [Token]> |
Request JSON |
{ "quotationid":"9", "amount":"150", "transactionNo":"abc0123", "transactionMessage":"success", "transactionUUID":"N/A", "transactionAuthNo":"N/A" }
|
Note |
* You can get the quotationID from [Create Travel Quotation] *transactionNo should be unique *if you used the Payment Gateway, you should fill in all data from the response, otherwise please pass “N/A” for "transactionMessage, transactionUUID, transactionAuthNo" *transactionUUID mean merchant ref. No. *transactionMessage should be “success” |
Response
Status |
200 |
Response |
{ "responseCode": "200 OK", "responseMessage": "Policy Issued", "dataCount": 1, "data": [ { "status": true, "statusMessage": "Policy Issued Successfully", "policyNo": "00001", "PDFURL": https://apiuat.solidarity.com.jo/print/Reports/Travel?pid=, "PolicyKey": "",
} ], "schemaCount": 3, "schema": [ { "name": "Status", "type": "Boolean" }, { "name": "StatusMessage", "type": "String" }, { "name": "PolicyNo", "type": "String" } ] } |
Request
Method |
POST |
URL |
api/Reports/Travel |
Authentication |
In Request Header <Bearer: [Token]> |
Request JSON |
{ "fromday":"01", "frommonth":"02", "fromyear":"2023", "today":"01", "tomonth":"03", "toyear":"2023" }
|
Response
Status |
200 |
Response |
{ "responseCode": "200 OK", "responseMessage": "Report Generated", "dataCount": 1, "data": [ { "nationalID": "OTg4MTA0NDM3Nw==", "nationality": "Jordan", "passport": "cGFzczAxMTE=", "fullName": "b3NhbWEgaXNhbQ==", "email": "b3NhQGRkLmNvbQ==", "mobile": "OTYyNzkxNjE4Nzky", "gender": "Male", "dob": "Jan 1 1988 12:00AM", "destinationName": "Qatar", "geoName": "Worldwide", "periodName": "7 Days", "fromDate": "Mar 2 2023 12:00AM", "toDate": "Mar 9 2023 12:00AM", "status": "Not Paid", "transactionNo": "N/A", "transactionAuth": "N/A", "transactionDate": "N/A", "transactionAmount": "N/A", "companyName": "Barzan", "creatorName": "Barzan Admin" }, "schemaCount": 20, "schema": [ { "name": "NationalID", "type": "String" },… ]} |
Request
Method |
POST |
URL |
api/Reports/THistory |
Authentication |
In Request Header <Bearer: [Token]> |
Request JSON |
{ "nationalid":"OTg4MTA0NDM3Nw==", }
|
Response
Status |
200 |
Response |
{ "responseCode": "200 OK", "responseMessage": "Report Generated", "dataCount": 1, "data": [ { "quotationID": "1", "nationalID": "OTg4MTA0NDM3Nw==", "passport": "cGFzczAxMTE=", "fullName": "b3NhbWEgaXNhbQ==", "email": "b3NhQGRkLmNvbQ==", "mobile": "OTYyNzkxNjE4Nzky", "gender": "Male", "dob": "Jan 1 1988 12:00AM", "nationalityID": "03", "nationality": "Jordan", "genderID": "1", "gender": "Male", "destinationID": "1", "destinationName": "Qatar", "geoID": "1", "geoName": "Worldwide", "periodID": "1", "periodName": "7 Days", "fromDate": "Mar 2 2023 12:00AM", "toDate": "Mar 9 2023 12:00AM", "statusID": "0", "status": "Not Paid", "transactionNo": "N/A", "transactionAmount": "N/A", "transactionAuth": "N/A", "transactionDate": "N/A", "companyName": "Barzan", "creatorName": "Barzan Admin", "policyKey": "", "PDFURL": "" }, "schemaCount": 20, "schema": [ { "name": "quotationID", "type": "String" },… ]} |
|
|
Request
Method |
POST |
URL |
api/Tariff/Travel |
Authentication |
In Request Header <Bearer: [Token]> |
Request JSON |
{ "age": "33", "geozone": "1", "coverage": "1", "period": "1" } |
Response
Status |
200 |
Response |
{ "responseCode": “200 OK”, "responseMessage": "Data Found", "dataCount": 1, "data": [ { "price": "18.7", "currency": "JOD" } ], "schemaCount": 2, "schema": [ { "name": "Price", "type": "String" }, { "name": "Currency", "type": "String" } ] } |
10.1. All Lookups
Request
Method |
POST |
URL |
api/lookups/List |
Authentication |
In Request Header <Bearer: [Token]> |
10.2. Travel Coverage
Request
Method |
POST |
URL |
api/lookups/ TravelCover |
Authentication |
In Request Header <Bearer: [Token]> |
10.3. Travel Destinations
Request
Method |
POST |
URL |
api/lookups/ TravelDestination |
Authentication |
In Request Header <Bearer: [Token]> |
10.4. Travel Geo Area
Request
Method |
POST |
URL |
api/lookups/ TravelGeoArea |
Authentication |
In Request Header <Bearer: [Token]> |
10.5. Travel Period
Request
Method |
POST |
URL |
api/lookups/ TravelPeriod |
Request JSON |
{“coverageid”:”1”,” geoid”:”1”} |
Authentication |
In Request Header <Bearer: [Token]> |
10.6. Genders
Request
Method |
POST |
URL |
api/lookups/ Gender |
Authentication |
In Request Header <Bearer: [Token]> |
10.7. Nationalities
Request
Method |
POST |
URL |
api/lookups/ Nationality |
Authentication |
In Request Header <Bearer: [Token]> |
11.1. All responses are in JSON format, you can Deserialize that in the following object*.
11.2. All Responses status should be 200 OK and must you find the Custom ResponseCode and ResponseMessage in the response body.
11.3. All request parameters are mandatory. Find the Schemas section in Swagger page
11.4. Base64string conversion .Net sample: Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(“ABC123”))
*General Response Object:
public class GeneralResponse
{
public string ResponseCode { get; set; }
public string ResponseMessage { get; set; }
public int DataCount { get; set; }
public List<object> Data { get; set; }
public int SchemaCount { get; set; }
public List<object> Schema { get; set; }
}
public class GeneralSchema
{
public string Name { get; set; }
public string Type { get; set; }
}
Request
Method |
POST / GET |
URL |
https://apiuat.solidarity.com.jo/print/Reports/Travel?pid= |
Authentication |
No Auth. |
Request Parameters |
Pid=Base64string Encode Value(“0000123”)", |
Response
Status |
Downloading PDF File directly |
13. Quotation Status
Status ID |
Status Name |
0 |
Not Paid |
1 |
Paid – Valid |
2 |
Paid - Expired |