Skip to main content

kobana dunning collection-rules

Commands of kobana dunning collection-rules. Every global option (Global options) applies here.

CommandHTTPDescription
collection-rules stepsGET /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
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​

List rule steps

kobana dunning collection-rules steps [ID] [OPTIONS] [COMMAND]

GET /v1/collection-rules/{id}/steps

Lists the rule steps ordered by position, with the message template embedded.

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on (id or public_id, listed by GET /v1/workspaces). Optional while the organization has a single workspace; with two or more, omitting it is 400 WORKSPACE_REQUIRED. A workspace of another organization is 403 UNKNOWN_WORKSPACE.

Responses

HTTPDescription
200Rule steps (data envelope, not paginated).
404Resource not found or outside your organization.
413Request body larger than 2 MB.

collection-rules steps create​

Create step

kobana dunning collection-rules steps create [ID] [OPTIONS]

POST /v1/collection-rules/{id}/steps

Creates a step on the rule. Without position it goes last; with position, following steps shift down.

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on (id or public_id, listed by GET /v1/workspaces). Optional while the organization has a single workspace; with two or more, omitting it is 400 WORKSPACE_REQUIRED. A workspace of another organization is 403 UNKNOWN_WORKSPACE.

Request body

NameTypeRequiredDescription
namestringyesStep name.
trigger_typestringyesTrigger (before_due | on_due | after_due). The after_issue/after_payment triggers can only be set via the rule. Values: before_due, on_due, after_due.
trigger_daysintegeryesDays relative to the trigger (0 = same day).
action_typestringyesAction (notification | negativation | protest | manual_task | negotiation_offer | judicial). Values: notification, negativation, protest, manual_task, negotiation_offer, judicial.
channelsarray<string>yesDelivery channels (email | sms | whatsapp | voice | manual).
message_template_idstring (uuid)noMessage template used by the step (must belong to the organization).
positionintegernoStep position in the rule (starts at 1).
tonestringnoMessage tone (friendly | neutral | firm | urgent). Values: friendly, neutral, firm, urgent, null.
preferred_timestringnoPreferred send time (e.g. 09:00).
activated_atstring (date-time)noActivation timestamp (null = inactive).
external_idstringnoIdentifier in YOUR system (integration key).
custom_dataobjectnoAPI-consumer custom metadata. Limits: 64 KB serialized and 16 nesting levels.
custom_metadataobjectnoUser metadata (free-form JSON object, read-write). See custom_data for the legacy field on core resources.
tagsarray<string>noFree-form tags.

More fields and nested objects: kobana schema dunning.collection-rules.steps.create.

Responses

HTTPDescription
201Step created (with message template).
400Invalid request (validation error).
404Resource not found or outside your organization.
413Request body larger than 2 MB.

collection-rules steps update​

Update step

kobana dunning collection-rules steps update [ID] [STEPID] [OPTIONS]

PUT /v1/collection-rules/{id}/steps/{stepId}

Updates a step (partial). Changing position automatically reorders the other steps.

Path arguments: id, stepId

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on (id or public_id, listed by GET /v1/workspaces). Optional while the organization has a single workspace; with two or more, omitting it is 400 WORKSPACE_REQUIRED. A workspace of another organization is 403 UNKNOWN_WORKSPACE.

Request body

NameTypeRequiredDescription
message_template_idstring (uuid)noMessage template used by the step (must belong to the organization).
positionintegernoStep position in the rule (starts at 1).
namestringnoStep name.
trigger_typestringnoTrigger (before_due | on_due | after_due). The after_issue/after_payment triggers can only be set via the rule. Values: before_due, on_due, after_due.
trigger_daysintegernoDays relative to the trigger (0 = same day).
action_typestringnoAction (notification | negativation | protest | manual_task | negotiation_offer | judicial). Values: notification, negativation, protest, manual_task, negotiation_offer, judicial.
channelsarray<string>noDelivery channels (email | sms | whatsapp | voice | manual).
tonestringnoMessage tone (friendly | neutral | firm | urgent). Values: friendly, neutral, firm, urgent, null.
preferred_timestringnoPreferred send time (e.g. 09:00).
activated_atstring (date-time)noActivation timestamp (null = inactive).
external_idstringnoIdentifier in YOUR system (integration key).
custom_dataobjectnoAPI-consumer custom metadata. Limits: 64 KB serialized and 16 nesting levels.
custom_metadataobjectnoUser metadata (free-form JSON object, read-write). See custom_data for the legacy field on core resources.
tagsarray<string>noFree-form tags.
custom_metadata_modestringnoHow the custom_metadata sent is reconciled with the stored value: replace (default) replaces the whole object; merge deep-merges — nested objects merge, scalars and arrays replace the key, and a key sent as null is stored as null (not removed). Update only. Values: replace, merge.

More fields and nested objects: kobana schema dunning.collection-rules.steps.update.

Responses

HTTPDescription
200Step updated (with message template).
400Invalid request (validation error).
404Resource not found or outside your organization.
413Request body larger than 2 MB.

collection-rules steps delete​

Delete step

kobana dunning collection-rules steps delete [ID] [STEPID] [OPTIONS]

DELETE /v1/collection-rules/{id}/steps/{stepId}

Soft-deletes a step and reorders the remaining ones. Fails with 409 if the step has associated notifications.

Path arguments: id, stepId

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on (id or public_id, listed by GET /v1/workspaces). Optional while the organization has a single workspace; with two or more, omitting it is 400 WORKSPACE_REQUIRED. A workspace of another organization is 403 UNKNOWN_WORKSPACE.

Responses

HTTPDescription
204Step deleted.
404Resource not found or outside your organization.
409Conflict with the current resource state (or reused idempotency key).
413Request body larger than 2 MB.

