Ledger accounts

List all ledger accounts of an administration

Returns a list of all the ledger accounts in the administration.

Pagination is not supported for this endpoint.

Example: returns a list of ledger accounts

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XGET \
  https://moneybird.com/api/v2/123/ledger_accounts.json?
    

Response

        
          
          Status: 200 OK
        
      
[
  {
    "id": "426664036164175391",
    "administration_id": 123,
    "name": "Algemene kosten",
    "account_type": "expenses",
    "account_id": null,
    "parent_id": null,
    "created_at": "2024-07-16T08:29:14.741Z",
    "updated_at": "2024-07-16T08:29:14.741Z",
    "allowed_document_types": [
      "purchase_invoice",
      "financial_mutation",
      "general_journal_document"
    ],
    "taxonomy_item": {
      "taxonomy_version": "3.5",
      "code": "WBedAlkOal",
      "name": "Algemene kosten",
      "name_english": "General expenses",
      "reference": "4215010"
    },
    "financial_account_id": null
  },
  {
    "id": "426664036195632686",
    "administration_id": 123,
    "name": "Betaalde en/of ontvangen btw",
    "account_type": "current_liabilities",
    "account_id": null,
    "parent_id": "426664036164175385",
    "created_at": "2024-07-16T08:29:14.773Z",
    "updated_at": "2024-07-16T08:29:14.773Z",
    "allowed_document_types": [
      "financial_mutation",
      "general_journal_document"
    ],
    "taxonomy_item": {
      "taxonomy_version": "3.5",
      "code": "BSchBepBtwAfo",
      "name": "Afgedragen omzetbelasting",
      "name_english": "Remitted Value Added Tax",
      "reference": "1205010.13"
    },
    "financial_account_id": null
  },
  {
    "id": "426664036164175385",
    "administration_id": 123,
    "name": "Btw",
    "account_type": "current_liabilities",
    "account_id": null,
    "parent_id": null,
    "created_at": "2024-07-16T08:29:14.741Z",
    "updated_at": "2024-07-16T08:29:14.741Z",
    "allowed_document_types": [
      "financial_mutation",
      "general_journal_document"
    ],
    "taxonomy_item": {
      "taxonomy_version": "3.5",
      "code": "BSchBepBtwOvm",
      "name": "Overige mutaties omzetbelasting",
      "name_english": "Other Value Added Tax adjustments",
      "reference": "1205010.15"
    },
    "financial_account_id": null
  }
]
      

Returns information about a ledger account

Example: returns a ledger account

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XGET \
  https://moneybird.com/api/v2/123/ledger_accounts/426664181118272663.json?
    

Response

        
          
          Status: 200 OK
        
      
{
  "id": "426664181118272663",
  "administration_id": 123,
  "name": "Grootboekrekening 7522ecb265f2446d664c",
  "account_type": "revenue",
  "account_id": "80829",
  "parent_id": null,
  "created_at": "2024-07-16T08:31:32.983Z",
  "updated_at": "2024-07-16T08:31:32.983Z",
  "allowed_document_types": [
    "sales_invoice",
    "financial_mutation",
    "general_journal_document"
  ],
  "taxonomy_item": {
    "taxonomy_version": "3.5",
    "code": "WOmzAovEie",
    "name": "Eiergeld",
    "name_english": "Egg money",
    "reference": "8008040"
  },
  "financial_account_id": null
}
      

Example: returns 404 when requesting unexisting ledger account

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XGET \
  https://moneybird.com/api/v2/123/ledger_accounts/831921.json?
    

Response

        
          
          Status: 404 Not Found
        
      
{
  "error": "record not found",
  "symbolic": {
    "id": "not_found"
  }
}
      

Creates a new ledger account

The account_type determines the kind of ledger account, this can be any of the following values: non_current_assets, current_assets, equity, provisions, non_current_liabilities, current_liabilities, revenue, direct_costs, expenses, other_income_expenses

By providing the parent_id, it is possible to create a tree of ledger accounts. Make sure the account_types of the parent and child equal.

Parameters

Parameter Type Description
ledger_account[name] String

Required

Should be unique for this combination of administration and account type.

ledger_account[account_type] String

Required

Can be non_current_assets, current_assets, equity, provisions, non_current_liabilities, current_liabilities, revenue, direct_costs, expenses or other_income_expenses.

