Tapaya
Online PaymentsGetting StartedQuick Start Guide

Quick Start Guide

Take your first online payment with Tapaya Checkout in a few server calls.

Hosted Checkout gives you a ready-made payment page for cards, Apple Pay, and Google Pay. Your server creates a session for an order, the customer pays, and your server confirms the result before fulfilling. Embedded Checkout mounts secure card fields directly inside your own page.

Try both flows below. The test card is already filled in, so select Pay and follow the payment through, or try Apple Pay or Google Pay. Both are replicas, so nothing leaves your browser.

checkout.sandbox.tapaya.com/c/cs_7Hq2x9LmR4
Return to store

Pay to

€121.00

or

Powered by Tapaya

Choose how customers pay

Hosted CheckoutRecommended

Send customers to a secure payment page that Tapaya runs for you.

Customer pays
On a Tapaya-hosted page
You build
One server call and a redirect
Payment methods
Cards, Apple Pay, Google Pay
Branding
Your logo and color
Read the guide

Drop secure card fields into the checkout page you already have.

Customer pays
Inside your own checkout page
You build
Payment endpoints and your checkout UI
Payment methods
Cards, Apple Pay, Google Pay
Branding
Your own page
Read the guide

Availability

Checkout is live for approved merchants. Both Hosted Checkout and Embedded Checkout support cards, Apple Pay, and Google Pay. Wallet availability depends on Checkout settings, domain registration, and the customer's device and browser. Embedded Checkout uses Tapaya.js 0.2.0 and the Node.js SDK 0.3.0. Start with sandbox, then follow Go live.

Accept a payment

Onboard your merchant

Complete merchant onboarding with the online payments capability, or both online and in-store payments. A Checkout-only merchant does not need a terminal. Provide the shop website and online business details, and wait for processor approval. Creating a merchant record or an API key alone does not enable payments.

Open Checkout in the Tapaya Platform. Merchants requesting online payments appear automatically, including those awaiting approval. Continue when the merchant is Ready.

Open the merchant's Settings. Under Merchant API key redirects, add your shop to Allowed websites and set the default success and cancel URLs. A platform using the organization Secret key sets these under Organization defaults instead. The examples use https://shop.example. See Checkout settings for wallets and branding.

Store your key on the server

Under the merchant's Settings, select Create merchant key and copy the tapaya_test_… key. It is shown only once. Keep it in server-side configuration only. It never belongs in browser code or source control.

.env
TAPAYA_ENVIRONMENT=sandbox
TAPAYA_CHECKOUT_API_URL=https://api.sandbox.tapaya.com
TAPAYA_SECRET_KEY=tapaya_test_...

The SDK reads TAPAYA_SECRET_KEY and TAPAYA_ENVIRONMENT automatically. The HTTP examples below use TAPAYA_CHECKOUT_API_URL. Load the variables into your server process; the SDK does not load .env files.

Send the key as Authorization: Bearer <key>. A merchant key selects its merchant, so no other header is needed. A platform serving many merchants uses the organization Secret key instead and sends X-Tapaya-Merchant-Token on every request. See Checkout authentication.

Create a Checkout session

When the customer clicks Checkout in your shop, calculate the final total on your server, persist the order with a unique attempt key, and create a session. merchantOrderId is required, and an order can be paid only once. Amounts are in minor units, so 12100 is EUR 121.00.

For Node.js 22.13.0 or newer, install the ESM SDK before using the Node.js SDK example:

npm install @tapayadot/checkout
server/checkout.js
const response = await fetch(
  new URL('/merchant/checkout-sessions', process.env.TAPAYA_CHECKOUT_API_URL),
  {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.TAPAYA_SECRET_KEY}`,
      'Content-Type': 'application/json',
      'Idempotency-Key': order.checkoutAttemptKey,
    },
    body: JSON.stringify({
      merchantOrderId: order.id,
      amount: order.totalInMinorUnits,
      currency: order.currency,
      successUrl: 'https://shop.example/checkout/return',
      cancelUrl: 'https://shop.example/checkout/cancel',
    }),
  },
);
if (!response.ok) throw new Error(`Checkout failed (${response.status})`);
const session = await response.json();

If the request times out, retry with the same key and body. The API replays the original session instead of creating a second one.

Redirect the customer

Save session.id with your order, then send the browser to session.url with HTTP 303. Use the URL exactly as returned.

// First persist session.id as the order's checkoutSessionId.
return Response.redirect(session.url, 303);

Tapaya shows the order summary and secure payment form, and handles tokenization, 3D Secure, and charging. After a decline, the customer can try another card on the same page. Sessions accept new payments for 30 minutes.

Verify the payment on your server

When the customer lands on your success or cancel URL, retrieve the session with your Secret key and compare it with the stored order. A redirect alone never proves payment.

server/return.js
const response = await fetch(
  new URL(
    `/merchant/checkout-sessions/${encodeURIComponent(order.checkoutSessionId)}`,
    process.env.TAPAYA_CHECKOUT_API_URL,
  ),
  { headers: { Authorization: `Bearer ${process.env.TAPAYA_SECRET_KEY}` } },
);
if (!response.ok) throw new Error(`Status check failed (${response.status})`);
const current = await response.json();

For either integration, compare the result with the stored order before fulfilling it:

const matches =
  current.id === order.checkoutSessionId &&
  current.merchantOrderId === order.id &&
  current.amount === order.totalInMinorUnits &&
  current.currency === order.currency;

if (matches && current.paymentStatus === 'successful') {
  await fulfillOnce(order); // idempotent, safe on repeated visits
}

If the status is still unpaid or retrieval fails, keep the session ID and check again. There are no webhooks yet, so run a reconciliation job for customers who close the tab before returning.

Go live

  1. Complete production merchant onboarding with online payments, or both online and in-store payments. Provide the shop website and online business details. An existing in-store merchant still needs online processor approval.

  2. Check that the merchant is Ready in Checkout settings. This requires an active merchant, online processor approval, and a configured live gateway.

  3. Create a production merchant checkout key, or use your production organization Secret key with the merchant token. Keep live credentials on your server.

  4. Set the production API origin and environment. Replace the sandbox configuration in your deployment:

    Production server configuration
    TAPAYA_ENVIRONMENT=production
    TAPAYA_CHECKOUT_API_URL=https://api.tapaya.com
    TAPAYA_SECRET_KEY=tapaya_live_...

    The HTTP examples use TAPAYA_CHECKOUT_API_KEY; set it to your live key as well. Use the session URL exactly as returned. Production hosted pages open on https://checkout.tapaya.com.

  5. Configure your production return URLs for Hosted Checkout. For embedded Apple Pay, register each shop domain and host its verification file. Live Google Pay requires a configured Google Pay merchant ID.

  6. Complete the QA Checklist, including server verification and the production job that checks unresolved payments. Use real payment methods in production. Sandbox test cards are for sandbox only.

Next steps