Options

Can't resubmit deleted transaction with same externalId

dabernathy89dabernathy89 Member Posts: 8

I'm running some tests on a tool for importing transactions. I've noticed that even if I delete a transaction from the Wave interface, I cannot resubmit a transaction with the same externalId:

{
  "data": {
    "moneyTransactionCreate": {
      "didSucceed": false,
      "inputErrors": [
        {
          "code": "INVALID",
          "message": "A transaction with the same externalId already exists.",
          "path": [
            "input",
            "externalId"
          ]
        }
      ],
      "transaction": null
    }
  }
}

(By the way, it would be nice to be able to list and delete transactions via the API as well. I know that's a separate discussion though).

Comments

  • Options
    dabernathy89dabernathy89 Member Posts: 8

    Any insight here from the team would be great. Is this something that should be possible, or will be in the future?

  • Options
    PaulCPaulC Member Posts: 186 ✭✭✭

    Hi @dabernathy89,

    You are correct, External ID needs to be truly unique. There are (admittedly rare) scenarios where actions in Accounting could be rolled back, causing a deleted transaction to have to be reinstated; this requirement avoids any risk of conflicting data. If you are adding transactions multiple times in automated testing, the best advice would be to add append an auto-incrementing number to the passed External ID, or even just a time-stamp, to force them to be unique.

    List / update transactions is something we are looking at.

    Hope that helps, Paul

  • Options
    dabernathy89dabernathy89 Member Posts: 8

    Thanks Paul! I am passing through the timestamp right now as an ID prefix. It shouldn't be an issue going forward, but while I was testing out this integration I needed to be able to delete and reinsert the same transactions a bunch o times.

Sign In or Register to comment.