Contracts
get
https://app.trelica.com/api/
contracts/v1
List contracts
delete
https://app.trelica.com/api/
contracts/v1/{id}
Delete a contract
put
https://app.trelica.com/api/
contracts/v1
Create or update a contract

Examples

Example filters

vendorName eq "Agilebits Inc"
Returns contracts where the vendor is "Agilebits Inc"
vendorName sw "Micros"
Contracts with vendors starting with "Micros" e.g. "Microsoft", "Microsoft, Inc" etc
lineItems[unitCount gt 100]
Contracts containing line items with more than 100 units.
isAutomaticRenewal eq true
Contracts that automatically renew
agreementDate ge "2021-06-01"
Contracts with agreement dates on or after 1st June 2021

Example body for creating a contract

{
"externalId": "EXT1234",
"ref": "PO-12345-00",
"type": "PurchaseOrder",
"vendorName": "Githhub, Inc.",
"agreementDate": "2022-04-01",
"renewalDate": "2023-04-01",
"terminationNoticeDays": 90,
"isAutomaticRenewal": false,
"notes": "Annual Github renewal negotiated by Rachele in procurement",
"paymentMethod": "Invoice",
"businessOwnerEmail": "[email protected]",
"lineItems": [{
"externalId": "L1",
"description": "Github Enterprise annual",
"notes": "For source control",
"unitCount": 50,
"amount": 210,
"currency": "USD",
"startDate": "2022-04-06",
"endDate": "2023-04-06"
}, {
"externalId": "L2",
"description": "Github Advanced Security",
"notes": "Secret scanning etc",
"unitCount": 10,
"amount": 250,
"currency": "USD",
"startDate": "2022-04-06",
"endDate": "2023-04-06"
}],
"documents": [{
"linkUrl": "https://github.com/pricing",
"description": "Github website"
}]
}

Data structures

Contract

Attribute
Type
Description
externalId
string
Unique identifier for the contract. This may be an internal ID from a source system.
ref
string
Reference for the contract (e.g. PO number).
type
enum
OrderForm | MSA | PurchaseOrder | GenericContract
vendorName
string
Name of the vendor.
agreementDate
date
(ISO format) Date agreement was made, e.g. "2022-01-15"
renewalDate
date
Optional. (ISO format) Date agreement will be renewed, e.g. "2023-01-15"
terminationNoticeDays
number
Optional. Number of days notice that is required to terminate the contract.
isAutomaticRenewal
boolean
Optional. True if the contract will automatically renew. (assumed False if not provided)
notes
string
Optional. Text notes about the contract.
paymentMethod
enum
Optional. CreditCard | Invoice
businessOwnerEmail
email
Optional. Email address of the owner of the agreement in the business.
lineItems
array
documents
array

Contract line item

Attribute
Text
Description
externalId
string
Optional. Unique identifier for the line item.
​
For updates, if the externalId is passed then an existing line item with this externalId will be updated. If no externalId is passed, then existing rows without an externalId will be deleted, and new line items inserted.
description
string
Text description for the line item.
notes
string
Optional. Notes about the line item.
unitCount
number
Optional. The number of units.
amount
number
Optional. Price per unit, or if no unitCount is provided, the price for the whole line item.
currency
currency
Optional. ISO 4217 currency code, e.g. USD. If no currency is provided, the Trelica organization base currency is assumed.
startDate
date
Optional. (ISO format) Start date for the line item. e.g. 2022-01-15
endDate
date
Optional. (ISO format) Exclusive end date for the line item. e.g. 2023-01-15

Contract document

Attribute
Text
Description
linkUrl
string
A URL link to the document.
description
string
Optional. Description for the document.
Last modified 5mo ago
Copy link
Outline
get
List contracts
delete
Delete a contract
put
Create or update a contract
Examples
Example filters
Example body for creating a contract
Data structures
Contract
Contract line item
Contract document