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 ElementInfo
CodeThe export code (not payroll export code) for the location
ActiveBoolean true/false as to whether the location is active
ParentCompanyAn integer of the record of the parent location (Enterprise only)
CompanyNameThe name of the company as a string
TradingNameThe trading name of the company as a string
IsWorkplaceWhether this is a company is considered a workplace or not. Either this or IsPayrollEntity must be 1
IsPayrollEntityWhether this is a payroll entity (For Enterprise this is important for pay cycles).
PayrollExportCodeThe payroll export code that will be used for timesheet exports
AddressThe 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 ElementInfo
intCompanyIdThe location id which the area should be linked to.
strOpUnitNameWhat the area should be called, for example, chef, front-of-house etc
strAddressThe Address of the area if relevant
strExportNameThe export name/code for the area
intOpUnitTypeBoolean 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.