createProduct() with digital products

Is it possible to use createProduct to create digital product? I already read the API documentation and try the example code, but if I change the type product for digital, it doesn’t work.

We don’t see any field to put the file. It is not possible.

Has this changed? I’m facing the same issue, as I would like to create digital products depending on some form results. Is it possible to use this to create a digital product? @certified-code