curl --request GET \
--url https://app.synthetic.ai/api/v1/contracts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.synthetic.ai/api/v1/contracts/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.synthetic.ai/api/v1/contracts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.synthetic.ai/api/v1/contracts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.synthetic.ai/api/v1/contracts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.synthetic.ai/api/v1/contracts/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.synthetic.ai/api/v1/contracts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"currencyCode": "USD",
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"cancelsAt": "2023-11-07T05:31:56Z",
"paymentTermsDays": 0,
"lifecycleStatus": "DRAFT",
"autoIssue": true,
"processingInvoices": true,
"processingInvoicesStartedAt": "<string>",
"autoRenew": true,
"notes": "<string>",
"autoRenewalAt": "2023-11-07T05:31:56Z",
"renewalNoticeDays": 0,
"renewingContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"renewalContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currentAmendmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currentAmendmentStatus": "DRAFT",
"currentAmendmentStartAt": "2023-11-07T05:31:56Z",
"draftAmendmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"futureAmendment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amendmentNumber": 0,
"status": "DRAFT",
"type": "MODIFICATION",
"processingInvoices": true,
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"paymentTermsDays": 0,
"finalizedAt": "<string>",
"voidedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"subscriptionBillableCount": 0,
"oneTimeBillableCount": 0,
"contractHealth": "RENEWAL_DUE",
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Input validation failed",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}{
"code": "NOT_FOUND",
"message": "The record does not exist for your business.",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred.",
"issues": []
}Get a contract
One contract by id, a deleted one included. A contract of another entity is not found. With amendmentId, the contract is read as it stood under that amendment: its current amendment fields, endAt and paymentTermsDays are that amendment’s, and futureAmendment is null. Needs a key holding contracts:read.
curl --request GET \
--url https://app.synthetic.ai/api/v1/contracts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.synthetic.ai/api/v1/contracts/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.synthetic.ai/api/v1/contracts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.synthetic.ai/api/v1/contracts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.synthetic.ai/api/v1/contracts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.synthetic.ai/api/v1/contracts/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.synthetic.ai/api/v1/contracts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"currencyCode": "USD",
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"cancelsAt": "2023-11-07T05:31:56Z",
"paymentTermsDays": 0,
"lifecycleStatus": "DRAFT",
"autoIssue": true,
"processingInvoices": true,
"processingInvoicesStartedAt": "<string>",
"autoRenew": true,
"notes": "<string>",
"autoRenewalAt": "2023-11-07T05:31:56Z",
"renewalNoticeDays": 0,
"renewingContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"renewalContractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currentAmendmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currentAmendmentStatus": "DRAFT",
"currentAmendmentStartAt": "2023-11-07T05:31:56Z",
"draftAmendmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"futureAmendment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contractId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amendmentNumber": 0,
"status": "DRAFT",
"type": "MODIFICATION",
"processingInvoices": true,
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"paymentTermsDays": 0,
"finalizedAt": "<string>",
"voidedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"subscriptionBillableCount": 0,
"oneTimeBillableCount": 0,
"contractHealth": "RENEWAL_DUE",
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Input validation failed",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}{
"code": "NOT_FOUND",
"message": "The record does not exist for your business.",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred.",
"issues": []
}Authorizations
An API key created in Settings, sent as Authorization: Bearer <key>.
Path Parameters
The contract id.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Query Parameters
One of this contract's amendments, to read the contract as it stood under it.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Response
Successful response
An agreement between the entity and one of its customers. It sets what the customer is billed for, from when and until when, and whether the agreement renews when it ends.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$The customer the contract bills.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$The contract's name, such as the agreement's title; null when it has none. It is not printed on invoices.
The currency the contract bills in.
USD, CAD, EUR, USDC The calendar date the contract starts, carried at UTC midnight. The time is not data.
The calendar date the contract ends, carried at UTC midnight: it covers the days before this date, not the date itself. It includes changes that are finalized but have not taken effect yet, and any agreed cancellation. The time is not data.
The calendar date an agreed cancellation ends the contract, carried at UTC midnight; null when no cancellation has been agreed. It is also endAt. The time is not data.
How many days the customer has to pay an invoice once it is issued, under the current amendment.
-9007199254740991 <= x <= 9007199254740991DRAFT: the contract's terms have not been agreed yet. ACTIVE: the terms are agreed and the contract has not ended, including one that has not started yet. EXPIRED: the contract has ended. CANCELLED: the contract was ended by a cancellation. DELETED: the contract was deleted; a list includes it only when lifecycleStatuses names DELETED.
DRAFT, ACTIVE, EXPIRED, CANCELLED, DELETED Whether the contract's invoices are issued on their periodStartAt without a person approving them. An invoice issued this way is not emailed to the customer. This does not apply while the entity is in billing setup, to an invoice whose period starts on or before the day billing setup finished, or to an invoice a person was asked to review.
Whether the contract's invoices are still being updated after a change to its terms or its deletion.
When the change that processingInvoices is waiting on was last requested; null while processingInvoices is false.
Whether the contract renews itself. A renewal is a new contract on the same terms that starts when this one ends. When true, the renewal is created on autoRenewalAt, so none while that is null, and is agreed automatically once this contract's terms are finalized. A contract already past its end when its terms are written or finalized gets one renewal for each term since. A change to this contract made after its renewal is agreed goes to a person to agree. When false, nothing is created automatically; from autoRenewalAt a person is asked to decide.
A note for the entity's own staff. It is never printed on an invoice.
The calendar date the contract comes up for renewal, carried at UTC midnight: renewalNoticeDays before the current amendment ends; null when renewalNoticeDays is null. Only a running contract with finalized terms, no agreed cancellation and no renewal comes up for renewal. The time is not data.
How many days before the current amendment ends the contract comes up for renewal; null when it never does, so nothing is created or asked before it ends, even when autoRenew is true.
-9007199254740991 <= x <= 9007199254740991The contract this one renews; null when it is not a renewal.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$The contract that renews this one, a draft renewal included and a deleted one not; null when there is none.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$The amendment whose terms apply today: the latest finalized one that has started, or amendment 0 until one has.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$The status of the current amendment. DRAFT means the contract's terms have not been agreed yet.
DRAFT, FINALIZING, FINALIZED, VOIDING, VOIDED The calendar date the current amendment takes or took effect, carried at UTC midnight. The time is not data.
The amendment being written and not yet agreed; null when there is none. It is the same as currentAmendmentId while the contract's terms have never been agreed.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Agreed changes to the contract that have not taken effect yet; null when there are none. Once it has started and is finalized, it becomes the current amendment. A scheduled cancellation shows in cancelsAt instead.
Show child attributes
Show child attributes
How many SUBSCRIPTION billables the current amendment carries.
-9007199254740991 <= x <= 9007199254740991How many ONE_TIME billables the current amendment carries.
-9007199254740991 <= x <= 9007199254740991Whether the contract needs attention. RENEWAL_DUE: it has come up for renewal, does not renew itself and no agreed contract of the customer follows it yet, so a person needs to decide. ENDING: its current amendment ends within 30 days, and it does not renew itself, never comes up for renewal and has no cancellation agreed. HEALTHY: running and needs nothing. UPCOMING: agreed and not started yet. NO_ACTIVE_CONTRACT: expired, ended by a cancellation, or deleted. DRAFT_ONLY: its terms have not been agreed yet.
RENEWAL_DUE, ENDING, HEALTHY, UPCOMING, NO_ACTIVE_CONTRACT, DRAFT_ONLY