Adding a location
Follow this guide to add new locations to Deputy
When first integrating with Deputy, to assist with mapping between departments/divisions within an organisation you may be required to add new locations to Deputy. This is easily achieved using the Deputy API and in our Enterprise product you can even implement a structural hierarchy to better represent the overall organisation structure of your clients.
The process to add a new location is detailed below.
URL and Payload
URL
curl --location --request PUT 'https://{install}.{geo}.deputy.com/api/v1/supervise/company
Sample Payload
{
"Code": "1234",
"Active": true,
"ParentCompany": 1,
"CompanyName": "The Company Co",
"TradingName": "Company Pty Ltd",
"IsWorkplace": 1,
"IsPayrollEntity": 1,
"PayrollExportCode": "PAY123",
"Address": "123 Jones St, Sydney, NSW, 2001",
}
This will create a new location in the Deputy install called The Company Co with payroll export code PAY123
Data Element | Info |
---|---|
Code | The export code (not payroll export code) for the location |
Active | Boolean true/false as to whether the location is active |
ParentCompany | An integer of the record of the parent location (Enterprise only) |
CompanyName | The name of the company as a string |
TradingName | The trading name of the company as a string |
IsWorkplace | Whether this is a company is considered a workplace or not. Either this or IsPayrollEntity must be 1 |
IsPayrollEntity | Whether this is a payroll entity (For Enterprise this is important for pay cycles). |
PayrollExportCode | The payroll export code that will be used for timesheet exports |
Address | The address of the location. Once added in Deputy this will become an integer which links to the address record. |
Adding an area
For a location to become valid for timesheets to be generated from it, the location must have an area. In a scenario where in Enterprise you are using a location for top level hierarchy, an area is not required. When a user adds a location in Deputy via the UI, a default area is always added. This does not occur when adding locations via the API and so it is important to always remember to add an area if you need timesheets to be attributed to the location added
To add an area to a location in Deputy follow the below guide.
URL
curl --location --request PUT 'https://{install}.{geo}.deputy.com/api/v1/supervise/department
Sample Payload
{
"intCompanyId": 381,
"strOpunitName": "This is an area",
"strAddress": "1 Smith Street, Sydney, Australia",
"strExportName": "SmithStreet",
"intOpunitType": 0
}
This will create a new area linked to an existing location in the Deputy install.
Data Element | Info |
---|---|
intCompanyId | The location id which the area should be linked to. |
strOpUnitName | What the area should be called, for example, chef, front-of-house etc |
strAddress | The Address of the area if relevant |
strExportName | The export name/code for the area |
intOpUnitType | Boolean 0 or 1. 0 is not geographically located, for example just a chef or front-of-house area where as 1 defines it as a geographically located area seperate to the location. |
Updated 8 months ago