ledger_account[account_id] String

Optional field, also known as general ledger code. Should be unique.

ledger_account[parent_id] Integer

Id of the parent ledger account. Should be a valid ledger account id.

ledger_account[allowed_document_types] Array

Can be sales_invoice, purchase_invoice, general_journal_document, financial_mutation or payment.

ledger_account[description] String
rgs_code String

Required

Existing RGS version 3.5 code, e.g. ‘WMfoBelMfo’

Example: creates a new ledger account

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPOST \
  -d '{"ledger_account":{"name":"Test ledger account","account_type":"expenses","account_id":2182},"rgs_code":"WAfsAmv"}' \
  https://moneybird.com/api/v2/123/ledger_accounts.json
    

Response

        
          
          Status: 201 Created
        
      
{
  "id": "426664181314356377",
  "administration_id": 123,
  "name": "Test ledger account",
  "account_type": "expenses",
  "account_id": "2182",
  "parent_id": null,
  "created_at": "2024-07-16T08:31:33.170Z",
  "updated_at": "2024-07-16T08:31:33.170Z",
  "allowed_document_types": [
    "purchase_invoice",
    "financial_mutation",
    "general_journal_document"
  ],
  "taxonomy_item": {
    "taxonomy_version": "3.5",
    "code": "WAfsAmv",
    "name": "Afschrijvingen op materiële vaste activa",
    "name_english": "Depreciation of tangible fixed assets",
    "reference": "4102000"
  },
  "financial_account_id": null
}
      

Example: creates a new ledger account with taxonomy item by providing an existing RGS code

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPOST \
  -d '{"rgs_code":"WOmzAovEie","ledger_account":{"name":"Test ledger account","account_type":"expenses","account_id":2182}}' \
  https://moneybird.com/api/v2/123/ledger_accounts.json
    

Response

        
          
          Status: 201 Created
        
      
{
  "id": "426664181401388187",
  "administration_id": 123,
  "name": "Test ledger account",
  "account_type": "expenses",
  "account_id": "2182",
  "parent_id": null,
  "created_at": "2024-07-16T08:31:33.253Z",
  "updated_at": "2024-07-16T08:31:33.253Z",
  "allowed_document_types": [
    "purchase_invoice",
    "financial_mutation",
    "general_journal_document"
  ],
  "taxonomy_item": {
    "taxonomy_version": "3.5",
    "code": "WOmzAovEie",
    "name": "Eiergeld",
    "name_english": "Egg money",
    "reference": "8008040"
  },
  "financial_account_id": null
}
      

Example: returns error when provided RGS code does not belong to a taxonomy item of version 3.5

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPOST \
  -d '{"rgs_code":"1234","ledger_account":{"name":"Test ledger account","account_type":"expenses","account_id":2182}}' \
  https://moneybird.com/api/v2/123/ledger_accounts.json
    

Response

        
          
          Status: 404 Not Found
        
      
{
  "error": "Given RGS code does not belong to a taxonomy item of version 3.5",
  "symbolic": {
    "rgs_code": "not_found"
  }
}
      

Example: returns an error when name is not provided

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPOST \
  -d '{"ledger_account":{"account_type":"expenses","account_id":2182},"rgs_code":"WAfsAmv"}' \
  https://moneybird.com/api/v2/123/ledger_accounts.json
    

Response

        
          
          Status: 400 Bad Request
        
      
{
  "error": "Name is required",
  "symbolic": {
    "ledger_account": {
      "name": "required"
    }
  }
}
      

Example: returns an error when an empty name is provided

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPOST \
  -d '{"ledger_account":{"name":"","account_type":"expenses","account_id":2182},"rgs_code":"WAfsAmv"}' \
  https://moneybird.com/api/v2/123/ledger_accounts.json
    

Response

        
          
          Status: 422 Unprocessable Entity
        
      
{
  "error": {
    "name": [
      "mag niet leeg zijn"
    ]
  }
}
      

Updates a ledger account

Parameters

Parameter Type Description
ledger_account[name] String

Should be unique for this combination of administration and account type.

ledger_account[account_id] String

Optional field, also known as general ledger code. Should be unique.

ledger_account[account_type] String

Can be non_current_assets, current_assets, equity, provisions, non_current_liabilities, current_liabilities, revenue, direct_costs, expenses or other_income_expenses.

