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

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[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][*][_destroy] 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":204882899554534966,"financial_mutations_attributes":{"1":{"date":"2017-11-02","message":"Foobar 1","amount":100},"2":{"date":"2017-11-02","message":"Foobar 2","amount":200}}}}' \
  https://moneybird.com/api/v2/123/financial_statements.json
    

Response

        
          
          Status: 201 Created
        
      
      {
  "id": "204882899767395897",
  "financial_account_id": "204882899554534966",
  "reference": "31012014_ABNAMRO",
  "official_date": null,
  "official_balance": null,
  "importer_service": null,
  "financial_mutations": [
    {
      "id": "204882899769493050",
      "administration_id": 123,
      "amount": "100.0",
      "code": null,
      "date": "2017-11-02",
      "message": "Foobar 1",
      "contra_account_name": null,
      "contra_account_number": null,
      "state": "unprocessed",
      "amount_open": "100.0",
      "sepa_fields": null,
      "batch_reference": null,
      "financial_account_id": "204882899554534966",
      "currency": "EUR",
      "original_amount": null,
      "created_at": "2017-11-02T08:33:01.101Z",
      "updated_at": "2017-11-02T08:33:01.101Z",
      "version": 1509611581,
      "financial_statement_id": "204882899767395897",
      "processed_at": null,
      "account_servicer_transaction_id": null,
      "payments": [

      ],
      "ledger_account_bookings": [

      ]
    },
    {
      "id": "204882899772638779",
      "administration_id": 123,
      "amount": "200.0",
      "code": null,
      "date": "2017-11-02",
      "message": "Foobar 2",
      "contra_account_name": null,
      "contra_account_number": null,
      "state": "unprocessed",
      "amount_open": "200.0",
      "sepa_fields": null,
      "batch_reference": null,
      "financial_account_id": "204882899554534966",
      "currency": "EUR",
      "original_amount": null,
      "created_at": "2017-11-02T08:33:01.104Z",
      "updated_at": "2017-11-02T08:33:01.104Z",
      "version": 1509611581,
      "financial_statement_id": "204882899767395897",
      "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/204882900169000512.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

Should be a valid financial mutation id.

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][*][_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":"2017-11-02","amount":100}}}}' \
  https://moneybird.com/api/v2/123/financial_statements/204882900921878089.json
    

Response

        
          
          Status: 200 OK
        
      
      {
  "id": "204882900921878089",
  "financial_account_id": "204882900647151174",
  "reference": "new_reference",
  "official_date": null,
  "official_balance": null,
  "importer_service": null,
  "financial_mutations": [
    {
      "id": "204882900930266699",
      "administration_id": 123,
      "amount": "-20.0",
      "code": null,
      "date": "2017-11-01",
      "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": "204882900647151174",
      "currency": "EUR",
      "original_amount": null,
      "created_at": "2017-11-02T08:33:02.208Z",
      "updated_at": "2017-11-02T08:33:02.208Z",
      "version": 1509611582,
      "financial_statement_id": "204882900921878089",
      "processed_at": null,
      "account_servicer_transaction_id": null,
      "payments": [

      ],
      "ledger_account_bookings": [

      ]
    },
    {
      "id": "204882900926072394",
      "administration_id": 123,
      "amount": "322.78",
      "code": null,
      "date": "2017-11-02",
      "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": "204882900647151174",
      "currency": "EUR",
      "original_amount": null,
      "created_at": "2017-11-02T08:33:02.203Z",
      "updated_at": "2017-11-02T08:33:02.203Z",
      "version": 1509611582,
      "financial_statement_id": "204882900921878089",
      "processed_at": null,
      "account_servicer_transaction_id": null,
      "payments": [

      ],
      "ledger_account_bookings": [

      ]
    },
    {
      "id": "204882901155710542",
      "administration_id": 123,
      "amount": "100.0",
      "code": null,
      "date": "2017-11-02",
      "message": "Foobar 1",
      "contra_account_name": null,
      "contra_account_number": null,
      "state": "unprocessed",
      "amount_open": "100.0",
      "sepa_fields": null,
      "batch_reference": null,
      "financial_account_id": "204882900647151174",
      "currency": "EUR",
      "original_amount": null,
      "created_at": "2017-11-02T08:33:02.421Z",
      "updated_at": "2017-11-02T08:33:02.421Z",
      "version": 1509611582,
      "financial_statement_id": "204882900921878089",
      "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/204882901876082259.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":"2017-11-02","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"
  }
}