\Stripe\Stripe::setApiKey("sk_live_ydfIQeSNp1oIfCtXpqCtgXjO"); // Get the token from the JS script $token = $_POST['stripeToken']; // Create a Customer $customer = \Stripe\Customer::create(array( "email" => "brianford@buildingfutures.marketing", "source" => $token, )); // or you can fetch customer id from the database too. // Creates a subscription plan. This can also be done through the Stripe dashboard. // You only need to create the plan once. $subscription = \Stripe\Plan::create(array( "amount" => 2000, "interval" => "month", "name" => "Basic Monthly", "currency" => "usd", "id" => "gold" )); // Subscribe the customer to the plan $subscription = \Stripe\Subscription::create(array( "customer" => $customer->id, "plan" => "gold" )); print_r($subscription);