Skip to content
campaiDeveloper
campai.com

Crm · Contracts · Statistics

GET/{organizationId}/{mandateId}/crm/contracts/statistics/collectedAmountsReads only

Get collected amounts

Returns the amount in cents collected through contract collections in a period and in the period of the same length right before it, with its monthly split by payment method. The amounts leave out draft, canceled and archived receipts. It also returns the amount per plan from the same receipts, splitting a receipt for several subscriptions evenly between them

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Permission checks in detail
Required permissions
  • mandate.read
  • plan.read
  • contract.read
  • contractCollection.read

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired

Query parameters

  • fromDatestringrequired
  • toDatestringrequired
Request
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/contracts/statistics/collectedAmounts' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

Content-Type: application/json

  • totalAmountnumber
  • previousTotalAmountnumber
  • monthsobject[]
    7 properties
    • datestring
    • totalAmountnumber
    • sepaDirectDebitnumber
    • onlinenumber
    • sepaCreditTransfernumber
    • cashnumber
    • nonenumber
  • plansobject[]
    2 properties
    • planIdid
    • amountnumber
Response200
{
  "totalAmount": 1,
  "previousTotalAmount": 1,
  "months": [
    {
      "date": "string",
      "totalAmount": 1,
      "sepaDirectDebit": 1,
      "online": 1,
      "sepaCreditTransfer": 1,
      "cash": 1,
      "none": 1
    }
  ],
  "plans": [
    {
      "planId": "000000000000000000000001",
      "amount": 1
    }
  ]
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.