diff --git a/coordinator/src/db/hodl_invoice.rs b/coordinator/src/db/hodl_invoice.rs
index 8f82edabe..ef1046a3e 100644
--- a/coordinator/src/db/hodl_invoice.rs
+++ b/coordinator/src/db/hodl_invoice.rs
@@ -69,6 +69,19 @@ pub fn get_r_hash_by_order_id(conn: &mut PgConnection, order_id: Uuid) -> QueryR
.get_result(conn)
}
+/// Returns the pre image of the hodl invoice associated with the order id
+/// If the hodl invoice can not be found a [`Not Found`] error is returned
+/// If the hodl invoice is found the pre_image is optional, as it might have not yet been set.
+pub fn get_pre_image_by_order_id(
+ conn: &mut PgConnection,
+ order_id: Uuid,
+) -> QueryResult