SandboxSepolia and Base Sepolia. Pay with test coins; nothing here is real money.

Developer docs

Create a payment priced in rupiah or dollars, send your customer to the checkout, and get a signed webhook when it’s paid.

Getting started

  1. Create a merchant account. You connect the wallet that receives payments and sign a message with it. Signup shows your API key and webhook signing secret once, so store them before you leave the page.
  2. On your server, create a payment for each order and send the customer to its payment_url.
  3. Set a webhook URL in the dashboard’s settings and fulfil the order on payment.paid.

Every request in these docs goes to https://sandbox-pwc.sblsblsbl.club. The customer pays in ETH, WETH, USDT or USDC on Ethereum or Base. The coin goes to your wallet in the same transaction, less the fee (1% unless agreed otherwise). paywithcrypto never holds your funds.

Authentication

Send your secret API key as a bearer token on every /api/v1/payments request:

Authorization: Bearer sk_test_...

Sandbox keys start with sk_test_ and live keys with sk_live_; each works only on its own deployment. Keep the key on your server. If it leaks, roll it in the dashboard: the old key stops working immediately.

Create a payment

POST /api/v1/payments makes one payment for one order. It answers 201 with the payment object.

Request
curl -X POST https://sandbox-pwc.sblsblsbl.club/api/v1/payments \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "order_id": "order-1042",
    "amount": "150000",
    "currency": "IDR",
    "description": "2x Kopi Susu",
    "redirect_url": "https://shop.example.com/orders/1042"
  }'
FieldTypeDescription
order_idstring, requiredYour reference, 1 to 64 characters. Unique per merchant: a second payment with the same order_id is refused with 409, so retrying a create after a timeout can't charge twice.
amountstring, requiredA decimal string in the currency's major unit. IDR is whole rupiah ("150000"); USD takes up to 2 decimals ("12.50").
currencystring, required"IDR" or "USD".
descriptionstringShown on the checkout. Up to 255 characters.
redirect_urlstringWhere the checkout's “Return to” button goes once the payment is paid.
expiry_minutesintegerHow long the payment can be paid: 5 to 10080 (7 days). Default 60.

Read a payment back at any time with GET /api/v1/payments/:id. A payment belonging to another merchant answers 404.

The checkout

Redirect the customer to payment_url. The checkout shows your name, the amount and the expiry. The customer picks a chain and a coin, and pays one of two ways:

  • Connect a wallet (MetaMask, Phantom, any browser wallet, or WalletConnect). The price is locked for 5 minutes for ETH and WETH and 60 minutes for stablecoins.
  • Send to an address from any wallet or exchange. The amount includes a small network fee that pays for moving the coin on to you. This option appears for payments worth $5 or more.

Once the payment is paid, the checkout shows a button back to your redirect_url. Nothing is added to that URL, and a customer can open it without paying, so don’t treat a visit as proof of payment: wait for the webhook or read the payment.

The payment object

API responses and webhooks carry the same object. Amounts in the payment currency are decimal strings; coin amounts are integers in the coin’s base units (wei for ETH, 6 decimals for USDC and USDT), also as strings.

A paid payment
{
  "id": "inv_354z1pfgp0pz9xdsf1tdk9yn",
  "object": "payment",
  "status": "paid",
  "order_id": "order-1042",
  "amount": "150000",
  "currency": "IDR",
  "description": "2x Kopi Susu",
  "redirect_url": "https://shop.example.com/orders/1042",
  "payment_url": "https://sandbox-pwc.sblsblsbl.club/pay/inv_354z1pfgp0pz9xdsf1tdk9yn",
  "amount_received": "150000",
  "paid_at": "2026-11-29T07:04:31.000Z",
  "expires_at": "2026-11-29T08:00:00.000Z",
  "created_at": "2026-11-29T07:00:00.000Z",
  "payments": [
    {
      "method": "wallet",
      "chain": "base",
      "token": "USDC",
      "decimals": 6,
      "amount": "9231054",
      "network_fee": "0",
      "value": "150000",
      "confirmed": true,
      "tx_hash": "0x8f1c...",
      "payer": "0x51a4...",
      "deposit_address": null
    }
  ]
}
FieldTypeDescription
idstringinv_ followed by 24 characters.
statusstringSee Statuses below.
amount_receivedstringConfirmed value received so far, in the payment currency. Unconfirmed funds aren't counted.
paid_atstring or nullWhen the payment became paid (ISO 8601).
paymentsarrayWhat has been received, confirmed or not: one entry per wallet transaction and one per deposit address that received funds.

