{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rctp.dev/schemas/approval-response.schema.json",
  "title": "Approval response",
  "description": "Submitted by the approval surface (Draft 0.4 9.2(3)). Only the seller's own registered key may sign it (INV-4). terms_commitment is required for listing.create and listing.set_terms approvals (binding 7).",
  "type": "object",
  "properties": {
    "approval_id": {
      "$ref": "common.schema.json#/$defs/ApprovalId"
    },
    "decision": {
      "type": "string",
      "enum": [
        "approve",
        "decline"
      ]
    },
    "level": {
      "$ref": "common.schema.json#/$defs/ApprovalLevel"
    },
    "assertion": {
      "type": "string",
      "pattern": "^webauthn:[A-Za-z0-9_-]+$",
      "maxLength": 16384
    },
    "displayed_text": {
      "$ref": "common.schema.json#/$defs/Digest"
    },
    "terms_commitment": {
      "$ref": "common.schema.json#/$defs/Digest"
    }
  },
  "additionalProperties": false,
  "required": [
    "approval_id",
    "decision",
    "level",
    "assertion",
    "displayed_text"
  ]
}
