Insert an Overlapping Expense Report

POST/expense-reports​/overlapping/ — Use this method to create a new expense report record if the expense report period overlaps with the period covered by an existing expense report. The expense report period is determined by the attributes startDate and endDate.

Note:

Check the account configuration before using this endpoint. Overlapping expense reports may not be allowed at all or may be restricted depending on the role permissions associated with the access token (The role permissions of the user on behalf of whom the client application is accessing OpenAir).

Parameters

Path parameters

None

Query string parameter

Path parameter

Required / Optional

Description

Type

expand

Optional

A comma-separated list of attributes available for expansion. The comma-separated list may include spaces (or %20 in the URL encoded string).

Note:

The expand value must contain only attributes referencing a supported object type. If return_object is set to any value other than 0 (zero), and the comma-separated list includes at least one attribute that is not available for expansion, the request fails — an error is returned and the object is not added or updated. For more information about attributes available for expansion and supported object types, see Available Expansions and Supported Object Types.

string

fields

Optional

A comma-separated list of attributes to include in the response. If not specified, the response includes all attributes for the expense report returned.

string

filterSetId

Optional

The internal ID of the filter set to be applied.

  • When specified, the request is successful only if the action is available when the specified filter set is active in OpenAir. The filter set with the specified internal ID must exist and must be associated with the user who authorized the application as per the access token.

  • Otherwise and by default, the primary filter set associated with the user who authorized the application is applied.

integer

return_object

Optional

If set to any value other than 0 (zero), the response will return the expense report created. Otherwise, the response will include only the internal ID of the expense report created.

Boolean

Request body

The ExpenseReport object to be created. The object must include valid key-value pairs for all required attributes and cannot include key-value pairs for read-only attributes. For information about the ExpenseReport object model, see ExpenseReport object properties.

Response definitions

A successful request returns a JSON object with the following properties:

Property

Description

data

An array containing one of the following:

  • The ExpenseReport object created, if the return_object parameter was set to any value other than 0 (zero) in the request. The object includes all the attributes specified using the fields if included in the request.

  • An object with only the internal ID of the expense report created.

See Returned Data.

included

An array of expanded objects, if the expand parameter was set in the request.

See Referenced Objects and Expansion.

meta

An object containing information about objects referenced by internal ID in the data array (object type and internal ID). Only returned if the return_object parameter was set to any value other than 0 (zero) in the request.

See Referenced Objects and Expansion.

message

A string containing a brief message about the status of your request — e.g. “Success”.

A failed request returns a JSON object with the following properties:

Property

Description

message

A string containing a brief message about the status of your request.

Sample request

            POST /rest/v1/expense-reports/overlapping/ HTTP/1.1
Host: company-id.app.openair.com
Content-Type: application/json
Authorization: Bearer <OAuth2_access_token>

{
   "date": "2020-10-10",
   "isAdjusting": false,
   "currency": "USD",
   "userId": 237,
   "name": "September 2020 Additional Expenses ",
   "isAccounting": false,
} 

          

In the example, <OAuth2_access_token> is the OAuth 2.0 access token obtained for the client application connecting to OpenAir. See Authentication.

Sample response

            {
   "data": [
      {
         "id": 2695,
      }
   ],
   "message": "success"
}