{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://taips.tap.rsvp/schemas/messages/authorize.json",
  "title": "Authorize Message",
  "description": "Authorization message for a TAP transaction per TAIP-4",
  "type": "object",
  "allOf": [
    {
      "$ref": "../common/didcomm-base.json#/$defs/didcommHeader"
    }
  ],
  "properties": {
    "type": {
      "const": "https://tap.rsvp/schema/1.0#Authorize"
    },
    "body": {
      "type": "object",
      "required": ["@context", "@type"],
      "properties": {
        "@context": {
          "const": "https://tap.rsvp/schema/1.0"
        },
        "@type": {
          "const": "https://tap.rsvp/schema/1.0#Authorize"
        },
        "settlementAddress": {
          "$ref": "../common/settlement-address.json",
          "description": "Settlement address in either CAIP-10 or RFC 8905 format"
        },
        "settlementAsset": {
          "$ref": "../common/caip-types.json#/$defs/caip19",
          "description": "Asset for settlement in CAIP-19 format"
        },
        "amount": {
          "$ref": "../common/base-types.json#/$defs/amount",
          "description": "Amount to be settled"
        },
        "expiry": {
          "$ref": "../common/base-types.json#/$defs/iso8601DateTime",
          "description": "Expiration time for the authorization"
        }
      },
      "additionalProperties": false
    }
  },
  "required": ["type", "body"]
}