Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add missing fields to webhook sample payloads

Kiran Kca1015af291a
diff --git a/apps/web/lib/webhook/sample-events/bounty-created.json b/apps/web/lib/webhook/sample-events/bounty-created.json
index f43dc63b53..c24d456e6d 100644
--- a/apps/web/lib/webhook/sample-events/bounty-created.json
+++ b/apps/web/lib/webhook/sample-events/bounty-created.json
@@ -17,6 +17,7 @@
"url": {}
},
"performanceCondition": null,
+ "socialMetricsLastSyncedAt": null,
"performanceScope": null,
"groups": [
{
diff --git a/apps/web/lib/webhook/sample-events/bounty-updated.json b/apps/web/lib/webhook/sample-events/bounty-updated.json
index 1b45be1876..49e6578742 100644
--- a/apps/web/lib/webhook/sample-events/bounty-updated.json
+++ b/apps/web/lib/webhook/sample-events/bounty-updated.json
@@ -17,6 +17,7 @@
"url": {}
},
"performanceCondition": null,
+ "socialMetricsLastSyncedAt": null,
"performanceScope": null,
"groups": [
{
diff --git a/apps/web/lib/webhook/sample-events/commission-created.json b/apps/web/lib/webhook/sample-events/commission-created.json
index f612bee91c..719aedfe61 100644
--- a/apps/web/lib/webhook/sample-events/commission-created.json
+++ b/apps/web/lib/webhook/sample-events/commission-created.json
@@ -19,6 +19,7 @@
"image": null,
"payoutsEnabledAt": null,
"country": "US",
+ "groupId": null,
"totalClicks": 50,
"totalLeads": 15,
"totalConversions": 10,
@@ -32,10 +33,13 @@
"name": "David",
"email": "[email protected]",
"avatar": null,
+ "stripeCustomerId": null,
"country": "US",
"sales": 1,
"saleAmount": 50000,
- "createdAt": "2025-07-16T10:48:01.739Z"
+ "createdAt": "2025-07-16T10:48:01.739Z",
+ "firstSaleAt": null,
+ "subscriptionCanceledAt": null
},
"link": {
"id": "cm0lcuvtz000xcutmqw4a7wi3",
diff --git a/apps/web/lib/webhook/sample-events/lead-created.json b/apps/web/lib/webhook/sample-events/lead-created.json
index f832117216..b5168d0be4 100644
--- a/apps/web/lib/webhook/sample-events/lead-created.json
+++ b/apps/web/lib/webhook/sample-events/lead-created.json
@@ -6,7 +6,13 @@
"name": "Tiny Beige Badger",
"email": "[email protected]",
"avatar": "https://api.dub.co/og/avatar/cus_BH6tDUWc9n0Y2pf55tVbk1hc",
- "createdAt": "2025-01-14T04:49:23.385Z"
+ "stripeCustomerId": null,
+ "country": null,
+ "sales": null,
+ "saleAmount": null,
+ "createdAt": "2025-01-14T04:49:23.385Z",
+ "firstSaleAt": null,
+ "subscriptionCanceledAt": null
},
"click": {
"id": "GWGrkftJdYlZD2mq",
@@ -20,6 +26,7 @@
"browser": "Chrome",
"os": "Mac OS",
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
+ "trigger": null,
"referer": "(direct)",
"refererUrl": "(direct)",
"qr": false,
@@ -68,6 +75,7 @@
"clicks": 882,
"lastClicked": "2025-01-14T04:49:10.000Z",
"leads": 3632,
+ "conversions": 0,
"sales": 2811,
"saleAmount": 290300,
"createdAt": "2024-09-02T18:49:56.136Z",
@@ -77,5 +85,6 @@
"testCompletedAt": null,
"testStartedAt": null
},
+ "partner": null,
"metadata": null
}
diff --git a/apps/web/lib/webhook/sample-events/link-clicked.json b/apps/web/lib/webhook/sample-events/link-clicked.json
index 3cb74a4c12..4e0b794933 100644
--- a/apps/web/lib/webhook/sample-events/link-clicked.json
+++ b/apps/web/lib/webhook/sample-events/link-clicked.json
@@ -11,6 +11,7 @@
"browser": "Unknown",
"os": "Unknown",
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
+ "trigger": null,
"referer": "(direct)",
"refererUrl": "(direct)",
"qr": false,
@@ -59,6 +60,7 @@
"clicks": 882,
"lastClicked": "2025-01-14T04:49:10.000Z",
"leads": 3631,
+ "conversions": 0,
"sales": 2811,
"saleAmount": 290300,
"createdAt": "2024-09-02T18:49:56.136Z",
diff --git a/apps/web/lib/webhook/sample-events/link-created.json b/apps/web/lib/webhook/sample-events/link-created.json
index f2ca251ef4..476b27322e 100644
--- a/apps/web/lib/webhook/sample-events/link-created.json
+++ b/apps/web/lib/webhook/sample-events/link-created.json
@@ -41,6 +41,7 @@
"clicks": 0,
"lastClicked": null,
"leads": 0,
+ "conversions": 0,
"sales": 0,
"saleAmount": 0,
"createdAt": "2024-08-26T16:41:52.084Z",
diff --git a/apps/web/lib/webhook/sample-events/link-deleted.json b/apps/web/lib/webhook/sample-events/link-deleted.json
index f2ca251ef4..476b27322e 100644
--- a/apps/web/lib/webhook/sample-events/link-deleted.json
+++ b/apps/web/lib/webhook/sample-events/link-deleted.json
@@ -41,6 +41,7 @@
"clicks": 0,
"lastClicked": null,
"leads": 0,
+ "conversions": 0,
"sales": 0,
"saleAmount": 0,
"createdAt": "2024-08-26T16:41:52.084Z",
diff --git a/apps/web/lib/webhook/sample-events/link-updated.json b/apps/web/lib/webhook/sample-events/link-updated.json
index f2ca251ef4..476b27322e 100644
--- a/apps/web/lib/webhook/sample-events/link-updated.json
+++ b/apps/web/lib/webhook/sample-events/link-updated.json
@@ -41,6 +41,7 @@
"clicks": 0,
"lastClicked": null,
"leads": 0,
+ "conversions": 0,
"sales": 0,
"saleAmount": 0,
"createdAt": "2024-08-26T16:41:52.084Z",
diff --git a/apps/web/lib/webhook/sample-events/payout-confirmed.json b/apps/web/lib/webhook/sample-events/payout-confirmed.json
index a1c11be09c..485b150f8d 100644
--- a/apps/web/lib/webhook/sample-events/payout-confirmed.json
+++ b/apps/web/lib/webhook/sample-events/payout-confirmed.json
@@ -9,9 +9,11 @@
"periodStart": "2025-10-22T15:49:33.343Z",
"periodEnd": "2025-10-31T18:29:59.999Z",
"createdAt": "2025-10-22T15:50:13.661Z",
+ "updatedAt": "2025-10-22T15:50:13.661Z",
"initiatedAt": "2025-10-22T15:50:13.661Z",
"paidAt": null,
"mode": "external",
+ "traceId": null,
"partner": {
"id": "cm6v2l38p000zubyl5fly3i7w",
"name": "Matthew Hayden",
diff --git a/apps/web/lib/webhook/sample-events/sale-created.json b/apps/web/lib/webhook/sample-events/sale-created.json
index 26f4d07460..8f06610012 100644
--- a/apps/web/lib/webhook/sample-events/sale-created.json
+++ b/apps/web/lib/webhook/sample-events/sale-created.json
@@ -6,7 +6,13 @@
"name": "Rural Red Goldfish",
"email": "[email protected]",
"avatar": "https://api.dub.co/og/avatar/cus_jTrfVKYN3Buc3F80JoqBiY0g",
- "createdAt": "2024-10-12T04:55:36.007Z"
+ "stripeCustomerId": null,
+ "country": null,
+ "sales": null,
+ "saleAmount": null,
+ "createdAt": "2024-10-12T04:55:36.007Z",
+ "firstSaleAt": null,
+ "subscriptionCanceledAt": null
},
"click": {
"id": "GWGrkftJdYlZD2mq",
@@ -20,6 +26,7 @@
"browser": "Chrome",
"os": "Mac OS",
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
+ "trigger": null,
"referer": "(direct)",
"refererUrl": "(direct)",
"qr": false,
@@ -68,6 +75,7 @@
"clicks": 882,
"lastClicked": "2025-01-14T04:49:10.000Z",
"leads": 3632,
+ "conversions": 0,
"sales": 2812,
"saleAmount": 290400,
"createdAt": "2024-09-02T18:49:56.136Z",
@@ -83,5 +91,6 @@
"paymentProcessor": "stripe",
"invoiceId": "INV_AUTi534JCiBUVdYmevCSYQ9G"
},
+ "partner": null,
"metadata": null
}
diff --git a/apps/web/tests/webhooks/index.test.ts b/apps/web/tests/webhooks/index.test.ts
index 4aac64a401..158085a710 100644
--- a/apps/web/tests/webhooks/index.test.ts
+++ b/apps/web/tests/webhooks/index.test.ts
@@ -86,6 +86,7 @@ const payoutWebhookEventSchemaExtended = payoutWebhookEventSchema.extend({
.nullable()
.transform((str) => (str ? new Date(str) : null)),
createdAt: z.string().transform((str) => new Date(str)),
+ updatedAt: z.string().transform((str) => new Date(str)),
initiatedAt: z.string().transform((str) => new Date(str)),
paidAt: z
.string()