{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usps/json-schema/usps-package-transaction-details-notification-schema.json",
  "title": "Subscription Event",
  "description": "Subscription Event",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usps-subscriptions-package-transaction-details-openapi.yml#/components/schemas/PackageTransactionDetailsNotification",
  "additionalProperties": false,
  "allOf": [
    {
      "$ref": "#/$defs/Notification"
    },
    {
      "type": "object",
      "properties": {
        "payload": {
          "type": "string",
          "description": "Tracking subscription details converted into a JSON formatted string."
        }
      }
    }
  ],
  "$defs": {
    "Links": {
      "title": "Hypermedia Links",
      "type": "array",
      "description": "Hypermedia links to related resources.",
      "items": {
        "required": [
          "href",
          "rel"
        ],
        "type": "object",
        "properties": {
          "rel": {
            "type": "array",
            "description": "The short name(s) of the relationship corresponding to the link.",
            "items": {
              "type": "string"
            }
          },
          "title": {
            "type": "string",
            "description": "A human-readable description of the link relationship."
          },
          "href": {
            "type": "string",
            "description": "The URL to a related resource.",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "description": "The HTTP method to use to access this link.",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "DELETE"
            ]
          },
          "submissionMediaType": {
            "type": "string",
            "description": "The media type of the resource request."
          },
          "targetMediaType": {
            "type": "string",
            "description": "The media type of the resource response."
          }
        },
        "additionalProperties": false
      }
    },
    "Notification": {
      "title": "Subscription Event",
      "type": "object",
      "properties": {
        "subscriptionId": {
          "type": "string",
          "description": "Unique identifier created for this Subscription"
        },
        "subscriptionType": {
          "type": "string",
          "description": "The name of the topic related to this event."
        },
        "timestamp": {
          "type": "string",
          "description": "Timestamp message was generated, in ISO-8601 format.",
          "format": "date-time"
        },
        "links": {
          "$ref": "#/$defs/Links"
        }
      },
      "additionalProperties": true,
      "description": "Subscription Event"
    }
  }
}