Get contract by ID
curl --request GET \
--url https://api.zenskar.com/contract_v2/{contract_id} \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zenskar.com/contract_v2/{contract_id}"
headers = {
"x-api-key": "<api-key>",
"organisation": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>', organisation: '<api-key>'}};
fetch('https://api.zenskar.com/contract_v2/{contract_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://api.zenskar.com/contract_v2/{contract_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 => [
"organisation: <api-key>",
"x-api-key: <api-key>"
],
]);
$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://api.zenskar.com/contract_v2/{contract_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("organisation", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zenskar.com/contract_v2/{contract_id}")
.header("x-api-key", "<api-key>")
.header("organisation", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zenskar.com/contract_v2/{contract_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["organisation"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Enterprise Plan - Q1 2025",
"description": "12-month enterprise subscription",
"status": "active",
"currency": "USD",
"start_date": "2025-01-01T00:00:00Z",
"end_date": "2025-12-31T23:59:59Z",
"customer_id": "987fcdeb-51a2-43d7-9876-543210fedcba",
"customer": {
"id": "987fcdeb-51a2-43d7-9876-543210fedcba",
"customer_name": "Acme Corporation",
"email": "billing@acme.com"
},
"phases": [
{
"id": "456e7890-e89b-12d3-a456-426614174111",
"name": "Standard Phase",
"start_date": "2025-01-01T00:00:00Z",
"end_date": "2025-12-31T23:59:59Z",
"phase_type": "active",
"pricings": []
}
],
"custom_attributes": {
"sales_rep": "john.doe@company.com",
"deal_id": "DEAL-2025-001"
},
"created_at": "2025-01-01T10:30:00Z",
"updated_at": "2025-01-15T14:20:00Z"
}{
"detail": "Contract with id 123e4567-e89b-12d3-a456-426614174000 not found"
}{
"detail": [
{
"loc": [
"path",
"contract_id"
],
"msg": "value is not a valid uuid",
"type": "type_error.uuid"
}
]
}{
"detail": "An unexpected error occurred"
}Contracts
Get contract by ID
Retrieve detailed information for a specific contract by its unique identifier.
Returns comprehensive contract data including basic information, customer details, contract phases with products and pricing, custom attributes, and timestamps.
GET
/
contract_v2
/
{contract_id}
Get contract by ID
curl --request GET \
--url https://api.zenskar.com/contract_v2/{contract_id} \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zenskar.com/contract_v2/{contract_id}"
headers = {
"x-api-key": "<api-key>",
"organisation": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>', organisation: '<api-key>'}};
fetch('https://api.zenskar.com/contract_v2/{contract_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://api.zenskar.com/contract_v2/{contract_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 => [
"organisation: <api-key>",
"x-api-key: <api-key>"
],
]);
$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://api.zenskar.com/contract_v2/{contract_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("organisation", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zenskar.com/contract_v2/{contract_id}")
.header("x-api-key", "<api-key>")
.header("organisation", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zenskar.com/contract_v2/{contract_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["organisation"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Enterprise Plan - Q1 2025",
"description": "12-month enterprise subscription",
"status": "active",
"currency": "USD",
"start_date": "2025-01-01T00:00:00Z",
"end_date": "2025-12-31T23:59:59Z",
"customer_id": "987fcdeb-51a2-43d7-9876-543210fedcba",
"customer": {
"id": "987fcdeb-51a2-43d7-9876-543210fedcba",
"customer_name": "Acme Corporation",
"email": "billing@acme.com"
},
"phases": [
{
"id": "456e7890-e89b-12d3-a456-426614174111",
"name": "Standard Phase",
"start_date": "2025-01-01T00:00:00Z",
"end_date": "2025-12-31T23:59:59Z",
"phase_type": "active",
"pricings": []
}
],
"custom_attributes": {
"sales_rep": "john.doe@company.com",
"deal_id": "DEAL-2025-001"
},
"created_at": "2025-01-01T10:30:00Z",
"updated_at": "2025-01-15T14:20:00Z"
}{
"detail": "Contract with id 123e4567-e89b-12d3-a456-426614174000 not found"
}{
"detail": [
{
"loc": [
"path",
"contract_id"
],
"msg": "value is not a valid uuid",
"type": "type_error.uuid"
}
]
}{
"detail": "An unexpected error occurred"
}Authorizations
Response
Contract retrieved successfully