Skip to content
campaiDeveloper
campai.com

Finance · Cash · Transactions

POST/{organizationId}/{mandateId}/finance/cash/transactions/rules/previewReads only

Preview cash transaction rule

Previews a cash transaction rule for a mandate using the supplied matcher. Returns the number of matching existing transactions and up to five of the most recent. Nothing is saved or changed.

Permissions

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

Who may call it

  • The caller must have access to the organization.
  • The caller needs the mandate.read permission.
  • The caller needs the cashTransaction.read permission.

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired

Body

Content-Type: application/json

  • matcherobjectrequired
    5 properties
    • typeMatchstringrequired
      revenue expense
    • amountobject
      2 properties
      • valueintegerrequired
      • comparatorstringrequired
        equals lessThan lessEqual greaterThan greaterEqual
    • purposeobject
    • counterpartNameobject
    • counterpartAccountobject
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/finance/cash/transactions/rules/preview' \
  --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

  • countnumber
  • cashTransactionsobject[]
    6 properties
    • _idid
    • datestring
    • amountinteger

      at most 9999999999

    • purposestring

      at most 1000 characters

    • infostring

      at most 200 characters

    • counterpartNamestring

      at most 200 characters

Response200
{
  "count": 1,
  "cashTransactions": [
    {
      "_id": "000000000000000000000001",
      "date": "string",
      "amount": 1,
      "purpose": "string",
      "info": "string",
      "counterpartName": "string"
    }
  ]
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.