Locations

Location is a dimension that is used to represent the geographic locations of offices or facilities, or to represent divisions in a company. Once you have defined some locations, you can set locations on transactions, and that information can be used to provide new insights in reports.

You can create a hierarchy of locations to reflect how locations are organized within your company.

List locations

get/objects/company-config/location

Returns up to 100 locations from the collection with a key, ID, and link for each location. This operation is mostly for use in testing; use the query service to find locations that meet certain criteria and specify the properties that are returned.

Permissions and other requirements
SubscriptionCompany
User typeBusiness, Employee, Payment Approver
PermissionsList, View Locations
SecurityOAuth2
Responses
200

OK

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::result": [
    • {
      • "key": "1",
      • "id": "US-PNW",
      • "href": "/objects/company-config/location/1"
      },
    • {
      • "key": "96",
      • "id": "US-EAST",
      • "href": "/objects/company-config/location/96"
      },
    • {
      • "key": "21",
      • "id": "US-SOUTH",
      • "href": "/objects/company-config/location/21"
      }
    ],
  • "ia::meta": {
    • "totalCount": 3,
    • "start": 1,
    • "pageSize": 100,
    • "next": null,
    • "previous": null
    }
}

Create a location

post/objects/company-config/location

Creates a new location. You can think of this as adding a new value to the dimension that you can use to tag transactions for reporting.

Permissions and other requirements
SubscriptionCompany
User typeBusiness user with admin privileges
PermissionsAdd Location
SecurityOAuth2
Request
Request Body schema: application/json

Create location object

id
required
string

Unique identifier for the location.

Example: "1-Lyon"
name
required
string

Name of the location.

Example: "Lyon-France"
status
string

Status of the dimension object:

  • active - Transactions can be posted to this dimension member and it can be used in reports.
  • activeNonPosting - Transactions cannot be posted to the dimension member but it can be used in reports.
  • inactive - The dimension member cannot be used for transactions or reports.
Enum: "active" "activeNonPosting" "inactive"
Example: "active"
taxId
string

State tax ID or VAT registration number.

Example: "US4321112"
startDate
string <date>

Start date of operation at this location.

Example: "2021-01-01"
endDate
string <date>

End date of operation at this location.

Example: "2022-04-01"
object

The list of contacts for the location.

object

The primary location contact specifies the company name, address, and other details as they should appear on invoices, bills, and other forms.

id
string

Contact ID

Example: "jsmith"
lastName
string

Last name

Example: "Smith"
firstName
string

First name

Example: "John"
middleName
string

Middle name

Example: "Archibald"
prefix
string

Prefix

Example: "Mr"
printAs
string

Print as

Example: "John Smith"
email1
string

Primary email

Example: "[email protected]"
email2
string

Secondary email

Example: "[email protected]"
phone1
string

Primary phone

Example: "14085551212"
phone2
string

Secondary phone

Example: "14085559876"
mobile
string

Mobile phone

Example: "14085554420"
pager
string

Pager

Example: "14085559987"
fax
string

Fax

Example: "14085555309"
URL1
string

Primary URL

Example: "https://mycompany.com"
URL2
string

Secondary URL

Example: "https://anothercompany.com"
companyName
string

Company name

Example: "AlcoSoft Inc"
object

Mailing Address

object

The address for receiving goods and services, if different from the primary contact address.

id
string

Contact ID

Example: "jsmith"
lastName
string

Last name

Example: "Smith"
firstName
string

First name

Example: "John"
middleName
string

Middle name

Example: "Archibald"
prefix
string

Prefix

Example: "Mr"
printAs
string

Print as

Example: "John Smith"
email1
string

Primary email

Example: "[email protected]"
email2
string

Secondary email

Example: "[email protected]"
phone1
string

Primary phone

Example: "14085551212"
phone2
string

Secondary phone

Example: "14085559876"
mobile
string

Mobile phone

Example: "14085554420"
pager
string

Pager

Example: "14085559987"
fax
string

Fax

Example: "14085555309"
URL1
string

Primary URL

Example: "https://mycompany.com"
URL2
string

Secondary URL

Example: "https://anothercompany.com"
companyName
string

Company name

Example: "AlcoSoft Inc"
object

Mailing Address

locationReportingTitle
string

Location information displayed in reports, in addition to the location name. For example, a location title might include the address and manager name.

object

Parent location, for location hierarchies.

key
string

Parent location key.

Example: 65
id
string

Parent location ID.

Example: "1-France"
object

The employee that manages the location.

key
string

Manager's employee key.

Example: 81
id
string

ID of the manager employee.

Example: "anne.jason"
Responses
201

Created

400

Bad Request

Request samples
application/json
{
  • "id": "loc22",
  • "name": "22-India",
  • "description": "All India offices",
  • "status": "active"
}
Response samples
application/json
{
  • "ia::result": {
    • "key": "234",
    • "id": "22-India",
    • "href": "/objects/company-config/location/234"
    },
  • "ia::meta": {
    • "totalCount": 1
    }
}

Get a location

get/objects/company-config/location/{key}

