{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agentictradestandard.org/schemas/problem.schema.json",
  "title": "SACP problem details",
  "description": "RFC 9457 problem details as used by the SACP REST profile. Media type application/problem+json. Added in SACP 1.3.0-draft. Code specific members are defined in checkout-outcomes.schema.json and agent-lane-outcomes.schema.json.",
  "type": "object",
  "required": [
    "type",
    "title",
    "status",
    "code"
  ],
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "description": "URI that identifies the problem type. For SACP codes it is https://agentictradestandard.org/api/#err-{code}."
    },
    "title": {
      "type": "string",
      "description": "Short summary. The same for every occurrence of the code."
    },
    "status": {
      "type": "integer",
      "minimum": 400,
      "maximum": 599
    },
    "detail": {
      "type": "string",
      "description": "Explanation of this occurrence. No personal data, no secrets."
    },
    "instance": {
      "type": "string",
      "format": "uri-reference"
    },
    "code": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]*$",
      "description": "Stable SACP error code from the registry."
    },
    "trace_id": {
      "type": "string",
      "maxLength": 128,
      "description": "Opaque id the shop can find in its logs."
    },
    "retryable": {
      "type": "boolean"
    },
    "retry_after_seconds": {
      "type": "integer",
      "minimum": 0
    },
    "errors": {
      "type": "array",
      "description": "Used by validation_failed.",
      "items": {
        "type": "object",
        "required": [
          "pointer",
          "detail"
        ],
        "additionalProperties": false,
        "properties": {
          "pointer": {
            "type": "string",
            "description": "JSON Pointer (RFC 6901) to the value."
          },
          "detail": {
            "type": "string"
          }
        }
      }
    },
    "supported_versions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Used by version_unsupported."
    }
  },
  "additionalProperties": true
}
