Subscribe a user to a specific plan. This creates a Stripe checkout session.
Path Parameters
The plan ID to subscribe to
Request Body
URL to redirect after successful payment
URL to redirect if payment is cancelled
Customer email for the checkout
User ID to associate with the subscription
Response
Whether the checkout session was created
Stripe checkout URL to redirect the user
curl -X POST "https://api.usegately.com/api/v1/plans/plan_123/subscribe" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"success_url": "https://mysite.com/success",
"cancel_url": "https://mysite.com/pricing",
"customer_email": "[email protected]",
"user_id": "user_123"
}'
{
"success": true,
"checkoutUrl": "https://checkout.stripe.com/c/pay/xxx",
"sessionId": "cs_xxx"
}