ledger_account[parent_id] Integer

Id of the parent ledger account. Should be a valid ledger account id.

ledger_account[allowed_document_types] Array

Can be sales_invoice, purchase_invoice, general_journal_document, financial_mutation or payment.

ledger_account[description] String
rgs_code String

Existing RGS version 3.5 code, e.g. ‘WMfoBelMfo’

Example: updates the information in the ledger account

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPATCH \
  -d '{"ledger_account":{"name":"New name"}}' \
  https://moneybird.com/api/v2/123/ledger_accounts/426664181648852125.json
    

Response

        
          
          Status: 200 OK
        
      
{
  "id": "426664181648852125",
  "administration_id": 123,
  "name": "New name",
  "account_type": "revenue",
  "account_id": "80829",
  "parent_id": null,
  "created_at": "2024-07-16T08:31:33.489Z",
  "updated_at": "2024-07-16T08:31:33.541Z",
  "allowed_document_types": [
    "sales_invoice",
    "financial_mutation",
    "general_journal_document"
  ],
  "taxonomy_item": {
    "taxonomy_version": "3.5",
    "code": "WOmzAovEie",
    "name": "Eiergeld",
    "name_english": "Egg money",
    "reference": "8008040"
  },
  "financial_account_id": null
}
      

Example: updates a ledger account with taxonomy item by providing an existing RGS code

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPATCH \
  -d '{"rgs_code":"WMfoBelMfo","ledger_account":{"name":"new name"}}' \
  https://moneybird.com/api/v2/123/ledger_accounts/426664181745321120.json
    

Response

        
          
          Status: 200 OK
        
      
{
  "id": "426664181745321120",
  "administration_id": 123,
  "name": "new name",
  "account_type": "revenue",
  "account_id": "80829",
  "parent_id": null,
  "created_at": "2024-07-16T08:31:33.581Z",
  "updated_at": "2024-07-16T08:31:33.627Z",
  "allowed_document_types": [
    "sales_invoice",
    "financial_mutation",
    "general_journal_document"
  ],
  "taxonomy_item": {
    "taxonomy_version": "3.5",
    "code": "WMfoBelMfo",
    "name": "Mutatie fiscale oudedagsreserve",
    "name_english": "Change in tax-deferred retirement reserve",
    "reference": "9104010"
  },
  "financial_account_id": null
}
      

Example: returns error when provided RGS code does not belong to a taxonomy item of version 3.5

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPATCH \
  -d '{"rgs_code":"1234","ledger_account":{"name":"new name"}}' \
  https://moneybird.com/api/v2/123/ledger_accounts/426664181837595811.json
    

Response

        
          
          Status: 404 Not Found
        
      
{
  "error": "Given RGS code does not belong to a taxonomy item of version 3.5",
  "symbolic": {
    "rgs_code": "not_found"
  }
}
      

Example: returns an error when validations are failing

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPATCH \
  -d '{"ledger_account":{"name":""}}' \
  https://moneybird.com/api/v2/123/ledger_accounts/426664181926724773.json
    

Response

        
          
          Status: 422 Unprocessable Entity
        
      
{
  "error": {
    "name": [
      "mag niet leeg zijn"
    ]
  }
}
      

Example: returns a 404 when the ledger account does not exist

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XPATCH \
  -d '{"ledger_account":{"name":"New name"}}' \
  https://moneybird.com/api/v2/123/ledger_accounts/12341.json
    

Response

        
          
          Status: 404 Not Found
        
      
{
  "error": "record not found",
  "symbolic": {
    "id": "not_found"
  }
}
      

Deletes a ledger account

Example: deletes a ledger account

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XDELETE \
  -d '{}' \
  https://moneybird.com/api/v2/123/ledger_accounts/426664182074573991.json
    

Response

Example: returns 404 when the ledger account does not exist

Request

curl -s -H "Content-Type: application/json" -H "Authorization: Bearer 84ec207ad0154a508f798e615a998ac1fd752926d00f955fb1df3e144cba44ab" \
  -XDELETE \
  -d '{}' \
  https://moneybird.com/api/v2/123/ledger_accounts/21321.json
    

Response

        
          
          Status: 404 Not Found
        
      
{
  "error": "record not found",
  "symbolic": {
    "id": "not_found"
  }
}