Skip to content

Go-live guide ​

This guide covers the path from a first sandbox payment to one authorized live acceptance payment on a certified Kuvex terminal. Complete the steps in order. The webhook step and the live-readiness review cannot be skipped.

Go-live criteria ​

Before accepting production traffic, the integration must demonstrate that:

  1. A payment completes in the isolated sandbox.
  2. The secret key is held by your server, never by the browser.
  3. A retry of the same business attempt cannot create a second charge.
  4. The webhook receiver verifies the signature over the raw HTTP body and records each event exactly once.
  5. The approved merchant, location and physical terminal are bound correctly. Kuvex assigns terminals to your account by serial number; there is no claim step.
  6. One authorized low-value live payment agrees across your application, the Kuvex API, the terminal and receipt, the signed webhook, and independent settlement evidence.

A successful sandbox payment does not authorize live processing. A sandbox key cannot be converted into a live key.

Responsibilities ​

PartyResponsibilities
ISVApplication code, secret key storage on the server, stable order IDs, idempotency keys, HTTPS webhook receiver, durable event deduplication, customer-facing payment state
Kuvex operationsAccount review, merchant and location approval, fulfillment and binding of certified terminals, issuance of live credentials, Runtime and acquirer configuration, approval of the launch window
Kuvex RuntimeCard-present interaction, certified payment SDK, device security, printing, durable delivery of terminal results

Your application never calls Hante, TSYS or a device payment SDK directly, and never receives a PAN, track data or device secrets.

Prerequisites ​

  • Node.js 20 or later, for the examples in this guide
  • A backend service under your control
  • PostgreSQL, for durable webhook receipt records
  • A public HTTPS hostname for the test mode webhook endpoint
  • Separate secret stores for test mode and live mode
  • A stable order ID for every order in your system

sk_test_, sk_live_ and whsec_ values and device secrets must never appear in browser code, source control, screenshots, email, chat or support tickets.

Process ​

StepTaskCompletion criterion
1Run a sandbox paymentThe sandbox page and the virtual terminal show the same payment with a final status
2Create a payment from your serverYour program receives the same final payment as the virtual terminal shows
3Issue a browser session tokenThe browser holds only a kvs_ token bound to one terminal
4Receive webhooksSigned events update the correct order exactly once
5Pass sandbox acceptanceEvery checklist item is met
6Request live accessKuvex operations has closed all eight live-readiness items
7Run the live acceptance paymentAll evidence for the payment agrees

Integrations in which a store POS drives the terminal also complete the companion mode requirements. After launch, the operating rules apply.

Step 1: Run a sandbox payment ​

The sandbox page calls Create a sandbox.

  1. Open the Kuvex sandbox.
  2. Click Create sandbox keys.
  3. Store the displayed sk_test_ key in your local server environment. The key is displayed so that you can call the API from your own backend; it must not be used in browser code.
  4. Record the displayed terminal ID.
  5. Click Open virtual terminal and keep the virtual terminal window open.
  6. Run the sample payment from the sandbox page and approve it on the virtual terminal.
  7. Confirm that the page shows a final status and exactly one payment ID.

Expected result: the sandbox page, the virtual terminal and the returned payment describe the same payment. No real funds move in the sandbox.

Step 2: Create a payment from your server ​

API: Create a payment, Retrieve a payment.

  1. Create a server-side project and install the Node SDK. The package URL is versioned and immutable.

    Development machine:

    bash
    mkdir kuvex-first-payment
    cd kuvex-first-payment
    npm init -y
    npm install https://api.kuvex.com/sdk/node/1.1.0/kuvex-node-1.1.0.tgz
  2. Set the test key and terminal ID from step 1 in your local secret environment. Do not commit them.

    Development machine:

    bash
    export KUVEX_API_KEY='sk_test_REPLACE_ME'
    export KUVEX_TERMINAL_ID='KV_REPLACE_ME'
  3. Create first-payment.cjs:

    js
    const { Kuvex } = require('@kuvex/node');
    
    const kuvex = new Kuvex(process.env.KUVEX_API_KEY);
    
    async function main() {
      const orderId = 'YOUR-ORDER-1001';
      const payment = await kuvex.payments.create({
        terminal_id: process.env.KUVEX_TERMINAL_ID,
        amount_cents: 100,
        currency: 'usd',
        order_id: orderId,
        metadata: { integration_test: true },
      }, {
        // Persist or deterministically derive this value from the business attempt.
        // Reuse the exact value after a timeout or network failure.
        idempotencyKey: `payment:${orderId}:attempt:1`,
        waitForResult: true,
        timeoutMs: 120_000,
      });
    
      console.log({
        id: payment.id,
        status: payment.status,
        order_id: payment.order_id,
        amount_cents: payment.amount_cents,
      });
    }
    
    main().catch((error) => {
      console.error({
        name: error.name,
        code: error.code,
        retriable: error.retriable,
        request_id: error.requestId,
      });
      process.exitCode = 1;
    });
  4. With the sandbox virtual terminal open, run the program.

    Development machine:

    bash
    node first-payment.cjs

