Introduction
Magicrete wanted one simple goal: connect HR and finance- no more switching between tools, no more manual entries, and zero errors in payroll and reimbursements.
That’s where the Keka + Microsoft Dynamics 365 Business Central integration came in. By linking the two systems, Magicrete could streamline:
- Employee data sync
- Keka PSA Integration sync
- Leave Integration
- Payroll processing
- Expense reimbursements
- Loan tracking
- Full & Final settlements
Integration Objectives
Enable seamless, bi-directional (or uni-directional) data sync between Keka and Microsoft D365 BC for:
- Employee Master Data
- Project Timesheet (PSA) Management
- Expense Claims & Reimbursements
- Loan Management
- Payroll Register
How the Integration Works
Primary Method: REST API-based integration
Auth: Secured via API Key. client ID and client secret
Direction: Mostly Keka → Business Central
Execution: Scheduled jobs handled by the D365 team or client integration team
Keka provides:
- Robust REST APIs
- Webhooks for live updates
- Custom field support (e.g., Vendor ID, Cost Center)
Key Integration Use Cases
Employee Master Sync -> Bidirectional sync with Microsoft BC
Use Case 1: New Employee in Keka → Auto-Create in D365 BC
Whenever a new employee is added in Keka, the system should automatically pull the data from Keka and push to Microsoft Dynamics 365 Business Central to create a matching employee record.
-
New Employee in Keka → Auto-created in D365
Keka API Reference – Get All Employees - Sync runs hourly or in real-time based on business need as per D365 configuration
- Details such as Department, Business Unit, Legal Entity, and Location are accessible through the group type and corresponding values in the Employees API call. For more information, refer to the Groups section. To understand the process of creating an employee in Keka, see the Create an Employee on Keka API Call documentation.
Use Case 2: Two-Way Sync – Job & Personal Details
Whenever job or personal details are updated in either Keka or D365, the changes are synced to the other system. Here the changes in D365 needs to be pushed to Keka using update APIs
-
APIs Used:
- PUT Personal Details → D365 → Keka
- PUT Job Details → D365 → Keka
- Custom Field: "Vendor ID" in Keka gets updated when D365 generates it
- Sync Frequency: Near real-time or hourly, based on D365's schedule
PSA - (Project, Client, Task, and Timesheet Sync)
This section explains how project-related entities and timesheet data flow between Microsoft Business Central and Keka PSA using PSA APIs.
All API endpoints include Base URL, Path Parameters, and Body Parameters within the documentation itself.
Important: The settings and configurations followed in Business Central must match the Keka PSA portal configurations for successful integration.
Case 1: Sync from Business Central to Keka
(Client → Project → Task → Timesheet Flow)
The sequence of creation must be followed in the order below:
Step 1: Create a Client: Use the PSA API to create a new client in Keka.
Step 2: Create a Project : Associate the project with the previously created Client.
Step 3: Add a project allocation : Allocate resources/employees to the created project.
Step 4: Create a task : Add tasks under the project using the project reference.
Timesheet Entry Sync (BC → Keka)
Once the Project, Client, and Task are successfully synced:
- Add Add project task timesheet entries. from Business Central.
- The timesheet entries will be reflected in Keka under the assigned Project and Task.
Case 2: Sync from Keka PSA to Business Central
(Pull data from Keka into Business Central)
You can retrieve all master and transactional records from Keka using the GET APIs:
Fetch all Clients: Get all clients
Fetch all Projects: Get all projects., Get a project
Fetch Project-wise Tasks: Get project tasks.
Fetch all Timesheet entries: Get project timesheet entries.
Fetch all Tasks: Get project tasks.
Fetch Task-level timesheet entries: Get project task time entries.
This enables Business Central to maintain an updated copy of all PSA-related data from Keka.
Leave management -> Bidirectional sync with Microsoft BC
Case 1- Leave application and approval/rejection happens on Keka and D365 pulls the leave requests from Keka.
API used: Get all Leave Requests
All leave enumerated values exposed under LeaveRequests
Case 2: Leave application and approval happens on D365 and only approved leaves flows to Keka for record purpose
API used: Create Leave Request
Note: If case 2 is chosen, please make sure that there is no approval chain on Keka, as the leaves will be already approved on D365.
Expense Reimbursements
-
Case 1: Employee submits expense in Keka → D365 pulls the data
GL Code mapping and filters applied via custom script
API: Get Expense Claims -
Case 2: Expense submitted in a 3rd-party system → Auto-pushed into Keka
Adds an Expense
Keka used only for recordkeeping; approval managed externally where Keka will have no approval chain
Payroll Integration: Keka → Microsoft D365 Business Central
- Goal: Import finalized salary details from Keka into D365 for accounting, vendor payments, and reconciliation.
-
Data Pulled:
Per-employee salary breakup including:- Earnings (Basic, HRA, Incentives, OT, etc.)
- Deductions (PF, TDS, Loan EMIs, Penalties)
- Net Pay
-
Main API Used:
Get Pay Register – to fetch complete salary details and custom deduction components like penalties or loans. -
Adhoc Transactions:
- If managed in Keka → Already covered in Get Pay Register.
- If pushed from D365 → Use Add Adhoc Transaction API.
-
Reimbursements, Flexi Benefits, Incentives, and Advances:
Captured via Get Pay Register
(All relevant data is currently managed through the Payroll API or alternatively, the Expense APIs.)
Loan Management
- Loans applied & approved in Keka
- D365 handles loan disbursement
- Monthly EMI deductions pulled from Keka Pay Register
- No real-time API for loan creation yet — workaround used
F&F & ID Blocking
- Once Full & Final is done in Keka:
- Trigger logic built in D365 using LastWorkingDate
Webhooks in Action
Webhooks in Keka trigger real-time updates for:
- Employee creation/exit
- Job or personal detail updates
- Expense submission & approval
- Leave requests
These help D365 stay in sync without polling.
Challenges & Solutions
| Issue | Solution |
|---|---|
| Keka data too detailed | Summarization done in D365 scripts |
| Missing ERP fields in Keka | Custom fields added (e.g., Vendor ID) |
| Loan creation not exposed | Workaround using Pay Register data |
| Component-wise budget data | ERP team handles custom mapping |
Sync Matrix
| Data Type | Direction | Notes |
|---|---|---|
| Employee Master | Bi-directional | Via API + Webhooks |
| Payroll Data | Keka → D365 | Post finalization |
| Expenses | One-way (either) | Based on origin of request |
| Incentives | Keka → D365 | Part of Pay Register |
| Loans | Workaround | API not fully available |
| F&F & ID Blocking | Manual | Via scheduled script logic |
Work in Progress / Feature Requests
- Loan API (Get All Loans)
- Bonus/Variable API
- F&F full automation & ID blocking
Conclusion: A Smart, Scalable Integration
Magicrete now enjoys unified HR and finance operations. With Keka's easy-to-use APIs and D365’s ERP logic:
- Employee data stays consistent
- Payroll is accurate and timely
- Financial teams get clean, structured
- Explore Keka API: developers.keka.com
- API Authentication & Access: For assistance with API key setup, please contact your Keka Customer Success Manager (CSM) or your technical account manager.
- Support & Customization: Feel free to email us or arrange a technical consultation through your CSM or our Sales team for any customization needs.
Please let us know if you find this article helpful.
Comments
0 comments
Please sign in to leave a comment.