Integrations · E-commerce

Check buyer emails on new Gumroad sales

Check the buyer's email address of each new Gumroad sale, and hear about the ones that cannot receive mail (by default invalid and disposable). A small relay you deploy receives Gumroad's Ping, checks the address with our API and sends a signed notice to a URL of yours. Only if you turn it on, it also disables the sale's license key, revokes the buyer's access or refunds the sale. It never refunds by default.

It is TypeScript with no dependencies, under the MIT licence. Download email-validation-gumroad.zip: it holds worker.ts (the Cloudflare Worker), handler.ts (the relay), constants.ts and LICENSE. It is not on a marketplace.

What you need

  • A Gumroad seller account. The Ping URL, its signing secret and API applications are all in Gumroad's Settings → Advanced.
  • A place to run the relay on a public HTTPS address: a Cloudflare account and Cloudflare's wrangler command (npx wrangler, on a computer with Node), or your own server with Node 22.18 or later, Bun or Deno.
  • An API key of ours from the API keys page with the permission Validate addresses (a server key: a browser key is refused), and a daily credit cap that limits what a busy day can spend.
  • Somewhere to hear about a flagged sale: an HTTPS URL of yours (your own app, or an automation tool's webhook) for the notice, or one of the actions below.

How a ping is trusted

Gumroad posts a ping to a URL you give it. The relay answers only POST /gumroad/<your GUMROAD_URL_SECRET>, a secret of 32 to 128 letters, digits, - or _ that only you know; any other path gets 404 and its body is never read. Every ping's seller_id must be yours. When you turn on Gumroad's signing and give the relay its secret, every ping must also carry a valid X-Gumroad-Signature sent less than GUMROAD_TOLERANCE_S seconds ago (default 300). Turn signing on: without it, the URL is the only lock, and anyone who learns it can send pings that name any address. Set GUMROAD_VERIFY_SALE=true as well, and each sale is read back from Gumroad's API before anything happens, so the address checked is the one Gumroad holds.

Set it up

  1. The URL secret. Make one with openssl rand -hex 32 (on Windows, your password manager's generator, 32 letters and digits or more).

  2. Signing. In Gumroad, Settings → Advanced: turn ping signing on and copy its secret.

  3. An access token (for GUMROAD_VERIFY_SALE and the actions). In Settings → Advanced, create an application (for your own account, any name, and http://127.0.0.1 as its redirect URI), then click Generate access token. It needs view_sales; edit_sales for revoke_access, edit_products for disable_license, and refund_sales (or edit_sales) for refund.

  4. Deploy the relay from the unzipped folder:

    cd email-validation-gumroad
    npx wrangler deploy worker.ts --name ev-gumroad-relay --compatibility-date 2026-10-01 \
      --var GUMROAD_SELLER_ID:… --var GUMROAD_VERIFY_SALE:true --var FORWARD_URL:https://…
    npx wrangler secret put EV_API_KEY --name ev-gumroad-relay              # our API key
    npx wrangler secret put GUMROAD_URL_SECRET --name ev-gumroad-relay      # the URL secret
    npx wrangler secret put GUMROAD_SIGNING_SECRET --name ev-gumroad-relay  # Gumroad's signing secret
    npx wrangler secret put GUMROAD_ACCESS_TOKEN --name ev-gumroad-relay    # the access token
    npx wrangler secret put FORWARD_SECRET --name ev-gumroad-relay          # signs the notice to FORWARD_URL

    Your seller id is the seller_id of every ping ("Send test ping" in Settings → Advanced shows one). wrangler deploy prints the Worker's address, such as https://ev-gumroad-relay.<your subdomain>.workers.dev. On another runtime, call handle(request, env, { waitUntil }) from handler.ts with the raw request and your platform's waitUntil (without one, the relay finishes the work before it answers, which can take longer than Gumroad's 5 seconds); do not let a framework parse the body first, since the signature covers the exact bytes.

  5. The Ping URL. In Gumroad, Settings → Advanced → Ping: https://ev-gumroad-relay.<your subdomain>.workers.dev/gumroad/<your GUMROAD_URL_SECRET>. Treat it as a password: if it leaks, pick a new secret.

A relay missing a setting it needs answers 500 and logs the setting's name. At least one of FORWARD_URL and GUMROAD_ON_FLAG must be set.

Settings

SettingWhat it does
GUMROAD_SELLER_IDRequired: your seller id; a ping for another seller gets 401
GUMROAD_URL_SECRETRequired: the secret in the Ping URL, 32 to 128 of A–Z a–z 0–9 _ -
GUMROAD_SIGNING_SECRETGumroad's ping signing secret; set, every ping must be signed
GUMROAD_TOLERANCE_SSeconds a signature's time may be from now, 1 to 900 (default 300)
GUMROAD_ACCESS_TOKENYour Gumroad access token, for GUMROAD_VERIFY_SALE and the actions
GUMROAD_VERIFY_SALEtrue: read each sale back from Gumroad's API before it is checked
GUMROAD_ON_FLAGWhat a flag does on Gumroad: any of disable_license, revoke_access, refund (default nothing)
GUMROAD_CHECK_TESTtrue: check test pings too; never acted on (default false)
EV_API_KEYRequired: our API key
EV_REGIONus (default) or eu: validated in the EU, results stored there (same key and credits)
EV_FLAGThe results that are flagged, default invalid,disposable; also catch_all, unknown; none flags nothing
EV_FAIL_CLOSEDtrue: a sale our API could not check is sent to FORWARD_URL as unchecked (never acted on); a sale Gumroad's API cannot confirm is only logged
FORWARD_URLYour HTTPS URL that gets a signed notice for each flagged sale
FORWARD_SECRETRequired with FORWARD_URL: signs the notice
FORWARD_ALLtrue: the notice goes out for every checked sale, not only a flagged one

The notice is a JSON POST signed X-EV-Signature: sha256=<base64 HMAC-SHA256 of the body with FORWARD_SECRET>. It holds the sale's ids, the result and what was done, never the address or the license key: look the sale up in Gumroad by its sale_id.

The actions

GUMROAD_ON_FLAG runs, for a flagged sale and in this order: disable_license (the sale's license key stops verifying), revoke_access (the buyer loses access to the content), refund (a full refund: money moves and it cannot be undone; a buyer with a typo in the address has still paid). The actions need GUMROAD_VERIFY_SALE=true and run only for a sale Gumroad confirms, never for a test ping. With refund, EV_FLAG may name only invalid and disposable, so a slow or greylisting mail server's catch_all or unknown never refunds a paying buyer.

What it checks

Sales only: a refund, dispute or cancellation ping, a refunded or disputed sale, a membership renewal (its first sale was checked), a sale more than 24 hours old and a test ping (unless GUMROAD_CHECK_TEST=true) start nothing. Each instance handles each sale once. Gumroad gives your endpoint 5 seconds, so the relay answers at once and checks after the answer. Each check uses one credit (unknown results, malformed and sandbox addresses are free).

It fails open: when our API or Gumroad cannot answer (a timeout, no credits, a refused key), nothing is flagged and the ping is still answered 200. The log holds sale ids, statuses and error codes, never an address, a key, a token or a license key.

Check it once

Set GUMROAD_CHECK_TEST=true and FORWARD_ALL=true (run the whole deploy line again with --var GUMROAD_CHECK_TEST:true --var FORWARD_ALL:true added, or set them in Cloudflare's dashboard: a deploy drops every variable it is not given), then buy your own product with an address of yours that receives mail: your FORWARD_URL gets a notice with "test": true (one credit). Then set both back to false the same way. Never buy with a test address that cannot receive mail, a sandbox address included: nothing stops the sale, so Gumroad's receipt to it would bounce and hurt your sender reputation.

End the access

Clear the Ping URL in Gumroad, delete the application (its token stops working), delete the Worker (npx wrangler delete --name ev-gumroad-relay) and our key on the API keys page.

More on Gumroad

Updated · Maintained by: Email Validation LLC

Need help? Contact support, or ask the help chat. Something wrong or missing on this page? Tell us