payments[] entries

FieldTypeDescription
methodstring"wallet" (paid through a connected wallet) or "deposit" (sent to the payment's address).
chainstring"ethereum" or "base".
tokenstring"ETH", "WETH", "USDT" or "USDC".
amountstringGross amount received, in base units. For a deposit, the address's total.
network_feestringThe part of amount kept to pay for moving a deposit on to you; "0" for wallet payments.
valuestringWhat the entry is credited at, in the payment currency.
confirmedbooleanPast the confirmation depth: 12 blocks on Ethereum, 30 blocks on Base.
tx_hash, payerstring or nullWallet payments only. Deposits are plain transfers, tracked by balance, so both are null.

You receive amount minus network_fee, less the platform fee, in the same coin on the same chain. There is no conversion.

Statuses

pending ──funds seen──▶ confirming ──confirmed──▶ paid
   │                         │
   │                         └──short──▶ partially_paid ──top-up──▶ confirming
   └──nothing by expires_at──▶ expired
StatusMeaning
pendingWaiting for the customer to pay.
confirmingFunds are in a block but not yet final. Don't ship yet.
partially_paidConfirmed, but short of the amount. The customer can pay the rest from the same checkout, on any chain and coin.
paidConfirmed in full. Fulfil the order. This is final.
expiredNothing was received before expires_at.
  • Up to 0.5% short still counts as paid, so a wallet rounding a few units down doesn’t leave a payment stuck.
  • Paying more is still paid. The extra goes to you, and the webhook carries an overpaid field with the excess in the payment currency.
  • An expired payment can still become paid. Funds sent late to the address are re-priced at the current rate and accepted if they cover the amount. Handle payment.paid whatever status you last saw.
  • A chain reorganisation can drop unconfirmed funds, which moves a payment from confirming back to pending.

Webhooks

Set your webhook URL in the dashboard’s settings (https only). Each status change is a POST with a JSON body:

payment.paid
{
  "id": "evt_7k2m9q4w8x1c5v3b6n0z2a4s",
  "type": "payment.paid",
  "created_at": "2026-11-29T07:04:31.000Z",
  "previous_status": "confirming",
  "data": {
    "id": "inv_354z1pfgp0pz9xdsf1tdk9yn",
    "object": "payment",
    "status": "paid",
    ...
  }
}

data is the payment object at the time of the event.

EventSent when
payment.confirmingFunds are seen in a block.
payment.pendingA reorg dropped the unconfirmed funds that made it confirming.
payment.partially_paidConfirmed, but short by more than 0.5%.
payment.paidConfirmed in full.
payment.expiredNothing was received before expires_at.
payment.received_after_paidMore confirmed funds arrived on a paid payment; amount_received grew.

Delivery

  • Answer with any 2xx within 10 seconds. Anything else, or no answer, is retried after 1 minute, 5 minutes, 30 minutes, 2, 6, 12 and 24 hours, then dropped: 8 attempts over about two days.
  • A retry sends the same body with the same event id. Record the ids you’ve handled and skip repeats.
  • Events are sent concurrently and can arrive out of order. Order them by created_at, or simply re-read the payment with GET /api/v1/payments/:id and act on its current status.
  • Events are only queued while a webhook URL is set. Events from before you set one aren’t sent later.
A handler (Node, Express)
import express from "express";
import { verifyWebhook } from "./verify-webhook.js";

const app = express();

// The signature covers the exact bytes sent: read the raw body, not parsed JSON.
app.post(
  "/webhooks/paywithcrypto",
  express.raw({ type: "application/json" }),
  async (req, res) => {
    const body = req.body.toString("utf8");
    const signature = req.get("paywithcrypto-signature") ?? "";
    if (!verifyWebhook(signature, body, process.env.PAYWITHCRYPTO_WEBHOOK_SECRET)) {
      return res.sendStatus(400);
    }
    const event = JSON.parse(body);
    if (await alreadyHandled(event.id)) return res.sendStatus(200);

    if (event.type === "payment.paid") {
      await fulfilOrder(event.data.order_id, event.data);
    }
    await markHandled(event.id);
    res.sendStatus(200);
  },
);

Verifying signatures

Every webhook has a paywithcrypto-signature header:

paywithcrypto-signature: t=1795957149,v1=55e7b181654e5e1e867ca6df59347bb0d18bf2abed0281f90fc7c3a86e773b5c

t is the send time in Unix seconds, and v1 is the hex HMAC-SHA256 of <t>.<raw body>, keyed with your webhook signing secret. To check it, recompute the HMAC over the body exactly as received, compare in constant time, and reject a t more than 5 minutes from now so a captured request can’t be replayed. Each retry is signed afresh with a new t.

verify-webhook (Node.js)
import { createHmac, timingSafeEqual } from "node:crypto";

// header: the paywithcrypto-signature request header
// body: the raw request body as a string, exactly as received
export function verifyWebhook(header, body, secret, toleranceSeconds = 300) {
  const parts = Object.fromEntries(
    header.split(",").map((part) => part.split("=", 2)),
  );
  const timestamp = Number(parts.t);
  if (!Number.isInteger(timestamp) || !parts.v1) return false;
  if (Math.abs(Date.now() / 1000 - timestamp) > toleranceSeconds) return false;
  const expected = createHmac("sha256", secret)
    .update(`${timestamp}.${body}`)
    .digest();
  const given = Buffer.from(parts.v1, "hex");
  return given.length === expected.length && timingSafeEqual(given, expected);
}

Rolling the secret in the dashboard signs every later delivery, retries included, with the new one. Update your server first or deliveries will fail until you do.

Errors

Errors are RFC 9457 problem objects. Branch on type; title and detail are for people.

409
{
  "type": "/errors/order-id-taken",
  "status": 409,
  "title": "A payment with this order_id already exists",
  "order_id": "order-1042"
}
400
{
  "type": "/errors/invalid-request",
  "status": 400,
  "title": "Invalid request",
  "detail": "The request payload doesn't match the API: currency: Expected "IDR" | "USD"",
  "errors": [
    { "path": ["payload", "currency"], "message": "Expected "IDR" | "USD"" }
  ]
}
StatustypeWhen
400/errors/invalid-requestThe body isn't valid JSON, a field is missing or has the wrong type, or the amount isn't valid for the currency. detail says why, and errors lists each failing field.
401/errors/unauthenticatedThe API key is missing, wrong, rolled, or from the other deployment.
403/errors/email-not-confirmedLive only: confirm the account's email before creating payments.
404/errors/payment-not-foundNo payment with that id for this merchant.
409/errors/order-id-takenA payment with this order_id exists. Look it up by the id you stored, or use a new order_id.

Testing in the sandbox

The sandbox is a separate deployment on Sepolia and Base Sepolia with its own accounts and sk_test_ keys. It prices payments from the same live rates as production, so amounts look real, but customers pay with test coins.

  • Get Sepolia ETH from a faucet and pay with a wallet switched to the test network. The checkout adds the network if the wallet doesn’t have it.
  • Sandbox accounts can create payments before confirming their email.
  • The webhook URL must be public https. To receive webhooks on your machine, use a tunnel such as cloudflared or ngrok.
  • Moving to production: sign up on the live deployment, swap in the sk_live_ key and webhook secret, and point the base URL at it.

This is the sandbox deployment, on Sepolia (chain 11155111) and Base Sepolia (chain 84532).