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, andpayout_details(with at least one currency and account type configured). - POST-only Fields: The
accountandagreement_templatefields can only be set when creating a creditor and cannot be modified afterward. - Readonly Fields: Fields like
partner,creditor_number, andadded_to_erp_systemare automatically managed by the system. - Organization Numbers: Use either
organization_no(for Swedish companies) ornon_swedish_organization_no(for non-Swedish companies), but not both.
Creditor endpoints
GET /creditors- List all creditors (paginated)GET /creditors/{creditorId}- Get a specific creditorPOST /creditors- Create a new creditor (Partner API)PATCH /creditors/{creditorId}- Update a creditor (Partner API)DELETE /creditors/{creditorId}- Delete a creditor (Partner API)
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/jsonRequest Body: None (GET request)
Response Code: 200 OK
Response Body:
{
"_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
| Name | Type | Required | Description |
|---|---|---|---|
creditorId | string | Yes | The unique identifier of the creditor |
Response Properties
| Property | Type | Required | Description |
|---|---|---|---|
_id | string | Yes | Unique identifier for the creditor |
_created | string | Yes | Creation timestamp |
_updated | string | Yes | Last update timestamp |
_etag | string | Yes | Entity tag for concurrency control |
account | string | Yes (POST only) | Account ID - can only be set when creating a creditor |
partner | string | No (readonly) | Partner ID - automatically set from account.partner |
name | string | Yes | Creditor name |
company_name | string | No | Company name if different from creditor name |
description | string | No | Creditor description |
organization_no | string | Yes (or non_swedish_organization_no) | Swedish organization number (10 digits) |
non_swedish_organization_no | string | Yes (or organization_no) | Non-Swedish organization number (mutually exclusive with organization_no) |
vat_area | string | Yes | VAT region (default: "sweden")* |
external_id | string | No | Identifier from creditor's own system (unique per account) |
creditor_number | number | No (readonly) | System-assigned creditor identifier |
is_active | boolean | No (default: false) | Whether the creditor is active - when true, requires activation fields below |
standard_debt_description | string | Required when is_active is True | Default description for debts |
always_use_standard_debt_description | boolean | No (default: false) | Whether to always use default description |
agreement_address | object | No | Primary business address |
sender_address | object | Required when is_active is True | Address for sending correspondence |
invoice_address | object | Required when is_active is True | Address for invoice correspondence |
case_config | object | No | Case handling configuration (overrides account case_config) |
case_settings | object | No | Default case settings for creditor (overrides account case_settings) |
flow_config | object | No | Immutable flow parameters for case lifecycle (overrides account flow_config) |
invoice_config | object | No | Invoice number handling configuration |
settings | object | No | Creditor-specific settings (payout exports, case info exports, etc.) |
payout_details | object | Required when is_active is True | Bank account details for payouts (cannot be empty) |
default_letter_locale | string | No (default: "sv") | Default language for letters (e.g. "sv")* |
legal_type | string | No | Legal entity type* |
contact_information | object | No | Contact details (required if use_creditor_contact_information_on_letters is true) |
logo_file | object | No | Logo media file (PNG only) |
logo_details | object | No | Logo display configuration |
kivra_sender_id | string | No | Kivra integration sender ID |
solicitor_team | string | No | Reference to solicitor team |
agreement_template | string | No (POST only) | Agreement template ID (overrides account agreement_template) |
productification | string | No | Reference to productification |
delay_print_distribution_hours | number | No | Hours to delay print distribution (0-24) for preview |
offboarding | boolean | No | Whether creditor is being offboarded |
added_to_erp_system | boolean | No (readonly, default: false) | Whether added to ERP system |
added_to_distributor_system | object | No (readonly) | Dates when creditor was registered to distributor systems |
company_status | object | No | Current company status information |
company_status_history | array | No (readonly) | Historical company status records |
offboarding_details | object | No (readonly) | Offboarding status and dates |
Address Properties
| Property | Type | Required | Description |
|---|---|---|---|
address_line_1 | string | Yes | Primary address line |
zip_code | string | Yes | Postal code |
city | string | Yes | City name |
country | string | Yes | Country code in ISO 3166-1 alpha-2 format (e.g. "SE")* |
Case Config Properties
| Property | Type | Required | Description |
|---|---|---|---|
vat_area | string | No | VAT region (e.g. "sweden")* |
commission_excluded_vat | boolean | No | Whether commission excludes VAT |
payout_capital_by_invoice | boolean | No | Whether to pay out capital per invoice |
payout_interest_by_invoice | boolean | No | Whether to pay out interest per invoice |
letter_config | object | No | Letter 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.
| Property | Type | Required | Description |
|---|---|---|---|
sek | object | No | SEK currency payout details (at least one of: bankgiro, plusgiro, etc.) |
nok | object | No | NOK currency payout details |
eur | object | No | EUR currency payout details |
dkk | object | No | DKK currency payout details |
usd | object | No | USD currency payout details |
gbp | object | No | GBP 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):
| Property | Type | Required | Description |
|---|---|---|---|
bankgiro | string | No | Bankgiro number (Swedish format) |
plusgiro | string | No | Plusgiro number (Swedish format) |
iban_bic | object | No | IBAN and BIC details (see IBAN/BIC Properties below) |
bank_account_number | object | No | Account and clearing number (see Bank Account Properties) |
IBAN/BIC Properties
| Property | Type | Required | Description |
|---|---|---|---|
iban | string | Yes | IBAN number |
bic | string | Yes | BIC/SWIFT code |
Bank Account Number Properties
| Property | Type | Required | Description |
|---|---|---|---|
account_number | string | Yes | Bank account number |
clearing_number | string | Yes | Bank clearing number |
Example payout_details with multiple account types:
{
"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 PATCHagreement_template- Can only be set when creating a creditor (POST), cannot be changed via PATCH
Readonly Fields:
partner- Automatically set fromaccount.partnervia cascade updatecreditor_number- System-assigned unique identifieradded_to_erp_system- System-managed flagadded_to_distributor_system- System-managed datescompany_status_history- Automatically trackedoffboarding_details- System-managed offboarding status
Mutual Exclusivity:
organization_noandnon_swedish_organization_noare 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 textsender_address- Address for outgoing correspondenceinvoice_address- Address for invoice-related correspondencepayout_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):
partneraccountnamecompany_nameexternal_id
Additional Validation:
organization_nomust be exactly 10 digits (Swedish format)payout_detailscannot be an empty object when provideddelay_print_distribution_hoursmust be between 0 and 24logo_filemust be PNG format onlyvat_areadefaults to "sweden" if not specified
*) For complete list of values and details, please see Creditor
