Retrieving all transactions associated with an object

Hi, I’m working on reconciling our book with data that Omise reports. I came across a large number of transaction ids that do not exist in our database, and upon investigation, they are failed charges or transfers. How Omise works is once the charge/transfer fails, a new transaction is created with the opposite amount, I think. So all transactions are “successful”, and all of them update the final balance. Correct me if I’m wrong.

Now the problem is if I only have the source object, like a charge or a transfer, I can’t retrieve all transactions associated with it. I can only grab the latest one. Meanwhile there are weird edge cases all over like one transfer that fails, so there are 1 debit and 1 credit transactions, and then Omise retries that transfer the next day, which creates 1 more debit transaction, all referencing the same source.

What it boils down is: relationship between source and transaction is 1:n, but the API pretends that it’s 1:1, which makes it quite confusing to track down real data.

Do you plan to change this, or is there a workaround for which I’m unaware?

Hello! Sorry to hear you were having trouble.

In the most recent version of the API (2019-05-29), the transfer object now lists an array of transactions associated with a transfer rather than just a single transaction. Charges are still associated with a single transaction. Can you verify that this addresses your issue w/r/t transfers?

See our API versioning guide to learn how to make a request at a different API version from your account default.

1 Like

Hi Dan,

Thanks for the helpful information. Seeing the Charges API is still not updated and only returns one transaction, in case of a charge having multiple transactions such as disputed charges, would this single transaction be the first or the latest?

Hello Pop,

Charges only have 1 transaction. In case a charge is disputed, you can find the corresponding transactions under the dispute.

I hope this helps!