{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentaos-ai/json-schema/agentaos-ai-discount-code-schema.json",
  "title": "DiscountCode",
  "description": "Fully camelCase on the wire.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentaos-ai-discount-codes-api-openapi.yml#/components/schemas/DiscountCode",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "code": {
      "type": "string",
      "description": "As you typed it. Buyers may type it in any case."
    },
    "kind": {
      "type": "string",
      "enum": [
        "discount",
        "tracking"
      ],
      "description": "`discount` changes the price. `tracking` changes nothing and only records who used it."
    },
    "planLinkId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "The one plan this code works on; null means every subscription plan you own."
    },
    "planName": {
      "type": [
        "string",
        "null"
      ]
    },
    "archivedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "active": {
      "type": "boolean",
      "description": "Usable as far as this list can tell: not archived, and fully created. Whether the code has since been used up is answered by the single-code route."
    }
  },
  "required": [
    "id",
    "code",
    "kind",
    "planLinkId",
    "planName",
    "archivedAt",
    "createdAt",
    "active"
  ]
}