Test modeDucat runs on Stripe's test mode for now, so no real card is charged.

Use cases

AI agents paying

Agents can work with money on both sides. Taking it: your agent calls Ducat with your team's key and sees only your team's data; anything past your standing limits waits for a person. Spending it: an agent gets a virtual card with rules, and a person approves the one purchase past them, in the moment.

Step by step

  1. Give the agent a key

    A key in the console belongs to your team; an agent holding it sees only your customers and payments.

    Console: API keys

  2. Free inside the rules

    Making customers, checkouts and reading anything needs no approval.

    POST /v1/checkout-sessions

  3. A nod past the limits

    A refund, charge or subscription past your standing limit answers 403 with a challenge naming the action; a person approves it in Nod and the request goes through once.

    403 + Nod-Approval

  4. A card with rules

    A person issues the agent a card: per purchase, day and month, categories, merchants, expiry, single use.

    POST /v1/cards

  5. Approve in the moment

    A purchase past the rules is held in the authorisation window while a person approves it.

    POST /v1/cards/{id}/approvals

  6. Never the number

    The agent pays through a payment tool and never sees the card number.

    POST /v1/cards/{id}/pay

In code

A refund past the limit: the 403, a person's nod, the same request again

TypeScript

const body = JSON.stringify({ payment_intent: paymentIntentId, amount: 25000 });
const headers = { authorization: `Bearer ${token}`, "content-type": "application/json" };
let r = await fetch("https://api.ducatpay.dev/v1/refunds", { method: "POST", headers, body });
if (r.status === 403 && r.headers.get("www-authenticate")) {
  const approval = await askAPersonInNod(r.headers.get("www-authenticate")!); // each approval works once
  r = await fetch("https://api.ducatpay.dev/v1/refunds", { method: "POST", headers: { ...headers, "nod-approval": approval }, body });
}

Python

import json, urllib.error, urllib.request

def refund(approval: str | None = None):
    headers = {"authorization": f"Bearer {token}", "content-type": "application/json"}
    if approval:
        headers["nod-approval"] = approval
    body = json.dumps({"payment_intent": payment_intent_id, "amount": 25000}).encode()
    req = urllib.request.Request("https://api.ducatpay.dev/v1/refunds", data=body, headers=headers, method="POST")
    return json.load(urllib.request.urlopen(req))

try:
    r = refund()
except urllib.error.HTTPError as e:
    challenge = e.headers.get("www-authenticate")
    if e.code != 403 or not challenge:
        raise
    r = refund(ask_a_person_in_nod(challenge))  # each approval works once

curl

curl -si https://api.ducatpay.dev/v1/refunds \
  -H "authorization: Bearer $DUCAT_TOKEN" -H "content-type: application/json" \
  -d '{"payment_intent": "pi_…", "amount": 25000}'
# → 403, WWW-Authenticate names the action; a person approves it in Nod

curl -s https://api.ducatpay.dev/v1/refunds \
  -H "authorization: Bearer $DUCAT_TOKEN" -H "content-type: application/json" \
  -H "nod-approval: $APPROVAL" \
  -d '{"payment_intent": "pi_…", "amount": 25000}'

Good to know

Features it uses

Start building in test mode

Sign up, make a key, and take a test payment in a few minutes. No card needed.