Upvote:1
The Trikaya concept is a Mahayana concept although the origin to the term Dharmakaya could be found in the Pali Canon at SN 22.87:
Enough, Vakkali! What is there to see in this vile body? He who sees Dhamma, Vakkali, sees me; he who sees me sees Dhamma. Truly seeing Dhamma, one sees me; seeing me one sees Dhamma."
Upvote:1
In my understanding, in the Pali Canon the Buddha had used the word "Dhammakaya" to refer metaphorically to the body of his teachings. Another term that was used in the same sense was "Dhammasarira" (Dharma-sharira) - playing on the notion of Buddha's cremation relics to refer specifically to the dispersed collection of teachings left after the Buddha's parinirvana.
Since Buddha himself said that "whoever sees Dhamma sees me" and that "the Dhamma exists as a natural law whether Tathagatas arise or not", it was easy enough for the eager students to add two and two together and assume that Dhammakaya implies the eternal cosmic body of the primordial Buddha.
The other two terms presumably evolved at the later times, at least they were not found in any of the early texts.