curl --location 'https://integrations.projectcor.com/v2/integrations/contracts' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {
"source": "SALESFORCE"
},
"id": "SF-CONTRACT-12345",
"name": "Annual Service Agreement",
"client_id": "SF-ACC-67890",
"type": "retainer",
"status": "active",
"start_date": "2025-01-01",
"end_date": "2025-12-31",
"value": 120000,
"description": "Annual retainer for design and development services"
}'
import requests
url = "https://integrations.projectcor.com/v2/integrations/contracts"
payload = {
"metadata": {
"source": "SALESFORCE"
},
"id": "SF-CONTRACT-12345",
"name": "Annual Service Agreement",
"client_id": "SF-ACC-67890",
"type": "retainer",
"status": "active",
"start_date": "2025-01-01",
"end_date": "2025-12-31",
"value": 120000,
"description": "Annual retainer for design and development services"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://integrations.projectcor.com/v2/integrations/contracts',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
metadata: {
source: 'SALESFORCE'
},
id: 'SF-CONTRACT-12345',
name: 'Annual Service Agreement',
client_id: 'SF-ACC-67890',
type: 'retainer',
status: 'active',
start_date: '2025-01-01',
end_date: '2025-12-31',
value: 120000,
description: 'Annual retainer for design and development services'
})
}
);
const data = await response.json();
console.log(data);
{
"id": 30001,
"name": "Annual Service Agreement",
"client_id": 25855,
"type": "retainer",
"status": "active",
"start_date": "2025-01-01",
"end_date": "2025-12-31",
"value": 120000,
"company_id": 1234,
"created_at": "2025-01-10T14:30:00Z",
"updated_at": "2025-01-10T14:30:00Z"
}
{
"status": 400,
"name": "CORCustomError",
"code": "CTR006",
"message": "Cannot save contract. Exchange rate not found for USD to ARS. Please sync exchange rates first."
}
{
"error": "ClientNotFoundError",
"message": "Client with external ID 'SF-ACC-67890' not found",
"code": "ZC004"
}
Contracts
Create Contract
Creates a new contract in your COR instance with external ID mapping
POST
/
v2
/
integrations
/
contracts
curl --location 'https://integrations.projectcor.com/v2/integrations/contracts' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {
"source": "SALESFORCE"
},
"id": "SF-CONTRACT-12345",
"name": "Annual Service Agreement",
"client_id": "SF-ACC-67890",
"type": "retainer",
"status": "active",
"start_date": "2025-01-01",
"end_date": "2025-12-31",
"value": 120000,
"description": "Annual retainer for design and development services"
}'
import requests
url = "https://integrations.projectcor.com/v2/integrations/contracts"
payload = {
"metadata": {
"source": "SALESFORCE"
},
"id": "SF-CONTRACT-12345",
"name": "Annual Service Agreement",
"client_id": "SF-ACC-67890",
"type": "retainer",
"status": "active",
"start_date": "2025-01-01",
"end_date": "2025-12-31",
"value": 120000,
"description": "Annual retainer for design and development services"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://integrations.projectcor.com/v2/integrations/contracts',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
metadata: {
source: 'SALESFORCE'
},
id: 'SF-CONTRACT-12345',
name: 'Annual Service Agreement',
client_id: 'SF-ACC-67890',
type: 'retainer',
status: 'active',
start_date: '2025-01-01',
end_date: '2025-12-31',
value: 120000,
description: 'Annual retainer for design and development services'
})
}
);
const data = await response.json();
console.log(data);
{
"id": 30001,
"name": "Annual Service Agreement",
"client_id": 25855,
"type": "retainer",
"status": "active",
"start_date": "2025-01-01",
"end_date": "2025-12-31",
"value": 120000,
"company_id": 1234,
"created_at": "2025-01-10T14:30:00Z",
"updated_at": "2025-01-10T14:30:00Z"
}
{
"status": 400,
"name": "CORCustomError",
"code": "CTR006",
"message": "Cannot save contract. Exchange rate not found for USD to ARS. Please sync exchange rates first."
}
{
"error": "ClientNotFoundError",
"message": "Client with external ID 'SF-ACC-67890' not found",
"code": "ZC004"
}
Creates a new contract in your COR instance through the integrations service. Validates contract type, status, client association, and validates date fields in
YYYY-MM-DD format before creating.
The currency ISO sent in the request must have a previously configured currency exchange in COR. If no exchange rate exists from the contract currency to the company base currency, contract creation is rejected with status: 400, name: CORCustomError, and code: CTR006.
Request Body Requirements
string
required
External contract ID from your source system
string
required
Contract name
string
required
External client ID. The client must have been previously created through the integrations API.
string
Contract type (e.g., “retainer”, “project”, “hourly”)
string
Contract status (e.g., “active”, “pending”, “completed”)
string
Start date in
YYYY-MM-DD formatstring
End date in
YYYY-MM-DD formatnumber
Contract value/amount
string
Contract description
Known Errors
ValidationError— Missing required fieldsClientNotFoundError— The specified client does not exist in the integration mappingsDuplicateExternalIdError— A contract with this external ID already existsValidationError—Invalid start date format: <value>whenstart_dateis not a validYYYY-MM-DDdateValidationError—Invalid end date format: <value>whenend_dateis not a validYYYY-MM-DDdateCTR006(CORCustomError,400) —Cannot save contract. Exchange rate not found for ${currency} to ${baseCurrency}. Please sync exchange rates first.
curl --location 'https://integrations.projectcor.com/v2/integrations/contracts' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {
"source": "SALESFORCE"
},
"id": "SF-CONTRACT-12345",
"name": "Annual Service Agreement",
"client_id": "SF-ACC-67890",
"type": "retainer",
"status": "active",
"start_date": "2025-01-01",
"end_date": "2025-12-31",
"value": 120000,
"description": "Annual retainer for design and development services"
}'
import requests
url = "https://integrations.projectcor.com/v2/integrations/contracts"
payload = {
"metadata": {
"source": "SALESFORCE"
},
"id": "SF-CONTRACT-12345",
"name": "Annual Service Agreement",
"client_id": "SF-ACC-67890",
"type": "retainer",
"status": "active",
"start_date": "2025-01-01",
"end_date": "2025-12-31",
"value": 120000,
"description": "Annual retainer for design and development services"
}
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch(
'https://integrations.projectcor.com/v2/integrations/contracts',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
metadata: {
source: 'SALESFORCE'
},
id: 'SF-CONTRACT-12345',
name: 'Annual Service Agreement',
client_id: 'SF-ACC-67890',
type: 'retainer',
status: 'active',
start_date: '2025-01-01',
end_date: '2025-12-31',
value: 120000,
description: 'Annual retainer for design and development services'
})
}
);
const data = await response.json();
console.log(data);
{
"id": 30001,
"name": "Annual Service Agreement",
"client_id": 25855,
"type": "retainer",
"status": "active",
"start_date": "2025-01-01",
"end_date": "2025-12-31",
"value": 120000,
"company_id": 1234,
"created_at": "2025-01-10T14:30:00Z",
"updated_at": "2025-01-10T14:30:00Z"
}
{
"status": 400,
"name": "CORCustomError",
"code": "CTR006",
"message": "Cannot save contract. Exchange rate not found for USD to ARS. Please sync exchange rates first."
}
{
"error": "ClientNotFoundError",
"message": "Client with external ID 'SF-ACC-67890' not found",
"code": "ZC004"
}
Was this page helpful?

