Skip to main content
GET
/
api
/
contracts
/
v1
/
{id}
Get a contract
curl --request GET \
  --url https://app.trelica.com/api/contracts/v1/{id} \
  --header 'Authorization: Bearer <token>'
{
  "id": "6609682bdb3cf6ec72b95839",
  "externalId": "EXT1235",
  "ref": "PO-12345-00",
  "type": "PurchaseOrder",
  "vendorName": "Github, Inc.",
  "agreementDate": "2022-04-01T00:00:00Z",
  "renewalDate": "2023-04-01T00:00:00Z",
  "terminationNoticeDays": 90,
  "isAutomaticRenewal": false,
  "notes": "Annual Github renewal negotiated by Rachele in procurement",
  "paymentMethod": "Invoice",
  "businessOwnerEmail": "jane.doe@example.org",
  "lineItems": [
    {
      "externalId": "1",
      "description": "Github Enterprise annual",
      "notes": "For source control",
      "unitCount": 50,
      "amount": 210,
      "currency": "USD",
      "baseAmount": 210,
      "baseCurrency": "USD",
      "startDate": "2022-04-06T00:00:00Z",
      "endDate": "2023-04-06T00:00:00Z"
    },
    {
      "externalId": "2",
      "description": "Github Advanced Security",
      "notes": "Secret scanning etc",
      "unitCount": 10,
      "amount": 250,
      "currency": "USD",
      "baseAmount": 250,
      "baseCurrency": "USD",
      "startDate": "2022-04-06T00:00:00Z",
      "endDate": "2023-04-06T00:00:00Z"
    }
  ],
  "documents": [],
  "createdBy": {
    "userId": "110e3dd8077945c2a60d33770eb74b97",
    "name": "Sam Procurement",
    "email": "sam.procurement@example.org"
  },
  "createdDtm": "2024-03-31T13:42:03.608Z",
  "lastModifiedBy": {
    "userId": "110e3dd8077945c2a60d33770eb74b97",
    "name": "Sam Procurement",
    "email": "sam.procurement@example.org"
  },
  "lastModifiedDtm": "2024-03-31T13:42:03.608Z"
}

Authorizations

Authorization
string
header
required

OAuth 2.0. Obtain an access token via the Client Credentials or Authorization Code flow, then send it as Authorization: Bearer <token>.

Path Parameters

id
string
required

The contract's SaaS Manager ID, or the external ID you assigned when importing it.

Response

OK

A contract

id
string | null

The contract's SaaS Manager ID. Supply to update an existing contract.

externalId
string | null

Your own external ID for the contract. Supply to match an existing contract on update.

ref
string | null

A reference for the contract, e.g. a PO number

type
enum<string>

The contract type

Available options:
OrderForm,
MSA,
GenericContract,
PurchaseOrder,
Subscription
vendorName
string | null

The vendor name

startDate
string<date-time> | null

(ISO format) The contract's start date

agreementDate
string<date-time> | null

(ISO format) The agreement date. Defaults to now on creation.

renewalDate
string<date-time> | null

(ISO format) The renewal date

isRolling
boolean | null

Whether the contract is a rolling contract

terminationNoticeDays
integer<int32> | null

The number of days' notice required to terminate the contract

isAutomaticRenewal
boolean | null

Whether the contract renews automatically

notes
string | null

Notes about the contract

paymentMethod
enum<string>

The payment method

Available options:
CreditCard,
Invoice
businessOwnerEmail
string | null

The email address of the contract's business owner

lineItems
object[] | null

The contract's line items

documents
object[] | null

Documents linked to the contract

createdBy
object

The user that created the contract record

createdDtm
string<date-time> | null
read-only

The timestamp for when the contract record was created

lastModifiedBy
object

The user that last modified the contract record

lastModifiedDtm
string<date-time> | null
read-only

The timestamp for when the contract record was last modified