Skip to content
campaiDeveloper
campai.com

Crm · Plans

POST/{organizationId}/{mandateId}/crm/plans/chargeFunctions/calculate

Calculate a charge amount function

'Runs the function of a published developer app that calculates the charge amount of a subscription ' + 'for a contact and returns its number, or the reason when the function failed'

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
Also checked, depending on the request and the records it touches
  • contact:member.read
  • contact:address.read
  • contact:customer.read
  • contact:sponsor.read
  • contact:contributor.read
  • contact:employee.read
  • contact:supplier.read

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired

Body

Content-Type: application/json

  • optionsstring[]required

    each at least 1 characters

  • startAtstringrequired
  • endAtstringrequirednullable
  • customFieldsFormDatarequired

    The answers of a form, by the ID of each field. A repeating group holds a list of its entries under its own ID.

  • flexibleIntervalstringrequirednullable
    month quarter halfYear year
  • fixedAmountintegerrequirednullable

    0–9999999999

  • pauseobjectrequirednullable
    3 properties
    • ruleIdstringrequired

      exactly 8 characters

    • startAtstringrequired
    • endAtstringrequired
  • contactIdidrequired
  • functionobjectrequired
    3 properties
    • operatorstringrequired
      set add subtract addPercentage subtractPercentage divideBy multiplyBy
    • appidrequired
    • groupidrequired
  • periodobjectrequired
    6 properties
    • periodStartstringrequired
    • periodEndstringrequired
    • flexiblePeriodStartstringrequirednullable
    • flexiblePeriodEndstringrequirednullable
    • collectAtstringrequirednullable
    • dueAtstringrequirednullable
  • planobjectrequired
    2 properties
    • namestringrequired

      1–64 characters

    • departmentidrequirednullable
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/crm/plans/chargeFunctions/calculate' \
  --header 'X-API-Key: YOUR_API_KEY'

No request that worked has been recorded yet, so the body is not shown.

Response

200 Successful response

Content-Type: application/json

  • amountnumbernullable
  • errorstringnullable
Response200
{
  "amount": 1,
  "error": "string"
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.