Create your first API token to start integrating hosted checkout.
Stripe Connect is the production payment rail. Other providers are sandbox-only simulations until their live integrations pass security and settlement review.
Checkout sessions will appear here once you start processing payments.
Use vpay_test_... tokens to simulate checkout without contacting a live payment network.
Use vpay_live_... tokens for production. The token—not a client-supplied field—locks every session to its environment.
Go to the API Tokens tab and create a new token. Pick Sandbox for test integrations or Live for production. Copy it immediately — you won't see it again.
Live checkout uses the Stripe Payment Element and a verified connected account. Google Pay, Amazon Pay and Clover choices are available only as sandbox simulations.
Use your API token to create a hosted checkout session from your backend. Sandbox sessions return a hosted test flow and simulated completion instead of a live processor charge:
curl -X POST https://pay.vigthoria.io/api/checkout/sessions \
-H "Authorization: Bearer vpay_test_YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"amount": 2999,
"currency": "USD",
"description": "Premium Plan",
"success_url": "https://yoursite.com/success",
"cancel_url": "https://yoursite.com/cancel",
"customer_email": "customer@example.com"
}'Use the returned checkout_url to redirect your customer to the hosted payment page. This sandbox response includes all simulators; live sessions include only Stripe:
// Response from POST /api/checkout/sessions
{
"success": true,
"session": {
"id": "cs_abc123...",
"checkout_url": "https://pay.vigthoria.io/checkout/cs_abc123...",
"amount": 2999,
"currency": "USD",
"available_providers": [
{ "id": "stripe", "name": "Stripe" },
{ "id": "google_pay", "name": "Google Pay" },
{ "id": "amazon_pay", "name": "Amazon Pay" },
{ "id": "clover", "name": "Clover" }
]
}
}
// Redirect customer
window.location.href = response.session.checkout_url;After payment, the customer is redirected to your success_url. Sandbox returns the same session contract, plus an environment=sandbox query parameter so you can keep test and live flows separate:
https://yoursite.com/success?session_id=cs_abc123&payment_id=pi_xyz789&environment=sandbox
// Verify the payment on your server
const response = await fetch(
`https://pay.vigthoria.io/api/checkout/sessions/${sessionId}/verify`,
{ headers: { 'Authorization': `Bearer ${apiToken}` } }
);
const { session } = await response.json();
if (session.status === 'completed') {
// Payment confirmed! Deliver the product/service
console.log('Payment successful:', session);
}Read session.environment on your server to decide whether you are handling a live order or a simulated sandbox result.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/checkout/sessions | Create a new checkout session in live or sandbox mode |
| GET | /api/checkout/sessions/:id/verify | Verify owned session details and status (API token required) |
| POST | /api/checkout/sessions/:id/cancel | Cancel an owned pending session (API token required) |
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | integer | ✅ | Amount in cents (e.g., 2999 = $29.99) |
| currency | string | No | 3-letter currency code (default: USD) |
| environment | read-only | — | Determined by the API token prefix (vpay_live_ or vpay_test_). |
| description | string | No | Product/service description |
| success_url | string | ✅ | Redirect URL after successful payment |
| cancel_url | string | No | Redirect URL if customer cancels |
| customer_email | string | No | Pre-fill customer email |
| allowed_providers | array | No | Live: ["stripe"]. Sandbox can also simulate Google Pay, Amazon Pay and Clover. |
| metadata | object | No | Custom key-value pairs |