Contract lines

A contract line is a header containing multiple schedule lines and is tied directly to a contract.

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 lines

get/objects/contracts/contract-line

Returns up to 100 object references from the collection with a key, ID, and link for each contract line. 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": "1",
      • "id": "1",
      • "href": "/objects/contracts/contract-line/1"
      },
    • {
      • "key": "2",
      • "id": "2",
      • "href": "/objects/contracts/contract-line/2"
      },
    • {
      • "key": "3",
      • "id": "3",
      • "href": "/objects/contracts/contract-line/3"
      }
    ],
  • "ia::meta": {
    • "totalCount": 3,
    • "start": 1,
    • "pageSize": 100,
    • "next": null,
    • "previous": null
    }
}

Create a contract line

post/objects/contracts/contract-line

Creates a new contract line.

SecurityOAuth2
Request
Request Body schema: application/json

Contract line to create

required
object

contract

key
string

Contract unique key

Example: "249"
id
string

Contract unique identifier

Example: "CON-0045"
required
object
key
string

Item Key

Example: "13"
id
string

Item ID

Example: "API3.0"
required
object
amountFrequency
string
Default: "useBillingTemplate"

Flat/fixed amount frequency

Enum: "includeWithEveryInvoice" "oneTime" "useBillingTemplate"
Example: "oneTime"
object

Billing template to use.

key
string

Key

Example: "12"
id
string

Contract Billing Template ID

Example: "12P_BeginingPeriod"
method
string
Default: "fixedPrice"

Billing method

Enum: "fixedPrice" "projectMaterials" "projectT&M" "projectTime" "quantityBased"
Example: "fixedPrice"
usageQuantityReset
string or null
Default: null

Reset usage quantity

Enum: "afterEachInvoice" "afterEachRenewal" null
Example: "afterEachRenewal"
isUsageQuantityRecurring
boolean
Default: false

Usage quantity recurs

Example: false
committedQuantityEndAction
string or null
Default: null

On contract line end date

Enum: "billUnusedQuantity" "cancelUnusedQuantity" "doNothing" null
Example: "billUnusedQuantity"
committedQuantityExcess
string or null
Default: null

If usage exceeds the committed quantity

Enum: "billOverage" "doNotAllowOverage" "doNothing" null
Example: "billOverage"
quantityType
string or null
Default: null

Quantity type

Enum: "committed" null "variable"
Example: "variable"
durationInPeriods
string

Duration (in periods)

Example: "3"
proratePartialPeriods
boolean
Default: false

Prorate partial periods?

Example: false
frequency
string or null
Default: null

Billing frequency

Enum: "annually" "monthly" null "quarterly"
Example: "monthly"
startDate
string <date>

Billing start

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

Billing end

Example: "2022-04-30"
memo
string or null

Memo

Example: "Cash customer"
quantity
string or null

Quantity

Example: "8"
rate
string or null

Rate

Example: "100"
multiplier
string or null

Multiplier

Example: "1"
discount
string
Default: "0"

Discount

Example: "10"
flatFixedAmount
string

Flat/fixed amount

Example: "100"
baseFlatFixedAmount
string

Base flat/fixed amount

Example: "100"
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"
state
string
Default: "inProgress"

State

Enum: "canceled" "closed" "completed" "draft" "inProgress" "notRenewed" "renewalForecast" "renewalOnly" "revalued"
Example: "completed"
startDate
string <date>

Line start

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

Line end

Example: "2024-04-30"
changeType
string or null
Default: null

Change type

Enum: "addOnMRR" "churnMRR" "downgrade" "newMRR" null "renewalDowngrade" "renewalUpgrade"
Example: "newMRR"
itemDescription
string

Item description

Example: "API usage"
deliveryStatus
string
Default: "delivered"

Delivery status

Enum: "delivered" "undelivered"
Example: "undelivered"
postingDate
string <date>

GL posting date

Example: "2024-01-01"
memo
string or null

Post Memo

Example: "POSTING LINE"
shipToSource
string
Default: "contractValue"

Specifies where the ship-to contact information should come from

Enum: "contractValue" "userSpecifiedValue"
Example: "contractValue"
billToSource
string
Default: "contractValue"

Specifies where the bill-to contact information should come from

Enum: "contractValue" "userSpecifiedValue"
Example: "contractValue"
revenueDeferralStatus
string
Default: "deferRevenueUntilItemIsDelivered"

Revenue recognition deferral status

Enum: "deferRevenueUntilAllItemsAreDelivered" "deferRevenueUntilItemIsDelivered"
Example: "deferRevenueUntilItemIsDelivered"
isRecurring
boolean
Default: false

Recurring

Example: false
object
exchangeRateDate
string <date>

Exchange rate date

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

Exchange rate

Example: "1.345"
object
memo
string or null

Memo

Example: "Cash customer"
object
object
object
startDate
string <date>

Revenue 1 start date

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

Revenue 1 end date

Example: "2022-04-30"
object
object
startDate
string <date>

Revenue 1 start date

Example: "2018-04-01"
endDate
string <date>

Revenue 1 end date

Example: "2022-04-30"
totalQuantity
string

Total revenue quantity

Example: "30"
memo
string or null

Memo

Example: "Cash customer"
object
renew
boolean
Default: false

Renew

Example: false
object
key
string

Key

Example: "17"
id
string

Contract revenue template ID

Example: "12P_BeginingPeriod"
Responses
201

Created

400

Bad Request

Request samples
application/json
{
  • "contract": {
    • "key": "1"
    },
  • "item": {
    • "key": "2"
    },
  • "dimensions": {
    • "location": {
      • "key": "1"
      }
    },
  • "startDate": "2022-01-01",
  • "endDate": "2022-12-31",
  • "billing": {
    • "quantity": "12",
    • "rate": "12",
    • "multiplier": "1",
    • "discount": "0",
    • "method": "fixedPrice",
    • "amountFrequency": "includeWithEveryInvoice",
    • "frequency": "monthly",
    • "flatFixedAmount": "144",
    • "baseFlatFixedAmount": "144",
    • "totalFlatFixedAmount": "1728",
    • "totalBaseFlatFixedAmount": "1728"
    },
  • "changeType": "newMRR",
  • "lineType": "sale",
  • "revenue": {
    • "journal1": {
      • "revenueTemplate": {
        }
      }
    },
  • "postingDate": "2022-01-01"
}
Response samples
application/json
{
  • "ia::result": {
    • "id": "26",
    • "key": "26",
    • "href": "/objects/contracts/contract-line/26"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Get a contract line

get/objects/contracts/contract-line/{key}

Returns detailed information for a specified contract line.

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the contract line.

Responses
200

OK

400

Bad Request

Request samples
Response samples
application/json
{
  • "ia::result": {
    • "id": "1",
    • "key": "1",
    • "contract": {
      • "key": "1",
      • "id": "Usagerevrec_Case6",
      • "state": "In progress",
      • "name": "CAR-IMPLEMENTATION",
      • "href": "/objects/contracts/contract/1"
      },
    • "parent": {
      • "id": null,
      • "key": null,
      • "item": {
        },
      • "lineNumber": null
      },
    • "currency": {
      • "txnCurrency": "USD",
      • "baseCurrency": "USD",
      • "exchangeRateDate": null,
      • "exchangeRate": "1.000000000000"
      },
    • "state": "inProgress",
    • "lineNumber": "1",
    • "recurringBillingPeriod": 0,
    • "startDate": "2015-01-15",
    • "endDate": "2015-03-31",
    • "cancelationDate": null,
    • "item": {
      • "key": "306",
      • "id": "LICNERP",
      • "name": "Licenses-ERP",
      • "href": "/objects/inventory-control/item/306"
      },
    • "itemDescription": null,
    • "deferralStatus": "deferRevenueUntilItemIsDelivered",
    • "billing": {
      • "quantity": "1",
      • "rate": "599999.99",
      • "multiplier": "1",
      • "discount": "0",
      • "template": {
        },
      • "schedule": {
        },
      • "startDate": "2015-01-15",
      • "endDate": "2015-03-31",
      • "method": "fixedPrice",
      • "amountFrequency": "includeWithEveryInvoice",
      • "frequency": "monthly",
      • "flatFixedAmount": "599999.99",
      • "baseFlatFixedAmount": "599999.99",
      • "totalFlatFixedAmount": "1799999.97",
      • "totalBaseFlatFixedAmount": "1799999.97",
      • "resetUsageQuantity": "",
      • "isUsageQuantityRecurring": null,
      • "holdDate": null,
      • "resumeDate": null,
      • "memo": null,
      • "durationInPeriods": "3",
      • "proratePartialPeriods": false,
      • "quantityType": "",
      • "committedQuantityEndAction": "",
      • "committedQuantityExcess": ""
      },
    • "contacts": {
      • "billTo": {
        },
      • "shipTo": {
        }
      },
    • "billToSource": "contractValue",
    • "shipToSource": "contractValue",
    • "renewal": {
      • "renew": false,
      • "billingTemplate": {
        }
      },
    • "isRecurring": false,
    • "lineType": "sale",
    • "revenue": {
      • "journal1": {
        },
      • "journal2": {
        },
      • "totalQuantity": "33333.33",
      • "holdDate": null,
      • "resumeDate": null,
      • "memo": null
      },
    • "dimensions": {
      • "location": {
        },
      • "department": {
        },
      • "task": {
        },
      • "project": {
        },
      • "customer": {
        },
      • "vendor": {
        },
      • "employee": {
        },
      • "class": {
        }
      },
    • "audit": {
      • "createdDateTime": "2023-06-05T17:45:45Z",
      • "modifiedDateTime": "2023-06-05T17:45:45Z",
      • "createdBy": "1",
      • "modifiedBy": "1"
      },
    • "changeType": "",
    • "isMRR": false,
    • "priceListDetails": null,
    • "deliveryStatus": "delivered",
    • "deliveryDate": "2015-01-15",
    • "postingDate": "2015-01-15",
    • "expense": {
      • "holdDate": null,
      • "resumeDate": null,
      • "memo": null
      },
    • "memo": null,
    • "renewalTriggerDate": null,
    • "lineRenewalDate": null,
    • "href": "/objects/contracts/contract-line/1"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Update a contract line

patch/objects/contracts/contract-line/{key}

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

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the contract line.

Request Body schema: application/json
state
string
Default: "inProgress"

State

Enum: "canceled" "closed" "completed" "draft" "inProgress" "notRenewed" "renewalForecast" "renewalOnly" "revalued"
Example: "completed"
startDate
string <date>

Line start

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

Line end

Example: "2024-04-30"
changeType
string or null
Default: null

Change type

Enum: "addOnMRR" "churnMRR" "downgrade" "newMRR" null "renewalDowngrade" "renewalUpgrade"
Example: "newMRR"
itemDescription
string

Item description

Example: "API usage"
deliveryStatus
string
Default: "delivered"

Delivery status

Enum: "delivered" "undelivered"
Example: "undelivered"
postingDate
string <date>

GL posting date

Example: "2024-01-01"
memo
string or null

Post Memo

Example: "POSTING LINE"
shipToSource
string
Default: "contractValue"

Specifies where the ship-to contact information should come from

Enum: "contractValue" "userSpecifiedValue"
Example: "contractValue"
billToSource
string
Default: "contractValue"

Specifies where the bill-to contact information should come from

Enum: "contractValue" "userSpecifiedValue"
Example: "contractValue"
revenueDeferralStatus
string
Default: "deferRevenueUntilItemIsDelivered"

Revenue recognition deferral status

Enum: "deferRevenueUntilAllItemsAreDelivered" "deferRevenueUntilItemIsDelivered"
Example: "deferRevenueUntilItemIsDelivered"
isRecurring
boolean
Default: false

Recurring

Example: false
object
exchangeRateDate
string <date>

Exchange rate date

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

Exchange rate

Example: "1.345"
object
amountFrequency
string
Default: "useBillingTemplate"

Flat/fixed amount frequency

Enum: "includeWithEveryInvoice" "oneTime" "useBillingTemplate"
Example: "oneTime"
object

Billing template to use.

key
string

Key

Example: "12"
id
string

Contract Billing Template ID

Example: "12P_BeginingPeriod"
method
string
Default: "fixedPrice"

Billing method

Enum: "fixedPrice" "projectMaterials" "projectT&M" "projectTime" "quantityBased"
Example: "fixedPrice"
usageQuantityReset
string or null
Default: null

Reset usage quantity

Enum: "afterEachInvoice" "afterEachRenewal" null
Example: "afterEachRenewal"
isUsageQuantityRecurring
boolean
Default: false

Usage quantity recurs

Example: false
committedQuantityEndAction
string or null
Default: null

On contract line end date

Enum: "billUnusedQuantity" "cancelUnusedQuantity" "doNothing" null
Example: "billUnusedQuantity"
committedQuantityExcess
string or null
Default: null

If usage exceeds the committed quantity

Enum: "billOverage" "doNotAllowOverage" "doNothing" null
Example: "billOverage"
quantityType
string or null
Default: null

Quantity type

Enum: "committed" null "variable"
Example: "variable"
durationInPeriods
string

Duration (in periods)

Example: "3"
proratePartialPeriods
boolean
Default: false

Prorate partial periods?

Example: false
frequency
string or null
Default: null

Billing frequency

Enum: "annually" "monthly" null "quarterly"
Example: "monthly"
startDate
string <date>

Billing start

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

Billing end

Example: "2022-04-30"
memo
string or null

Memo

Example: "Cash customer"
quantity
string or null

Quantity

Example: "8"
rate
string or null

Rate

Example: "100"
multiplier
string or null

Multiplier

Example: "1"
discount
string
Default: "0"

Discount

Example: "10"
flatFixedAmount
string

Flat/fixed amount

Example: "100"
baseFlatFixedAmount
string

Base flat/fixed amount

Example: "100"
object
memo
string or null

Memo

Example: "Cash customer"
object
object
object
startDate
string <date>

Revenue 1 start date

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

Revenue 1 end date

Example: "2022-04-30"
object
object
startDate
string <date>

Revenue 1 start date

Example: "2018-04-01"
endDate
string <date>

Revenue 1 end date

Example: "2022-04-30"
totalQuantity
string

Total revenue quantity

Example: "30"
memo
string or null

Memo

Example: "Cash customer"
object
renew
boolean
Default: false

Renew

Example: false
object
key
string

Key

Example: "17"
id
string

Contract revenue template ID

Example: "12P_BeginingPeriod"
object

contract

key
string

Contract unique key

Example: "249"
id
string

Contract unique identifier

Example: "CON-0045"
object
key
string

Item Key

Example: "13"
id
string

Item ID

Example: "API3.0"
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
{
  • "item": {
    • "key": "3"
    },
  • "dimensions": {
    • "location": {
      • "key": "1"
      }
    },
  • "startDate": "2022-01-01",
  • "endDate": "2022-12-31",
  • "billing": {
    • "quantity": "12",
    • "rate": "12",
    • "multiplier": "1",
    • "discount": "0",
    • "method": "fixedPrice",
    • "amountFrequency": "includeWithEveryInvoice",
    • "frequency": "monthly",
    • "flatFixedAmount": "144",
    • "baseFlatFixedAmount": "144",
    • "totalFlatFixedAmount": "1728",
    • "totalBaseFlatFixedAmount": "1728"
    },
  • "changeType": "newMRR",
  • "lineType": "sale",
  • "revenue": {
    • "journal1": {
      • "revenueTemplate": {
        }
      },
    • "journal2": {
      • "revenueTemplate": {
        }
      }
    },
  • "postingDate": "2022-01-01"
}
Response samples
application/json
{
  • "ia::result": {
    • "id": "3",
    • "key": "3",
    • "href": "/objects/contracts/contract-line/3"
    },
  • "ia::meta": {
    • "totalCount": 1,
    • "totalSuccess": 1,
    • "totalError": 0
    }
}

Delete a contract line

delete/objects/contracts/contract-line/{key}

Deletes a contract line.

SecurityOAuth2
Request
path Parameters
key
required
string

System-assigned key for the contract line.

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 contract lines

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/contract-line"
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
    }
}