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.
| Item | Value |
|---|---|
| Base URL | https://api.kuvex.com/v1 |
| Amounts | int in cents; currency usd only |
| Idempotency | Money-moving writes require Idempotency-Key, see Idempotency |
| Card data | Read 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:
curl -X POST https://api.kuvex.com/v1/sandbox/session| Field | Use |
|---|---|
api_key | Test secret key (sk_test_); server side only |
session_token | Browser session token (kvs_) bound to the virtual terminal |
terminal_id | Virtual 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:
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:
<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
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:
| Result | Behavior |
|---|---|
| Succeeded and the collection is fully paid | Resolves with the payment |
failed, canceled, review, partially_approved, offline_approved, or collection not fully paid | Rejects; 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 |
| Parameter | Type | Required | Description |
|---|---|---|---|
amount_cents | int | Yes | Transaction amount in cents |
order_id | String | No | Merchant order ID |
idempotency_key | String | No | Idempotency key; generated by the SDK if omitted |
wait | boolean | No | false returns the pending payment at once without waiting |
timeout_ms | int | No | Wait 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:
- Register a webhook endpoint and store the returned
secret. - Verify the signature over the raw request body.
- Record the event
idand update the order in one transaction, then respond2xx.
Runnable receiver: /examples/webhook-receiver/.
Sandbox
| Item | Value |
|---|---|
| Lifetime | 14 days; afterwards keys, tokens and the terminal return 401 sandbox_expired |
| Keys | sk_test_ prefix; no real charges; cannot be converted to live keys |
| Virtual terminal | Same 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:
| Requirement | Description |
|---|---|
| Account | Approved ISV account; request an account if you have none |
| Merchant | Approved merchant entity and location |
| Terminal | Physical terminal assigned to the account by serial number, with production configuration synced |
| Webhook | Live HTTPS receiver that verifies signatures on raw bytes and deduplicates by event ID |
| Keys | Live secret key held only in a server-side secret store; the front end uses kvs_ tokens only |
Steps:
- Create a test key in the Dashboard under Developers → API keys and complete the integration from your own server.
- Add a webhook endpoint under Developers → Webhooks; verify signature checking and deduplication.
- Link the approved merchant, location and physical terminal; verify the production Runtime configuration.
- Receive the live key (shown once) and store it in your server-side secret store.
- 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
| Topic | Document |
|---|---|
| Choose an integration mode | Integration modes |
| Go-live steps | Launch: sandbox to live |
| Endpoints, statuses, error codes | API reference |
| Browser SDK, server SDK | SDKs and tools |