collection-rules list​

List collection rules

kobana dunning collection-rules list [OPTIONS]

GET /v1/collection-rules

Lists the organization’s collection rules, ordered by priority. _count.charges carries the number of active charges on the rule.

Query parameters

NameTypeRequiredDescription
pageintegernoPage number (starts at 1).
per_pageintegernoItems per page (max 100).
classification_idstringnoFilter by associated classification (UUID).
is_defaultstringnoFilter by default rule (true | false). Values: true, false.
activated_atstringnoFilter by activation: true = active, false = inactive. Values: true, false.
includestringnoComma-separated relations to embed. Supported: steps.

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on (id or public_id, listed by GET /v1/workspaces). Optional while the organization has a single workspace; with two or more, omitting it is 400 WORKSPACE_REQUIRED. A workspace of another organization is 403 UNKNOWN_WORKSPACE.

Responses

HTTPDescription
200Paginated collection rule list.
400Invalid request (validation error).
404Resource not found or outside your organization.
413Request body larger than 2 MB.

collection-rules create​

Create collection rule

kobana dunning collection-rules create [OPTIONS]

POST /v1/collection-rules

Creates a collection rule, optionally with steps. Setting is_default unsets the previous default rule.

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on (id or public_id, listed by GET /v1/workspaces). Optional while the organization has a single workspace; with two or more, omitting it is 400 WORKSPACE_REQUIRED. A workspace of another organization is 403 UNKNOWN_WORKSPACE.

Request body

NameTypeRequiredDescription
namestringyesRule name.
classification_idstring (uuid)noCustomer classification served by the rule (segmentation).
descriptionstringnoRule description.
is_defaultbooleannotrue when this is the organization’s default rule (only one).
priorityintegernoPriority when selecting a rule (higher wins).
activated_atstring (date-time)noActivation timestamp (null = inactive).
external_idstringnoIdentifier in YOUR system (integration key).
custom_dataobjectnoAPI-consumer custom metadata. Limits: 64 KB serialized and 16 nesting levels.
custom_metadataobjectnoUser metadata (free-form JSON object, read-write). See custom_data for the legacy field on core resources.
tagsarray<string>noFree-form tags.
stepsarray<object>noRule steps ordered by position (present with include=steps and in create/update responses).

More fields and nested objects: kobana schema dunning.collection-rules.create.

Responses

HTTPDescription
201Collection rule created (with classification and steps).
400Invalid request (validation error).
404Resource not found or outside your organization.
413Request body larger than 2 MB.

collection-rules get​

Get collection rule

kobana dunning collection-rules get [ID] [OPTIONS]

GET /v1/collection-rules/{id}

Returns a collection rule by ID. Use include=steps to embed the steps.

Path arguments: id

Query parameters

NameTypeRequiredDescription
includestringnoComma-separated relations to embed. Supported: steps.

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on (id or public_id, listed by GET /v1/workspaces). Optional while the organization has a single workspace; with two or more, omitting it is 400 WORKSPACE_REQUIRED. A workspace of another organization is 403 UNKNOWN_WORKSPACE.

Responses

HTTPDescription
200Collection rule found (data envelope).
404Resource not found or outside your organization.
413Request body larger than 2 MB.

collection-rules update​

Update collection rule

kobana dunning collection-rules update [ID] [OPTIONS]

PUT /v1/collection-rules/{id}

Updates the rule data (partial). The steps array, when sent, upserts and removes missing steps.

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on (id or public_id, listed by GET /v1/workspaces). Optional while the organization has a single workspace; with two or more, omitting it is 400 WORKSPACE_REQUIRED. A workspace of another organization is 403 UNKNOWN_WORKSPACE.

Request body

NameTypeRequiredDescription
classification_idstring (uuid)noCustomer classification served by the rule (segmentation).
namestringnoRule name.
descriptionstringnoRule description.
is_defaultbooleannotrue when this is the organization’s default rule (only one).
priorityintegernoPriority when selecting a rule (higher wins).
activated_atstring (date-time)noActivation timestamp (null = inactive).
external_idstringnoIdentifier in YOUR system (integration key).
custom_dataobjectnoAPI-consumer custom metadata. Limits: 64 KB serialized and 16 nesting levels.
custom_metadataobjectnoUser metadata (free-form JSON object, read-write). See custom_data for the legacy field on core resources.
tagsarray<string>noFree-form tags.
stepsarray<object>noFull step set (upsert): with id updates, without id creates, missing ones are removed.
custom_metadata_modestringnoHow the custom_metadata sent is reconciled with the stored value: replace (default) replaces the whole object; merge deep-merges — nested objects merge, scalars and arrays replace the key, and a key sent as null is stored as null (not removed). Update only. Values: replace, merge.

More fields and nested objects: kobana schema dunning.collection-rules.update.

Responses

HTTPDescription
200Collection rule updated (data envelope).
400Invalid request (validation error).
404Resource not found or outside your organization.
413Request body larger than 2 MB.

collection-rules delete​

Delete collection rule

kobana dunning collection-rules delete [ID] [OPTIONS]

DELETE /v1/collection-rules/{id}

Soft-deletes the rule and its steps. Fails with 409 if any charge uses the rule.

Path arguments: id

Headers

NameTypeRequiredDescription
X-Workspace-IdstringnoWorkspace the call acts on (id or public_id, listed by GET /v1/workspaces). Optional while the organization has a single workspace; with two or more, omitting it is 400 WORKSPACE_REQUIRED. A workspace of another organization is 403 UNKNOWN_WORKSPACE.

Responses

HTTPDescription
204Collection rule deleted.
404Resource not found or outside your organization.
409Conflict with the current resource state (or reused idempotency key).
413Request body larger than 2 MB.