Wam Pay for developers

Payments in a few
lines of code

Create a payment, send your customer to checkout, and get a signed webhook when it is paid. Cards and the Wam app, in one integration.

npm install @wamnow/payment-sdk
checkout.ts
import { WamPaymentSDK } from "@wamnow/payment-sdk";

const wam = new WamPaymentSDK({
  businessId: process.env.WAM_BUSINESS_ID!,
  apiKey: process.env.WAM_API_KEY!,
  environment: "production",
});

const intent = await wam.createPaymentIntent({
  amountCents: 21000, // TT$210.00
  currency: "TTD",
  orderReference: "order-1042",
  description: "Linen shirt, sand",
  returnUrl: "https://islandthreads.tt/order/complete",
});

// Send your customer to Wam's checkout
redirect(intent.checkoutUrl);
How it works

Three calls from cart to paid

  1. 1Create a payment intent

    Your server sends the amount, currency and your order reference. Wam returns a checkout URL.

  2. 2Send them to checkout

    Redirect to Wam's hosted checkout or embed it in your page. Your customer pays by card or with the Wam app.

  3. 3Fulfil on the webhook

    Wam posts a signed payment_intent.succeeded event to your endpoint. Verify it and ship the order.

Wam Pay

Everything you need to take payments

One API for one-off payments, subscriptions and refunds, with card details kept off your servers.1

Checkout

Hosted or embedded, themed to your brand

Send customers to Wam's checkout, or mount it inside your own page with your colours, corners and fonts. Card fields stay in Wam's frame.

ITIsland ThreadsLinen shirt, sandTT$210.00
WPay with Wam
or pay by card
Card number•••• •••• •••• 4242
Expiry08 / 29
CVC•••
Webhooks

Signed events you can trust

Every delivery carries an HMAC-SHA256 signature and timestamp. One call in the SDK verifies both.

POST/webhooks/wam200
{
  "type": "payment_intent.succeeded",
  "data": {
    "amount": 21000,
    "currency": "TTD",
    "status": "succeeded"
  }
}
Subscriptions

Bill on a schedule

Plans, hosted sign-up and invite pages, automatic retries and a page where customers manage their own subscription.

Unlimited membershipMonthly · renews 1 NovTT$1,250
Invite sentmember_10482
Saved cards

Charge returning customers

Save a card during checkout, or without a charge, and reuse it for subscriptions and later payments.

Visa •••• 4242Saved for member_10482
Charged off sessionNo checkout neededTT$1,250
Refunds

Refund from code or the portal

Refund a completed payment through the API. An idempotency key makes every retry safe.

Refund issuedorder-1042TT$210.00
Idempotency keySafe to retry
Embedded checkout

Checkout inside your page

Load one script, mount into a container or open as a modal, and listen for the result. Wam keeps the card fields in its own frame, so your PCI scope stays at the lowest level.

checkout.html
<div id="wam-pay"></div>
<script src="https://pay.wam.money/embed/v1/checkout.js"></script>
<script>
  WamCheckout.mount({
    checkoutUrl,              // from createPaymentIntent
    container: "#wam-pay",
    theme: {
      colorPrimary: "#111114",
      borderRadius: "12px",
    },
    onSucceeded: (ev) => showReceipt(ev.paymentId),
  });
</script>
Webhooks

Fulfil orders on a verified event

Never ship on the redirect alone. Wam signs every event with your webhook secret, and the SDK checks the signature and timestamp for you.

app/api/webhooks/wam/route.ts
import { WamPaymentSDK } from "@wamnow/payment-sdk";

export async function POST(request: Request) {
  const event = WamPaymentSDK.verifyWebhookSignature({
    payload: await request.text(),
    signature: request.headers.get("x-wam-signature") ?? "",
    timestamp: request.headers.get("x-wam-timestamp") ?? "",
    secret: process.env.WAM_WEBHOOK_SECRET!,
  });

  if (event.type === "payment_intent.succeeded") {
    await fulfillOrder(event.data.merchantReference);
  }
  return Response.json({ received: true });
}
Ways to integrate

Start with no code. Go as deep as you need.

No code

Create payment links and invoices from the app or the Business Portal and share them anywhere.

Shopify

Install the Wam Pay app and add a Pay with Wam button to your store in about ten minutes.

Build your own

Use the Node.js SDK, or call the REST API from Python, PHP or any language that can sign a request.

Test first

A sandbox for every step

Take sandbox keys from the staging Business Portal, pay with test cards, run the mock SDK in your CI and tunnel webhooks to your laptop before you go live.

Ready to build?

Open a Business account, copy your API keys from the Business Portal and take your first test payment today.

Pricing

A flat rate per card payment, with no setup or monthly fee.

See pricing
Talk to us

Building something bigger? Our team can help you plan it.

Contact us