For developers

A developer-friendly payments API with better economics.

REST and JSON, an idempotency key on every write, signed webhooks, and SDKs for Node.js, Python and the browser. From 0.79% per payment for eligible UK consumer cards, with no fixed fee.

Test mode, the API, webhooks and the SDKs cost nothing. You pay per payment, and nothing else.

Node.js
import { Tuppence } from "@tuppence/node";

const tuppence = new Tuppence(process.env.TUPPENCE_SECRET_KEY);
const payment = await tuppence.payments.create({
  amount: 2000, // £20.00, in pence
  currency: "gbp",
  description: "Order 1042",
});
console.log(payment.status, payment.approval_url);
Code samples

The docs' examples, as they run in our CI.

Every sample on this page is type-checked against the SDK in our CI, like the docs' own. Signed in to the docs, the examples there carry your own test keys, ready to paste.

import { Tuppence } from "@tuppence/node";

const tuppence = new Tuppence(process.env.TUPPENCE_SECRET_KEY);

// A payment link to share, in your account's currency, and its address.
const link = await tuppence.paymentLinks.create({
  name: "Research report",
  amount: 2000,
});
console.log(link.url);

// A payment, retried safely: the same key never charges twice.
const idempotencyKey = `order-${Date.now()}`;
const payment = await tuppence.payments.create(
  { amount: 4500, currency: "gbp" },
  { idempotencyKey },
);

// Part of it back, later.
const refund = await tuppence.refunds.create({ payment: payment.id, amount: 500 });
console.log(refund.status);
API coverage

One API for taking money, paying it out and spending it.

Every endpoint is in the API reference, generated from the same OpenAPI document the SDKs are built from.

Payments

Payments, refunds, disputes, payment links, customers and saved cards, and checkout in your own page with @tuppence/js.

Recurring and metered

Plans and subscriptions, and metered billing with meters, meter events and prepaid credits.

Balance and payouts

Your balance, payouts to your bank and the events behind every change.

Card issuing

Cards for your business or your agents, spend policies, card authorisations and transactions, and approvals.

Platforms

Connected accounts and their onboarding, transfers and application fees, with Tuppence Connect.

Bookings

Services, staff, availability, bookings, classes and the waitlist, for businesses that sell time.

Idempotency

A retry is never a second charge.

Send an Idempotency-Key on every POST. A retry with the same key returns the first result, marked Idempotent-Replayed: true, instead of acting again.

  • Keys are kept for 24 hours.
  • The same key with a different body is refused: 409 idempotency_key_reuse.
  • The SDKs send a key on every write, and reuse it across their own retries.
  • Every error has a stable code to branch on. Idempotency and errors
Webhooks

Signed events, verified in one line.

A payment succeeded, a refund was made, a dispute opened, a payout reached the bank: each is an event, signed in its Tuppence-Signature header.

  • constructEvent in each SDK checks the signature against the raw body.
  • No 2xx? We retry on a schedule for 72 hours.
  • Test mode has an inbox that stands in for your server, so you can see deliveries before you write one.

Webhooks in the docs

Migrating

Coming from another payments API?

The conventions are the ones you know, so most of the work is renaming.

  • Amounts are integers in the currency's smallest unit: 2000 is £20.00.
  • Secret keys start sk_test_ and sk_live_; publishable keys pk_test_ and pk_live_.
  • Lists page with limit and starting_after, newest first, with has_more.
  • Events are named for what happened: payment.succeeded, refund.created.
  • Run both side by side: send new checkouts to Tuppence and let your old provider settle what it holds.

The concepts, in the docs

Time and price

From test key to a paid link in minutes.

The quickstart creates a payment link with your test key and pays it with a test card. Checkout in your own page is one server call and a few lines in the browser.

0.79% per payment on eligible UK consumer cards

  • American Express +0.9%, commercial cards +1.5%, cards issued outside the UK +1.7%.
  • No monthly fee, and nothing for test mode, the API, webhooks or the SDKs.

Every price

Payments that give more back.

Start in test mode in a minute. Go live once you’re verified.