Financial statements
Create a new financial statement
Creates a new financial statement. Provided financial mutations will be grouped in the statement.
Parameters
Parameter | Type | Description |
---|---|---|
financial_statement[financial_account_id] |
Integer |
Required Should be a valid financial account id. |
financial_statement[reference] |
String |
Required |
financial_statement[official_date] |
Date |
|
financial_statement[official_balance] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. Should be a number -1,000,000,000 <= n <= 1,000,000,000. |
financial_statement[importer_key] |
String |
|
financial_statement[financial_mutations_attributes][date] |
Date |
|
financial_statement[financial_mutations_attributes][valutation_date] |
Date |
|
financial_statement[financial_mutations_attributes][message] |
String |
|
financial_statement[financial_mutations_attributes][amount] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
financial_statement[financial_mutations_attributes][code] |
String |
|
financial_statement[financial_mutations_attributes][contra_account_name] |
String |
|
financial_statement[financial_mutations_attributes][contra_account_number] |
String |
|
financial_statement[financial_mutations_attributes][batch_reference] |
String |
|
financial_statement[financial_mutations_attributes][offset] |
Integer |
|
financial_statement[financial_mutations_attributes][account_servicer_transaction_id] |
String |
|
financial_statement[financial_mutations_attributes][account_servicer_metadata] |
Duck |
|
financial_statement[financial_mutations_attributes][adyen_payment_instrument_id] |
Integer |
Should be a valid adyen payment instrument id. |
financial_statement[financial_mutations_attributes][_destroy] |
Boolean |
|
financial_statement[financial_mutations_attributes][smart_transfer] |
Boolean |
Example: creates a financial statement
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPOST \
-d '{"financial_statement":{"reference":"31012014_ABNAMRO","financial_account_id":407012552191509680,"financial_mutations_attributes":{"1":{"date":"2023-12-12","message":"Foobar 1","amount":100},"2":{"date":"2023-12-12","message":"Foobar 2","amount":200}}}}' \
https://moneybird.com/api/v2/123/financial_statements.json
Response
Status: 201 Created
{
"id": "407012552255472819",
"financial_account_id": "407012552191509680",
"reference": "31012014_ABNAMRO",
"official_date": null,
"official_balance": null,
"importer_service": null,
"financial_mutations": [
{
"id": "407012552256521396",
"administration_id": 123,
"amount": "100.0",
"code": null,
"date": "2023-12-12",
"message": "Foobar 1",
"contra_account_name": null,
"contra_account_number": "",
"state": "unprocessed",
"amount_open": "100.0",
"sepa_fields": null,
"batch_reference": null,
"financial_account_id": "407012552191509680",
"currency": "EUR",
"original_amount": null,
"created_at": "2023-12-12T10:37:19.262Z",
"updated_at": "2023-12-12T10:37:19.262Z",
"version": 1702377439,
"financial_statement_id": "407012552255472819",
"processed_at": null,
"account_servicer_transaction_id": null,
"payments": [
],
"ledger_account_bookings": [
]
},
{
"id": "407012552257569973",
"administration_id": 123,
"amount": "200.0",
"code": null,
"date": "2023-12-12",
"message": "Foobar 2",
"contra_account_name": null,
"contra_account_number": "",
"state": "unprocessed",
"amount_open": "200.0",
"sepa_fields": null,
"batch_reference": null,
"financial_account_id": "407012552191509680",
"currency": "EUR",
"original_amount": null,
"created_at": "2023-12-12T10:37:19.264Z",
"updated_at": "2023-12-12T10:37:19.264Z",
"version": 1702377439,
"financial_statement_id": "407012552255472819",
"processed_at": null,
"account_servicer_transaction_id": null,
"payments": [
],
"ledger_account_bookings": [
]
}
]
}
Delete a financial statement
Example: deletes a financial statement
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XDELETE \
-d '{}' \
https://moneybird.com/api/v2/123/financial_statements/407012552490353850.json
Response
Example: returns a 404 status when the financial statement is not found
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XDELETE \
-d '{}' \
https://moneybird.com/api/v2/123/financial_statements/1564321.json
Response
Status: 404 Not Found
{
"error": "record not found",
"symbolic": {
"id": "not_found"
}
}
Update a financial statement
When updating a financial statement, you only need to provide the information you want to change. Attributes you don’t provide in the request will not be updated.
Parameters
Parameter | Type | Description |
---|---|---|
financial_statement[reference] |
String |
|
financial_statement[official_date] |
String |
|
financial_statement[official_balance] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. Should be a number -1,000,000,000 <= n <= 1,000,000,000. |
financial_statement[financial_mutations_attributes][id] |
Integer |
|
financial_statement[financial_mutations_attributes][date] |
Date |
|
financial_statement[financial_mutations_attributes][message] |
String |
|
financial_statement[financial_mutations_attributes][amount] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
financial_statement[financial_mutations_attributes][code] |
String |
|
financial_statement[financial_mutations_attributes][contra_account_name] |
String |
|
financial_statement[financial_mutations_attributes][contra_account_number] |
String |
|
financial_statement[financial_mutations_attributes][batch_reference] |
String |
|
financial_statement[financial_mutations_attributes][offset] |
Integer |
|
financial_statement[financial_mutations_attributes][account_servicer_transaction_id] |
String |
|
financial_statement[financial_mutations_attributes][adyen_payment_instrument_id] |
Integer |
Should be a valid adyen payment instrument id. |
financial_statement[financial_mutations_attributes][_destroy] |
Boolean |
Example: updates a financial statement
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPATCH \
-d '{"financial_statement":{"reference":"new_reference","financial_mutations_attributes":{"0":{"message":"Foobar 1","date":"2023-12-12","amount":100}}}}' \
https://moneybird.com/api/v2/123/financial_statements/407012552908735683.json
Response
Status: 200 OK
{
"id": "407012552908735683",
"financial_account_id": "407012552746206400",
"reference": "new_reference",
"official_date": null,
"official_balance": null,
"importer_service": null,
"financial_mutations": [
{
"id": "407012552911881413",
"administration_id": 123,
"amount": "-20.0",
"code": null,
"date": "2023-12-11",
"message": "Afboeking",
"contra_account_name": "Krant",
"contra_account_number": "CH3608387000001080173",
"state": "unprocessed",
"amount_open": "-20.0",
"sepa_fields": null,
"batch_reference": null,
"financial_account_id": "407012552746206400",
"currency": "EUR",
"original_amount": null,
"created_at": "2023-12-12T10:37:19.887Z",
"updated_at": "2023-12-12T10:37:19.887Z",
"version": 1702377439,
"financial_statement_id": "407012552908735683",
"processed_at": null,
"account_servicer_transaction_id": null,
"payments": [
],
"ledger_account_bookings": [
]
},
{
"id": "407012552909784260",
"administration_id": 123,
"amount": "322.78",
"code": null,
"date": "2023-12-12",
"message": "637034759 B & S CARD SERVICE GMBH\n0001234567EINREICH ABR.280000000\n321 / 333,60 -SERV 10,82 +0%MWST\n0,00 REF VU0251478",
"contra_account_name": "Internetprovider",
"contra_account_number": "BE68539007547034",
"state": "unprocessed",
"amount_open": "322.78",
"sepa_fields": null,
"batch_reference": null,
"financial_account_id": "407012552746206400",
"currency": "EUR",
"original_amount": null,
"created_at": "2023-12-12T10:37:19.885Z",
"updated_at": "2023-12-12T10:37:19.885Z",
"version": 1702377439,
"financial_statement_id": "407012552908735683",
"processed_at": null,
"account_servicer_transaction_id": null,
"payments": [
],
"ledger_account_bookings": [
]
},
{
"id": "407012553044001992",
"administration_id": 123,
"amount": "100.0",
"code": null,
"date": "2023-12-12",
"message": "Foobar 1",
"contra_account_name": null,
"contra_account_number": "",
"state": "unprocessed",
"amount_open": "100.0",
"sepa_fields": null,
"batch_reference": null,
"financial_account_id": "407012552746206400",
"currency": "EUR",
"original_amount": null,
"created_at": "2023-12-12T10:37:20.013Z",
"updated_at": "2023-12-12T10:37:20.013Z",
"version": 1702377440,
"financial_statement_id": "407012552908735683",
"processed_at": null,
"account_servicer_transaction_id": null,
"payments": [
],
"ledger_account_bookings": [
]
}
]
}
Example: returns an error when invalid input is given
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPATCH \
-d '{"financial_statement":{"reference":""}}' \
https://moneybird.com/api/v2/123/financial_statements/407012553315583181.json
Response
Status: 422 Unprocessable Entity
{
"error": {
"reference": [
"cannot be empty"
]
}
}
Example: returns a 404 status when the statement is not found
Request
curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
-XPATCH \
-d '{"financial_statement":{"reference":"new_reference","financial_mutations_attributes":{"0":{"message":"Foobar 1","date":"2023-12-12","amount":100}}}}' \
https://moneybird.com/api/v2/123/financial_statements/1564321.json
Response
Status: 404 Not Found
{
"error": "record not found",
"symbolic": {
"id": "not_found"
}
}