Voxel Shop beta is live. Expect occasional bugs. Learn more
X-Polymart-Webhook-Version: 1
X-Polymart-Signature will be a signature that verifies that the webhook request is in-fact valid. This is a
SHA256 HMAC hash, where the data is the data that was POSTed, and the key is your webhook secret. Your webhook secret generated when you
create a new webhook. YOU MUST VALIDATE THAT THIS IS CORRECT. If you do not, attackers will
easily be able to send random or malicious webhooks to your server
{
"event": "",
"time": "",
"nonce": "",
"payload": {
"": "",
"": "",
"<...>": "<...>"
}
} So, the top-level information might look something like this
{
"event": "product.update",
"time": 1795522359,
"nonce": "GR-qM3cKHFOAZSwk",
"payload": "<...>"
} Putting it all together, this is what a full valid request to https://example.com/polymartWebhook might look like, given the webhook secret
POST /polymartWebhook HTTP/1.1
X-Polymart-Webhook-Version: 1
X-Polymart-Signature: f220f3d67d45c49b845fc17fbf3b2d6dfbf9f85e10b8352bf6284781ade8ea01
Content-Type: application/json
Content-Length: 166
{
"event": "testEvent",
"time": 1795522359,
"nonce": "XQqPlh-QS3iwZPOo",
"payload": {
"webhook": "https://example.com/polymartWebhook"
}
}
{
"event": "ping",
"time": "",
"nonce": "",
"payload": {
"product": {
"id": "",
"title": "",
"subtitle": "",
"url": ""
},
"webhook": {
"url": ""
}
}
} {
"event": "ping",
"time": 1795522359,
"nonce": "Y83UztoyUJSsHPRW",
"payload": {
"product": {
"id": "1",
"title": "CustomItems",
"subtitle": "Design new Custom items and blocks!",
"url": "https://voxel.shop/resource/1"
},
"webhook": {
"url": "https://example.com/polymartWebhook"
}
}
} {
"event": "resource.update",
"time": "",
"nonce": "",
"payload": {
"product": {
"id": "",
"title": "",
"subtitle": "",
"url": ""
},
"previous": {
"version": "",
"id": "",
"time": "",
"size": "",
"fileType": "",
"branch": ""
},
"update": {
"version": "",
"id": "",
"time": "",
"size": "",
"fileType": "",
"branch": "",
"title": "",
"description": ""
}
}
} {
"event": "product.update",
"time": 1795522359,
"nonce": "B_PqLtObs5cJroWT",
"payload": {
"product": {
"id": "1",
"title": "CustomItems",
"subtitle": "Design new Custom items and blocks!",
"url": "https://voxel.shop/resource/1"
},
"previous": {
"version": "2.19.5",
"id": "91",
"time": 1795518759,
"size": "716624",
"fileType": "jar",
"branch": "snapshot"
},
"update": {
"version": "3.0",
"id": "107",
"time": 1795522359,
"size": "718232",
"fileType": "jar",
"branch": "release",
"title": "Automatic Resource Pack Generation",
"description": "This version adds an automatic resource pack generator to CustomItems!"
}
}
} {
"event": "product.user.purchase",
"time": "",
"nonce": "",
"payload": {
"product": {
"id": "",
"title": "",
"subtitle": "",
"url": ""
},
"user": {
"id": ""
}
}
} {
"event": "product.user.purchase",
"time": 1795522359,
"nonce": "CuTMCCUNj9N1G6kR",
"payload": {
"product": {
"id": "1",
"title": "CustomItems",
"subtitle": "Design new Custom items and blocks!",
"url": "https://voxel.shop/resource/1"
},
"user": {
"id": 160808
}
}
} {
"event": "product.user.purchaseRemoved",
"time": "",
"nonce": "",
"payload": {
"product": {
"id": "",
"title": "",
"subtitle": "",
"url": ""
},
"user": {
"id": ""
}
}
} {
"event": "product.user.purchaseRemoved",
"time": 1795522359,
"nonce": "59biETJyaptBpRKZ",
"payload": {
"product": {
"id": "1",
"title": "CustomItems",
"subtitle": "Design new Custom items and blocks!",
"url": "https://voxel.shop/resource/1"
},
"user": {
"id": 139161
}
}
} {
"event": "product.user.firstDownload",
"time": "",
"nonce": "",
"payload": {
"product": {
"id": "",
"title": "",
"subtitle": "",
"url": ""
},
"user": {
"id": ""
}
}
} {
"event": "product.user.firstDownload",
"time": 1795522359,
"nonce": "1Za8XMatln1c_Mtt",
"payload": {
"product": {
"id": "1",
"title": "CustomItems",
"subtitle": "Design new Custom items and blocks!",
"url": "https://voxel.shop/resource/1"
},
"user": {
"id": 175720
}
}
}