One-time payment

Charge a dynamic amount, send the customer to /pay, fulfill when the webhook fires.

AGENTS.md

1. Product

Create a one_time product with pricing_model: "dynamic" so each checkout can supply amount_etb.

2. Create checkout from your cart API

ts
const res = await fetch("https://verifyitet.duckdns.org/api/v1/checkouts/", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PAYPROOF_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    app_id: Number(process.env.PAYPROOF_APP_ID),
    product_id: Number(process.env.PAYPROOF_ONE_TIME_PRODUCT_ID),
    amount_etb: cartTotal.toFixed(2),
    customer_ref: orderId,
    success_url: `${siteUrl}/orders/${orderId}/thanks`,
    cancel_url: `${siteUrl}/cart`,
    idempotency_key: `order_${orderId}`,
  }),
});
const { checkout, pay_url } = await res.json();
// Redirect browser to websiteOrigin + pay_url

3. Fulfill on webhook

Handle checkout.verified or payment.verified. Verify the signature first — see webhook receiver.