If you wanted to use an actual explicit composite type with an OID it would need to be created.
There where clause is the easy part, its the code side for setting the parameter that I don't know. Ideally the library lets you pass around language-specific objects and it does it for you.
You could consider writing out a JSONB object and writing your condition in terms of json operators/expressions.