Skip to main content

AITP-02: Decisions Schema Reference

  • Version: 1.0.0
  • Spec Status: Draft
Auto-generated Documentation

Parts of this documentation were auto-generated from the schema and example messages by an AI model.

Schema URL

https://aitp.dev/capabilities/aitp-02-decisions/v1.0.0/schema.json

Schema Overview

The AITP-02 Decisions capability defines a JSON schema that supports two main message types:

  1. Request Decision - Asking for a choice to be made
  2. Decision - Responding with the chosen option(s)

Complete Schema Definition

The schema is structured as an "anyOf" with two possible object types.

Schema Root Structure

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
// Decision response schema
},
{
// Request decision schema
}
]
}

Request Decision Schema

{
"type": "object",
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"request_decision": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["products", "checkbox", "radio", "confirmation"],
"default": "radio"
},
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"short_variant_name": {
"type": "string"
},
"image_url": {
"type": "string",
"format": "uri"
},
"description": {
"type": "string"
},
"quote": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "Quote"
},
"quote_id": {
"type": "string"
},
"payee_id": {
"type": "string"
},
"payment_plans": {
"type": "array",
"items": {
"type": "object",
"properties": {
"plan_id": {
"type": "string"
},
"plan_type": {
"type": "string",
"const": "one-time"
},
"amount": {
"type": "number"
},
"currency": {
"type": "string",
"const": "USD"
}
},
"required": [
"plan_id",
"plan_type",
"amount",
"currency"
],
"additionalProperties": true
}
},
"valid_until": {
"type": "string",
"format": "date-time"
}
},
"required": [
"type",
"quote_id",
"payee_id",
"payment_plans",
"valid_until"
],
"additionalProperties": true
},
"reviews_count": {
"type": "integer"
},
"five_star_rating": {
"type": "number",
"minimum": 0,
"maximum": 5
},
"url": {
"type": "string",
"format": "uri"
},
"variants": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
// References the same schema as parent options
},
"name": {
// References the same schema as parent options
},
"short_variant_name": {
// References the same schema as parent options
},
"image_url": {
// References the same schema as parent options
},
"description": {
// References the same schema as parent options
},
"quote": {
// References the same schema as parent options
},
"reviews_count": {
// References the same schema as parent options
},
"five_star_rating": {
// References the same schema as parent options
},
"url": {
// References the same schema as parent options
}
},
"required": ["id"],
"additionalProperties": true
}
}
},
"required": ["id"],
"additionalProperties": true
},
"minItems": 1
}
},
"required": ["id", "options"],
"additionalProperties": true
}
},
"required": ["$schema", "request_decision"],
"additionalProperties": true
}

Decision Response Schema

{
"type": "object",
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"decision": {
"type": "object",
"properties": {
"request_decision_id": {
"type": "string"
},
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"quantity": {
"type": "number"
}
},
"required": ["id"],
"additionalProperties": false
},
"minItems": 1
}
},
"required": ["options"],
"additionalProperties": true
}
},
"required": ["$schema", "decision"],
"additionalProperties": true
}

Field Descriptions

Request Decision Fields

FieldTypeRequiredDescription
$schemastringYesURI reference to the schema: https://aitp.dev/capabilities/aitp-02-decisions/v1.0.0/schema.json
request_decisionobjectYesContainer for the decision request
request_decision.idstringYesUnique identifier for this decision request
request_decision.titlestringNoTitle for the decision UI
request_decision.descriptionstringNoDetailed explanation of what decision is being requested
request_decision.typestringNoType of decision UI to display. One of: "radio" (default), "checkbox", "confirmation", "products"
request_decision.optionsarrayYesArray of available options to choose from
request_decision.options[].idstringYesUnique identifier for this option
request_decision.options[].namestringNoDisplay name for this option
request_decision.options[].descriptionstringNoMore detailed explanation of this option
request_decision.options[].image_urlstringNoURL to an image representing this option
request_decision.options[].short_variant_namestringNoShorter name for product variants
request_decision.options[].reviews_countintegerNoNumber of reviews for this product
request_decision.options[].five_star_ratingnumberNoRating on a scale of 0-5
request_decision.options[].urlstringNoURL to more information about this option
request_decision.options[].quoteobjectNoPayment information for this option
request_decision.options[].quote.typestringYesMust be "Quote"
request_decision.options[].quote.quote_idstringYesUnique identifier for this quote
request_decision.options[].quote.payee_idstringYesIdentifier for the recipient of payment
request_decision.options[].quote.payment_plansarrayYesArray of payment options
request_decision.options[].quote.payment_plans[].plan_idstringYesIdentifier for this payment plan
request_decision.options[].quote.payment_plans[].plan_typestringYesType of payment plan ("one-time")
request_decision.options[].quote.payment_plans[].amountnumberYesAmount to pay
request_decision.options[].quote.payment_plans[].currencystringYesCurrency code ("USD")
request_decision.options[].quote.valid_untilstringYesExpiration date/time for this quote
request_decision.options[].variantsarrayNoArray of product variants
request_decision.options[].variants[].*object-Same structure as parent options

Decision Response Fields

FieldTypeRequiredDescription
$schemastringYesURI reference to the schema: https://aitp.dev/capabilities/aitp-02-decisions/v1.0.0/schema.json
decisionobjectYesContainer for the decision response
decision.request_decision_idstringNoReference to the ID of the request being responded to
decision.optionsarrayYesArray of selected options
decision.options[].idstringYesID of the selected option
decision.options[].namestringNoName of the selected option
decision.options[].quantitynumberNoQuantity selected (for product options)