AltScore
Credit Management System (CMS)

Debts API

This API allows managing debts in the system. It provides endpoints to list, create, get details, and perform various operations related to debts.

The CMS Base URL is used (see introduction).

The Debt Object

The Debt object represents a debt in the system.

{
  "debtId": "89480edc-d0e2-4e59-96ce-e705a3b6e1c4",
  "flowId": "a3a424c6-e34c-4519-933a-7e44fb016c40",
  "client": {
    "clientId": "e732bc5f-5b84-4a0a-81b4-5354d4625a8b",
    "partnerId": "6457c3ce-3887-45d6-92ca-299219ea96db",
    "externalId": "cli:32321",
    "legalName": "Frodo Baggins",
    "email": "mcgiber@irepair.com"
  },
  "disbursedAt": "2023-01-08",
  "referenceId": "PO-1234",
  "status": "active",
  "subStatus": "overdue",
  "terms": {
    "principal": {
      "amount": "100000.00",
      "currency": "ARS"
    },
    "repayEvery": 15,
    "interestRate": {
      "rate": "12.50",
      "period": 30
    },
    "installments": 2,
    "amortizationType": "equal_total",
    "disbursementDate": "2023-01-08",
    "interestTax": 12.5,
    "timezone": "America/Argentina/Buenos_Aires",
    "calendarType": "BusinessDays",
    "loanTermDuration": 30
  },
  "schedule": [
    {
      "number": 1,
      "dueDate": "2023-11-29",
      "originalAmounts": {
        "principal": {
          "amount": "25000.00",
          "currency": "ARS"
        },
        "interest": {
          "amount": "1250.00",
          "currency": "ARS"
        },
        "fees": {
          "amount": "0.00",
          "currency": "ARS"
        },
        "taxes": {
          "amount": "0.00",
          "currency": "ARS"
        },
        "total": {
          "amount": "26250.00",
          "currency": "ARS"
        }
      },
      "status": "overdue",
      "balance": {
        "principal": {
          "amount": "25000.00",
          "currency": "ARS"
        },
        "interest": {
          "amount": "1250.00",
          "currency": "ARS"
        },
        "fees": {
          "amount": "0.00",
          "currency": "ARS"
        },
        "taxes": {
          "amount": "0.00",
          "currency": "ARS"
        },
        "total": {
          "amount": "26250.00",
          "currency": "ARS"
        }
      },
      "daysPastDue": 10
    }
  ],
  "balance": {
    "principal": {
      "amount": "25000.00",
      "currency": "ARS"
    },
    "interest": {
      "amount": "1250.00",
      "currency": "ARS"
    },
    "fees": {
      "amount": "0.00",
      "currency": "ARS"
    },
    "taxes": {
      "amount": "0.00",
      "currency": "ARS"
    },
    "total": {
      "amount": "26250.00",
      "currency": "ARS"
    }
  },
  "daysPastDue": 10,
  "maxDaysPastDue": 30,
  "oldestDueDate": "2023-12-18",
  "source": "simple_credit",
  "totalDebtAmount": {
    "amount": "26250.00",
    "currency": "ARS"
  },
  "totalPaymentsAmount": {
    "amount": "0.00",
    "currency": "ARS"
  },
  "createdAt": "2021-01-01T00:00:00Z",
  "updatedAt": "2021-01-01T00:00:00Z"
}

Attributes

AttributeDescriptionType
debtIdUnique identifier of the debtString (UUID)
flowIdIdentifier of the associated flowString (UUID)
clientClient informationObject
disbursedAtDisbursement dateString (Date)
referenceIdReference identifierString
statusDebt statusString
subStatusDebt sub-statusString
termsDebt termsObject
schedulePayment scheduleArray of Object
balanceCurrent debt balanceObject
daysPastDueDays past dueInteger
maxDaysPastDueMaximum days past dueInteger
oldestDueDateOldest due dateString (Date)
sourceDebt sourceString
totalDebtAmountTotal debt amountObject
totalPaymentsAmountTotal amount of payments madeObject
createdAtCreation dateString (DateTime)
updatedAtLast update dateString (DateTime)

Debt Status

StatusKeyDescription
Unknown""The debt is in an unknown state, possibly not started.
Pending"pending"The debt is pending approval.
Approved"approved"The debt has been approved and is ready to be disbursed.
Active"active"The debt has been disbursed, and payments can be received.
Closed"closed"The debt has been closed, and all payments have been fulfilled.
Canceled"canceled"The debt was canceled, and no further payments are expected.

