Skip to content

Test Square webhooks

Square sends webhooks for payments, refunds, orders, inventory, and catalog changes. Capture them on a free webhooks.cc endpoint to see exactly what Square sends, or fire realistic, correctly signed sample payloads at your own handler without touching a production account.

Start free:
or sign up with email

No credit card · 50 requests/day free · or get a guest URL without an account

Prefer a walkthrough? Read the local webhook testing guide.

Common Square webhook events

Square webhooks carry event_id, type, merchant_id, and data. Subscribe to specific event types in the Square Developer Dashboard.

EventWhen it fires
payment.createdA new payment is initialized
payment.updatedA payment status changes (such as COMPLETED or FAILED)
order.createdA new order is created
order.updatedAn order state, fulfillment, or line item changes
refund.updatedA payment refund completes or fails
invoice.payment_madeA customer pays a Square invoice

Source: Square webhooks overview.

How to test Square webhooks

  1. 1

    Create a webhook endpoint

    Sign in free with GitHub, Google, or email to create a persistent endpoint, or grab an instant guest URL at webhooks.cc without an account.

  2. 2

    Point Square at your URL

    Paste the endpoint URL into Square: Square Developer Dashboard → your app → Webhooks → Subscriptions.

  3. 3

    Inspect what arrives

    Each delivery appears live in the dashboard with method, headers, body, query parameters, and source IP.

  4. 4

    Forward to localhost or assert in CI

    Run whk tunnel <port> to forward webhooks to a local server, or use the TypeScript, Python or Go SDK to wait for and assert on deliveries in tests.

Square webhook signature

Signature headerx-square-hmacsha256-signature
AlgorithmHMAC-SHA256
Verification in webhooks.ccSupported: add your signing secret and every request is checked automatically

Checking one request by hand? Paste its body and headers into the webhook signature checker, which has the Square scheme built in and runs in your browser.

New to signature verification? Read the webhook signature verification guide.

Send sample Square events

These Square templates ship with realistic payloads and valid signature headers. Send them from the dashboard's Send button, the SDK, or your AI agent via MCP.

payment.createdpayment.updatedrefund.created
# Send a signed Square sample with the SDK
await client.endpoints.sendTemplate( slug, {
  provider: "square",
  template: "payment.created",
  secret: "your-test-secret",
});

Test your Square webhook handler in CI

sendTo signs each request the way Square does, with your test secret from SQUARE_WEBHOOK_SECRET, and posts it straight to your handler, so its signature check stays on. The second test proves the handler rejects a forged signature. Drop the file into a Vitest suite that runs against your app; for Jest, delete the first line, since Jest provides the same globals.

import { describe, expect, it } from "vitest";
import { WebhooksCC } from "@webhooks-cc/sdk";

// Runs against your app on localhost. WHK_API_KEY and SQUARE_WEBHOOK_SECRET come from the env.
const client = new WebhooksCC({ apiKey: process.env.WHK_API_KEY! });
const url = "http://localhost:3000/api/webhooks/square";

const send = (secret: string) =>
  client.sendTo(url, {
    provider: "square",
    template: "payment.created",
    secret,
  });

describe("Square webhook handler", () => {
  it("accepts a signed payment.created", async () => {
    const response = await send(process.env.SQUARE_WEBHOOK_SECRET!);
    expect(response.status).toBeGreaterThanOrEqual(200);
    expect(response.status).toBeLessThan(300);
  });

  it("rejects a forged signature", async () => {
    const response = await send("not-the-real-secret");
    // A 4xx, not a crash: providers retry 5xx responses.
    expect(response.status).toBeGreaterThanOrEqual(400);
    expect(response.status).toBeLessThan(500);
  });
});

Let your coding agent write and run it: the webhooks.cc agent skill teaches Claude Code, Cursor, and Codex to test webhook handlers with signed payloads. More patterns in the SDK testing docs.

Everything in one place

  • Live dashboard: see deliveries the moment they arrive
  • Forward to localhost with whk tunnel
  • Replay any captured request to any URL
  • Mock responses with custom status, headers, and body
  • Forward to your servers, Slack or Discord
  • TypeScript, Python and Go SDKs for CI assertions
  • MCP server for AI coding agents

Square webhook questions

More providers

Browse all 68 providers

Your Square webhook URL is seconds away

Sign up free, create an endpoint, and point Square at it.

or sign up with email

No credit card · or try without an account