{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/up-bank/main/json-schema/up-bank-webhook-event-callback-schema.json",
  "title": "WebhookEventCallback",
  "description": "Asynchronous callback request used for webhook event delivery.\n",
  "x-generated": "2026-10-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/up-bank-webhooks-api-openapi.yml#/components/schemas/WebhookEventCallback",
  "type": "object",
  "properties": {
    "data": {
      "description": "The webhook event data sent to the subscribed webhook.\n",
      "allOf": [
        {
          "$ref": "#/$defs/WebhookEventResource"
        }
      ]
    }
  },
  "required": [
    "data"
  ],
  "$defs": {
    "WebhookEventResource": {
      "type": "object",
      "description": "Provides the event data used in asynchronous webhook event callbacks to\nsubscribed endpoints. Webhooks events have defined `eventType`s and may\noptionally relate to other resources within the Up API.\n",
      "properties": {
        "type": {
          "type": "string",
          "description": "The type of this resource: `webhook-events`"
        },
        "id": {
          "type": "string",
          "description": "The unique identifier for this event. This will remain constant across\ndelivery retries.\n"
        },
        "attributes": {
          "type": "object",
          "properties": {
            "eventType": {
              "description": "The type of this event. This can be used to determine what action to\ntake in response to the event.\n",
              "allOf": [
                {
                  "$ref": "#/$defs/WebhookEventTypeEnum"
                }
              ]
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "description": "The date-time at which this event was generated.\n"
            }
          },
          "required": [
            "eventType",
            "createdAt"
          ]
        },
        "relationships": {
          "type": "object",
          "properties": {
            "webhook": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "The type of this resource: `webhooks`"
                    },
                    "id": {
                      "type": "string",
                      "description": "The unique identifier of the resource within its type.\n"
                    }
                  },
                  "required": [
                    "type",
                    "id"
                  ]
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "related": {
                      "type": "string",
                      "description": "The link to retrieve the related resource(s) in this relationship.\n"
                    }
                  },
                  "required": [
                    "related"
                  ]
                }
              },
              "required": [
                "data"
              ]
            },
            "transaction": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "The type of this resource: `transactions`"
                    },
                    "id": {
                      "type": "string",
                      "description": "The unique identifier of the resource within its type.\n"
                    }
                  },
                  "required": [
                    "type",
                    "id"
                  ]
                },
                "links": {
                  "type": "object",
                  "properties": {
                    "related": {
                      "type": "string",
                      "description": "The link to retrieve the related resource(s) in this relationship.\n"
                    }
                  },
                  "required": [
                    "related"
                  ]
                }
              },
              "required": [
                "data"
              ]
            }
          },
          "required": [
            "webhook"
          ]
        }
      },
      "required": [
        "type",
        "id",
        "attributes",
        "relationships"
      ]
    },
    "WebhookEventTypeEnum": {
      "enum": [
        "TRANSACTION_CREATED",
        "TRANSACTION_SETTLED",
        "TRANSACTION_DELETED",
        "PING"
      ],
      "description": "Specifies the type of a webhook event. This can be used to determine what\naction to take in response to the event, such as which relationships to\nexpect.\n"
    }
  }
}