Skip to content

Creditor

Manage creditor information in the Amili system. Creditors represent businesses that use Amili for invoice and case management, including their organization details, addresses, and configuration settings.

Creditors are always associated with an Account, and each Account must have at least one Creditor. The first Creditor for an Account is created during Account creation using the initial_creditor_data parameter. Additional Creditors can be created using this endpoint.

Important Notes:

  • Activation Requirements: When setting is_active: true, several fields become required: standard_debt_description, sender_address, invoice_address, and payout_details (with at least one currency and account type configured).
  • POST-only Fields: The account and agreement_template fields can only be set when creating a creditor and cannot be modified afterward.
  • Readonly Fields: Fields like partner, creditor_number, and added_to_erp_system are automatically managed by the system.
  • Organization Numbers: Use either organization_no (for Swedish companies) or non_swedish_organization_no (for non-Swedish companies), but not both.

Creditor endpoints

Example Request

Below is an example of retrieving a specific creditor.

URL: GET /creditors/674dbeb208847b9501cc9138

Headers:

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

Request Body: None (GET request)

Response Code: 200 OK

Response Body:

json
{
  "_id": "674dbeb208847b9501cc9138",
  "account": "674dbeaf08847b9501cc9132",
  "name": "Amili Integration Team",
  "organization_no": "1122334455",
  "is_active": true,
  "standard_debt_description": "Standard skuldbeskrivning på Konto",
  "agreement_address": {
    "address_line_1": "Redaregatan 50",
    "zip_code": "25236",
    "city": "Helsingborg",
    "country": "SE"
  },
  "case_config": {
    "vat_area": "sweden",
    "commission_excluded_vat": false,
    "payout_capital_by_invoice": true,
    "payout_interest_by_invoice": false,
    "letter_config": {}
  },
  "description": "Generella tester",
  "default_letter_locale": "sv",
  "payout_details": {
    "sek": {
      "bankgiro": "12312312"
    }
  },
  "sender_address": {
    "address_line_1": "Redaregatan 50",
    "zip_code": "25236",
    "city": "Helsingborg",
    "country": "SE"
  },
  "invoice_address": {
    "address_line_1": "Redaregatan 50",
    "zip_code": "25236",
    "city": "Helsingborg",
    "country": "SE"
  },
  "always_use_standard_debt_description": false,
  "added_to_erp_system": false,
  "_updated": "Fri, 04 Apr 2025 14:30:14 GMT",
  "_created": "Mon, 02 Dec 2024 14:05:38 GMT",
  "creditor_number": 2000037,
  "_etag": "9513f97705d5a98d99f5a61f483b4102c67f0ec6"
}

Parameters

Path Parameters

NameTypeRequiredDescription
creditorIdstringYesThe unique identifier of the creditor

Response Properties

PropertyTypeRequiredDescription
_idstringYesUnique identifier for the creditor
_createdstringYesCreation timestamp
_updatedstringYesLast update timestamp
_etagstringYesEntity tag for concurrency control
accountstringYes (POST only)Account ID - can only be set when creating a creditor
partnerstringNo (readonly)Partner ID - automatically set from account.partner
namestringYesCreditor name
company_namestringNoCompany name if different from creditor name
descriptionstringNoCreditor description
organization_nostringYes (or non_swedish_organization_no)Swedish organization number (10 digits)
non_swedish_organization_nostringYes (or organization_no)Non-Swedish organization number (mutually exclusive with organization_no)
vat_areastringYesVAT region (default: "sweden")*
external_idstringNoIdentifier from creditor's own system (unique per account)
creditor_numbernumberNo (readonly)System-assigned creditor identifier
is_activebooleanNo (default: false)Whether the creditor is active - when true, requires activation fields below
standard_debt_descriptionstringRequired when is_active is TrueDefault description for debts
always_use_standard_debt_descriptionbooleanNo (default: false)Whether to always use default description
agreement_addressobjectNoPrimary business address
sender_addressobjectRequired when is_active is TrueAddress for sending correspondence
invoice_addressobjectRequired when is_active is TrueAddress for invoice correspondence
case_configobjectNoCase handling configuration (overrides account case_config)
case_settingsobjectNoDefault case settings for creditor (overrides account case_settings)
flow_configobjectNoImmutable flow parameters for case lifecycle (overrides account flow_config)
invoice_configobjectNoInvoice number handling configuration
settingsobjectNoCreditor-specific settings (payout exports, case info exports, etc.)
payout_detailsobjectRequired when is_active is TrueBank account details for payouts (cannot be empty)
default_letter_localestringNo (default: "sv")Default language for letters (e.g. "sv")*
legal_typestringNoLegal entity type*
contact_informationobjectNoContact details (required if use_creditor_contact_information_on_letters is true)
logo_fileobjectNoLogo media file (PNG only)
logo_detailsobjectNoLogo display configuration
kivra_sender_idstringNoKivra integration sender ID
solicitor_teamstringNoReference to solicitor team
agreement_templatestringNo (POST only)Agreement template ID (overrides account agreement_template)
productificationstringNoReference to productification
delay_print_distribution_hoursnumberNoHours to delay print distribution (0-24) for preview
offboardingbooleanNoWhether creditor is being offboarded
added_to_erp_systembooleanNo (readonly, default: false)Whether added to ERP system
added_to_distributor_systemobjectNo (readonly)Dates when creditor was registered to distributor systems
company_statusobjectNoCurrent company status information
company_status_historyarrayNo (readonly)Historical company status records
offboarding_detailsobjectNo (readonly)Offboarding status and dates

