Skip to content
POST/{organizationId}/{mandateId}/crm/contracts/list

Gets a list of contracts for the mandate

Required permissions:

  • mandate.read

  • contract.read

  • plan.read

Path Parameters

organizationIdstringrequired
mandateIdstringrequired

Request Body required

Content-Type: application/json

limitintegeroptional

Default: 50

minimum: 0

maximum: 100

offsetintegeroptional

Default: 0

minimum: 0

maximum: 9007199254740991

returnCountbooleanoptional

Default: false

searchTermstringoptional
contactIdstringoptional
planIdstringoptional
paymentMethodTypestringoptional

Options:

sepaCreditTransfersepaDirectDebitcashonline

maxItems: 50

statusstringoptional

Options:

collectactiveupcomingpausedterminationendedfailedcollecting

A stringified json object representing a property filter

Authentication: X-API-Key

Request

POST/{organizationId}/{mandateId}/crm/contracts/list
curl --request POST 'https://cloud.campai.com/api/{organizationId}/{mandateId}/crm/contracts/list' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "sort": {},
  "limit": 50,
  "offset": 0
}'

Responses

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

200Successful response

Content-Type: application/json

countintegerrequired

minimum: 0

maximum: 9007199254740991

Response

200
{
  "count": 0,
  "contracts": [
    {
      "_id": "000000000000000000000001",
      "mandate": "000000000000000000000001",
      "contact": {
        "name": "string",
        "type": "contact",
        "nameNormalized": "string",
        "nameSort": "string",
        "contact": "000000000000000000000001",
        "image": {
          "resource": "string"
        },
        "user": {
          "name": "string",
          "type": "user",
          "userId": "string",
          "image": {
            "resource": "string"
          }
        }
      },
      "debtor": {
        "account": 1,
        "name": "string",
        "nameNormalized": "string",
        "nameSort": "string",
        "paymentMethodType": "sepaCreditTransfer"
      },
      "plan": {
        "plan": "000000000000000000000001",
        "name": "string",
        "tags": "string",
        "interval": "month"
      },
      "options": [
        "string"
      ],
      "startAt": "string",
      "endAt": "string",
      "terminatedAt": "string",
      "pause": {
        "ruleId": "string",
        "startAt": "string",
        "endAt": "string"
      },
      "customFields": {},
      "flexibleInterval": "month",
      "fixedAmount": 0,
      "lastCollection": {
        "collectAt": "string",
        "periodStart": "string",
        "periodEnd": "string",
        "flexiblePeriodStart": "string",
        "flexiblePeriodEnd": "string",
        "counter": 1,
        "amount": 0,
        "description": "string",
        "amounts": [
          {
            "price": {
              "account": 1,
              "costCenter1": 1,
              "costCenter2": 1,
              "isNet": true,
              "taxCode": "string"
            },
            "appliedPause": {
              "rule": {
                "id": "string",
                "name": "string",
                "adjustment": {
                  "operator": "set",
                  "value": 0
                }
              },
              "startAt": "string",
              "endAt": "string"
            },
            "baseAmount": 1,
            "proRatedBaseAmount": 1,
            "adjustedAmount": 1,
            "proRatedAdjustedAmountBeforePause": 1,
            "proRatedAdjustedAmount": 1,
            "optionsAmount": 1,
            "proRatedOptionsAmountBeforePause": 1,
            "proRatedOptionsAmount": 1,
            "totalAmount": 1,
            "multiplyFactor": 1,
            "isDeviantStart": true,
            "isDeviantEnd": true,
            "isProRataStart": true,
            "isProRataEnd": true,
            "deviantStartDays": 1,
            "deviantEndDays": 1,
            "adjustments": [
              {
                "adjustment": {
                  "operator": "set",
                  "value": 1,
                  "type": "filter",
                  "id": "string",
                  "name": "string",
                  "description": "string",
                  "min": 0,
                  "max": 1,
                  "filter": {
                    "operator": "and",
                    "groups": [
                      null
                    ]
                  }
                },
                "description": "string"
              }
            ],
            "options": [
              {
                "option": {
                  "id": "string",
                  "name": "string",
                  "amount": {
                    "price": {
                      "isNet": true,
                      "price": 0,
                      "taxCode": null,
                      "account": 1,
                      "costCenter1": null,
                      "costCenter2": null
                    },
                    "proRataMode": "start",
                    "expression": {
                      "operator": "set",
                      "expression": null
                    },
                    "tiers": {
                      "expression": null,
                      "tiers": null
                    }
                  },
                  "description": "string",
                  "preSelected": true,
                  "oneTime": true,
                  "filter": {
                    "operator": "and",
                    "groups": [
                      null
                    ]
                  }
                },
                "amount": 1,
                "proRatedAmount": 1,
                "description": "string"
              }
            ],
            "description": "string",
            "voucherAmount": 1,
            "vouchers": [
              {
                "voucher": "000000000000000000000001",
                "name": "string",
                "code": "string",
                "usagePeriod": "string",
                "usageDate": "string",
                "amount": 1
              }
            ]
          }
        ],
        "dueAt": "string",
        "sepaDirectDebitPurpose": "string",
        "receiptTexts": {
          "title": "string",
          "intro": "string",
          "note": "string",
          "subject": "string",
          "message": "string"
        },
        "voucherAmount": 0,
        "plan": {
          "type": "membershipFee",
          "department": "000000000000000000000001",
          "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"
            }
          },
          "charge": {
            "isNet": true
          },
          "billing": {
            "receiptTemplate": "000000000000000000000001",
            "sepaDirectDebitCashAccount": "000000000000000000000001",
            "sepaDirectDebitSendReceipts": true,
            "sepaCreditTransferCashAccount": "000000000000000000000001"
          }
        },
        "contractCollectionId": "000000000000000000000001"
      },
      "nextCollection": {
        "collectAt": "string",
        "periodStart": "string",
        "periodEnd": "string",
        "flexiblePeriodStart": "string",
        "flexiblePeriodEnd": "string",
        "counter": 1,
        "amount": 0,
        "description": "string",
        "amounts": [
          {
            "price": {
              "account": 1,
              "costCenter1": 1,
              "costCenter2": 1,
              "isNet": true,
              "taxCode": "string"
            },
            "appliedPause": {
              "rule": {
                "id": "string",
                "name": "string",
                "adjustment": {
                  "operator": "set",
                  "value": 0
                }
              },
              "startAt": "string",
              "endAt": "string"
            },
            "baseAmount": 1,
            "proRatedBaseAmount": 1,
            "adjustedAmount": 1,
            "proRatedAdjustedAmountBeforePause": 1,
            "proRatedAdjustedAmount": 1,
            "optionsAmount": 1,
            "proRatedOptionsAmountBeforePause": 1,
            "proRatedOptionsAmount": 1,
            "totalAmount": 1,
            "multiplyFactor": 1,
            "isDeviantStart": true,
            "isDeviantEnd": true,
            "isProRataStart": true,
            "isProRataEnd": true,
            "deviantStartDays": 1,
            "deviantEndDays": 1,
            "adjustments": [
              {
                "adjustment": {
                  "operator": "set",
                  "value": 1,
                  "type": "filter",
                  "id": "string",
                  "name": "string",
                  "description": "string",
                  "min": 0,
                  "max": 1,
                  "filter": {
                    "operator": "and",
                    "groups": [
                      null
                    ]
                  }
                },
                "description": "string"
              }
            ],
            "options": [
              {
                "option": {
                  "id": "string",
                  "name": "string",
                  "amount": {
                    "price": {
                      "isNet": true,
                      "price": 0,
                      "taxCode": null,
                      "account": 1,
                      "costCenter1": null,
                      "costCenter2": null
                    },
                    "proRataMode": "start",
                    "expression": {
                      "operator": "set",
                      "expression": null
                    },
                    "tiers": {
                      "expression": null,
                      "tiers": null
                    }
                  },
                  "description": "string",
                  "preSelected": true,
                  "oneTime": true,
                  "filter": {
                    "operator": "and",
                    "groups": [
                      null
                    ]
                  }
                },
                "amount": 1,
                "proRatedAmount": 1,
                "description": "string"
              }
            ],
            "description": "string",
            "voucherAmount": 1,
            "vouchers": [
              {
                "voucher": "000000000000000000000001",
                "name": "string",
                "code": "string",
                "usagePeriod": "string",
                "usageDate": "string",
                "amount": 1
              }
            ]
          }
        ],
        "dueAt": "string",
        "sepaDirectDebitPurpose": "string",
        "receiptTexts": {
          "title": "string",
          "intro": "string",
          "note": "string",
          "subject": "string",
          "message": "string"
        },
        "voucherAmount": 0,
        "plan": {
          "type": "membershipFee",
          "department": "000000000000000000000001",
          "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"
            }
          },
          "charge": {
            "isNet": true
          },
          "billing": {
            "receiptTemplate": "000000000000000000000001",
            "sepaDirectDebitCashAccount": "000000000000000000000001",
            "sepaDirectDebitSendReceipts": true,
            "sepaCreditTransferCashAccount": "000000000000000000000001"
          }
        }
      },
      "totalCollectedAmount": 0,
      "voucher": {
        "name": "string",
        "interval": "month",
        "amount": 1,
        "amountPercentage": true,
        "code": "string",
        "endAt": "string",
        "startAt": "string",
        "voucher": "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

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": []
}