82trust / 100

Commerce Tip Split

by x402toll.com in Company & people data

x402 APIPassing, checked 2 h ago

Tip amount, total, and per-person split for a restaurant bill.

POST https://x402toll.com/v1/commerce/tip-split

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
281 ms typical, 400 ms slowest 5%
Last check
2 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://x402toll.com/v1/commerce/tip-split" \
  -H "content-type: application/json" \
  -d '{"billAmount":1,"numPeople":1,"tipPct":18}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fx402toll.com%2Fv1%2Fcommerce%2Ftip-split
const res = await pay("https://x402toll.com/v1/commerce/tip-split", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"billAmount":1,"numPeople":1,"tipPct":18}),
});
console.log(await res.json());

Example input

{
  "billAmount": 1,
  "numPeople": 1,
  "tipPct": 18
}

Example output

{
  "inputs": {
    "billAmount": 1,
    "numPeople": 1,
    "tipPct": 18
  },
  "perPersonTip": 0.18,
  "perPersonTotal": 1.18,
  "tipAmount": 0.18,
  "totalWithTip": 1.18
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
2 h agoPassed402263 ms$0.01
5 h agoPassed402267 ms$0.01
9 h agoPassed402333 ms$0.01
13 h agoPassed402281 ms$0.01
17 h agoPassed402282 ms$0.01
20 h agoPassed402267 ms$0.01
24 h agoPassed402272 ms$0.01
27 h agoPassed402289 ms$0.01
31 h agoPassed402602 ms$0.01
36 h agoPassed402400 ms$0.01