Contract expenses

A contract expense is the cost incurred to obtain or fulfill a contract with a customer.

  • For termed contracts, you can add expenses to the contract and/or to a contract line.
  • For evergreen contracts, you can only add expenses to the contract.
  • For kit contract lines, you can add expenses to the contract or to the kit component contract lines. You cannot add an expense to the kit item contract line.
    Please be aware that this object is currently "Uncertified" in our open beta, signifying that it has not undergone the complete review process and the design may change during ongoing refinement. Users are advised to exercise discretion in using this object and are encouraged to provide feedback.

List contract expenses

get/objects/contracts/expense

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

SecurityOAuth2
Responses
200

OK

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::result": [
    • {
      • "key": "84",
      • "id": "84",
      • "href": "/objects/contracts/expense/84"
      },
    • {
      • "key": "87",
      • "id": "87",
      • "href": "/objects/contracts/expense/87"
      }
    ],
  • "ia::meta": {
    • "totalCount": 2,
    • "start": 1,
    • "pageSize": 100,
    • "next": null,
    • "previous": null
    }
}

Create a contract expense

post/objects/contracts/expense

Creates a new contract expense.

SecurityOAuth2
Request
Request Body schema: application/json

Contract expense to create

required
object

contract

key
string

Contract key

Example: "59"
id
string

Contract

Example: "CON-0045"
name
string

Contract name

Example: "ACME Widgets - Service"
required
object
key
string

Item key

Example: "319"
id
string

Item ID

Example: "Overhead"
postingDate
required
string <date>

GL posting date

Example: "2022-02-01"
required
object
object

Location or entity associated with the contract. This field is required in a multi-entity environment. Contract lines are restricted to the specified location or entity or to a child of the location or entity.

key
string

Location Key

Example: "22"
id
string

Location

Example: "LOC-22"
object

Department associated with the contract.

key
string

Department Key

Example: "11"
id
string

Department

Example: "DEP-11"
name
string

Department name

Example: "Human Resources"
object
key
string

Class Key

Example: "731"
id
string

Class ID

Example: "REST_CLS_001"
object
id
string

Task ID

Example: "1"
key
string

Task Key

Example: "1"
object
key
string

Vendor Key

Example: "357"
id
string

Vendor ID

Example: "1605212096809"
object

Customer that the contract is associated with. The customer cannot be changed after a contract line has been posted to the contract.

key
string

Customer Key

Example: "250"
id
string

Customer ID

Example: "CUS-RT-0011"
object
key
string

Project Key

Example: "2"
id
string

Project ID

Example: "NET-XML30-2"
object
key
string

Employee Key

Example: "10"
id
string

Employee ID

Example: "EMP-10"
txnAmount
required
string <decimal-precision-2>

Amount

Example: "100.00"
baseAmount
string <decimal-precision-2>

Base amount

Example: "100.00"
object
exchangeRateDate
string <date>

Exchange rate date

Example: "2022-01-01"
exchangeRate
string <decimal-precision-12>

Exchange rate

Example: "1.345"
object
key
string

Contract detail key

Example: "2"
id
string

Contract detail key

Example: "2"
object
object
object

Expense template

startDate
string <date>

Expense start

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

Expense end

Example: "2022-12-01"
object
object

Expense template

object

contract expense schedule

startDate
string <date>

Expense2 start

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

Expense2 end

Example: "2022-12-01"
Responses
201

Created

400

Bad Request

Request samples
application/json
{
  • "contract": {
    • "key": "1"
    },
  • "item": {
    • "key": "1"
    },
  • "dimensions": {
    • "location": {
      • "key": "1"
      }
    },
  • "templates": {
    • "expenseJournal1": {
      • "expenseTemplate": {
        },
      • "startDate": "2015-01-15",
      • "endDate": "2015-03-31"
      }
    },
  • "txnAmount": "8.25",
  • "baseAmount": "8.25",
  • "postingDate": "2015-01-15"
}
Response samples
application/json
{
  • "ia::result": [
    • {
      • "key": "2",
      • "id": "2",
      • "href": "/objects/contracts/expense/2"
      }
    ],
  • "ia::meta": {
    • "totalCount": 1
    }
}

Get a contract expense

get/objects/contracts/expense/{key}

Returns detailed information for a specified contract expense.

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the contract expense.

Example: 17
Responses
200