Returns detailed information for a specified location.

Permissions and other requirements
SubscriptionCompany
User typeBusiness, Employee, Payment Approver
PermissionsList, View Locations
SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the location.

Example: 92
Responses
200

OK

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::result": {
    • "id": "WEN",
    • "key": "6",
    • "name": "Wenatchee",
    • "parent": {
      • "id": "PNW--Pacific Northwest",
      • "key": "5",
      • "href": "/objects/company-config/location/5"
      },
    • "manager": {
      • "name": "miller, dan",
      • "id": "EE-0000123--miller, dan",
      • "key": "2",
      • "href": "/objects/company-config/employee/2"
      },
    • "contacts": {
      • "primary": {
        },
      • "shipTo": {
        }
      },
    • "startDate": null,
    • "endDate": null,
    • "status": "active",
    • "audit": {
      • "createdDateTime": "2022-02-11T09:07:07Z",
      • "modifiedDateTime": "2022-02-11T09:07:07Z",
      • "createdBy": "110",
      • "modifiedBy": "110"
      },
    • "locationReportingTitle": "Seattle Sales Office",
    • "taxId": null,
    • "href": "/objects/company-config/location/102"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Update a location

patch/objects/company-config/location/{key}

Updates an existing location by setting field values. Any fields not provided remain unchanged.

Permissions and other requirements
SubscriptionCompany
User typeBusiness user with admin privileges
PermissionsEdit Locations
SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the location.

Example: 92
Request Body schema: application/json
name
string

Name of the location.

Example: "Lyon-France"
status
string

Status of the dimension object:

  • active - Transactions can be posted to this dimension member and it can be used in reports.
  • activeNonPosting - Transactions cannot be posted to the dimension member but it can be used in reports.
  • inactive - The dimension member cannot be used for transactions or reports.
Enum: "active" "activeNonPosting" "inactive"
Example: "active"
taxId
string

State tax ID or VAT registration number.

Example: "US4321112"
startDate
string <date>

Start date of operation at this location.

Example: "2021-01-01"
endDate
string <date>

End date of operation at this location.

Example: "2022-04-01"
object

The list of contacts for the location.

object

The primary location contact specifies the company name, address, and other details as they should appear on invoices, bills, and other forms.

id
string

Contact ID

Example: "jsmith"
lastName
string

Last name

Example: "Smith"
firstName
string

First name

Example: "John"
middleName
string

Middle name

Example: "Archibald"
prefix
string

Prefix

Example: "Mr"
printAs
string

Print as

Example: "John Smith"
email1
string

Primary email

Example: "[email protected]"
email2
string

Secondary email

Example: "[email protected]"
phone1
string

Primary phone

Example: "14085551212"
phone2
string

Secondary phone

Example: "14085559876"
mobile
string

Mobile phone

Example: "14085554420"
pager
string

Pager

Example: "14085559987"
fax
string

Fax

Example: "14085555309"
URL1
string

Primary URL

Example: "https://mycompany.com"
URL2
string

Secondary URL

Example: "https://anothercompany.com"
companyName
string

Company name

Example: "AlcoSoft Inc"
object

Mailing Address

object

The address for receiving goods and services, if different from the primary contact address.

id
string

Contact ID

Example: "jsmith"
lastName
string

Last name

Example: "Smith"
firstName
string

First name

Example: "John"
middleName
string

Middle name

Example: "Archibald"
prefix
string

Prefix

Example: "Mr"
printAs
string

Print as

Example: "John Smith"
email1
string

Primary email

Example: "[email protected]"
email2
string

Secondary email

Example: "[email protected]"
phone1
string

Primary phone

Example: "14085551212"
phone2
string

Secondary phone

Example: "14085559876"
mobile
string

Mobile phone

Example: "14085554420"
pager
string

Pager

Example: "14085559987"
fax
string

Fax

Example: "14085555309"
URL1
string

Primary URL

Example: "https://mycompany.com"
URL2
string

Secondary URL

Example: "https://anothercompany.com"
companyName
string

Company name

Example: "AlcoSoft Inc"
object

Mailing Address

locationReportingTitle
string

Location information displayed in reports, in addition to the location name. For example, a location title might include the address and manager name.

object

Parent location, for location hierarchies.

key
string

Parent location key.

Example: 65
id
string

Parent location ID.

Example: "1-France"
object

The employee that manages the location.

key
string

Manager's employee key.

Example: 81
id
string

ID of the manager employee.

Example: "anne.jason"
Responses
200

OK

400

Bad Request

Request samples
application/json
{
  • "manager": {
    • "key": "12"
    },
  • "contacts": {
    • "primary": {
      • "id": "john.doe"
      },
    • "shipTo": {
      • "id": "jane.daw"
      }
    }
}
Response samples
application/json
{
  • "ia::result": {
    • "key": "12",
    • "id": "SW",
    • "href": "/objects/company-config/location/12"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Delete a location

delete/objects/company-config/location/{key}

Deletes a location. You can delete a location if it is not being used or referenced. Deleted locations cannot be recovered.

Permissions and other requirements
SubscriptionCompany
User typeBusiness user with admin privileges
PermissionsDelete Locations
SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the location.

Example: 92
Responses
204

No Content

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::result": {
    • "ia::error": {
      • "code": "invalidRequest",
      • "message": "A POST request requires a payload",
      • "errorId": "REST-1028",
      • "additionalInfo": {
        },
      • "supportId": "Kxi78%7EZuyXBDEGVHD2UmO1phYXDQAAAAo"
      }
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 0,
    • "totalError": 1
    }
}

