Which fields need to be set in an "Update Transaction" request?

Hi - I'm trying to write some code to update the memo of a transaction. So I retrieve the transaction through the API, modify some fields, and then post it back. This seems like a *very* common use case.

 

However, when I do this, I get a 'Bad Request' error. Looking at the documentation, it looks like not all of the 'emitted' fields can be sent in an Update request.

 

Seems like some fields are required here - am I supposed to just filter the fields down to the fields supported for Update? This seems error-prone because if you add a new permitted field, that field will be inadvertantly blanked by my non-updated script.

 

In the alternative, do you just update fields specified, should I just specify {'memo': 'Foo'}?

 

What's the right way to do a read-modify-write to update a single field on a Transaction object (or any other)?

3replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Never mind, this was a different issue (apparently, contrary to documentation, the Python Requests will *not* automatically convert my data to JSON for me).

    Reply Like
      • George
      • Developer
      • george_ynab
      • 4 mths ago
      • Reported - view

      Sorry you ran into that, Beige Thunder .  Can you point me to the errant documentation so we can fix it?  Thanks!

      Reply Like
  • Beige Thunder - You should be able to GET a transaction, modify it, and then send it back up with the fields you originally got.  The JavaScript example here is doing just that.  If you got a 400 Bad Request response, the body should have JSON explaining the validation error.  If you are still running into issues here let us know!

    Reply Like
Like Follow
  • 3 mths agoLast active
  • 3Replies
  • 48Views
  • 2 Following