Allow partial transaction insertions (or upserts)
planned
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
J
JP Shipherd
planned
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.J
JP Shipherd
Agustín Covarrubias: There is work underway to support your use case. Please see the design for the v2 API here: https://lm-v2-api-v1-proxy-08a8f2bf0c0c.herokuapp.com/v2#tag/transactions-bulk/POST/transactions
If you (or any other users who upvoted this request) can comment if this design hits the mark, it would be appreciated!
A
Agustín Covarrubias
JP Shipherd Hi JP, this seems like it would entirely solve my problem!