Get order(s) based on transaction reference


I’m trying to fetch all orders based on a certain transaction reference value, without luck.

I’ve tried both using PaymentViewFilteringInfo and OrderViewFilteringInfo, but as far as I can tell, there’s no way of finding either payments nor orders based on the transaction reference.

I don’t want to search for orders, as a corrupt search index could have major consequences for my use case.

Maybe there’s a smarter way to achieve what I want? My payment provider has an id that I set as the “TransactionReference” on the payment info object once it is created. In some cases, I need to check if an order exist for said transaction reference.

I don’t want to the set the external order number in Litium to the id from the payment provider.

Litium version: 7.7.1

On the order collection there’s a method GetOrdersByTransactionReference(String paymentProvider, String transactionReference, Token) you can use to fetch an order by what’s saved as the payments’ transaction reference.

GetOrdersByTransactionReference in API docs

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.