I answered a related question here.
The idea of Thomas' involvement has a long lineage in the Thomistic churches in India and may have emerged from oral tradition there. It does also appear in some early Christian texts, which I mention.