well you actually need to know more about this type than just being a record, it also needs not to have any fields created and updated that are not string. So it’s actually not that easy to model type-wise!
The data is a wrapper around S.object schema which you can also use to describe transformations and field renamings. And after you got the schema, I can use it for decoding/encoding + get a list of fields and do some additional logic around this. Checkout the rescript-stripe source code to see how it’s done.