Developer Portal
Abhi Open API
Introduction
Abhi offers a set of APIs to 3rd parties for the purpose of integration to render EWA services to the external platform.
3rd parties system shall integrate Abhi API(s) in its platform to offer the frontend application to its end users. The users will essentially log in to the 3rd party system & the 3rd party system in turn will call Abhi API(s) to render its services.
As part of the one-time onboarding, Abhi team set up the root organization for 3rd parties. This will allow the 3rd party system to create employees under the root organization. Moreover, additional organizations can be created under the root organizations, allowing 3rd party system to create employees under each orgnaization seperately. Users or employees of one organization can not access detail of other organization, however admin shall be able to access all child organizaiton details.
Authentication
Upon successful login, Abhi authenciation system shall generate a JWT token with 24 hours validity. All subsequent API calls must include the provided JWT token in the header to prove the identity and Abhi shall provide the relevant data in response to the APIs.
NOTES:
- By default, multi login is not allowed, therefore in case if a user is already logged in with a valid JWT token, the next successful attempt will invalid earlier token.
- Five consective wrong attempts will lock the user login.
{{token}}
Employee
API reference for Employee endpoints
GETGet All Employees
This is a sample HTTP request along with the response from the API. This request is for the GET
method on the endpoint /connect/employees
, with query parameters page=1
and limit=10
. The response returned by the API contains information about a single employee, including
- ID: This is a UUID.
- Creation date
- Joining date
- Salary, and personal information like name, CNIC, date of birth, etc.
The response also includes some metadata like the total number of results and the status of the request (status
, code
, and message
).
2010-01-10T10:10:59.409Z
2015-12-31T10:10:59.409Z
johndoe@hotmail.com
846-779-0237
1
John
Doe
10
4220187683175
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/employees?page=1&limit=10'
{
"data": {
"total": 1,
"results": [
{
"id": "39e542ee-ae52-4a57-af31-d97b4b02178c",
"createdAt": "2023-03-08T11:46:03.196Z",
"deletedDate": null,
"employeeCode": null,
"dateOfJoining": "2023-03-06T00:00:00.000Z",
"organizationId": "df35ced3-42a8-4e29-9f03-998772892dff",
"netSalary": "500000",
"updatedAt": "2023-03-08T11:51:37.339Z",
"person": {
"firstName": "John",
"lastName": "Doe",
"cnic": "4210187123176",
"dob": "1970-01-01",
"user": {
"enabled": true,
"username": "john.doe@gmail.com"
}
},
"selectedBankAccount": {
"accountTitle": "John Doe",
"accountNumber": "1231221312312",
"bank": {
"bankName": "Silk Bank"
}
},
"officialEmail": {
"email": "john.doe@gmail.com"
},
"organization": {
"name": "Acme"
},
"limit": 50
}
]
},
"message": "Success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 12:48:55 GMT
application/json
718
keep-alive
a7e5656b-f720-49e6-841a-38cdbad36487
*
1; mode=block
gzip
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
BdmYDHNLjoEFesg=
nosniff
Root=1-64088433-0b87fe4d2e949e29298ff1a8
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
POSTAdd Employee
This is a sample HTTP request to add an employee. The request contains a JSON payload with information about a single employee.
The payload includes the following information for the employee:
- employeeCode: Optional - It can be alpha numeric
- firstName: Mandatory: Maximum 32 characters limit allowed
- lastName: Mandatory: xxxxxxxxxxxxxxxxxxxx
- cnic: Mandatory: 13 digits CNIC without dashes, e.g. 3268617554925
- gender: Mandatory: Supported values include 'Male' , 'Female'
- department: Optional
- designation: Optional
- phone: Mandatory: +92XXXXXXXXXX format supported
- email: Mandatory
- dob: Optional
- dateOfJoining: Optional: The earned wage balance amount computation starts from the date of joining., therefore in case this field is not provided, the current system date is taken as date of joinging.
- netSalary: Mandatory: Number should be postive above 0.
- accountNumber: Mandatory: This is the bank account number
- accountTitle: Mandatory: This is the bank account title
- bankId: Mandatory. The list of bank can be obained via
/connect/mics/banks
API shown below
In this example the API has successfully processed the request, as the response includes a "status" field with the value "success" and a "code" field with the value 200. The response also includes a "message" field with the value "Success".
{
"employees": [
{
"employeeCode": "",
"firstName": "John",
"lastName": "Doe",
"department": "tech",
"designation": "software engineer",
"phone": "",
"email": "john.doe@gmail.com",
"dob": "1970-01-01",
"dateOfJoining": "2023-03-06",
"accountTitle": "John Doe",
"accountNumber": "1231871512312",
"netSalary": "500000",
"cnic": "4210187121564",
"gender": "Male",
"bankId": "1694afcf-832a-4837-993f-42b426c8b1ee"
}
]
}
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/employees'
--data-raw '{
"employees": [
{
"employeeCode": "",
"firstName": "John",
"lastName": "Doe",
"department": "tech",
"designation": "software engineer",
"phone": "",
"email": "john.doe@gmail.com",
"dob": "1970-01-01",
"dateOfJoining": "2023-03-06",
"accountTitle": "John Doe",
"accountNumber": "1231871512312",
"netSalary": "500000",
"cnic": "4210187121564",
"gender": "Male",
"bankId": "1694afcf-832a-4837-993f-42b426c8b1ee"
}
]
}'
{
"data": [],
"message": "Success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
PUTUpdate Employees
This is a sample HTTP request to update an employee. The request contains a JSON payload with an array of employees.
The payload includes the following information for the employee:
- id: Mandatory: The UUID of employee.
- employeeCode: Optional - It can be alpha numeric
- firstName: Mandatory: Maximum 32 characters limit allowed
- lastName: Mandatory: Maximum 32 characters limit allowed
- cnic: Mandatory: 13 digits CNIC without dashes, e.g. 3268617554925
- gender: Mandatory: Supported values include 'Male' , 'Female'
- department: Optional
- designation: Optional
- phone: Mandatory: +92XXXXXXXXXX format supported
- email: Mandatory
- dob: Optional
- dateOfJoining: Optional: The earned wage balance amount computation starts from the date of joining., therefore in case this field is not provided, the current system date is taken as date of joinging.
- netSalary: Mandatory: Number should be postive above 0.
- accountNumber: Mandatory: This is the bank account number
- accountTitle: Mandatory: This is the bank account title
- bankId: Mandatory: This can be obained via list of bank API shown below under Miscellaneous API refernces
/connect/mics/banks
{
"employees": [
{
"id": "39e542ee-ae52-4a57-af31-d97b4b02178c",
"employeeCode": "",
"firstName": "test 3",
"lastName": "processed_ok",
"department": "tech",
"designation": "software engineer",
"phone": "",
"email": "sheikh.hammd+user4@gmail.com",
"dob": "1970-01-01",
"dateOfJoining": "2023-03-06",
"accountTitle": "PROCESSED_OK",
"accountNumber": "1231221312312",
"netSalary": "500000",
"cnic": "4210187123176",
"gender": "Male",
"bankId": "1694afcf-832a-4837-993f-42b426c8b1ee"
}
]
}
curl --location --request PUT 'https://sandbox.abhi.com.pk/uat-open-api/employees' \
--data-raw '{
"employees": [
{
"employeeCode": "",
"firstName": "John",
"lastName": "Doe",
"department": "tech",
"designation": "software engineer",
"phone": "",
"email": "john.doe@gmail.com",
"dob": "1970-01-01",
"dateOfJoining": "2023-03-06",
"accountTitle": "John Doe",
"accountNumber": "1231871512312",
"netSalary": "500000",
"cnic": "4210187121564",
"gender": "Male",
"bankId": "1694afcf-832a-4837-993f-42b426c8b1ee"
}
]
}'
{
"data": {
"editStatus": "All employees are updated Successfully!"
},
"message": "Success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
DELETEDelete Employee
This is a HTTP request to delete employee records from the API. The payload includes a single field "cnicArray", which is an array of CNIC numbers for the employees to be deleted. In this case, the array contains a single CNIC number.
The response from the API indicates that the employees were deleted successfully. The response is also in JSON format and includes the following information:
- data: an object containing information about the status of the deletion
- message: a string indicating that the employees were deleted successfully
- status: a string indicating the status of the API call (in this case, "success")
- code: a numerical HTTP status code indicating the success of the API call (in this case, 200)
{
"cnicArray": ["4210187123175"]
}
curl --location --request DELETE 'https://sandbox.abhi.com.pk/uat-open-api/employees' \
--data '{
"cnicArray": ["4210187121564"]
}'
{
"data": {
"updated": true,
"cnicFailed": []
},
"message": "Employes Deleted Successfully",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Transactions
API reference for Transactions endpoints
Employee
Transactions API endpoints for Employees
POST Post Transaction
This is a HTTP request to create a new transaction for an employee. The request is being sent to a URL path /connect/transactions/employee
.
The payload of the request is in JSON format and contains information about the transaction ie. a single field "amount", which has a value of 500.
{
"amount": 500
}
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/transaction/employee/post-transaction' \
--data '{
"amount": 550
}'
{
"data": {},
"message": "Your account details are not approved. Please contact your HR.",
"status": "bad request",
"code": 400
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
POSTGet Employee Transaction History
This is a sample HTTP request to retrieve transaction history for an employee using the API endpoint /connect/transactions/employee/history
. The request is a POST method and includes query parameters for pagination (limit
and page
). The request body includes a JSON payload with the amount to be transferred (amount
).
The API response is also in JSON format and includes information about the transaction history, such as the total amount, transaction date, account details, and any error messages associated with the transaction. The response also includes a message and status indicating whether the request was successful or not.
10
1
complete
500
2020-01-01T00%3A00%3A00,B05%3A00
2023-03-07T23%3A59%3A59,B05%3A00
curl --location --request POST 'https://sandbox.abhi.com.pk/uat-open-api/transaction/employee/history/?limit=10&page=1'
{
"data": {
"totalAmount": 0,
"transactions": {
"08-03-2023": [
{
"id": "760ab263-2297-461c-8e22-940b5c7bdf5a",
"amount": "500",
"fee": "90",
"transactionStatus": "error",
"transactionDate": "2023-03-08T12:02:42.508Z",
"errorMessage": "GatewayCriticalError: from: titleFetch | STAN: 070684| ResponseDetail: PROCESSED OK",
"accountToNumber": "1231221312312",
"accountToTitle": "John Doe",
"accountToBank": "Silk Bank",
"stan": null,
"accountNumber": "1231221312312",
"accountName": "PROCESSED_OK"
}
]
}
},
"message": "Success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
GETGet Traansaction Status
This is a HTTP request to the API endpoint /connect/transactions/employee/status/760ab263-2297-461c-8e22-940b5c7bdf5a
. The request includes a JSON payload with a `data` object containing an id
field with the value "eefda895-30cb-479e-85bb-f64c1592b09c" and a status
field with the value "error".
The response to the request has a status
field with the value "success", a message
field with the value "Success", and a `code` field with the value 200.
760ab263-2297-461c-8e22-940b5c7bdf5a
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/status/760ab263-2297-461c-8e22-940b5c7bdf5a'
{
"data": {
"id": "eefda895-30cb-479e-85bb-f64c1592b09c",
"status": "error"
},
"message": "Success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
GETGet Monthly Balance
This is a HTTP request to get monthly balance of employee. The request is asking for employee transaction and balance information, and the response contains data related to salary, available salary, available balance, total withdrawals, daily available salary, total days in the month, and a breakdown of the balance on each day of the month.
The breakdown of the balance includes information about the date, day of the month, the amount of money withdrawn on that day, the total amount of money withdrawn up to that day, and the remaining balance after each day.
The response will include
- salary: This is the net salary amount provided at the time of creating the employee (or edit at later stage)
- avilableSalary: This is the risk adjusted salary that act as the benchmark to compute the accessible balance. There, if a person has 100,000/- net salary, with 50% risk limit, the available salary will be 50.000/-
- availableBalance: This is the amount accessible by the specific user at the time of accessing the API. This is adjusted balance having all withdrawals deducted in current payroll cycle, allowing the user to draw down any amount up to avaialble Balance.
- totalWithdraw: This is the sum of all withdrawals by the specific user in current payroll cycle.
- perDayAvilableSalary: This is the prorated salary on day basis.
- totalDaysOfMonth: This specifies the total no. of days in current payroll cycle.
- monthlyBreakup: This provides an array of day by day withdrawals with running withrawal amount of the user in current payroll cycle, including
- date: This is the date starting from the first day of the payroll cycle
- day: This is the number of day in current payroll cycle
- withdrawMondy: This is the amount withdrawn on specific date
- totalWithdraw: This is the running withdraw balance.
- balane: This is the accessible balance at the specific date after adjusting the withdrawMony on the particular day.
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/transaction/employee/balance'
{
"data": {
"salary": 500000,
"availableSalary": 250000,
"availableBalance": 21895,
"totalWithdraw": 500,
"perDayAvailableSalary": 8064.5161290322585,
"totalDaysOfMonth": 31,
"monthlyBreakup": [
{
"date": "03-01-2023",
"day": 1,
"withdrawMoney": 0,
"totalWithdraw": 0,
"balance": 8065
},
{
"date": "03-02-2023",
"day": 2,
"withdrawMoney": 0,
"totalWithdraw": 0,
"balance": 16129
},
{
"date": "03-03-2023",
"day": 3,
"withdrawMoney": 0,
"totalWithdraw": 0,
"balance": 24194
},
{
"date": "03-04-2023",
"day": 4,
"withdrawMoney": 0,
"totalWithdraw": 0,
"balance": 32258
},
{
"date": "03-05-2023",
"day": 5,
"withdrawMoney": 0,
"totalWithdraw": 0,
"balance": 40323
},
{
"date": "03-06-2023",
"day": 6,
"withdrawMoney": 0,
"totalWithdraw": 0,
"balance": 48387
},
{
"date": "03-07-2023",
"day": 7,
"withdrawMoney": 0,
"totalWithdraw": 0,
"balance": 56452
},
{
"date": "03-08-2023",
"day": 8,
"withdrawMoney": 500,
"totalWithdraw": 500,
"balance": 64516
},
{
"date": "03-09-2023",
"day": 9,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 72581
},
{
"date": "03-10-2023",
"day": 10,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 80645
},
{
"date": "03-11-2023",
"day": 11,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 88710
},
{
"date": "03-12-2023",
"day": 12,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 96774
},
{
"date": "03-13-2023",
"day": 13,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 104839
},
{
"date": "03-14-2023",
"day": 14,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 112903
},
{
"date": "03-15-2023",
"day": 15,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 120968
},
{
"date": "03-16-2023",
"day": 16,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 129032
},
{
"date": "03-17-2023",
"day": 17,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 137097
},
{
"date": "03-18-2023",
"day": 18,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 145161
},
{
"date": "03-19-2023",
"day": 19,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 153226
},
{
"date": "03-20-2023",
"day": 20,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 161290
},
{
"date": "03-21-2023",
"day": 21,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 169355
},
{
"date": "03-22-2023",
"day": 22,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 177419
},
{
"date": "03-23-2023",
"day": 23,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 185484
},
{
"date": "03-24-2023",
"day": 24,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 193548
},
{
"date": "03-25-2023",
"day": 25,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 201613
},
{
"date": "03-26-2023",
"day": 26,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 209677
},
{
"date": "03-27-2023",
"day": 27,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 217742
},
{
"date": "03-28-2023",
"day": 28,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 225806
},
{
"date": "03-29-2023",
"day": 29,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 233871
},
{
"date": "03-30-2023",
"day": 30,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 241935
},
{
"date": "03-31-2023",
"day": 31,
"withdrawMoney": 0,
"totalWithdraw": 500,
"balance": 250000
}
]
},
"message": "success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
POSTValidate Transaction
This is a HTTP request to validate a transaction. This is to make sure if the transaction is processable, before creating a transaction request.
Upon processing the request, the server responds with a JSON object that includes a status
, a code
property and a message
property.
The request is being used to validate a transaction involving an employee, with the amount of the transaction being specified in the request body. The response indicates either the transaction is processable or not based upon the status, code and message.
status: "success" , code: 200 and message : ""Transaction Is Processable"" indicates a processable transaction.
Any response other than success means the transaction is not processable with the reason stated in message
field.
{
"amount": 500
}
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/transaction/employee/validate-transaction' \
--data '{
"amount": 500
}'
{
"data": {},
"message": "Transaction Is Processable",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Employer
Transaction API endpoints for employer
GETGet Transactions
This is a HTTP request/response for an API call to retrieve a list of transactions.
The request is a GET request to the endpoint /connect/transactions/
with a query parameter of limit=10
and page=1
. This indicates that the client is requesting a list of the first 10 transactions.
The response includes a JSON payload with a data
field that contains information about the transactions. The total number of transactions is 1 and the results
field contains an array with a single transaction object.
The supported query parameter filters are:
- limit: Positive number
- page: Positive number
- status: Valid status (complete, failed, queued, In progress, awaited, rejected, error)
- amount: Positive number.
- from: Valid Date (yyyy/mm/dd)
- to: Valid Date (yyyy/mm/dd)
- cnic: 13 digits CNIC without dashes.
- transactionId: UUID of transaction
10
1
complete
500
2020-01-01T00%3A00%3A00,B05%3A00
2023-03-07T23%3A59%3A59,B05%3A00
4210187123175
7a4280ff-ad08-4acd-b259-c9fcb2ccc293
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/transaction/employer/all?limit=10&page=1'
{
"data": {
"total": 1,
"results": [
{
"id": "760ab263-2297-461c-8e22-940b5c7bdf5a",
"amount": "500",
"fee": "90",
"transactionStatus": "error",
"transactionDate": "2023-03-08T12:02:42.508Z",
"errorMessage": "GatewayCriticalError: from: titleFetch | STAN: 070684| ResponseDetail: PROCESSED OK",
"accountToNumber": "1231221312312",
"accountToTitle": "John Doe",
"accountToBank": "Silk Bank",
"stan": null,
"createdBy": {
"id": "a03e56cb-a47e-416b-b549-024bcbfecdb9",
"persons": [
{
"id": "bc834616-27be-4b13-8470-19b25d64dd24",
"firstName": "John",
"lastName": "Doe",
"cnic": "4210187123176",
"employees": [
{
"id": "39e542ee-ae52-4a57-af31-d97b4b02178c",
"employeeCode": null,
"netSalary": "500000",
"officialPhone": null
}
]
}
]
}
}
]
},
"message": "Success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Organizations
API reference for Organizations endpoints
GETGet Transaction Status
This is a HTTP GET request to the API endpoint /connect/transactions/status/:id
.
The response body is a JSON object containing information about the status of the transaction with the given ID. The status is "error", indicating that there was an error with the transaction. The response code is 200, indicating success. The response also includes a message stating that the request was successful, as well as contextual information about the function that was executed on the server.
Supported status includes
- Queued: This is an internal status of Abhi sytem, indicating that the transaction requeste is successfully received by the system and placed in the queue for processing.
- In Progress: The request is passed for payment processing and response is awatied from the payment gateway
- Awaited: This status is for manually transaction apprval, implying that the request is kept in the system, however the admin approval is awaited for procssing.
- Completed: The transaction life cycle is completed successfully and amount is transfered to the end user.
- Failed: This The transaction request was rejected at payment processor part.
- Rejected: The transaction request is rejected by Abhi system due to interal compliance.
- Error: The transaction is proned to sme internal error and the support team shall resolve to make it either complete or fail.
760ab263-2297-461c-8e22-940b5c7bdf5a
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/status/760ab263-2297-461c-8e22-940b5c7bdf5a'
{
"data": {
"id": "760ab263-2297-461c-8e22-940b5c7bdf5a",
"status": "error"
},
"message": "Success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Organizations
API reference for Organizations endpoints
GETGet All Sub Organizations
This is a HTTP GET request to the API endpoint /connect/organization
with query parameters page=1
and limit=10
. The request is sent to the host api-dev11.abhi.com.pk
.
The response is in JSON format and includes the following information:
-
data
: an object containing information about the organizations returned in the response. This includes the total number of organizations (total
) and an array of organization objectsresults
that includes:- id: String (UUID of organization)
- deletedDate: Date (yyyy/mm/dd: hh:mm:ss)
- name: String (name of organziation)
- organizationNumber: String (organization number)
- industry: String (industry of organization)
- managementAlias: String (management alias of organization, used as the unique identifier for the organization)
- organizationType: String (organization type, child or parent)
- active: Boolean (true or false)
- creditLimit: Number (credit limit of organization)
- businessType:
- name: String (name of business type)
- country: String (country of business type)
- parentOrganizations:
- parentOrganizationId: String (UUID of parent organization)
-
message
: a string indicating the status of the request (in this case, "Success"). -
status
: a string indicating the status of the request (in this case, "success"). -
code
: an integer indicating the HTTP status code of the response (in this case, 200).
1
10
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/organizations?page=1&limit=10'
{
"data": {
"total": 2,
"results": [
{
"id": "a7dcb49d-1f0f-43dc-81dd-68e02335edc9",
"deletedDate": null,
"name": "Acme Child Org",
"organizationNumber": 1752,
"industry": "tech",
"managementAlias": "acme.acmechild",
"organizationType": "child",
"active": true,
"creditLimit": 100000000,
"businessType": {
"name": "Limited Company",
"country": "Pakistan"
},
"parentOrganizations": {
"parentOrganizationId": "df35ced3-42a8-4e29-9f03-998772892dff"
}
},
{
"id": "5fbded24-8d4e-4af3-8684-2acd75e322e4",
"deletedDate": null,
"name": "Acme Child Org 2",
"organizationNumber": 1751,
"industry": "tech",
"managementAlias": "acme.acmechildtwo",
"organizationType": "child",
"active": true,
"creditLimit": 100000000,
"businessType": {
"name": "Limited Company",
"country": "Pakistan"
},
"parentOrganizations": {
"parentOrganizationId": "df35ced3-42a8-4e29-9f03-998772892dff"
}
}
]
},
"message": "Success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
POSTCreate Sub Organization
This is a HTTP request to the API endpoint /connect/organization
.
The request body contains a JSON object with information about a new organization being created, including the organization's name, industry, business type ID, address, city, email, phone, management alias, and credit limit.
The response body is also a JSON object, containing information about the success of the request. The response code is 200, indicating success. The response includes a message stating that the organization was created successfully, as well as information about the admin and operator users that were created for the new organization. These users have email addresses and passwords associated with them.
{
"name": "Acme Child 3",
"industry": "tech",
"businessTypeId": "ab4d503f-bf9f-4a95-aeb3-20817776bc7c",
"address": "Lahore",
"city": "Lahore",
"email": "",
"phone": "",
"managementAlias": "acmechildthree",
"creditLimit": 100000000
}
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/organizations' \
--data '{
"name": "Acme Child 3",
"industry": "tech",
"businessTypeId": "ab4d503f-bf9f-4a95-aeb3-20817776bc7c",
"address": "Lahore",
"city": "Lahore",
"email": "",
"phone": "",
"managementAlias": "acmechildfour",
"creditLimit": 100000000
}'
{
"data": {
"message": "organization created successfully",
"users": {
"admin": {
"email": "acme.acmechildfour-admin@99.80.150.43",
"password": "!1u4#e8r"
},
"operator": {
"email": "acme.acmechildfour-ops@99.80.150.43",
"password": "c353ep#@"
}
}
},
"message": "Success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Miscellaneous
Miscellaneous API reference for endpoints
GETGet All Banks
100
1
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/banks?limit=100&page=1'
{
"data": {
"total": 44,
"results": [
{
"id": "2017c350-e1e4-423f-9d1c-a7826a1dab66",
"bankName": "Al Baraka Bank Limited"
},
{
"id": "29071df0-5f3f-4141-bf17-f8e9df862f3d",
"bankName": "Allied Bank Limited"
},
{
"id": "c9a42ee4-f4c6-4d8c-ac64-1d638d37c730",
"bankName": "Apna Microfinance Bank"
},
{
"id": "0f479fb3-4bde-47a4-b719-accaec88ca19",
"bankName": "Askari Commercial Bank Limited"
},
{
"id": "8b6ede88-44d3-4d02-b20f-4dd4314c6d63",
"bankName": "Bank Alfalah Limited"
},
{
"id": "8c6326a6-420a-44ce-b93b-b0b6251ba9e9",
"bankName": "Bank AL Habib Limited"
},
{
"id": "9efa288e-d085-4320-8fe4-e71934604f05",
"bankName": "Bank Islami Pakistan Limited"
},
{
"id": "e9614021-d2f5-4fa1-b084-148dc125b9d8",
"bankName": "Bank of Khyber"
},
{
"id": "5c2bd95d-b440-48fc-9274-053e660e38df",
"bankName": "Bank of Punjab"
},
{
"id": "3eca6b8b-9819-4b2e-a5d2-5fe6f47b632e",
"bankName": "Citi Bank"
},
{
"id": "58ca37d7-9414-43f9-9170-2722f4b2039f",
"bankName": "Dubai Islamic Bank Pakistan Limited"
},
{
"id": "eccaf78a-a0b2-4a7c-880f-1f0aaf87b869",
"bankName": "EasyPaisa"
},
{
"id": "554fce39-33a6-4a0c-a3e3-bdd7c1bc98fc",
"bankName": "Faysal Bank"
},
{
"id": "e9c4543d-e259-4ddf-8665-98533a1bfa3a",
"bankName": "FINCA"
},
{
"id": "ca1f5c02-7747-49ff-a9d1-4a0887bed598",
"bankName": "Finja"
},
{
"id": "598ec287-339f-4554-8c9f-a385b06f1f56",
"bankName": "First Microfinance Bank"
},
{
"id": "b4176d60-b08d-4a06-86eb-825ea703e703",
"bankName": "First Women Bank Limited"
},
{
"id": "b24750fd-3863-4b71-8c16-d0fc92743d8b",
"bankName": "Habib Bank Limited"
},
{
"id": "93a13f48-c62e-43a1-91ec-a1294842c044",
"bankName": "Habib Metropolitan Bank Limited"
},
{
"id": "c0c82d0d-d733-409b-8ce1-2c2d193af03f",
"bankName": "ICBC"
},
{
"id": "a6f4a22f-8ce0-4fef-9dde-a84713c8194f",
"bankName": "JazzCash"
},
{
"id": "c5cf99f9-d853-4d1b-8a1f-1afff7c3dd6d",
"bankName": "JS Bank"
},
{
"id": "7dc03eb8-2c11-47d1-a4a8-932800371ea2",
"bankName": "MCB Bank Limited"
},
{
"id": "0a0dd418-9ff5-4644-850e-655dcd789596",
"bankName": "MCB Islamic Bank"
},
{
"id": "2a68fc64-fb0d-4362-b193-e95de222c321",
"bankName": "Meezan Bank Limited"
},
{
"id": "b9beda1d-604b-4bc1-9449-0c1d24e611c3",
"bankName": "National Bank of Pakistan"
},
{
"id": "247cbe4a-cab1-49e6-a3ff-1075e916da52",
"bankName": "NRSP Bank"
},
{
"id": "35df8f19-577d-4017-8a52-30f9ad9ef223",
"bankName": "SAMBA"
},
{
"id": "1694afcf-832a-4837-993f-42b426c8b1ee",
"bankName": "Silk Bank"
},
{
"id": "f12ca087-6380-45ed-a2e1-1640c77f2970",
"bankName": "Sindh Bank"
},
{
"id": "e3f8fe57-f430-4243-9891-56c7dbe0a62e",
"bankName": "Soneri Bank Limited"
},
{
"id": "c0285d50-26aa-4d4c-95e5-7ab218edc71e",
"bankName": "Standard Chartered"
},
{
"id": "92b25570-3318-4e9f-bf33-c2dc691f5630",
"bankName": "Summit Bank"
},
{
"id": "a1cb0fa6-2977-4884-82ec-42e24be5a440",
"bankName": "Ubank"
},
{
"id": "121ac05e-9f6f-4216-b0cf-70b8e740e5c2",
"bankName": "United Bank Limited"
}
]
},
"message": "Success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
GETGet All Bussines Types
100
1
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/business?limit=100&page=1'
{
"data": {
"total": 6,
"results": [
{
"id": "efa52d51-081b-44d9-9ce8-253329a17e61",
"businessName": "Partnership Deed",
"description": null,
},
{
"id": "b720e7b2-0dfc-4215-bfcf-6540f239cf25",
"businessName": "NGO’s/Club/Trust",
"description": null
},
{
"id": "ab4d503f-bf9f-4a95-aeb3-20817776bc7c",
"businessName": "Limited Company",
"description": null
},
{
"id": "b407d2a3-f3ca-49da-a8b0-cdeab338dd28",
"businessName": "Partnership Concern",
"description": null
},
{
"id": "418ce2e0-59e6-42be-b27d-9ed5eaa3a762",
"businessName": "Proprietorship Concern/Individual (Self-employed)",
"description": null
},
{
"id": "6bc427c2-9095-47b3-bcab-e8e9209868ba",
"businessName": "Government / Semi Government (Must go through EnterpriseChannel)",
"description": null
}
]
},
"message": "Success",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
Wed, 08 Mar 2023 14:08:20 GMT
application/json
61
keep-alive
41d59239-60b2-4292-898b-7db626ed3e16
*
1; mode=block
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
Bdx_2HKYjoEFrmA=
nosniff
Root=1-640896cb-2d5d3f6a04b79fba2b74aa7f
true
POSTLogin Thirdparty
{
"username": "thirdpartydev-admin@99.80.150.43",
"password": "c71r1s!_"
}
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/login' \
--data-raw '{
"username": "acme-admin@99.80.150.43",
"password": "#7r8!w8n"
}'
{
"data": {
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImU3YmUzMWI3LTM0ZmEtNDExMC1hZGMwLWU0OGM4NjFhYzNjYyIsImluaXRpYXRvciI6ImV4dGVybmFsX3NvdXJjZSIsImFsbG93TXVsdGlsb2dpbiI6ZmFsc2UsImlhdCI6MTY3ODM0MTcwNCwiZXhwIjoxNjc4NDI4MTA0LCJhdWQiOiJhYmhpLmNvbS5wayIsImlzcyI6IkFiaGkgUHZ0LiBMdGQuIiwic3ViIjoiZTdiZTMxYjctMzRmYS00MTEwLWFkYzAtZTQ4Yzg2MWFjM2NjIn0.xKzd4StJCoIVFtJqeXRraxO9lHa15lDavdTv1S8GIGSZ3hEijWbcEJQeOa-ZGuzR_DYgXasDhwrxInBLza3GJg"
},
"message": "Successfully logged in!",
"status": "success",
"code": 200
}
curl --location 'https://sandbox.abhi.com.pk/uat-open-api/login' \
--data-raw '{
"username": "acme-admin@99.80.150.43",
"password": "#7r8!w8n",
"cnic": "4210187123176"
}'
{
"data": {
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImU3YmUzMWI3LTM0ZmEtNDExMC1hZGMwLWU0OGM4NjFhYzNjYyIsImluaXRpYXRvciI6ImV4dGVybmFsX3NvdXJjZSIsImFsbG93TXVsdGlsb2dpbiI6ZmFsc2UsImlhdCI6MTY3ODM0MTcwNCwiZXhwIjoxNjc4NDI4MTA0LCJhdWQiOiJhYmhpLmNvbS5wayIsImlzcyI6IkFiaGkgUHZ0LiBMdGQuIiwic3ViIjoiZTdiZTMxYjctMzRmYS00MTEwLWFkYzAtZTQ4Yzg2MWFjM2NjIn0.xKzd4StJCoIVFtJqeXRraxO9lHa15lDavdTv1S8GIGSZ3hEijWbcEJQeOa-ZGuzR_DYgXasDhwrxInBLza3GJg"
},
"message": "Successfully logged in!",
"status": "success",
"code": 200
}
Wed, 08 Mar 2023 12:43:59 GMT
application/json
1459
keep-alive
5623dd8e-d6c3-49ab-97b2-7d3cc7ebcd44
*
1; mode=block
gzip
max-age=63072000; includeSubdomains; preload
DENY
default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'
BdlphFLSDoEFk2g=
nosniff
Root=1-64088309-13475acc3449cad0181fd89c
true