Skip to content

Quickstart ​

Complete a test transaction in the sandbox: create a sandbox, issue a browser session token, create a payment and receive the result. The sandbox moves no real money and requires no account.

ItemValue
Base URLhttps://api.kuvex.com/v1
Amountsint in cents; currency usd only
IdempotencyMoney-moving writes require Idempotency-Key, see Idempotency
Card dataRead by the terminal and sent directly to the acquirer; never passes through the merchant's systems

1. Get a terminal ​

Call Create a sandbox to get a test key, a browser session token and a virtual terminal:

bash
curl -X POST https://api.kuvex.com/v1/sandbox/session
FieldUse
api_keyTest secret key (sk_test_); server side only
session_tokenBrowser session token (kvs_) bound to the virtual terminal
terminal_idVirtual terminal ID

Open the virtual terminal on the sandbox page; it behaves like a physical terminal at the API level. In live mode, Kuvex assigns physical terminals to the account by serial number at fulfillment; no binding is required.

2. Issue a token and load the SDK ​

The secret key must never reach the front end. Your server calls Create a browser session token and passes the kvs_ token to the page:

bash
curl https://api.kuvex.com/v1/auth/token \
  -H "Authorization: Bearer $KUVEX_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"terminal_id": "KV100023", "expires_in": 900}'

The page loads and initializes the browser SDK:

html
<script src="https://api.kuvex.com/kuvex.js"></script>
<script>
const kuvex = Kuvex('kvs_...', { terminal_id: 'KV100023' });

// Tokens last 900 seconds; fetch a new one from your server before expiry
kuvex.setToken('kvs_new_...');
</script>

3. Create a payment ​

js
try {
  const payment = await kuvex.pay({ amount_cents: 3000, order_id: 'A-1042' });
  // payment.status === 'succeeded'
} catch (e) {
  // e.code: failure.code or the payment status; e.payment: the payment
}

kuvex.pay() calls Create a payment and waits for the terminal's result:

ResultBehavior
Succeeded and the collection is fully paidResolves with the payment
failed, canceled, review, partially_approved, offline_approved, or collection not fully paidRejects; e.code is the failure reason or status, e.payment the payment
No result within timeout_ms (default 120000)Rejects with e.code=payment_timeout
ParameterTypeRequiredDescription
amount_centsintYesTransaction amount in cents
order_idStringNoMerchant order ID
idempotency_keyStringNoIdempotency key; generated by the SDK if omitted
waitbooleanNofalse returns the pending payment at once without waiting
timeout_msintNoWait timeout, default 120000

Other parameters are as in Create a payment. Server-initiated payments call that endpoint directly.

4. Receive the result ​

The page gets the result through await for display. Order state must be driven by the webhook your server receives:

  1. Register a webhook endpoint and store the returned secret.
  2. Verify the signature over the raw request body.
  3. Record the event id and update the order in one transaction, then respond 2xx.

Runnable receiver: /examples/webhook-receiver/.

Sandbox ​

ItemValue
Lifetime14 days; afterwards keys, tokens and the terminal return 401 sandbox_expired
Keyssk_test_ prefix; no real charges; cannot be converted to live keys
Virtual terminalSame API as a physical terminal; simulate tap, insert, decline and other actions on the sandbox page

Go live ​

Live access is granted after review by Kuvex; test keys cannot be used in live mode. Prerequisites:

RequirementDescription
AccountApproved ISV account; request an account if you have none
MerchantApproved merchant entity and location
TerminalPhysical terminal assigned to the account by serial number, with production configuration synced
WebhookLive HTTPS receiver that verifies signatures on raw bytes and deduplicates by event ID
KeysLive secret key held only in a server-side secret store; the front end uses kvs_ tokens only

Steps:

  1. Create a test key in the Dashboard under Developers → API keys and complete the integration from your own server.
  2. Add a webhook endpoint under Developers → Webhooks; verify signature checking and deduplication.
  3. Link the approved merchant, location and physical terminal; verify the production Runtime configuration.
  4. Receive the live key (shown once) and store it in your server-side secret store.
  5. Run one authorized low-value live transaction and reconcile the page result, webhook, terminal receipt and settlement record.

A terminal being online, a successful sandbox transaction or holding a key does not by itself authorize live processing. The Dashboard lists outstanding requirements; Runtime still checks every transaction. Detailed steps: Launch: sandbox to live. For a live pilot contact hello@kuvex.com; never send API keys or card data by email.

Next steps ​

TopicDocument
Choose an integration modeIntegration modes
Go-live stepsLaunch: sandbox to live
Endpoints, statuses, error codesAPI reference
Browser SDK, server SDKSDKs and tools