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:
| Header | Value |
|---|---|
X-Signature | HMAC-SHA256 of the raw body with your webhook secret, in hex. |
X-Timestamp | Unix time in seconds. |
Idempotency-Key | The 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
4xxanswer other than408or429is not retried. - Treat the
Idempotency-Keyas the delivery's ID and ignore repeats. - Every attempt is in Developers → Webhook logs, where Resend sends it again.
Event names
| Event | HTTP name |
|---|---|
| New invoice created | NOTIFICATION.SHOP_INVOICE_CREATED |
| Invoice paid | NOTIFICATION.SHOP_INVOICE_PROCESSED |
| Payment needs confirmation | NOTIFICATION.SHOP_INVOICE_CONFIRMING |
| Paid invoice short of stock | NOTIFICATION.SHOP_INVOICE_OUT_OF_STOCK |
| Custom fields submitted | NOTIFICATION.SHOP_CUSTOM_FIELDS_SUBMITTED |
| Withdrawal requested | NOTIFICATION.SHOP_WITHDRAWAL_REQUESTED |
| Product out of stock | NOTIFICATION.SHOP_PRODUCT_OUT_OF_STOCK |
| Product restocked | NOTIFICATION.SHOP_PRODUCT_RESTOCKED |
| Product status changed | NOTIFICATION.SHOP_PRODUCT_STATUS_CHANGED |
| New feedback | NOTIFICATION.SHOP_FEEDBACK_RECEIVED |
| Feedback updated | NOTIFICATION.SHOP_FEEDBACK_UPDATED |
| Feedback dispute accepted / rejected | NOTIFICATION.SHOP_FEEDBACK_DISPUTE_ACCEPTED / _REJECTED |
| New support ticket | NOTIFICATION.SHOP_TICKET_CREATED |
| New ticket reply | NOTIFICATION.SHOP_TICKET_MESSAGE |
| Delivery or payment error | NOTIFICATION.SHOP_ERROR |
| Payment dispute opened or decided | NOTIFICATION.SHOP_PAYMENT_DISPUTE |
| Order held for review, or appealed | NOTIFICATION.SHOP_RISK_REVIEW |
| New subscriber | NOTIFICATION.SHOP_SUBSCRIPTION_CREATED |
| Subscription renewed | NOTIFICATION.SHOP_SUBSCRIPTION_RENEWED |
| Subscription renewal failed | NOTIFICATION.SHOP_SUBSCRIPTION_PAST_DUE |
| Subscription cancelled or ending | NOTIFICATION.SHOP_SUBSCRIPTION_ENDING |
| Subscription expired | NOTIFICATION.SHOP_SUBSCRIPTION_EXPIRED |
| Subscription plan changed | NOTIFICATION.SHOP_SUBSCRIPTION_PLAN_CHANGED |
| Subscription paused / resumed | NOTIFICATION.SHOP_SUBSCRIPTION_PAUSED / _RESUMED |
| Subscription payment method changed | NOTIFICATION.SHOP_SUBSCRIPTION_PAYMENT_METHOD_CHANGED |
| Affiliate payout day | NOTIFICATION.AFFILIATE_PAYOUT |
| Affiliate payout requested | NOTIFICATION.SHOP_AFFILIATE_PAYOUT_REQUESTED |
| Reseller application received | NOTIFICATION.SHOP_RESELLER_APPLICATION_RECEIVED |
| Store suspended / restored | NOTIFICATION.SHOP_TERMINATED / NOTIFICATION.SHOP_UNTERMINATED |
| Import finished | NOTIFICATION.SHOP_IMPORT_STATUS |
| Team member joined | NOTIFICATION.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.