Skip to main content

Collection rules

The rule itself: the sequence of steps that fires messages, tasks, credit-bureau reports or protests as a charge approaches its due date and ages. Steps are managed under steps, each with its trigger (before_due, on_due, after_due + days), its action and its channels.

CommandHTTPDescription
collection-rules listGET /v1/collection-rulesList collection rules
collection-rules createPOST /v1/collection-rulesCreate collection rule
collection-rules getGET /v1/collection-rules/{id}Get collection rule
collection-rules updatePUT /v1/collection-rules/{id}Update collection rule
collection-rules deleteDELETE /v1/collection-rules/{id}Delete collection rule
collection-rules steps getGET /v1/collection-rules/{id}/stepsList rule steps
collection-rules steps createPOST /v1/collection-rules/{id}/stepsCreate step
collection-rules steps updatePUT /v1/collection-rules/{id}/steps/{stepId}Update step
collection-rules steps deleteDELETE /v1/collection-rules/{id}/steps/{stepId}Delete step

Examples​

--params carries query, path and header parameters (id, page, filters, X-Workspace-Id); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.

# List collection rules
kobana dunning collection-rules list --fields "id,name,classification_id,is_default,activated_at"

# Create a collection rule
kobana dunning collection-rules create \
--json '{"name": "Régua padrão", "is_default": true}'

# List a rule's steps
kobana dunning collection-rules steps get --params '{"id": "RULE_ID"}'

# Add a step: e-mail 3 days before the due date
kobana dunning collection-rules steps create \
--params '{"id": "RULE_ID"}' \
--json '{"name": "Lembrete D-3", "trigger_type": "before_due", "trigger_days": 3, "action_type": "notification", "channels": ["email"]}'

# Delete a step
kobana dunning collection-rules steps delete --params '{"id": "RULE_ID", "stepId": "STEP_ID"}' --dry-run

Next steps​