Expected result: the program prints the same final payment that the virtual terminal shows.

Idempotency and retries ​

Store the idempotency key as part of the order record. Semantics: Idempotency.

SituationAction
Network error on the same payment attempt of the same orderRetry with the same idempotency key
The customer intentionally starts a new payment after an explicit failed or canceled resultCreate a new attempt with a new idempotency key
Payment ID received, final result not receivedCall kuvex.payments.retrieve(paymentId) or kuvex.payments.wait(paymentId). Do not create another payment
Result is review or otherwise unknownReport neither success nor failure, and do not ask the customer to present the card again. Retrieve the original payment and escalate with the order ID, payment ID and request ID

The API does not enforce the key: a payment request without an Idempotency-Key header is accepted, and resending it creates a second payment. Always send the header.

The SDK retries eligible network failures with the same key. A stable key supplied by your code also protects retries after your process restarts.

Payment results ​

With waitForResult, the call returns once the payment has a result. There are seven results, and each requires a separate branch. Full status list: Transaction status.

statusMeaningAction
succeededPaid in fullRelease the order
partially_approvedPartial approval: only approved_amount_cents was charged; remaining_cents is still owedCollect the remainder with another tender, or void. Do not release the full order
offline_approvedOffline approval: approved by the terminal without the card network; risk describes the exposureThe merchant bears the risk. The payment later becomes succeeded, failed or review
requires_captureAuthorized, not captured (only with capture_method: "manual")Capture from your server
failedNothing was charged; failure.code gives the reasonAnother card or tender. A retry is a new attempt with a new idempotency key
canceledNothing was chargedA new payment can be started safely
reviewUnknown outcomeDo not charge again. Keep retrieving the same payment

pending, processing and void_pending are not results.

Cancel a payment in progress ​

POST /v1/payments/{id}/void (Cancel / void) responds according to whether the terminal has already received the payment:

Terminal stateResponseAction
Payment not yet received by the terminal200, status=canceledThe payment is canceled
Payment received; Runtime 294 or later202, cancel_requested: trueThe terminal is asked to stop and decides the outcome. Keep polling the payment
Payment received; earlier Runtime409 cancel_not_safeWait for the result

Only 200 means canceled. Once the terminal has received the payment, Kuvex does not declare it canceled, because only the terminal knows whether a card was read.

Step 3: Issue a browser session token ​

If your web page calls kuvex.pay(), your backend issues a kvs_ browser session token bound to one terminal (Create a browser session token). Never return the secret key to the browser.

Server route:

js
const { Kuvex } = require('@kuvex/node');
const kuvex = new Kuvex(process.env.KUVEX_API_KEY);

app.post('/api/kuvex-session', requireYourUserSession, async (req, res, next) => {
  try {
    // Resolve this from your authenticated store/location, not arbitrary browser input.
    const terminalId = req.user.assignedKuvexTerminalId;
    const session = await kuvex.browserSessions.create({
      terminal_id: terminalId,
      expires_in: 900,
    });
    res.json({ ...session, terminal_id: terminalId });
  } catch (error) {
    next(error);
  }
});

Browser code:

html
<script src="https://api.kuvex.com/sdk/web/1.1.0/kuvex.js"></script>
<script>
  const session = await fetch('/api/kuvex-session', {
    method: 'POST',
    credentials: 'same-origin',
  }).then((response) => response.json());

  const kuvex = Kuvex(session.token, { terminal_id: session.terminal_id });
  const payment = await kuvex.pay({
    amount_cents: 100,
    order_id: 'YOUR-ORDER-1001',
  });
