POST Bank Transactions to incorrect bank account


We are using the POST /v2/bank_transactions/statement endpoint to push OFX-formatted transactions into FreeAgent bank accounts as documented here, but it appears this endpoint does not push into the account specified in the query string, but instead pushes to a different account.
We have multiple GBP bank accounts set up in FreeAgent, including account 528630 and account 530469. When calling the endpoint with bank_account=530469 the API responds 200, but the new transaction actually appears in account 530469.
Are we not using the API correctly, or is this an internal issue with the FreeAgent API? I’ve pasted the raw request below if that helps.


>     POST HTTP/1.1
>     Accept: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml
>     Authorization: Bearer <token>
>     User-Agent: RestSharp/
>     Content-Type: application/x-www-form-urlencoded
>     Host:
>     Content-Length: 1037
>     Accept-Encoding: gzip, deflate


Hi David,

My name is Dave and I am one of the Support Engineers here at FreeAgent.

Just a quick message to let you know that we’ve seen your message and we’re currently digging into the issue you’ve reported.

Thanks for bringing this to our attention and we’ll be back in touch soon with an update :thumbsup:

Kind regards,
Dave J

Hi David,

It looks like the bank account parameter is being ignored and that the account number and sort code within the statement are instead used to identify the bank account.

Could I ask you to try uploading a statement that includes the account number/sort code inside the OFX statement?

We will look into updating our documentation to make this clearer.

Andy Stabler
Software Engineer - FreeAgent