/{organizationId}/{mandateId}/crm/plansCreates a new plan for the given mandate
Required permissions:
mandate.read
plan.insert
Path Parameters
organizationIdstringrequired mandateIdstringrequired Request Body required
Content-Type: application/json
typestringrequired Options:
membershipFeecontractdonationcontactTypestring | nullrequired Options:
memberaddresscustomersponsorcontributoremployeesuppliernamestringrequired minLength: 1
maxLength: 64
maxItems: 64
ObjectId as string
requireActiveDepartmentbooleanrequired Authentication: X-API-Key
Request
curl --request POST 'https://cloud.campai.com/api/{organizationId}/{mandateId}/crm/plans' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"type": "membershipFee",
"contactType": "member",
"name": "string",
"tags": [
"string"
],
"period": {
"interval": "month",
"mode": "interval",
"count": 1,
"custom": {
"startDay": 1,
"startMonth": 1,
"rrule": "string",
"range": {
"value": 1,
"unit": "hours"
}
},
"flexible": {
"baseInterval": "month",
"intervals": [
"month"
],
"mode": "multiply"
}
},
"collection": {
"mode": "relative",
"period": "start",
"relative": "at",
"shiftMode": "before",
"shiftTime": {
"value": 0,
"unit": "hours"
},
"deviantMode": "before",
"deviantTime": {
"value": 0,
"unit": "hours"
},
"daysToDue": 0,
"absolute": {
"anchor": "interval",
"date": 1,
"month": 1
}
},
"pauseRules": [
{
"id": "string",
"name": "string",
"adjustment": {
"operator": "set",
"value": 0
}
}
],
"billing": {
"deleteContractAfterEnd": true,
"sepaDirectDebitCashAccount": "000000000000000000000001",
"sepaDirectDebitPurpose": "string",
"sepaDirectDebitSendReceipts": true,
"sepaCreditTransferCashAccount": "000000000000000000000001",
"receiptTemplate": "000000000000000000000001",
"receiptTexts": {
"intro": "string",
"note": "string",
"title": "string",
"subject": "string",
"message": "string"
}
},
"customFields": {
"groups": [
{
"id": "string",
"label": "string",
"fields": [
{
"id": "string",
"type": "placeholder",
"name": "string"
}
]
}
]
},
"department": "000000000000000000000001",
"requireActiveDepartment": true,
"charge": {
"isNet": true,
"proRataDivisor": 2,
"contactNameMode": "disabled",
"description": "string",
"relativeDate": "periodStart",
"adjustments": {
"adjustments": [
{
"operator": "set",
"value": 1,
"type": "filter",
"id": "string",
"name": "string",
"description": "string",
"min": 0,
"max": 1,
"filter": {
"operator": "and",
"groups": [
{
"operator": "and",
"fields": [
{
"path": "string",
"comparator": "exists"
}
]
}
]
}
}
],
"min": 0,
"max": 1
},
"amount": {
"proRataMode": "start",
"expression": {
"operator": "set",
"expression": {
"literal": [
1
]
}
},
"tiers": {
"expression": {
"literal": [
1
]
},
"tiers": [
{
"operator": "set",
"value": 1,
"from": 1,
"to": 1
}
]
},
"price": {
"isNet": true,
"price": 0,
"taxCode": "string",
"account": 1,
"costCenter1": 1,
"costCenter2": 1
}
},
"options": [
{
"id": "string",
"name": "string",
"description": "string",
"preSelected": true,
"oneTime": true,
"filter": {
"operator": "and",
"groups": [
{
"operator": "and",
"fields": [
{
"path": "string",
"comparator": "exists"
}
]
}
]
},
"amount": {
"proRataMode": "start",
"expression": {
"operator": "set",
"expression": {
"literal": [
1
]
}
},
"tiers": {
"expression": {
"literal": [
1
]
},
"tiers": [
{
"operator": "set",
"value": 1,
"from": 1,
"to": 1
}
]
},
"price": {
"isNet": true,
"price": 0,
"taxCode": "string",
"account": 1,
"costCenter1": 1,
"costCenter2": 1
}
}
}
]
}
}'Responses
This endpoint returns different response codes based on the request outcome.
200Successful response
Content-Type: application/json
ObjectId as string
Response
{
"_id": "000000000000000000000001"
}400Invalid input data
Content-Type: application/json
The error information
messagestringrequired The error message
codestringrequired The error code
An array of issues that were responsible for the error
Response
{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}401Authorization not provided
Content-Type: application/json
The error information
messagestringrequired The error message
codestringrequired The error code
An array of issues that were responsible for the error
Response
{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}403Insufficient access
Content-Type: application/json
The error information
messagestringrequired The error message
codestringrequired The error code
An array of issues that were responsible for the error
Response
{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}500Internal server error
Content-Type: application/json
The error information
messagestringrequired The error message
codestringrequired The error code
An array of issues that were responsible for the error
Response
{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}