{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/crevio-co/json-schema/crevio-co-discount-schema.json",
  "title": "Discount",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/crevio-co-discounts-api-openapi.yml#/components/schemas/Discount",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "object": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "inactive"
      ]
    },
    "discount_type": {
      "type": "string",
      "enum": [
        "percentage",
        "fixed"
      ]
    },
    "code": {
      "type": "string"
    },
    "amount_off": {
      "type": [
        "integer",
        "null"
      ]
    },
    "duration": {
      "type": "string",
      "enum": [
        "forever",
        "once",
        "repeating"
      ]
    },
    "duration_in_months": {
      "type": [
        "integer",
        "null"
      ]
    },
    "max_redemptions": {
      "type": [
        "integer",
        "null"
      ]
    },
    "times_redeemed": {
      "type": "integer"
    },
    "starts_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "redeem_by": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "minimum_amount": {
      "type": [
        "integer",
        "null"
      ]
    },
    "once_per_customer": {
      "type": "boolean"
    },
    "first_order_only": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "percent_off": {
      "type": [
        "number",
        "null"
      ],
      "format": "double"
    },
    "currency": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "id",
    "object",
    "status",
    "discount_type",
    "code",
    "amount_off",
    "duration",
    "duration_in_months",
    "max_redemptions",
    "times_redeemed",
    "starts_at",
    "redeem_by",
    "minimum_amount",
    "once_per_customer",
    "first_order_only",
    "created_at",
    "updated_at",
    "percent_off",
    "currency"
  ]
}