Debt Sub-Statuses

Sub-StatusKeyAssociated StatusDescription
Active"active"ActiveThe debt is active and payments can be received.
Due"due"ActiveThe debt is active with a payment due today (in UTC time)
Overdue"overdue"ActiveThe debt is active and at least one payment is overdue.
Paid"paid"ClosedThe debt was fully paid and is now closed.
Overpaid"overpaid"ClosedThe debt was fully paid and closed, but the last payment was greater than the remaining debt balance.
InRefinancing"refinancing"ActiveThe debt is in the process of refinancing, indicating that terms are being renegotiated.
Refinanced"refinanced"ClosedThe debt has been successfully refinanced with new terms, and the previous debt has been settled under the new terms.

Debt Terms

The terms object contains the terms and conditions under which the debt was created.

AttributeDescriptionTypeAllowed Values
principalPrincipal amount of the debtObject
repayEveryPayment frequency in daysInteger
interestRateInterest rate of the debtObject
installmentsNumber of installmentsInteger
amortizationTypeType of amortizationString
disbursementDateDisbursement dateString (Date)
interestTaxInterest taxNumber
timezoneTimezone for calculationsString
calendarTypeCalendar type for date calculationsStringCustom, BusinessDays, NaturalDays
loanTermDurationTotal loan duration in daysInteger

Endpoints

List Debts

Retrieves a paginated list of debts with filtering and sorting options.

GET /v1/debts

Query Parameters:

ParameterDescriptionType
client-idComma-separated list of client IDsArray of UUID
flow-idID of the associated flowUUID
external-idClient's external IDString
tax-idClient's tax IDString
statusStatus of debts to returnArray of String
disbursed-fromInitial disbursement dateDate
disbursed-toFinal disbursement dateDate
sort-bySorting field and directionString
sub-statusSub-status of debts to returnArray of String
oldest-due-date-fromInitial oldest due dateDate
oldest-due-date-toFinal oldest due dateDate
offsetNumber of items to skipInteger
limitMaximum number of items to returnInteger
pagePage numberInteger
per-pageItems per pageInteger
sort-directionSorting direction (asc or desc)String

Successful Response:

The response will be a paginated list of Debt objects.

Create a Debt

Creates a new debt from a flow, using the terms and schedule extracted from the flow.

POST /v1/debts

Input Parameters:

ParameterDescriptionTypeRequired
flowIdID of the flow associated with the debtUUIDYes
disbursedAtDebt disbursement dateDateNo
amountAmount and currency of the debtObjectYes

Request Example:

{
  "flowId": "a3a424c6-e34c-4519-933a-7e44fb016c40",
  "disbursedAt": "2023-01-08",
  "amount": {
    "amount": "100000.00",
    "currency": "ARS"
  }
}

Successful Response:

Status code 201 (Created) if the debt was successfully created.

Get a Debt

Retrieves detailed information of a specific debt.

GET /v1/debts/:debt_id

Path Parameters:

ParameterDescription
debt_idID of the debt to retrieve

Query Parameters:

ParameterDescription
dateToAnalyzeDate to analyze the balance and transactions

Successful Response:

The response will be a complete Debt object.

Add a Credit Note to a Debt

Adds a credit note to a specific debt.

POST /v1/debts/:debt_id/credit-notes

Path Parameters:

ParameterDescription
debt_idID of the debt

Input Parameters:

ParameterDescriptionTypeRequired
referenceIdUnique reference ID of the credit noteStringYes
amountAmount and currency of the credit noteObjectYes
creditNoteDateDate of the credit noteDateYes
breakdownBreakdown of the credit note componentsObjectNo
notesAdditional notesStringNo

Request Example:

{
  "referenceId": "CN-1234",
  "amount": {
    "amount": "5000.00",
    "currency": "ARS"
  },
  "creditNoteDate": "2023-05-15",
  "breakdown": {
    "principal": {
      "amount": "4000.00",
      "currency": "ARS"
    },
    "interest": {
      "amount": "1000.00",
      "currency": "ARS"
    }
  },
  "notes": "Partial refund for defective product"
}

Successful Response:

Status code 204 (No Content) if the credit note was successfully added.

Get Events of a Debt

Retrieves the list of events in the history of a specific debt.

GET /v1/debts/:debt_id/events

