Webhooks

Receive store events at your own URL, check the signature and handle retries.

Turn on HTTP for an event in Settings → Notifications and enter your URL. PaidGoods then sends a POST for each occurrence. Which events exist and how to choose them: Notifications.

The request

The body uses SellAuth's format, so code written for SellAuth notifications works unchanged:

{
  "event": "NOTIFICATION.SHOP_INVOICE_PROCESSED",
  "data": { "invoice_id": "…" },
  "shop_id": "…"
}

data holds the IDs for the event: invoice_id; product_id and variant_id; feedback_id; ticket_id and message_id; plan_name and expires_at; title and description for NOTIFICATION.SHOP_ERROR. Extra fields (title, body, test) may follow.

Headers:

HeaderValue
X-SignatureHMAC-SHA256 of the raw body with your webhook secret, in hex.
X-TimestampUnix time in seconds.
Idempotency-KeyThe same for every retry of one delivery.

The Webhook secret is in Developers → API keys → Signing secrets. Showing or replacing it asks you to confirm it's you. Dynamic delivery requests use a separate Dynamic delivery secret.

Check the signature

import { createHmac, timingSafeEqual } from 'node:crypto';

export function verifyPaidGoodsWebhook(rawBody, signature, secret) {
  const expected = createHmac('sha256', secret).update(rawBody).digest('hex');
  const a = Buffer.from(signature, 'hex');
  const b = Buffer.from(expected, 'hex');
  return a.length === b.length && timingSafeEqual(a, b);
}

Use the raw body exactly as received, before any JSON parsing.

Retries

  • A delivery is tried up to three times, five seconds apart.
  • A 4xx answer other than 408 or 429 is not retried.
  • Treat the Idempotency-Key as the delivery's ID and ignore repeats.
  • Every attempt is in Developers → Webhook logs, where Resend sends it again.

Event names

EventHTTP name
New invoice createdNOTIFICATION.SHOP_INVOICE_CREATED
Invoice paidNOTIFICATION.SHOP_INVOICE_PROCESSED
Payment needs confirmationNOTIFICATION.SHOP_INVOICE_CONFIRMING
Paid invoice short of stockNOTIFICATION.SHOP_INVOICE_OUT_OF_STOCK
Custom fields submittedNOTIFICATION.SHOP_CUSTOM_FIELDS_SUBMITTED
Withdrawal requestedNOTIFICATION.SHOP_WITHDRAWAL_REQUESTED
Product out of stockNOTIFICATION.SHOP_PRODUCT_OUT_OF_STOCK
Product restockedNOTIFICATION.SHOP_PRODUCT_RESTOCKED
Product status changedNOTIFICATION.SHOP_PRODUCT_STATUS_CHANGED
New feedbackNOTIFICATION.SHOP_FEEDBACK_RECEIVED
Feedback updatedNOTIFICATION.SHOP_FEEDBACK_UPDATED
Feedback dispute accepted / rejectedNOTIFICATION.SHOP_FEEDBACK_DISPUTE_ACCEPTED / _REJECTED
New support ticketNOTIFICATION.SHOP_TICKET_CREATED
New ticket replyNOTIFICATION.SHOP_TICKET_MESSAGE
Delivery or payment errorNOTIFICATION.SHOP_ERROR
Payment dispute opened or decidedNOTIFICATION.SHOP_PAYMENT_DISPUTE
Order held for review, or appealedNOTIFICATION.SHOP_RISK_REVIEW
New subscriberNOTIFICATION.SHOP_SUBSCRIPTION_CREATED
Subscription renewedNOTIFICATION.SHOP_SUBSCRIPTION_RENEWED
Subscription renewal failedNOTIFICATION.SHOP_SUBSCRIPTION_PAST_DUE
Subscription cancelled or endingNOTIFICATION.SHOP_SUBSCRIPTION_ENDING
Subscription expiredNOTIFICATION.SHOP_SUBSCRIPTION_EXPIRED
Subscription plan changedNOTIFICATION.SHOP_SUBSCRIPTION_PLAN_CHANGED
Subscription paused / resumedNOTIFICATION.SHOP_SUBSCRIPTION_PAUSED / _RESUMED
Subscription payment method changedNOTIFICATION.SHOP_SUBSCRIPTION_PAYMENT_METHOD_CHANGED
Affiliate payout dayNOTIFICATION.AFFILIATE_PAYOUT
Affiliate payout requestedNOTIFICATION.SHOP_AFFILIATE_PAYOUT_REQUESTED
Reseller application receivedNOTIFICATION.SHOP_RESELLER_APPLICATION_RECEIVED
Store suspended / restoredNOTIFICATION.SHOP_TERMINATED / NOTIFICATION.SHOP_UNTERMINATED
Import finishedNOTIFICATION.SHOP_IMPORT_STATUS
Team member joinedNOTIFICATION.USER_SHOP_INVITE

The reseller marketplace events are listed in Settings → Notifications. Some events don't exist on SellAuth (disputes, risk review, most subscription events, payout day and the marketplace events). If your code was written for SellAuth, leave them unticked for your URL.

IDs

For records imported from SellAuth, IDs in the body are the SellAuth IDs, and shop_id is your SellAuth shop ID. Records made in PaidGoods get a stable number, which the SellAuth-format API accepts. Ticket IDs stay UUIDs, as on SellAuth.

On this page