How can I add a subscription using selling plans API?

Greetings everyone I have a hard time understanding the subscriptions aka selling plans api
here is my query, I just want to ensure that I can use it to add a subscription to the customer
In addition can I store selling plan group details on the object I would I need to leverage an external db to do that