Skip to content
POST/{organizationId}/{mandateId}/crm/plans/{planId}

Updates a plan on the given mandate

Required permissions:

  • mandate.read

  • plan.edit

Path Parameters

organizationIdstringrequired
mandateIdstringrequired
planIdstringrequired

Request Body required

Content-Type: application/json

typestringrequired

Options:

membershipFeecontractdonation
contactTypestring | nullrequired

Options:

memberaddresscustomersponsorcontributoremployeesupplier
namestringrequired

minLength: 1

maxLength: 64

maxItems: 64

ObjectId as string

requireActiveDepartmentbooleanrequired
updateContractsbooleanrequired

Authentication: X-API-Key

Request

POST/{organizationId}/{mandateId}/crm/plans/{planId}
curl --request POST 'https://cloud.campai.com/api/{organizationId}/{mandateId}/crm/plans/{planId}' \
  --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
          }
        }
      }
    ]
  },
  "updateContracts": true
}'

Responses

This endpoint returns different response codes based on the request outcome.

200Successful response

Content-Type: application/json

Valueany

Response

200
"string"

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

400
{
  "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

401
{
  "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

403
{
  "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

500
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}