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": "user@example.com",
"user_id": "user_123"
}'
{
"success": true,
"checkoutUrl": "https://checkout.stripe.com/c/pay/xxx",
"sessionId": "cs_xxx"
}
Plans
Subscribe to Plan
Create a subscription to a plan
POST
/
api
/
v1
/
plans
/
{id}
/
subscribe
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": "user@example.com",
"user_id": "user_123"
}'
{
"success": true,
"checkoutUrl": "https://checkout.stripe.com/c/pay/xxx",
"sessionId": "cs_xxx"
}
Subscribe a user to a specific plan. This creates a Stripe checkout session.
Path Parameters
Request Body
Response
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": "user@example.com",
"user_id": "user_123"
}'
{
"success": true,
"checkoutUrl": "https://checkout.stripe.com/c/pay/xxx",
"sessionId": "cs_xxx"
}
Was this page helpful?