Address Properties

PropertyTypeRequiredDescription
address_line_1stringYesPrimary address line
zip_codestringYesPostal code
citystringYesCity name
countrystringYesCountry code in ISO 3166-1 alpha-2 format (e.g. "SE")*

Case Config Properties

PropertyTypeRequiredDescription
vat_areastringNoVAT region (e.g. "sweden")*
commission_excluded_vatbooleanNoWhether commission excludes VAT
payout_capital_by_invoicebooleanNoWhether to pay out capital per invoice
payout_interest_by_invoicebooleanNoWhether to pay out interest per invoice
letter_configobjectNoLetter template configuration

Payout Details Properties

The payout_details object contains bank account information organized by currency. At least one currency must be configured, and each currency must have at least one account type specified. The object cannot be empty when provided.

PropertyTypeRequiredDescription
sekobjectNoSEK currency payout details (at least one of: bankgiro, plusgiro, etc.)
nokobjectNoNOK currency payout details
eurobjectNoEUR currency payout details
dkkobjectNoDKK currency payout details
usdobjectNoUSD currency payout details
gbpobjectNoGBP currency payout details

Currency Payout Account Types

Each currency object can contain one or more of the following account types (at least one must be provided):

PropertyTypeRequiredDescription
bankgirostringNoBankgiro number (Swedish format)
plusgirostringNoPlusgiro number (Swedish format)
iban_bicobjectNoIBAN and BIC details (see IBAN/BIC Properties below)
bank_account_numberobjectNoAccount and clearing number (see Bank Account Properties)

IBAN/BIC Properties

PropertyTypeRequiredDescription
ibanstringYesIBAN number
bicstringYesBIC/SWIFT code

Bank Account Number Properties

PropertyTypeRequiredDescription
account_numberstringYesBank account number
clearing_numberstringYesBank clearing number

Example payout_details with multiple account types:

json
{
  "payout_details": {
    "sek": {
      "bankgiro": "12312312",
      "plusgiro": "123123-4"
    },
    "eur": {
      "iban_bic": {
        "iban": "SE3550000000054910000003",
        "bic": "ESSESESS"
      }
    },
    "nok": {
      "bank_account_number": {
        "account_number": "12345678901",
        "clearing_number": "9710"
      }
    }
  }
}

### Validation Rules

POST-only Fields:

  • account - Can only be set when creating a creditor (POST), cannot be changed via PATCH
  • agreement_template - Can only be set when creating a creditor (POST), cannot be changed via PATCH

Readonly Fields:

  • partner - Automatically set from account.partner via cascade update
  • creditor_number - System-assigned unique identifier
  • added_to_erp_system - System-managed flag
  • added_to_distributor_system - System-managed dates
  • company_status_history - Automatically tracked
  • offboarding_details - System-managed offboarding status

Mutual Exclusivity:

  • organization_no and non_swedish_organization_no are mutually exclusive - provide one or the other, not both

Conditional Requirements (when is_active is True): When activating a creditor (is_active: true), the following fields become required:

  • standard_debt_description - Default debt description text
  • sender_address - Address for outgoing correspondence
  • invoice_address - Address for invoice-related correspondence
  • payout_details - At least one currency with at least one account type must be configured

Uniqueness Constraints: The combination of the following fields must be unique (with optional keys):

  • partner
  • account
  • name
  • company_name
  • external_id

Additional Validation:

  • organization_no must be exactly 10 digits (Swedish format)
  • payout_details cannot be an empty object when provided
  • delay_print_distribution_hours must be between 0 and 24
  • logo_file must be PNG format only
  • vat_area defaults to "sweden" if not specified

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