Pay
Create Subscription
Create a Stripe Checkout session for a recurring subscription plan. Returns a subscription_url to redirect the user to.
POST
/api/pay/create_subscription.php
Requires
Authorization: AppID:AppKey + user tokenRequest body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| token | string | required | — | User session token |
| itemKey | string | required | — | Subscription plan key from the console |
| currency | string | optional | "usd" | usd, brl, or eur |
| success_url | string | optional | Vanelton default | Redirect URL after successful subscription |
| cancel_url | string | optional | Vanelton default | Redirect URL if user cancels |
Test this endpoint
Headers
Body
Success response 200
{
"success": true,
"message": "Subscription link created successfully.",
"subscription_url": "https://checkout.stripe.com/pay/cs_live_..."
}