</script>

Acceptance criteria:

  • Browser network traffic contains only a kvs_ token, never an sk_ or whsec_ secret.
  • The token expires in 15 minutes or less.
  • The server selects the terminal from the authenticated store context.
  • A token issued for one terminal cannot address another terminal.

Step 4: Receive webhooks ​

The webhook receiver is the durable record of payment results in your system. Start from the runnable durable webhook receiver: copy its server.js and schema.sql into your backend and replace the example business mutation with your order update.

Register the endpoint ​

API: Register a webhook endpoint.

js
const endpoint = await kuvex.webhookEndpoints.create({
  url: 'https://your-test-domain.example/webhooks/kuvex',
});

// endpoint.secret is shown once. Put it directly in your secret manager.
CredentialRegistration
Sandbox test key from step 1By API
Live secret keyBy API
Test key created in the Dashboard for a real accountNot by API: returns 403 webhook_account_key_required, because webhook subscriptions apply to the whole account. Add the endpoint in the Dashboard under Developers → Webhooks; the signing secret is displayed once there as well

Handle at least payment.completed, payment.partially_approved, payment.failed, payment.canceled, payment.review_required and payment.refunded. All events: Event types.

Webhook URLs on localhost, private networks or other non-public addresses are rejected. For local development, expose only the development receiver through a temporary public HTTPS URL (Cloudflare Quick Tunnel or ngrok), register that URL, and stop the tunnel after testing. Do not put production credentials behind a development tunnel.

Processing order ​

The receiver processes each delivery in this order (Signature verification):

  1. Read the raw HTTP request body.
  2. Verify the kuvex-signature header before parsing the JSON.
  3. Begin a database transaction.
  4. Insert the event ID and a digest of the payload.
  5. Update the order in the same transaction.
  6. Commit.
  7. Return 2xx only after the commit.

Failure handling ​

CaseRequired behavior
Invalid or stale signatureReject without touching the database
Same event ID, same payloadReturn success without a second business mutation
Same event ID, different payloadReject as an identity conflict
Business update or commit failsRoll back the event record and return a non-2xx status so that Kuvex retries

An HTTP 200 alone does not mean completion: the event record and the order update must both be committed first.

Step 5: Pass sandbox acceptance ​

Request live credentials only after every item is met:

  • [ ] A payment created by your backend reaches one explicit final status.
  • [ ] A retry for the same order cannot create a duplicate payment.
  • [ ] Browser code contains only a short-lived kvs_ token.
  • [ ] The signed webhook updates the correct order.
  • [ ] Replaying the same webhook does not update the order twice.
  • [ ] A simulated database failure returns a non-2xx status and leaves no partial receipt record.
  • [ ] The UI handles terminal_offline, terminal_busy, timeouts and review without inventing a payment result.
  • [ ] The code has a branch for each of the seven results; partially_approved never releases the full order.
  • [ ] When canceling a payment in progress, only 200 is treated as canceled; after 202 or 409 the code keeps retrieving the payment.
  • [ ] Logs contain IDs and stable error codes, but no API key, webhook secret, PAN, track data or device secret.

Record the sandbox payment ID, the event ID and your order ID. Do not record credentials.

Step 6: Request live access ​

Approved accounts sign in to the Dashboard. New ISVs first request a Kuvex account; every request is reviewed manually. To request the live pilot, email hello@kuvex.com with the following non-secret information:

  • Legal company name and application name
  • Technical and operational contacts
  • Kuvex ISV ID, if already issued
  • Merchant and location identity
  • Requested certified terminal model and quantity, and which terminals run in companion mode (driven by a store POS)
  • Webhook hostname (not the signing secret)
  • Preferred launch window and escalation contact

Never send API keys, webhook secrets, card data, device credentials, or screenshots containing them, by email.

Live-readiness items ​

Kuvex operations closes the following eight items. A terminal being online does not close any of them.

ItemClosure evidenceOwner
Merchant bindingAn active, reviewed merchant belongs to the ISVKuvex operations
Location bindingThe terminal's location belongs to that merchantKuvex operations
Device activeThe approved physical terminal is active and assigned to your account. Kuvex assigns it by serial number; claim codes are retired (POST /v1/terminals/claim returns 410 claim_code_retired)Kuvex operations
Live credentialThe live key is approved and delivered once through the agreed secure channelKuvex operations
Live modeThe device is explicitly authorized for live modeKuvex operations
Production payment RuntimeA release-signed Runtime and the production SDK environment are installedKuvex operations
Configuration synchronizedThe device reports the desired configuration with a matching hash and versionKuvex Runtime
Acquirer configurationThe current acquirer configuration is applied and the device has signed inKuvex operations and device

