Search subkey inside JSONB
I'm using this sql to get 'application' (field) -> 'tour_id.id' 


Assuming you meant to ask:

I'm using this SQL query to retrieve the row where application #&gt;&gt; '{0, tour_id, id}' equals the provided UUID.

.. which already carries half an answer.

If your outer JSON array only has a single element like your example value implies, use this simple query:

SELECT *
FROM   payment
WHERE  application #&gt;&gt; '{0, tour_id, id}' = 'a43d38d4-9bfb-4ffa-8704-e536f04b0c60'
ORDER  BY "createdAt" DESC;


Note how I replaced the (assumingly) unneeded fuzziness of
like '%a43d38d4-9bfb-4ffa-8704-e536f04b0c60%'
with simpler and faster
= 'a43d38d4-9bfb-4ffa-8704-e536f04b0c60'.

Else (for any number of elements in the outer JSON array):

SELECT *
FROM   payment
WHERE  application @&gt; '[{"tour_id": {"id":"a43d38d4-9bfb-4ffa-8704-e536f04b0c60"}}]'
ORDER  BY "createdAt" DESC;


That's the jsonb containment operator @&gt;, which can be supported with a generic index or a more specialized jsonb_path_ops index. Instructions and links:


How to get particular object from jsonb array in PostgreSQL?


The manual hints:


  For a full description of jsonb containment and existence semantics, see Section 8.14.3.