External Reconciliations
External reconciliations allow you to match journal entry lines with external records such as bank transactions. Unlike internal reconciliations (which match journal entry lines against each other), external reconciliations link accounting entries to their corresponding external counterparts.
Endpoints
List External Reconciliations
GET /api/v2/external-reconciliations
Retrieves a paginated list of external reconciliations.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| client_account_id | integer | Yes | ID of the client account |
| from_date | date | No | Filter from this date |
| to_date | date | No | Filter to this date |
| relation_type | string | No | Filter by relation type |
| relation_id | integer | No | Filter by relation ID |
| relation_line_id | integer | No | Filter by relation line ID |
| page | integer | No | Page number |
| per_page | integer | No | Items per page |
Response
{
"data": [
{
"id": 1,
"created_at": "2024-03-15T10:00:00Z",
"created_by_id": 7,
"client_account_id": 7,
"external_type": "bank_transaction",
"internal_type": "journal_entry_line",
"internal_id": 456,
"sequence_number": 1,
"entries": [
{
"id": 1,
"relation_type": "journal_entry_line",
"relation_id": 456,
"relation_line_id": 1,
"amount": "1500.000000",
"currency_code": "NOK",
"exchange_rate": "1.000000"
}
]
}
],
"meta": {
"page": 1,
"pages": 1,
"per_page": 25,
"records": 1
}
}
Create External Reconciliation
POST /api/v2/external-reconciliations
Creates a new external reconciliation with entries.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| client_account_id | integer | Yes | The client account ID |
| external_type | string | Yes | Type of the external record (e.g., bank_transaction) |
| internal_type | string | Yes | Type of the internal record (e.g., journal_entry_line) |
| internal_id | integer | Yes | ID of the internal record |
| sequence_number | integer | Yes | Sequence number for ordering |
| entries | array | Yes | Array of reconciliation entries |
Entry Object
| Field | Type | Required | Description |
|---|---|---|---|
| relation_type | string | Yes | Type of the related record |
| relation_id | integer | Yes | ID of the related record |
| relation_line_id | integer | Yes | Line ID of the related record |
| amount | decimal | Yes | Reconciled amount |
| currency_code | string | Yes | ISO 4217 currency code |
| exchange_rate | decimal | Yes | Exchange rate applied |
Example Request
{
"client_account_id": 7,
"external_type": "bank_transaction",
"internal_type": "journal_entry_line",
"internal_id": 456,
"sequence_number": 1,
"entries": [
{
"relation_type": "journal_entry_line",
"relation_id": 456,
"relation_line_id": 1,
"amount": "1500.00",
"currency_code": "NOK",
"exchange_rate": "1.00"
}
]
}
Response
Returns the created external reconciliation with status 201 Created.
Delete External Reconciliation
DELETE /api/v2/external-reconciliations/{id}
Deletes an external reconciliation and its entries.
Response
Returns 204 No Content on success.
Attributes
| Attribute | Type | Description |
|---|---|---|
| id | integer | Unique identifier (read-only) |
| created_at | datetime | Creation timestamp (read-only) |
| created_by_id | integer | ID of the user who created it (read-only) |
| client_account_id | integer | ID of the client account |
| external_type | string | Type of the external record |
| internal_type | string | Type of the internal record |
| internal_id | integer | ID of the internal record |
| sequence_number | integer | Sequence number for ordering |
Relationships
| Relationship | Type | Description |
|---|---|---|
| entries | ExternalReconciliationEntry[] | The reconciliation entries (included by default) |
Error Responses
| Status Code | Description |
|---|---|
| 400 | Invalid request (missing required fields) |
| 403 | Forbidden (no access to client account) |
| 404 | Reconciliation not found |