{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-coupon-codes-schema.json",
  "title": "CouponCodes",
  "description": "Document representing a set of coupon codes.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-coupons-api-openapi.yml#/components/schemas/CouponCodes",
  "type": "object",
  "required": [
    "data",
    "total"
  ],
  "allOf": [
    {
      "$ref": "#/$defs/PaginatedResultBase"
    }
  ],
  "properties": {
    "data": {
      "description": "The collection of coupon codes.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/CouponCode"
      }
    }
  },
  "$defs": {
    "CouponCode": {
      "description": "A coupon code with accompanying stats for redemptions and issues.",
      "type": "object",
      "required": [
        "code",
        "issued",
        "redemptionCount"
      ],
      "additionalProperties": false,
      "properties": {
        "code": {
          "description": "The code used to redeem the coupon.",
          "type": "string"
        },
        "issued": {
          "description": "Flag indicating if the coupon code has been issued.",
          "type": "boolean"
        },
        "redemptionCount": {
          "format": "int32",
          "description": "The count of the number of redemptions associated with the code.",
          "type": "integer"
        }
      }
    },
    "Offset": {
      "default": 0,
      "minimum": 0,
      "format": "int32",
      "description": "The zero-based index of the first hit/data to include in the result.",
      "type": "integer"
    },
    "PaginatedResultBase": {
      "description": "Schema defining generic pageable result. Each response schema of a resource requiring pagination should extend this schema. \nIf you use this extend this schema directly, it needs to be defined what data is returned. Allowed names for the data field is `data`.",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/ResultBase"
        }
      ],
      "properties": {
        "offset": {
          "$ref": "#/$defs/Offset"
        }
      },
      "required": [
        "limit",
        "offset",
        "total"
      ]
    },
    "ResultBase": {
      "description": "Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. \nAdditionally it needs to be defined what data is returned.",
      "type": "object",
      "required": [
        "limit",
        "total"
      ],
      "properties": {
        "limit": {
          "format": "int32",
          "description": "Maximum records to retrieve per request. The limit with its constraints (minimum, maximum, default) is defined by the request parameter `limit` of the endpoint returning this schema.",
          "type": "integer"
        },
        "total": {
          "$ref": "#/$defs/Total"
        }
      }
    },
    "Total": {
      "default": 0,
      "minimum": 0,
      "format": "int32",
      "description": "The total number of hits that match the search's criteria. This can be greater than the number of results returned as search results are pagenated.",
      "type": "integer"
    }
  }
}