Developers

Take stablecoin paymentsin three calls.

Your server creates an order. Your page opens the checkout. Uniform tells your server when it's paid. You always receive USDT on Whitechain, whatever the customer paid with.

API base
https://uniform-blush.vercel.app/desk/v1
Widget
https://uniform-blush.vercel.app/widget.js

Overview

  1. Your server calls POST /v1/orders with your API key and gets a payUrl.
  2. Your page opens that URL in Uniform's checkout card. The customer logs in with an email and pays with USDT on Whitechain or USDC on Base or Ethereum. They pay no gas.
  3. Uniform posts a signed order.paid webhook to your server. Ship the order when it arrives.

Your API key never reaches the browser, and the browser never decides that an order is paid. Only the signed webhook, or reading the order yourself, does.

Get your keys

Open the dashboard and connect the wallet you want to be paid to. If it isn't a merchant yet, give your business a name and sign one free message. You get two secrets, shown once:

API keyCreates orders. Send it as Authorization: Bearer …. Server only.
Webhook secretStarts with whsec_. Checks that a webhook really came from Uniform.

Lost one? Replace it in Settings. The old one stops working at once.

Create an order

POST/v1/ordersAuth: API key

Call this from your server when the customer clicks pay.

FieldTypeNotes
amountstringUSDT as decimal text, up to 6 decimals: "12", "12.50". Above zero, at most 100.
referencestringYour own id for the sale, 1 to 200 characters. Comes back in every webhook.
successUrlstring, optionalWhere to send the customer after paying. https:// or http://.
curl https://uniform-blush.vercel.app/desk/v1/orders \
  -H "Authorization: Bearer $UNIFORM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "12.50",
    "reference": "order-1042",
    "successUrl": "https://yourshop.com/thanks"
  }'

The answer is 201 Created. The customer has 30 minutes to pay before the order expires.

201 Created
{
  "orderId": "0x5f1c3e…9a2e",
  "status": "created",
  "amount": "12.500000",
  "payUrl": "https://…/pay/0x5f1c3e…9a2e",
  "expiresAt": 1794003600
}

Show the checkout

Add the widget and point a button at an endpoint on your server that creates the order and answers { payUrl }. The checkout opens in a card over your page, the same in every browser. It closes by itself once paid.

<script src="https://uniform-blush.vercel.app/widget.js" defer></script>

<!-- POSTs to your endpoint, which answers { "payUrl": "…" } -->
<button data-uniform-checkout="/api/checkout"
        data-uniform-body='{"cartId": "c_81"}'>
  Pay with Uniform
</button>

<script>
  document.addEventListener("uniform:paid", (event) => {
    location.href = "/thanks?order=" + event.detail.orderId;
  });
</script>
uniform:paidFired on the button once paid. event.detail.orderId is the order.
uniform:closedThe customer closed the card first. Uniform.checkout() rejects with Error("closed").

Treat uniform:paid as a hint for your page, not as proof. Ship on the webhook.

No JavaScript? Redirect the customer to payUrl instead. It works as a full page too.

Webhooks

Set your webhook URL in the dashboard under Settings. Uniform sends a POST with a JSON body when an order ends:

order.paidYou have the USDT. Ship the order.
order.expiredNobody paid in time, or a cross-chain payment ran out and went back to the customer.
order.refundedYou refunded the full amount from the dashboard.
What your server receives
POST /uniform/webhook
Content-Type: application/json
X-Uniform-Event: order.paid
X-Uniform-Signature: 7d0a3b…c41f

{
  "type": "order.paid",
  "orderId": "0x5f1c3e…9a2e",
  "reference": "order-1042",
  "amount": "12.500000",
  "currency": "USDT",
  "path": "crosschain",
  "receipts": {
    "customer": ["https://sepolia.basescan.org/tx/0x…"],
    "settlement": "https://explorer.testnet.whitechain.io/tx/0x…"
  }
}

Check the signature

X-Uniform-Signature is the HMAC-SHA256 of the raw body, keyed with your webhook secret, as lowercase hex. Compute it over the bytes you received, before parsing, and compare in constant time.

# Check a signature by hand: the HMAC-SHA256 of the raw body, as lowercase hex.
printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$UNIFORM_WEBHOOK_SECRET" | awk '{print $2}'
# It must equal the X-Uniform-Signature header.

Delivery

Answer with any 2xx within 10 seconds. Anything else is tried again after 10 seconds, 1 minute, 5 minutes and 30 minutes, then given up. You can resend any delivery from the dashboard's Webhooks tab. A delivery can arrive twice, so make your handler safe to run again for the same orderId.

Read an order

GET/v1/orders/{orderId}Auth: none

Anyone with the order id can read it; the id is random and unguessable. Use it to check an order's state yourself, for example on your thank-you page.

curl https://uniform-blush.vercel.app/desk/v1/orders/0x5f1c…9a2e

Order statuses

createdMade by your server. Nobody has paid.
quotedThe customer opened the checkout and got a price.
payingThe customer signed; the payment is on its way.
source_lockedCross-chain: the customer's USDC is locked on their chain.
destination_lockedCross-chain: the provider's USDT is locked for you on Whitechain.
paidYou have the USDT.
partially_refundedYou gave back part of it.
refundedYou gave back all of it.
expiredNobody paid in time. Nothing moved.
returnedCross-chain ran out of time; the customer's money went back to them.

Errors

Every error has the same shape and a matching HTTP status:

HTTP/1.1 400 Bad Request

{
  "error": {
    "code": "bad_amount",
    "message": "amount must be USDT as decimal text with at most 6 decimals, like \"12.50\""
  }
}
401unauthorizedMissing or wrong API key.
400bad_amountNot decimal USDT, more than 6 decimals, or zero.
400amount_too_largeAbove the per-order limit (100 USDT).
400bad_referenceEmpty or longer than 200 characters.
400bad_success_urlNot an http:// or https:// address.
404not_foundNo order with that id.

Testing

Uniform runs on test networks today: Whitechain testnet, Base Sepolia and Ethereum Sepolia. Payments use test USDT and USDC with no real value. Free test USDC is at faucet.circle.com.

Want to see it whole first? The demo store uses exactly the calls above.