Crm · Compensation
Get compensation claim
Gets a compensation claim by organization, mandate and claim ID. The response includes its entries and history, allowance usage, default booking mandate, waiver donation and qualification warnings, subject to the caller’s access.
Permissions
Send an API key of the organization in the path, using the X-API-Key header.
Who may call it
- The caller must have organization access.
- The caller needs
mandate.read. - The caller also needs
compensationClaim.read. - Callers restricted to assigned claims can only retrieve their assigned claims.
- Without
user.read, non-contact actors other than the current actor are masked. - Without
apiKey.read, API-key actors are masked.
Request
Path parameters
-
organizationIdidrequired -
mandateIdidrequired -
claimIdidrequired
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
--request GET 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/crm/compensation/claims/YOUR_CLAIM_ID' \
--header 'X-API-Key: YOUR_API_KEY'const response = await fetch("https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/crm/compensation/claims/YOUR_CLAIM_ID", {
method: "GET",
headers: {
"X-API-Key": "YOUR_API_KEY"
},
redirect: 'error',
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) throw new Error(`campai HTTP ${response.status}`);
const text = await response.text();
const result = text ? JSON.parse(text) : null;
console.log(JSON.stringify(result, null, 2));<?php
$context = stream_context_create(['http' => [
'method' => 'GET',
'header' => [
'X-API-Key: YOUR_API_KEY',
],
'timeout' => 30,
'follow_location' => 0,
'ignore_errors' => true,
]]);
$text = @file_get_contents('https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/crm/compensation/claims/YOUR_CLAIM_ID', false, $context);
preg_match('/^HTTP\/\S+ (\d{3})/', $http_response_header[0] ?? '', $match);
$status = (int) ($match[1] ?? 0);
if ($text === false || $status < 200 || $status >= 300) {
throw new RuntimeException("campai HTTP $status (0 means no response)");
}
$result = $text === '' ? null : json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($result, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR), PHP_EOL;
Response
200 Successful response
Content-Type: application/json
-
_idid -
createdAtstring · date-timenullable -
updatedAtstring · date-timenullable -
removedAtstring · date-timenullable -
createdByobjectnullable -
updatedByobjectnullable -
removedByobjectnullable -
__ignoreTriggersstringnullable -
organizationid -
mandatesid[] -
mandateScopestringselectedall -
numberstringat most 30 characters
-
contactobject -
periodobject4 properties
-
yearinteger2000–2999
-
indexinteger1–12
-
fromstring -
tostring
-
-
deadlineAtstring -
reminderSentForDeadlinestringnullable -
statusstringdraftsubmittedapproved -
ratesobject[]at most 50 items
6 properties
-
_idid -
typestringhourlyflatmileage -
labelstring1–60 characters
-
amountinteger0–999999
-
limitidnullable -
oncePerEntryboolean
-
-
entryFieldsobject[]at most 10 items
6 properties
-
_idid -
typestringtextselectmultiSelect -
labelstring1–60 characters
-
entryTypesstring[]at most 4 items
hoursflatRatesmileageexpenses -
requiredboolean -
optionsstring[]at most 50 items · each 1–100 characters
-
-
expensesEnabledboolean -
expenseMaxAmountintegernullableat most 9999999999
-
expenseReceiptRequiredboolean -
hoursobject[]at most 500 items
8 properties
-
_idid -
datestring -
startTimestringpattern
^(([01]\d|2[0-3]):[0-5][05]|24:00)$ -
endTimestringpattern
^(([01]\d|2[0-3]):[0-5][05]|24:00)$ -
rateid -
fieldsobject[]at most 50 items
2 properties
-
fieldid -
valuesstring[]1–50 items · each 1–100 characters
-
-
detailsstringat most 500 characters
-
eventidnullable
-
-
flatRatesobject[]at most 200 items
7 properties
-
_idid -
datestring -
rateid -
quantitynumber0.5–99
-
fieldsobject[]at most 50 items
2 properties
-
fieldid -
valuesstring[]1–50 items · each 1–100 characters
-
-
detailsstringat most 500 characters
-
eventidnullable
-
-
mileageobject[]at most 200 items
7 properties
-
_idid -
datestring -
rateid -
distanceinteger1–9999
-
purposestring2–100 characters
-
fieldsobject[]at most 50 items
2 properties
-
fieldid -
valuesstring[]1–50 items · each 1–100 characters
-
-
detailsstringat most 500 characters
-
-
expensesobject[]at most 100 items
7 properties
-
_idid -
datestring -
amountintegerat most 9999999999
-
descriptionstring2–100 characters
-
filesobject[]at most 5 items
5 properties
-
resourcestringat least 1 characters
-
fileNamestringat most 128 characters
-
contentTypestringat most 75 characters
-
fileSizeBytesintegerat least 0
-
idstringexactly 6 characters
-
-
fieldsobject[]at most 50 items
2 properties
-
fieldid -
valuesstring[]1–50 items · each 1–100 characters
-
-
detailsstringat most 500 characters
-
-
correctionsobject[]at most 50 items
6 properties
-
_idid -
descriptionstring2–100 characters
-
amountinteger -
limitidnullable -
createdAtstring · date-time -
createdByobject
-
-
totalAmountintegerat most 9999999999
-
payeeobjectnullable3 properties
-
accountHolderNamestringat most 80 characters
-
ibanstring · iban -
bicstring
-
-
declarationTextstringat most 4000 characters
-
submittedAtstring · date-timenullable -
submittedByobjectnullable -
submittedOnBehalfboolean -
waiverobjectnullable -
reviewsobject[]at most 1000 items
4 properties
-
atstring · date-time -
byobject -
decisionstringsubmittedcheckedreturnedapprovedrevoked -
messagestringnullableat most 2000 characters
-
-
changesobject[]at most 1000 items
-
reviewerUserIdsstring[]at most 100 items · each at least 1 characters
-
notesobject[]6 properties
-
idstringexactly 6 characters
-
contentstringat most 4000 characters
-
writtenAtstring · date-time -
writtenByobject -
updatedAtstring · date-time -
updatedByobject
-
-
approvedAtstring · date-timenullable -
approvedByobjectnullable -
documentobjectnullable4 properties
-
resourcestringat least 1 characters
-
fileNamestringat most 128 characters
-
contentTypestringat most 75 characters
-
fileSizeBytesintegerat least 0
-
-
receiptobjectnullable3 properties
-
_idid -
receiptNumberstringat most 30 characters
-
mandateid
-
-
waiverBookingsid[]at most 60 items
-
limitUsageobjectnullablelimitUsageis null without limits or a contributor contact.3 properties
-
limitsobject[]5 properties
-
_idid -
labelstring1–60 characters
-
amountintegerat most 9999999
-
dailyAmountintegernullableat most 9999999
-
monthlyAmountintegernullableat most 9999999
-
-
limitAmountsobject[]at most 10 items
2 properties
-
limitid -
amountinteger0–9999999
-
-
otherClaimsobject[]2 properties
-
fromstring -
amountsobject[]3 properties
-
limitid -
amountinteger -
withinCapsinteger
-
-
-
-
defaultMandateidnullabledefaultMandateis null when approvers choose the booking mandate. -
waiverDonationobjectnullablewaiverDonationis null if the claim has no waiver bookings or the caller lacksdonation.read.3 properties
-
_idid -
numberstringat least 1 characters
-
confirmationStatusstringpendingnotRequiredcreatedthanked
-
-
qualificationWarningsobject2 properties
-
proofsobject[]qualificationWarnings.proofsis empty withoutproof.read.qualificationWarnings.proofsis empty when the contributor has no proofs whose status is notconfirmed.2 properties
-
typeNamestring -
statusstringrequestedconfirmedrequireddueoverdueexpired
-
-
certificatesobject[]qualificationWarnings.certificatesis empty withoutcertificate.read.qualificationWarnings.certificatesis empty when the contributor has no certificates whose status is notvalid.2 properties
-
typeNamestring -
statusstringvalidwillExpireexpired
-
-
More about the fields
contact.user: For a visible contact actor other than the current actor, its nested user’s name and image are masked withoutuser.read.
{
"_id": "000000000000000000000001",
"organization": "000000000000000000000001",
"mandates": [
"000000000000000000000001"
],
"number": "string",
"contact": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
},
"period": {
"year": 2000,
"index": 1,
"from": "string",
"to": "string"
},
"deadlineAt": "string",
"reminderSentForDeadline": "string",
"status": "draft",
"rates": [
{
"_id": "000000000000000000000001",
"type": "hourly",
"label": "string",
"amount": 0,
"limit": "000000000000000000000001",
"oncePerEntry": true
}
],
"entryFields": [
{
"_id": "000000000000000000000001",
"type": "text",
"label": "string",
"entryTypes": [
"hours"
],
"required": true,
"options": [
"string"
]
}
],
"expensesEnabled": true,
"expenseMaxAmount": 1,
"expenseReceiptRequired": true,
"hours": [
{
"_id": "000000000000000000000001",
"date": "string",
"startTime": "string",
"endTime": "string",
"rate": "000000000000000000000001",
"fields": [
{
"field": "000000000000000000000001",
"values": [
"string"
]
}
],
"details": "string",
"event": "000000000000000000000001"
}
],
"flatRates": [
{
"_id": "000000000000000000000001",
"date": "string",
"rate": "000000000000000000000001",
"quantity": 0.5,
"fields": [
{
"field": "000000000000000000000001",
"values": [
"string"
]
}
],
"details": "string",
"event": "000000000000000000000001"
}
],
"mileage": [
{
"_id": "000000000000000000000001",
"date": "string",
"rate": "000000000000000000000001",
"distance": 1,
"purpose": "string",
"fields": [
{
"field": "000000000000000000000001",
"values": [
"string"
]
}
],
"details": "string"
}
],
"expenses": [
{
"_id": "000000000000000000000001",
"date": "string",
"amount": 1,
"description": "string",
"files": [
{
"resource": "string",
"id": "string"
}
],
"fields": [
{
"field": "000000000000000000000001",
"values": [
"string"
]
}
],
"details": "string"
}
],
"corrections": [
{
"_id": "000000000000000000000001",
"description": "string",
"amount": 1,
"limit": "000000000000000000000001",
"createdAt": "2026-06-15T22:30:00Z",
"createdBy": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
}
}
],
"totalAmount": 1,
"payee": {
"accountHolderName": "string",
"iban": "string",
"bic": "string"
},
"declarationText": "string",
"submittedAt": "2026-06-15T22:30:00Z",
"submittedBy": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
},
"submittedOnBehalf": true,
"waiver": {
"type": "full"
},
"reviews": [
{
"at": "2026-06-15T22:30:00Z",
"by": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
},
"decision": "submitted",
"message": "string"
}
],
"changes": [
{
"at": "2026-06-15T22:30:00Z",
"by": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
},
"type": "entries",
"previousTotalAmount": 1,
"totalAmount": 1
}
],
"reviewerUserIds": [
"string"
],
"notes": [
{
"id": "string",
"content": "string",
"writtenAt": "2026-06-15T22:30:00Z",
"writtenBy": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
}
}
],
"approvedAt": "2026-06-15T22:30:00Z",
"approvedBy": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
},
"document": {
"resource": "string"
},
"receipt": {
"_id": "000000000000000000000001",
"receiptNumber": "string",
"mandate": "000000000000000000000001"
},
"waiverBookings": [
"000000000000000000000001"
],
"limitUsage": {
"limits": [
{
"_id": "000000000000000000000001",
"label": "string",
"amount": 1,
"dailyAmount": 1,
"monthlyAmount": 1
}
],
"limitAmounts": [
{
"limit": "000000000000000000000001",
"amount": 0
}
],
"otherClaims": [
{
"from": "string",
"amounts": [
{
"limit": "000000000000000000000001",
"amount": 1,
"withinCaps": 1
}
]
}
]
},
"defaultMandate": "000000000000000000000001",
"waiverDonation": {
"_id": "000000000000000000000001",
"number": "string",
"confirmationStatus": "pending"
},
"qualificationWarnings": {
"proofs": [
{
"typeName": "string",
"status": "requested"
}
],
"certificates": [
{
"typeName": "string",
"status": "valid"
}
]
}
}
Errors
Other errors
| Status | Error | When |
|---|---|---|
| 404 | Claim not found. | If the claim is not found within the caller’s accessible scope, the endpoint returns HTTP 404 with compensation.errors.claimNotFound. |
Errors nearly every request can meet are listed under Errors.