curl --request POST \
--url https://api.example.com/api/payments/create-checkout \
--header 'Authorization: <authorization>'{
"message": "<string>",
"data": {
"url": "<string>"
}
}Start a Stripe checkout flow to upgrade a user to the Pro plan.
curl --request POST \
--url https://api.example.com/api/payments/create-checkout \
--header 'Authorization: <authorization>'{
"message": "<string>",
"data": {
"url": "<string>"
}
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/devxtra-community/hayon/llms.txt
Use this file to discover all available pages before exploring further.
401 Unauthorized.Authorization: Bearer <token> header. The token is issued at login.
Bearer <token>.200 OK with a JSON body containing a single-use Stripe Checkout URL.
Hide properties
checkout.session.completed webhook event. The webhook handler upgrades the user’s plan in the database — no action is needed on the client beyond redirecting the user./payment/cancel page. No charge is made.url is single-use. Do not cache or reuse it. If the user navigates away without completing payment, call this endpoint again to get a fresh URL.curl --request POST \
--url https://api.hayon.app/api/payments/create-checkout \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
{
"message": "Checkout session created",
"data": {
"url": "https://checkout.stripe.com/c/pay/cs_test_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6#fidkdWxOYHwnPyd1blpxYHZxWjA0"
}
}
{
"message": "Unauthorized"
}
{
"message": "Payment session creation failed"
}
Webhook upgrades the account
checkout.session.completed event to POST /api/payments/webhook. The server upgrades the user’s plan to Pro and sets subscription period dates.