Step 7: Run the live acceptance payment ​

Run exactly one live acceptance payment. Kuvex operations schedules the launch window and approves the amount; do not choose the amount yourself and do not run unscheduled live tests.

Before the payment

  • Confirm the terminal ID, merchant and location.
  • Confirm that the webhook receiver is healthy and its signing secret is loaded.
  • Confirm that the live key is in the server's secret manager, not in the browser.
  • Confirm that the order has one stable idempotency key.
  • Agree on who may stop the test and who owns escalation.

During the payment

  1. Create one payment from your application.
  2. Present the card once on the designated terminal.
  3. Wait for an explicit result.
  4. If the page loses the result, retrieve the original payment ID. Do not create another charge.
  5. Do not retry with a new idempotency key unless the original payment has an explicit failed or canceled final status and the operator intentionally starts a new attempt.

Pass criteria

The live acceptance passes only when all available evidence agrees:

  • [ ] ISV order ID
  • [ ] Kuvex payment ID and explicit final status
  • [ ] Terminal ID and receipt time
  • [ ] Signed webhook event ID, committed once
  • [ ] Amount and currency
  • [ ] Independent settlement or reconciliation evidence, when available

A success screen in the browser is never, by itself, proof that funds moved.

Companion mode requirements ​

These items apply in addition to steps 1–7 when a machine in the store (a store host), not only your backend, calls Kuvex. Companion mode lists the same items with the reasons in its go-live section.

  • [ ] Kuvex has set the companion terminals to companion mode. In live mode, Kuvex sets the mode when the terminal ships or when the merchant goes live; list the serial numbers in the hardware order or go-live request. In the sandbox, switch the mode yourself (Switch run mode).
  • [ ] The live secret key exists only in your backend's secret manager. No store machine, disk image, installer or configuration file contains an sk_ key.
  • [ ] Every store host is registered again with the live key, because hosts registered with a test key do not carry over, and a store manager has paired it on the terminal in that store (Register a host).
  • [ ] Each host's private key stays on that machine. A host has been revoked once and was observed to stop working (Revoke a host).
  • [ ] Store machines keep their clocks synchronized: a host token request must be within 60 seconds of Kuvex's clock (Get a host token).
  • [ ] The host saves the Idempotency-Key with the order before sending the payment, and finds the same payment again after a restart.
  • [ ] The host obtains results by polling; your backend's webhook receiver remains the record of payment results.
  • [ ] Refunds and voids of completed payments go through your backend with your own approval step. A host token cannot perform them.
  • [ ] The customer display mode and the brand (idle screen) are set per terminal. If you use your own display page, its application shows applied on every terminal before you switch to it.
  • [ ] Terminal models without a system lock (currently Kozen P8 and SUNMI CPad Pay) are deployed attended only, and you know which terminals must be reopened manually after a power failure.
  • [ ] It is decided who prints the receipt.
  • [ ] Selling without internet access is not offered: every host call goes through the Kuvex API.

Operating rules after launch ​

  • Keep test and live keys in separate secret stores and deployments.
  • Pin the tested SDK version (current: 1.1.0) and compare the published hashes with the version list.
  • Rotate a compromised credential instead of hiding it in logs or tickets.
  • Monitor webhook delay, retries and event identity conflicts.
  • Retrieve the original payment whenever result delivery is uncertain.
  • One suspicious payment does not automatically stop the whole terminal. Stop new payments only when the terminal cannot safely establish payment identity, authorization or durable result handling.
  • Maintain an operational owner and an escalation contact for every live merchant.

Launch evidence sheet ​

Complete the sheet without secrets or card data:

text
ISV:
Application:
Environment: test / live
Merchant:
Location:
Terminal ID:
ISV order ID:
Kuvex payment ID:
Webhook event ID:
Final status:
Amount/currency:
Receipt timestamp:
Settlement/reconciliation reference:
ISV approver:
Kuvex approver:
Launch timestamp and timezone:
Open issues: