Pay
Create Payment
Create a Stripe Checkout session for a one-time purchase. Returns a payment_url to redirect the user to.
POST
/api/pay/create_payment.php
Requires
Authorization: AppID:AppKey + user tokenRequest body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| token | string | required | — | User session token |
| itemKey | string | required | — | Product key from the console |
| quantity | int | optional | 1 | Number of items |
| currency | string | optional | "usd" | usd, brl, or eur |
| success_url | string | optional | Vanelton default | Redirect URL after successful payment |
| cancel_url | string | optional | Vanelton default | Redirect URL if user cancels |
| debug | bool | optional | false | Use Stripe test mode |
Test this endpoint
Headers
Body
Success response 200
{
"success": true,
"message": "Payment link created successfully.",
"payment_url": "https://checkout.stripe.com/pay/cs_live_..."
}
Errors
| Code | Message |
|---|---|
| 401 | Invalid or expired token. |
| 400 | itemKey not found or not active. |