{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/subotiz-com/json-schema/subotiz-com-list-discounts-response-schema.json",
  "title": "ListDiscountsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/subotiz-com-discount-api-openapi.yml#/components/schemas/ListDiscountsResponse",
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "error code"
    },
    "message": {
      "type": "string",
      "description": "error message"
    },
    "data": {
      "$ref": "#/$defs/ListDiscountsResponse_Data"
    }
  },
  "$defs": {
    "Discount": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique ID of the discount object"
        },
        "discount_name": {
          "type": "string",
          "description": "The name of the discount"
        },
        "status": {
          "type": "string",
          "description": "Discount status:\n - draft: The discount has been created but is not active or visible to users yet.\n - not_started: The discount is defined, but its start time has not yet arrived.\n - ongoing: The discount is currently active and available for use.\n - completed: The discount has ended and is no longer available for use."
        },
        "discount_code": {
          "type": "string",
          "description": "Discount code to be applied at checkout"
        },
        "discount_method": {
          "type": "string",
          "description": "Discount method: Only when set to \"discount_code\" can a discount code be used:\n - discount_code: Discount by discount code"
        },
        "starts_at": {
          "type": "string",
          "description": "Discount start time in UTC format, An empty string means no restriction"
        },
        "ends_at": {
          "type": "string",
          "description": "Discount end time in UTC format, An empty string means no restriction"
        },
        "created_at": {
          "type": "string",
          "description": "Creation time, UTC formatted string"
        },
        "updated_at": {
          "type": "string",
          "description": "Last update time, UTC formatted string"
        }
      }
    },
    "ListDiscountsResponse_Data": {
      "type": "object",
      "properties": {
        "has_more": {
          "type": "boolean",
          "description": "Whether there is more data"
        },
        "list": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Discount"
          },
          "description": "Discount list"
        }
      }
    }
  }
}