Credits
Verify Checkout Session
Verify a completed checkout session and ensure credits have been added.
GET
Overview
After a successful checkout, use this endpoint to verify the payment was processed and credits were added to the account. This is useful as a fallback in case the webhook wasn’t processed.Credits are typically added automatically via Stripe webhooks. This endpoint provides a manual verification option for edge cases or client-side confirmation.
For third-party integrations: Use
GET /credits/verify-session/{sessionId}/api with API Key authentication instead.Authentication
Your JWT access token (session auth). Format:
Bearer YOUR_ACCESS_TOKENPath Parameters
The Stripe checkout session ID returned from
/credits/checkout.Response Fields
Whether the session verification was successful.
Number of credits from the purchase.
The verified session ID.
Error Responses
400
Bad Request - Payment not completed or invalid session metadata.
401
Unauthorized - Invalid or missing token.
403
Forbidden - Session does not belong to the authenticated user.
Idempotency
This endpoint is idempotent. If the credits were already added (via webhook), it will not add them again. It will still return success with the credit amount.Typical Flow
- User completes checkout at Stripe
- Stripe redirects to your
successUrl - Call this endpoint to verify and confirm credits
- Display confirmation to user
- Refresh credit balance in your UI
GET /credits/verify-session//api
This endpoint verifies a checkout session using API Key authentication. Ideal for third-party integrations.Authentication
Requires API Key authentication. Include your API key in theAuthorization header: