Getting "dated_on is not valid" error on bank transaction explanation

Hello,

Using the input:

{“bank_transaction_explanations”:[{“bank_transaction”:“https://api.freeagent.com/v2/bank_transactions/123456789",“type”:"Invoice Receipt”,“dated_on”:“2023-02-28”,“gross_value”:4.99,“paid_invoice”:“https://api.freeagent.com/v2/invoices/12345678”}]}

(transaction & invoice ID changed)

Gives me the response:

{“errors”:{“error”:{“message”:“dated_on is not valid”}}}

The “dated_on” value i’m using matches the format in the API documentation:

I’ve tried a few other formats as well with no success. Also tried todays date in case that was what is expected, no joy.

Please advise?

Any help please? Just need to know the correct format for the “dated_on” value, which is apparantly not what it says in the docs…

Hello,

The dated_on format looks good to me and should be valid, are you still experiencing this issue? If yes, please make another API call and provide the timestamp when it was made so I can try and trace what’s going wrong in the logs.

Kind regards,
Bogdan

Thanks - Still seeing this issue.

Time:
31-Aug-2023 15:23:25
FA API Response:
{“errors”:{“error”:{“message”:“dated_on is not valid”}}}

Hi again,

There are a couple of issues with your payload:

  1. The top-level key in your input is bank_transaction_explanations, it should be bank_transaction_explanation (singular)
  2. The value under the bank_transaction_explanation key should be another object, not an array i.e. it should be:
    {"bank_transaction_explanation": { "bank_transaction": ... } }
    instead of:
    {"bank_transaction_explanation": [ {"bank_transaction": ...} ] }

Hope this helps.

Kind regards,
Bogdan