Allow partial transaction insertions (or upserts)
A
Agustín Covarrubias
I'm having the same problem as the one described in this Discord thread [1].
Basically I want to just create a stateless CLI that just fetches records from my banks, and call the insert endpoint with all the records found. The problem is that unless you're using strictly exclusive intervals, you'll sometimes get repeated transactions that were already inserted before by the CLI, and currently that just errors out the entire insertion operation (notably, while still returning a 200 status code).
Ideally, this would instead return an error for the individual entries that were duplicated, while still inserting the rest, or alternatively, just ignore the duplicated insertions. Even better would be an upsert endpoint, which just updated or inserted based on the external_id, which would greatly simplify both development and deployment of these kinds of synchronization scripts.
AFAIK, this currently forces me to insert individually (or check before insert), which is inconvenient and slow.
Log In
A
Agustín Covarrubias
Apparently updating a transaction is also tricky, since apparently one cannot update by
external_id
, nor is there an endpoint for looking up transactions. A hack would be to get transactions for the same asset and day, and then get the ID from that.