API Tokens

No API Tokens Yet

Create your first API token to start integrating hosted checkout.

Payment Providers

Stripe Connect is the production payment rail. Other providers are sandbox-only simulations until their live integrations pass security and settlement review.

Recent Checkout Sessions

No Sessions Yet

Checkout sessions will appear here once you start processing payments.

Integration Guide

Sandbox

Use vpay_test_... tokens to simulate checkout without contacting a live payment network.

Live

Use vpay_live_... tokens for production. The token—not a client-supplied field—locks every session to its environment.

Create an API Token

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.

Verify Stripe Connect

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.

Create a Checkout Session

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
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"
  }'

Redirect to Checkout

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:

JavaScript
// 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;

Handle the Result

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:

URL
https://yoursite.com/success?session_id=cs_abc123&payment_id=pi_xyz789&environment=sandbox
Node.js
// 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.

API Reference

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)

Checkout Session Parameters

Parameter Type Required Description
amountinteger✅Amount in cents (e.g., 2999 = $29.99)
currencystringNo3-letter currency code (default: USD)
environmentread-only—Determined by the API token prefix (vpay_live_ or vpay_test_).
descriptionstringNoProduct/service description
success_urlstring✅Redirect URL after successful payment
cancel_urlstringNoRedirect URL if customer cancels
customer_emailstringNoPre-fill customer email
allowed_providersarrayNoLive: ["stripe"]. Sandbox can also simulate Google Pay, Amazon Pay and Clover.
metadataobjectNoCustom key-value pairs