Type definitions for App Store Connect webhook notification payloads in Swift.
import AppStoreConnectWebhook
import Foundation
let payloadJSON = """
{
"data": {
"type": "webhookPingCreated",
"id": "01234567-abcd-8901-dcba-987654321012",
"version": 1,
"attributes": {
"timestamp": "2025-06-09T10:09:30.123456789Z"
}
}
}
"""
let payload = try AppStoreConnectWebhookPayload(json: payloadJSON)
switch payload.data {
case .webhookPingCreated(let webhookPingCreated):
webhookPingCreated.id // "01234567-abcd-8901-dcba-987654321012"
webhookPingCreated.attributes.timestamp // 2025-06-09T10:09:30.123Z
// ...
}
.package(url: "https://github.com/treastrain/AppStoreConnectWebhook", branch: "main"),
.product(name: "AppStoreConnectWebhook", package: "AppStoreConnectWebhook"),
MIT