Skip to main content

kobana dunning agreements

Commands of kobana dunning agreements. Every global option (Global options) applies here.

CommandHTTPDescription
agreements installmentsGET /v1/agreements/{id}/installmentsList agreement installments
agreements installments updatePUT /v1/agreements/{id}/installmentsUpdate agreement installment
agreements listGET /v1/agreementsList agreements
agreements createPOST /v1/agreementsCreate agreement
agreements getGET /v1/agreements/{id}Get agreement
agreements updatePUT /v1/agreements/{id}Update agreement
agreements deleteDELETE /v1/agreements/{id}Delete agreement
agreements acceptPOST /v1/agreements/{id}/acceptAccept agreement
agreements cancelPOST /v1/agreements/{id}/cancelCancel agreement
agreements pdfGET /v1/agreements/{id}/pdfAgreement term (PDF)

agreements installments​

List agreement installments

kobana dunning agreements installments [ID] [OPTIONS] [COMMAND]

GET /v1/agreements/{id}/installments

Lists an agreement’s installments (ordered by number) with an aggregated summary.

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
200Agreement installments with summary.
404Resource not found or outside your organization.
413Request body larger than 2 MB.

agreements installments update​

Update agreement installment

kobana dunning agreements installments update [ID] [OPTIONS]

PUT /v1/agreements/{id}/installments

Updates an installment (payment/status). Allowed only for accepted or active agreements; cancelled installments cannot be changed (409). The first payment activates the agreement; once all installments are paid, the agreement is completed.

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
installment_numberintegeryesInstallment number (starts at 1).
paid_amountnumbernoAmount paid for the installment.
paid_atstringnoInstallment payment date.
statusstringnoStatus (pending | paid | overdue | cancelled). Values: pending, paid, overdue, cancelled.
custom_metadataobjectnoUser metadata (free-form JSON object, read-write). See custom_data for the legacy field on core resources.
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.agreements.installments.update.

Responses

HTTPDescription
200Installment updated (returns the installment and the updated agreement).
400Invalid request (validation error).
404Resource not found or outside your organization.
409Conflict with the current resource state (or reused idempotency key).
413Request body larger than 2 MB.

agreements list​

List agreements

kobana dunning agreements list [OPTIONS]

GET /v1/agreements

Lists the organization’s agreements with pagination and filters.

Query parameters

NameTypeRequiredDescription
pageintegernoPage number (starts at 1).
per_pageintegernoItems per page (max 100).
sort_bystringnoSort field (public snake_case name, e.g. due_date).
sort_orderstringnoSort direction (asc | desc). Values: asc, desc.
statusstringnoFilter by agreement status. Values: proposed, accepted, active, completed, cancelled, defaulted.
person_idstringnoFilter by a customer’s agreements (UUID).
includestringnoRelations to include in the response (person, installments, negotiation_offer).

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 agreement list.
404Resource not found or outside your organization.
413Request body larger than 2 MB.

agreements create​

Create agreement

kobana dunning agreements create [OPTIONS]

POST /v1/agreements

Creates an agreement with proposed status. final_total = original_total − discount_amount (must be greater than zero) and installment_value = final_total / number_of_installments.

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
person_idstring (uuid)yesCustomer (debtor) of the agreement.
original_totalnumberyesOriginal total of the renegotiated debt.
number_of_installmentsintegeryesNumber of installments (1 to 120).
first_due_datestringyesFirst installment due date (the rest fall due monthly).
negotiation_offer_idstring (uuid)noNegotiation offer that originated the agreement.
discount_amountnumbernoGranted discount (default 0).
terms_acceptedstringnoTerms accepted by the debtor (text/version).
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.agreements.create.

Responses

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

agreements get​

Get agreement

kobana dunning agreements get [ID] [OPTIONS]

GET /v1/agreements/{id}

Returns an agreement by ID (always includes summarized customer data).

Path arguments: id

Query parameters

NameTypeRequiredDescription
includestringnoRelations to include in the response (installments, negotiation_offer).

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
200Agreement found.
404Resource not found or outside your organization.
413Request body larger than 2 MB.

agreements update​

Update agreement

kobana dunning agreements update [ID] [OPTIONS]

PUT /v1/agreements/{id}

Updates an agreement (partial). Allowed only while status is proposed or accepted (409 otherwise).

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
original_totalnumbernoOriginal total of the renegotiated debt.
discount_amountnumbernoGranted discount (default 0).
number_of_installmentsintegernoNumber of installments (1 to 120).
first_due_datestringnoFirst installment due date (the rest fall due monthly).
terms_acceptedstringnoTerms accepted by the debtor (text/version).
external_idstringnoIdentifier in YOUR system (integration key).
custom_dataobjectnoAPI-consumer custom metadata. Limits: 64 KB serialized and 16 nesting levels.
custom_data_modestringnoHow custom_data is applied on update: replace (default) overwrites the whole object; merge deep-merges the payload over the stored value — nested objects merge, scalars/arrays/null overwrite the key. Values: replace, merge.
custom_metadataobjectnoUser metadata (free-form JSON object, read-write). See custom_data for the legacy field on core resources.
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.
tagsarray<string>noFree-form tags.

More fields and nested objects: kobana schema dunning.agreements.update.

Responses

HTTPDescription
200Agreement updated.
400Invalid request (validation error).
404Resource not found or outside your organization.
409Conflict with the current resource state (or reused idempotency key).
413Request body larger than 2 MB.

agreements delete​

Delete agreement

kobana dunning agreements delete [ID] [OPTIONS]

DELETE /v1/agreements/{id}

Soft-deletes an agreement, marking it cancelled. completed agreements cannot be deleted (409).

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
204Agreement deleted.
404Resource not found or outside your organization.
409Conflict with the current resource state (or reused idempotency key).
413Request body larger than 2 MB.

agreements accept​

Accept agreement

kobana dunning agreements accept [ID] [OPTIONS]

POST /v1/agreements/{id}/accept

Accepts a proposed agreement (409 for other statuses): records accepted_at/accepted_ip and creates the installments with monthly due dates starting at first_due_date.

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
accepted_ipstringnoIP recorded on acceptance (audit trail).
terms_acceptedstringnoTerms accepted by the debtor (text/version).

More fields and nested objects: kobana schema dunning.agreements.accept.

Responses

HTTPDescription
200Agreement accepted (returns the agreement with the created installments).
400Invalid request (validation error).
404Resource not found or outside your organization.
409Conflict with the current resource state (or reused idempotency key).
413Request body larger than 2 MB.

agreements cancel​

Cancel agreement

kobana dunning agreements cancel [ID] [OPTIONS]

POST /v1/agreements/{id}/cancel

Cancels an agreement, recording cancelled_at and the reason, and cancels pending/overdue installments. completed or already-cancelled agreements return 409.

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
reasonstringyesCancellation reason (required; stored in cancellation_reason).

More fields and nested objects: kobana schema dunning.agreements.cancel.

Responses

HTTPDescription
200Agreement cancelled (returns the agreement with its installments).
400Invalid request (validation error).
404Resource not found or outside your organization.
409Conflict with the current resource state (or reused idempotency key).
413Request body larger than 2 MB.

agreements pdf​

Agreement term (PDF)

kobana dunning agreements pdf [ID] [OPTIONS]

GET /v1/agreements/{id}/pdf

Generates the agreement term as a PDF (legal document) with creditor, debtor, totals and installments, scoped to the organization. Responds with application/pdf as a binary attachment.

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
200Agreement term PDF (binary application/pdf attachment).
404Resource not found or outside your organization.
413Request body larger than 2 MB.