Query locations

post/services/core/query

Queries an object for filtered data.

SecurityOAuth2
Request
Request Body schema: application/json
object
string

Object type to query, in the form <application-name>/<object name>. For custom objects use platform-apps/nsp::<object-name>.

Example: "company-config/location"
fields
Array of strings

List of fields to include in the response. Can be any combination of these:

  • The name of a field in the object that you are querying, such as id.

  • The name of a field in a related object, using the form relatedObjectName.fieldName, such as vendor.id.

  • The result of an aggregate function run against the values in the returned objects. Use the form function:fieldName, such as min:startDate to return the earliest starting date. Valid function names are:

    • count
    • avg
    • sum
    • min
    • max
  • The result of an aggregate function run against the values in related objects, using the form function:relatedObjectName.fieldName, such as max:vendor.creditLimit. The same functions are supported as for object fields.

Example: ["key","id","max:vendor.creditLimit"]
Array of equal (object) or not equal (object) or less than (object) or (less than or equal (object)) or greater than (object) or (greater than or equal (object)) or in (object) or not in (object) or between (object) or not between (object) or contains (object) or does not contain (object) or starts with (object) or does not start with (object) or ends with (object) or does not end with (object)

Filter conditions to select the objects to return based on their field values. You use operators and conditions to build your filter, such as {"$eq":{"status":"active"}} to select objects in which status is equal to "active".

Example: [{"$eq":{"status":"active"}},{"$gt":{"totalDue":"1000"}},{"$contains":{"name":"Acme"}}]
Array
Any of:

Field value must be equal to this specified value.

For date fields, you can use these macro values that are relative to the current date or the asOfDate in filterParameters, if set:

  • today
  • currentWeek
  • currentMonth
  • currentQuarter
  • currentYear
  • yesterday
  • lastWeek
  • priorMonth
  • priorQuarter
  • priorYear

These are most useful for queries that you want to save and use repeatedly, such as for views or reports. Just change the asOfDate each time to retrieve the same data set for different time periods.

For example, {"eq":{"postingDate":"priorYear"}}.

object

The field name and value to be compared with object values.

Example: {"status":"active"}
filterExpression
string
Default: "and"

Logical operators to apply when there are multiple filter conditions. The conditions in the filters array are implicitly numbered starting at 1. Supports and, or, and grouping with parentheses.

Shortcuts:

  • and by itself means that all conditions must be true.
  • or by itself means that at least one condition must be true.
Example: "(1 and 2) or 3"
object

Pre-defined filter options.

asOfDate
string <date>

The "as of" date to use with any relative date comparisons in filters. For example, if asOfDate is set to "2022-04-01" then priorMonth will be "03".

The current date is used if asOfDate is not set.

Example: "2022-04-01"
includeHierarchyFields
boolean
Default: false

Set to true to include hierarchical structure information with each object in the response.

Example: false
caseSensitiveComparison
boolean
Default: true

Queries are case-sensitive by default. Set to false to ignore case in a query.

Example: true
includePrivate
boolean
Default: false

By default, in a multi-entity company, queries from the top-level entity do not access data in private entities. Set includePrivate to true if you want to query data in private entities.

Example: false
Array of objects

Set the order of the results by specifying field names to sort by and whether they should be in ascending or descending order.

Example: [{"totalDue":"asc"},{"lastPaymentMadeDate":"desc"}]
Array
property name*
additional property
string
Enum: "asc" "desc"
start
integer

First record of the result set to include in the response.

Example: 1
size
integer

Number of records to include in the response.

Example: 100
Responses
200

OK

400

Bad Request

Request samples
application/json
{
  • "object": "company-config/location",
  • "filters": [
    • {
      • "$eq": {
        }
      },
    • {
      • "$eq": {
        }
      }
    ],
  • "filterExpression": "1 and 2",
  • "fields": [
    • "id",
    • "name",
    • "href"
    ],
  • "orderBy": [
    • {
      • "id": "asc"
      }
    ]
}
Response samples
application/json
{
  • "ia::result": [
    • {
      • "key": "6",
      • "id": "SJ",
      • "name": "San Jose",
      • "status": "active",
      • "href": "/objects/company-config/location/6"
      },
    • {
      • "key": "19",
      • "id": "LA",
      • "name": "Los Angeles",
      • "status": "active",
      • "href": "/objects/company-config/location/19"
      }
    ],
  • "ia::meta": {
    • "totalCount": 2,
    • "start": 1,
    • "pageSize": 100,
    • "next": null,
    • "previous": null
    }
}