Skip to content

Case

Access cases in the Amili system. Cases represent collection matters with associated invoices, customer information, and status tracking.

Case Management endpoints

See Case Registration and Invoice Registration for case creation.

Example Request

Below is an example of retrieving a specific case. Other operations follow similar request/response patterns with the same data structure.

URL: GET /cases/6867da7788b9226bb78d716c

Headers:

x-api-key: {your_access_token}
Content-Type: application/json

Request Body: None (GET request)

Response Code: 200 OK

Response Body:

json
{
  "_id": "6867da7788b9226bb78d716c",
  "debt": {
    "invoice_number": "103118",
    "debt_reference": "1031186",
    "payout_reference": "1031186",
    "invoice_date": "Tue, 25 Jun 2025 00:00:00 GMT",
    "invoice_due_days_after_invoice_date": 30,
    "interest_days_after_invoice_date": 30,
    "initial_capital": 300.0,
    "capital_to_claim": 300.0,
    "debt_description": "Services"
  },
  "creditor": "671a133fc9e282cfad3ffeb6",
  "_created": "Mon, 30 Aug 2025 07:06:05 GMT",
  "_etag": "e291a3c19b834a11960187af",
  "_updated": "Mon, 30 Aug 2025 07:06:05 GMT",
  "agreement_version": "60e7fdefc90dc3e2ddd6c7ac",
  "case_registration": "60e7fdefc90dc3e2ddd6c7ad",
  "case_settings": {
    "interest_rate": {
      "reference_rate": true
    }
  },
  "creditor_name": "Integration team AB",
  "currency": "SEK",
  "customer": "60e7fdefc90dc3e2ddd6c7ae",
  "customer_id_number": "7766554433",
  "customer_name": "Integration team",
  "customer_number": "12345",
  "customer_status": "initialized",
  "latest_state_date": "Mon, 30 Aug 2025 07:06:05 GMT",
  "local_added_capital_amount": 300.0,
  "local_added_costs_amount": 0,
  "local_added_interest_amount": 0.0,
  "local_added_transaction_amount": 300.0,
  "local_remaining_capital_amount": 300.0,
  "local_remaining_costs_amount": 0,
  "local_remaining_interest_amount": 0.0,
  "local_remaining_transaction_amount": 300.0,
  "state": "initializing",
  "state_history": [
    {
      "state": "initializing",
      "status_date": "Mon, 30 Aug 2025 07:06:05 GMT"
    }
  ],
  "status": "initialized",
  "status_history": [
    {
      "status": "initializing",
      "status_date": "Mon, 30 Aug 2025 07:06:05 GMT"
    },
    {
      "status": "initialized",
      "status_date": "Mon, 30 Aug 2025 07:07:07 GMT"
    }
  ],
  "total_added_capital_amount": 300.0,
  "total_added_costs_amount": 0,
  "total_added_interest_amount": 0.0,
  "total_added_transaction_amount": 300.0,
  "total_remaining_capital_amount": 300.0,
  "total_remaining_costs_amount": 0,
  "total_remaining_interest_amount": 0.0,
  "total_remaining_transaction_amount": 300.0,
  "transactions": [
    {
      "bank_transaction_date": "Tue, 25 Jun 2025 00:00:00 GMT",
      "registration_date": "Mon, 30 Aug 2025 07:06:05 GMT",
      "origin": "creditor_system",
      "type": "capital",
      "description_locale_tag": "api.transaction.case_registration",
      "amount": 300.0
    }
  ],
  "reference_number": "123456",
  "original_invoice": {
    "id": "8be4d5fc86d77d226b0f83f8593de423",
    "filename": "original_invoice.pdf",
    "content_type": "application/pdf",
    "size": 358131
  }
}

Parameters

Path Parameters

NameTypeRequiredDescription
caseIdstringYesThe unique identifier of the case

Response Properties

PropertyTypeRequiredDescription
_idstringYesUnique identifier for the case
_createdstringYesCreation timestamp
_updatedstringYesLast update timestamp
_etagstringYesEntity tag for concurrency control
creditorstringYesCreditor ID
creditor_namestringYesName of the creditor
customerstringYesCustomer ID
customer_namestringYesName of the customer
customer_id_numberstringYesCustomer's personal ID or organization number
customer_numberstringNoCustomer's reference number
customer_statusstringYesCurrent customer status (e.g. "initialized")*
reference_numberstringNoReference number from creditor
currencystringYesCurrency code (e.g. "SEK")
statestringYesCurrent state (e.g. "initializing")*
state_historyarrayYesHistory of state changes
statusstringYesCurrent status (e.g. "initialized")*
status_historyarrayYesHistory of status changes
latest_state_datestringYesTimestamp of latest state change
agreement_versionstringYesAgreement version ID
case_registrationstringYesCase registration ID
case_settingsobjectYesCase specific settings
debtobjectYesDebt information
transactionsarrayYesList of transactions
total_added_capital_amountnumberYesTotal capital amount added
total_added_costs_amountnumberYesTotal costs amount added
total_added_interest_amountnumberYesTotal interest amount added
total_added_transaction_amountnumberYesTotal transaction amount added
total_remaining_capital_amountnumberYesRemaining capital amount
total_remaining_costs_amountnumberYesRemaining costs amount
total_remaining_interest_amountnumberYesRemaining interest amount
total_remaining_transaction_amountnumberYesRemaining transaction amount
local_added_capital_amountnumberYesCapital amount added in local currency
local_added_costs_amountnumberYesCosts amount added in local currency
local_added_interest_amountnumberYesInterest amount added in local currency
local_added_transaction_amountnumberYesTransaction amount added in local currency
local_remaining_capital_amountnumberYesRemaining capital amount in local currency
local_remaining_costs_amountnumberYesRemaining costs amount in local currency
local_remaining_interest_amountnumberYesRemaining interest amount in local currency
local_remaining_transaction_amountnumberYesRemaining transaction amount in local currency
original_invoiceobjectNoOriginal invoice document information

Debt Properties

PropertyTypeRequiredDescription
invoice_numberstringYesInvoice number from creditor
debt_referencestringNoReference number for the debt
payout_referencestringNoReference for payout tracking
invoice_datestringYesDate invoice was issued
invoice_due_days_after_invoice_datenumberYesDays until due date after invoice date
interest_days_after_invoice_datenumberYesDays until interest starts after invoice date
initial_capitalnumberYesInitial capital amount
capital_to_claimnumberYesCapital amount to collect
debt_descriptionstringYesDescription of the debt

Transaction Properties

PropertyTypeRequiredDescription
bank_transaction_datestringYesDate of bank transaction
registration_datestringYesDate transaction was registered
originstringYesOrigin of transaction (e.g. "creditor_system")*
typestringYesType of transaction (e.g. "capital")*
description_locale_tagstringYesLocalization tag for description
amountnumberYesTransaction amount

*) For complete list of values and details, please see Case