The easiest approach would be to send an invite email to the person after they make a purchase. You can setup the invite so that the user is automatically added to a Discourse group when they accept the invitation. See Automate sending Discourse invite emails with Zapier for details.
If sending invites is not an option for you, it should be possible to use a Zapier webhook to create a Discourse user. The Discourse API Docs give details about the request to create a user.