{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/stripe/main/json-schema/stripe-promotion-code-schema.json",
  "title": "PromotionCode",
  "description": "A Promotion Code represents a customer-redeemable code for a [coupon](https://stripe.com/docs/api#coupons). It can be used to\ncreate multiple codes for a single coupon.",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stripe-promotion-codes-api-openapi.yml#/components/schemas/promotion_code",
  "properties": {
    "active": {
      "description": "Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid.",
      "type": "boolean"
    },
    "code": {
      "description": "The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer.",
      "maxLength": 5000,
      "type": "string"
    },
    "coupon": {
      "$ref": "#/$defs/coupon"
    },
    "created": {
      "description": "Time at which the object was created. Measured in seconds since the Unix epoch.",
      "format": "unix-time",
      "type": "integer"
    },
    "customer": {
      "anyOf": [
        {
          "maxLength": 5000,
          "type": "string"
        },
        {
          "$ref": "#/$defs/customer"
        },
        {
          "$ref": "#/$defs/deleted_customer"
        }
      ],
      "description": "The customer that this promotion code can be used by.",
      "x-expansionResources": {
        "oneOf": [
          {
            "$ref": "#/$defs/customer"
          },
          {
            "$ref": "#/$defs/deleted_customer"
          }
        ]
      }
    },
    "expires_at": {
      "description": "Date at which the promotion code can no longer be redeemed.",
      "format": "unix-time",
      "type": [
        "integer",
        "null"
      ]
    },
    "id": {
      "description": "Unique identifier for the object.",
      "maxLength": 5000,
      "type": "string"
    },
    "livemode": {
      "description": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.",
      "type": "boolean"
    },
    "max_redemptions": {
      "description": "Maximum number of times this promotion code can be redeemed.",
      "type": [
        "integer",
        "null"
      ]
    },
    "metadata": {
      "additionalProperties": {
        "maxLength": 500,
        "type": "string"
      },
      "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.",
      "type": [
        "object",
        "null"
      ]
    },
    "object": {
      "description": "String representing the object's type. Objects of the same type share the same value.",
      "enum": [
        "promotion_code"
      ],
      "type": "string"
    },
    "restrictions": {
      "$ref": "#/$defs/promotion_codes_resource_restrictions"
    },
    "times_redeemed": {
      "description": "Number of times this promotion code has been used.",
      "type": "integer"
    }
  },
  "required": [
    "active",
    "code",
    "coupon",
    "created",
    "id",
    "livemode",
    "object",
    "restrictions",
    "times_redeemed"
  ],
  "type": "object",
  "x-expandableFields": [
    "coupon",
    "customer",
    "restrictions"
  ],
  "x-resourceId": "promotion_code",
  "$defs": {
    "coupon": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    },
    "customer": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    },
    "deleted_customer": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    },
    "promotion_codes_resource_restrictions": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    }
  }
}