Built for developers who never want to integrate payments twice.
One REST integration to every acquirer and payment method in your KLAUDE setup. Idempotent requests, signed webhooks, network tokens and a sandbox from day one.
The API examples on this page are demonstrative. Endpoints, fields and behaviour are illustrative until your production credentials and documentation are issued.
Payments API
Create a payment with an amount in minor units, a currency and a payment method. Set routing to smart and KLAUDE selects the acquirer; set it to a specific acquirer ID to pin the route. Every request accepts an Idempotency-Key header so retries never double-charge.
- Authorise-and-capture or authorise-only
- 3-D Secure 2 handled inline with exemption logic
- Hosted payment page or full API control
// Request
{
"amount": 25000,
"currency": "EUR",
"customer": "cus_9Xp2LmA",
"payment_method": "pm_card_4Zk1",
"capture": true,
"routing": "smart",
"three_ds": { "mode": "auto" },
"metadata": { "order_id": "A-10422" }
}
// Response 201
{
"id": "pay_7Hq3ZtR",
"status": "succeeded",
"amount": 25000,
"currency": "EUR",
"route": { "acquirer": "acq_eu_02", "attempts": 1 },
"created": "2026-09-17T10:42:11Z"
}
Routing
Routing rules are configured in the dashboard and can be overridden per request. Each payment response includes the route taken and any cascade attempts, so you always know why a transaction went where it did.
{
"routing": {
"strategy": "smart", // smart | cost | pinned
"prefer": ["acq_eu_02", "acq_eu_01"],
"cascade": true, // retry soft declines
"max_attempts": 2
}
}
// Response route detail
"route": {
"acquirer": "acq_eu_01",
"attempts": 2,
"history": [
{ "acquirer": "acq_eu_02", "result": "soft_decline", "code": "91" },
{ "acquirer": "acq_eu_01", "result": "approved" }
]
}
Tokenisation
Card details are captured by KLAUDE's hosted fields or SDK and exchanged for a token. Tokens are acquirer-independent, so you can change providers without re-collecting cards. Network tokens and account updater keep stored credentials valid when cards are reissued.
{
"type": "card",
"card_token": "tok_hosted_Fk92…", // from hosted fields
"customer": "cus_9Xp2LmA",
"network_token": true
}
// Response
{
"id": "pm_card_4Zk1",
"card": { "brand": "visa", "last4": "4242", "exp": "09/29", "issuing_country": "DE" },
"network_token": { "status": "active" }
}
Recurring payments
Create a subscription against a stored payment method. KLAUDE flags transactions correctly as merchant-initiated, applies smart retry logic on failed renewals and emits events at each stage so your billing system stays in sync.
{
"customer": "cus_9Xp2LmA",
"payment_method": "pm_card_4Zk1",
"amount": 4900,
"currency": "EUR",
"interval": "month",
"trial_days": 14,
"retry": { "strategy": "smart", "max_attempts": 4 }
}
Webhooks
Every event is delivered as a signed JSON POST. Verify the Klaude-Signature header (HMAC-SHA256 of the raw body with your endpoint secret), respond with a 2xx, and KLAUDE retries with exponential backoff for up to 72 hours if you don't. Events can be replayed from the dashboard.
payment.succeeded,payment.failed,payment.rerouteddispute.opened,dispute.alert,dispute.wonsubscription.renewed,subscription.retry_scheduledpayout.paid,settlement.completed
{
"id": "evt_2Nq8sT",
"type": "payment.rerouted",
"created": "2026-09-17T10:42:12Z",
"data": {
"payment": "pay_7Hq3ZtR",
"from": "acq_eu_02",
"to": "acq_eu_01",
"reason": "soft_decline"
}
}
// Verify (Node)
const sig = crypto.createHmac('sha256', secret)
.update(rawBody).digest('hex');
if (!timingSafeEqual(sig, req.headers['klaude-signature'])) throw …
Errors
Conventional HTTP status codes. Errors carry a stable code, a human-readable message and, for declines, the acquirer response code and whether a retry is permitted under scheme rules.
{
"error": {
"type": "card_declined",
"code": "insufficient_funds",
"message": "The card was declined by the issuer.",
"acquirer_code": "51",
"retry_allowed": false
}
}