OK

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::result": {
    • "id": "2",
    • "key": "2",
    • "contract": {
      • "key": "1",
      • "id": "Usagerevrec_Case6",
      • "href": "/objects/contracts/contract/1"
      },
    • "contractLine": {
      • "id": null,
      • "key": null,
      • "state": null
      },
    • "item": {
      • "key": "322",
      • "id": "CONT-SUPPEXP",
      • "name": "Functional Consultation support Charges",
      • "href": "/objects/inventory-control/item/322"
      },
    • "dimensions": {
      • "location": {
        },
      • "department": {
        },
      • "project": {
        },
      • "customer": {
        },
      • "vendor": {
        },
      • "employee": {
        },
      • "class": {
        }
      },
    • "templates": {
      • "expenseJournal1": {
        },
      • "expenseJournal2": {
        }
      },
    • "txnAmount": "8.25",
    • "baseAmount": "8.25",
    • "currency": {
      • "txnCurrency": "USD",
      • "baseCurrency": "USD",
      • "exchangeRateDate": null,
      • "exchangeRate": "1.000000000000"
      },
    • "postingDate": "2015-01-15",
    • "cancelationDate": null,
    • "deferredExpenseGLAccount": {
      • "key": "427",
      • "href": "/objects/general-ledger/account/427"
      },
    • "recognizedExpenseGLAccount": {
      • "key": "433",
      • "href": "/objects/general-ledger/account/433"
      },
    • "expenseAccrualGLAccount": {
      • "key": "439",
      • "href": "/objects/general-ledger/account/439"
      },
    • "state": "inProgress",
    • "expenseType": "contract",
    • "audit": {
      • "createdDateTime": "2023-06-26T10:17:19Z",
      • "modifiedDateTime": "2023-06-26T10:19:18Z",
      • "createdBy": "1",
      • "modifiedBy": "1"
      },
    • "calculatedExpensePostingType": "M",
    • "memo": null,
    • "lineNumber": "2",
    • "href": "/objects/contracts/expense/2"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Update a/an contract expense

patch/objects/contracts/expense/{key}

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

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the contract expense.

Example: 17
Request Body schema: application/json
txnAmount
string <decimal-precision-2>

Amount

Example: "100.00"
baseAmount
string <decimal-precision-2>

Base amount

Example: "100.00"
object
exchangeRateDate
string <date>

Exchange rate date

Example: "2022-01-01"
exchangeRate
string <decimal-precision-12>

Exchange rate

Example: "1.345"
postingDate
string <date>

GL posting date

Example: "2022-02-01"
object

contract

key
string

Contract key

Example: "59"
id
string

Contract

Example: "CON-0045"
name
string

Contract name

Example: "ACME Widgets - Service"
object
key
string

Contract detail key

Example: "2"
id
string

Contract detail key

Example: "2"
object
object
object

Expense template

startDate
string <date>

Expense start

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

Expense end

Example: "2022-12-01"
object
object

Expense template

object

contract expense schedule

startDate
string <date>

Expense2 start

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

Expense2 end

Example: "2022-12-01"
object
key
string

Item key

Example: "319"
id
string

Item ID

Example: "Overhead"
object
object

Location or entity associated with the contract. This field is required in a multi-entity environment. Contract lines are restricted to the specified location or entity or to a child of the location or entity.

key
string

Location Key

Example: "22"
id
string

Location

Example: "LOC-22"
object

Department associated with the contract.

key
string

Department Key

Example: "11"
id
string

Department

Example: "DEP-11"
name
string

Department name

Example: "Human Resources"
object
key
string

Class Key

Example: "731"
id
string

Class ID

Example: "REST_CLS_001"
object
id
string

Task ID

Example: "1"
key
string

Task Key

Example: "1"
object
key
string

Vendor Key

Example: "357"
id
string

Vendor ID

Example: "1605212096809"
object

Customer that the contract is associated with. The customer cannot be changed after a contract line has been posted to the contract.

key
string

Customer Key

Example: "250"
id
string

Customer ID

Example: "CUS-RT-0011"
object
key
string

Project Key

Example: "2"
id
string

Project ID

Example: "NET-XML30-2"
object
key
string

Employee Key

Example: "10"
id
string

Employee ID

Example: "EMP-10"
Responses
200

OK

400

Bad Request

Request samples
application/json
{
  • "templates": {
    • "expenseJournal1": {
      • "expenseTemplate": {
        },
      • "startDate": "2015-01-15",
      • "endDate": "2015-03-31"
      }
    },
  • "txnAmount": "8.25",
  • "baseAmount": "8.25",
  • "postingDate": "2015-01-15"
}
Response samples
application/json
{
  • "ia::result": {
    • "key": "2",
    • "id": "2",
    • "href": "/objects/contracts/expense/2"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Delete a contract expense

delete/objects/contracts/expense/{key}

Deletes a contract expense.

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the contract expense.

Example: 17
Responses
204

No Content

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::error": {
    • "code": "invalidRequest",
    • "message": "Malformed URL",
    • "supportId": "sQrM9%7EYdh5oDEWVb80mrn9xuHjoAAAABBQ",
    • "details": [
      • {
        }
      ]
    }
}

Query expenses

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: "contracts/expense"
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": "accounts-payable/vendor",
  • "fields": [
    • "id",
    • "name",
    • "status",
    • "href"
    ],
  • "filters": [
    • {
      • "$eq": {
        }
      },
    • {
      • "$eq": {
        }
      }
    ],
  • "filterExpression": "1 and 2",
  • "orderBy": [
    • {
      • "id": "asc"
      }
    ]
}
Response samples
application/json
{
  • "ia::result": [
    • {
      • "id": "Vend-00002",
      • "name": "Test vendor",
      • "status": "active",
      • "href": "/objects/accounts-payable/vendor/85"
      },
    • {
      • "id": "VEND-00010",
      • "name": "Design Works",
      • "status": "active",
      • "href": "/objects/accounts-payable/vendor/111"
      }
    ],
  • "ia::meta": {
    • "totalCount": 2,
    • "start": 1,
    • "pageSize": 100,
    • "next": null,
    • "previous": null
    }
}