Path Parameters:

ParameterDescription
debt_idID of the debt

Successful Response:

The response will be a list of Event objects related to the debt.

List Payments of a Debt

Retrieves the list of payments received for a specific debt.

GET /v1/debts/:debt_id/payments

Path Parameters:

ParameterDescription
debt_idID of the debt

Successful Response:

The response will be a list of Payment objects related to the debt.

Add a Payment to a Debt

Adds a new payment to a specific debt.

POST /v1/debts/:debt_id/payments

Path Parameters:

ParameterDescription
debt_idID of the debt

Input Parameters:

ParameterDescriptionTypeRequired
referenceIdUnique reference ID of the paymentStringYes
paymentDatePayment dateDateYes
amountAmount and currency of the paymentObjectYes
notesAdditional notesStringNo

Request Example:

{
  "referenceId": "PAY-1234",
  "paymentDate": "2023-05-20",
  "amount": {
    "amount": "26250.00",
    "currency": "ARS"
  },
  "notes": "Payment of the first installment"
}

Successful Response:

Status code 204 (No Content) if the payment was successfully added.

Add a Payment by Reference ID

Adds a payment to a debt identified by your referenceId (the invoice/PO number you supplied when creating the debt). Equivalent to the previous endpoint, but avoids having to resolve the debtId UUID first.

POST /v1/debts/payments/:reference_id

Path Parameters:

ParameterDescription
reference_idYour referenceId for the debt

Input Parameters:

Same as POST /v1/debts/:debt_id/payments.

Successful Response:

Status code 204 (No Content) if the payment was successfully added.

Reverse a Payment on a Debt

Reverses a previously-reported payment, identified by its referenceId.

POST /v1/debts/:debt_id/payments/reversal

Path Parameters:

ParameterDescription
debt_idID of the debt

Input Parameters:

ParameterDescriptionTypeRequired
referenceIdreferenceId of the payment to reverseStringYes
notesReason for the reversalStringNo

Request Example:

{
  "referenceId": "PAY-1234",
  "notes": "Payment bounced at bank"
}

Successful Response:

Status code 204 (No Content) if the reversal was successfully applied.

List Penalties of a Debt

Retrieves the list of penalties applied to a specific debt.

GET /v1/debts/:debt_id/penalties

Path Parameters:

ParameterDescription
debt_idID of the debt

Successful Response:

The response will be a list of Transaction objects representing the debt penalties.

Add a Waiver to a Debt

Adds a waiver to a specific debt.

POST /v1/debts/:debt_id/waivers

Path Parameters:

ParameterDescription
debt_idID of the debt

Input Parameters:

ParameterDescriptionTypeRequired
referenceIdUnique reference ID of the waiverStringYes
amountAmount and currency of the waiverObjectYes
waiverDateWaiver dateDateYes
breakdownBreakdown of the waiver componentsObjectYes
notesAdditional notesStringNo

Request Example:

{
  "referenceId": "WV-1234",
  "amount": {
    "amount": "500.00",
    "currency": "ARS"
  },
  "waiverDate": "2023-05-25",
  "breakdown": {
    "penalties": {
      "amount": "500.00",
      "currency": "ARS"
    }
  },
  "notes": "Waiver of penalties as a goodwill gesture for the client"
}

Successful Response:

Status code 204 (No Content) if the waiver was successfully added.

Query Transactions Across Debts

Cross-debt transaction query, filtered by type and date range. Handy for reconciliation (e.g., pulling all penalties posted in the last month).

GET /v1/debts/transactions

Query Parameters:

ParameterDescriptionType
typeTransaction type (payment, penalty, credit-note, ...)String
transaction-date-fromInclusive start dateDate
transaction-date-toInclusive end dateDate
external-idClient's external IDString
client-idClient IDUUID
offsetNumber of items to skipInteger
limitMaximum items to returnInteger

Successful Response:

A list of Transaction objects.

Export Debts

Schedules a batch export of debts matching the filters. Returns an exportId you can poll.

POST /v1/exports/debts
GET  /v1/exports/debts
GET  /v1/exports/debts/:export_id

See the /v1/exports subresource for the full export lifecycle (create, list, download).

Error Handling

The API may return the following error codes:

CodeDescription
400Bad Request
401Unauthorized
403Forbidden
404Not Found
409Conflict
500Internal Server Error

Errors will include a descriptive message in the response body.