Skip to content

API Reference

VIO v4 provides two sets of APIs for different integration scenarios.

External API

The External API is a REST API for tenant-level integrations. It uses API key authentication and provides full CRUD access to platform resources.

Use the External API when you want to:

  • Integrate your backend systems with VIO
  • Automate voucher creation and management
  • Manage users programmatically
  • Build custom dashboards with analytics data
  • Handle token minting, burning, and transfers from your server
FeatureDetails
AuthAPI Key via X-API-Key header
Base URLhttps://{your-domain}/api/external/v1
Rate Limit60 req/min, 10,000 req/day
FormatJSON request/response

API sections: Vouchers | Users | Campaigns | Tokens | Analytics


Mini App API

The Mini App API is designed for third-party web apps that are embedded inside the VIO Member App via an iframe. It uses JWT-based authentication (refresh/access tokens).

Use the Mini App API when you want to:

  • Build a mini app that runs inside the VIO Member App
  • Access the current user's profile and wallet data
  • Display token balances and voucher listings
  • Send tokens or issue vouchers to users (admin role)
  • Create interactive experiences within the VIO ecosystem
FeatureDetails
AuthJWT (refresh token -> access token)
Base URLhttps://api.vio.com/api/miniapp
Embeddingiframe inside VIO Member App
FormatJSON request/response

API sections: Auth | User Info | Tokens | Vouchers | Admin Actions | Public APIs


Public APIs

The Public API provides endpoints that don't require authentication, useful for mini apps that need to perform initial operations before user login.

Use the Public API when you want to:

  • Verify a redemption PIN to identify a tenant
  • Get a list of stores for a tenant
  • Retrieve tenant branding information for UI customization
FeatureDetails
AuthNone required
Base URLhttps://api.vio.com/api/public
FormatJSON request/response

Endpoints:

MethodEndpointDescription
POST/verify-pinVerify PIN and get tenant info
GET/tenants/:tenantId/storesGet stores list for a tenant
GET/tenants/:tenantId/infoGet tenant public info and branding

See Public APIs documentation for details.



Web3 Asset Service

The platform uses an external Web3 Asset Service for on-chain operations. This service manages ERC-20 token contracts, ERC-721 NFT contracts, and custodial wallets.

FeatureDetails
AuthX-API-Key header
DocsSwagger UI
CapabilitiesWallet creation, Token deploy/mint/transfer/burn/recall, NFT deploy/mint/transfer

Key points:

  • Every user gets an auto-provisioned custodial wallet with a userSecretKey for signing transactions
  • When a user links across tenants via Cross-Tenant SSO, all linked User records share the same wallet address (the wallet is only created once)
  • Token and NFT contracts are deployed on-chain via the Web3 service when created through the Admin Portal or API
  • Wallet provisioning happens automatically on user creation or lazily on first blockchain operation

Internal APIs (Member App & Admin Portal)

The following APIs are used internally by the VIO Member App and Admin Portal. They use JWT Bearer token authentication.

Push Notifications API

EndpointMethodAuthDescription
/api/users/me/push-subscriptionPOSTJWTRegister a Web Push subscription
/api/users/me/push-subscriptionDELETEJWTRemove a push subscription
/api/users/me/notification-preferencesGETJWTGet notification preferences
/api/users/me/notification-preferencesPUTJWTUpdate notification preferences
/api/notifications/broadcastPOSTJWT (Admin)Broadcast notification to all users
/api/notifications/sendPOSTJWT (Admin)Send notification to a specific user
/api/notifications/statsGETJWT (Admin)Get push subscription statistics

WebAuthn / Biometric API

EndpointMethodAuthDescription
/api/auth/webauthn/register-optionsPOSTJWTGenerate biometric registration options
/api/auth/webauthn/register-verifyPOSTJWTVerify and store biometric credential
/api/auth/webauthn/login-optionsPOSTPublicGenerate biometric login challenge
/api/auth/webauthn/login-verifyPOSTPublicVerify biometric login, return JWT tokens
/api/auth/webauthn/credentials/:idDELETEJWTRemove a biometric credential

Cross-Tenant SSO API

Enables single sign-on across tenants and sub-companies. Uses an HttpOnly cookie (vio_sso_token) for global session management. The login endpoint supports crossTenantLink, crossSubCompanyLink, and crossParentPortalLink (parent company URL vs sub-company–only profile) for account linking. Signup detection (check-identifier) and cross-tenant prompts can return sourceSubCompanyName when the existing account was created under a sub-company. See the full Cross-Tenant SSO guide for architecture details and QA test cases.

EndpointMethodAuthDescription
/api/auth/sso/check-identifierPOSTPublicCheck if email/phone is registered in another tenant (signup detection)
/api/auth/sso/checkGETCookieCheck if SSO session exists for a target portal (tenant + optional sub-company)
/api/auth/sso/exchangePOSTCookieExchange SSO token for portal-specific JWT
/api/auth/sso/linkPOSTCookieLink existing portal account (password confirmation, optional subCompanyId)
/api/auth/sso/unlinkPOSTJWTUnlink a portal from global identity (optional subCompanyId)
/api/auth/sso/logoutPOSTCookieRevoke SSO session globally
/api/auth/me/linked-tenantsGETJWTList all portals linked to the user's identity (includes sub-company info)
/api/auth/loginPOSTPublicLogin with optional crossTenantLink, crossSubCompanyLink, crossParentPortalLink; see SSO guide for prompt responses

Voucher Transfer API

APIs for transferring vouchers between users and viewing transfer history.

EndpointMethodAuthDescription
/api/vouchers/me/:userVoucherId/transferPOSTJWTTransfer a voucher to another user
/api/vouchers/me/transfer-historyGETJWTGet user's voucher transfer history

Transfer Voucher

Transfer a claimed voucher to another user. Transfer eligibility is determined by the voucher's visibility setting:

VisibilityTransfer Scope
PrivateOnly within the creating company (same tenant/sub-company)
SharedCreating company + shared organizations (sharedWithTenants, sharedWithSubCompanies)
PublicNo restrictions - can transfer to any user

Request body:

json
{
  "toUserId": "string"  // Recipient user ID
}

Error responses:

  • 403 Forbidden - "Private vouchers can only be transferred within the creating company"
  • 403 Forbidden - "Shared vouchers can only be transferred within allowed organizations"

Get Voucher Transfer History

Get the current user's voucher transfer history (sent and received).

Query parameters:

ParameterTypeDefaultDescription
pagenumber1Page number
limitnumber20Items per page
directionstring"all"Filter by direction: "all", "sent", or "received"

Response:

json
{
  "success": true,
  "data": [
    {
      "_id": "transfer_id",
      "userVoucherId": "user_voucher_id",
      "voucherId": { "_id": "...", "name": "Voucher Name", "images": [...] },
      "fromUserId": { "_id": "...", "displayName": "Sender Name", "email": "..." },
      "toUserId": { "_id": "...", "displayName": "Recipient Name", "email": "..." },
      "voucherSnapshot": { "name": "...", "value": 100, "valueType": "fixed" },
      "transferredAt": "2024-01-15T10:30:00Z",
      "direction": "sent"  // or "received"
    }
  ],
  "pagination": { "total": 10, "page": 1, "limit": 20 }
}

Comparison

External APIMini App APIPublic API
AuthenticationAPI KeyJWT TokensNone
Use caseServer-to-serverClient-side (iframe)Pre-auth operations
User contextAny user (by ID)Current logged-in userNo user context
Admin featuresFull CRUDSend tokens/vouchersRead-only
AnalyticsYesNoNo
Rate limiting60/minStandardStandard

VIO v4 Platform Documentation