Add Pay with PoP to your website
Checkout is the easy part. PoP handles what happens after: delivery, refunds, receipts and reviews.
About 15 lines of integration code
// server: one PoP client with your keys
import { PoP } from "@pop/checkout-sdk/server";
const pop = new PoP({ baseUrl, apiKey, webhookSecret, merchantPk });
// server: POST /api/checkout
const s = await pop.createSession({ title, priceInr, priceUsdt, merchantRef: cartId, returnUrl });
return Response.json({ url: s.url });
// server: POST /api/pop/webhook
const raw = await req.text();
const ev = pop.verifyWebhook(raw, req.headers.get("pop-signature"));
const { state, amount } = await pop.confirmOnChain(ev);
// browser: the Pay with PoP button
import { startPayWithPoP } from "@pop/checkout-sdk/browser";
startPayWithPoP("/api/checkout");Kurta Co., a separate app, uses exactly these calls. Open Kurta Co.
Order webhooks
order.funded, order.shipped, order.delivered, order.released, order.refunded. Each is signed with HMAC-SHA256 in the PoP-Signature header, and the store checks it against the chain before it trusts it.
An onchain receipt for every order
Payment, shipping, delivery and payout or refund are transactions on Whitechain Sepolia that anyone can look up.
Refunds
Automatic when a ship-by or deliver-by deadline is missed, decided by the arbiter in a dispute, and forced for a banned seller. There is no merchant-initiated refund button in this version.
Export for your accountant
One CSV row per order, with these columns:
- order_id
- state
- listing_id
- title
- merchant_ref
- buyer_wallet
- amount_test_usdt
- funded_at_utc
- shipped_at_utc
- delivered_at_utc
- fund_tx
- ship_tx
- deliver_tx
- settle_event
- settle_tx
- explorer_base
Why USDT on Whitechain
On UPI or cards, a refund depends on the seller agreeing or a slow dispute. Here the refund rule lives in a contract nobody can switch off, and every order has a public receipt. Rupee payments would need a licensed on-ramp partner; this demo uses test USDT only.