Skip to content

AvailablePromotion ​

Type: schema

Description ​

A promotion as returned by the available-promotions endpoint. This is a reduced/flattened projection built by the cart service (get_promotions), NOT the full promotion entity — do not confuse with the webhook Promotion schema.

TypeScript Definition ​

typescript
AvailablePromotion: {{
            id: string;
            name: string;
            description?: string | null;
            tags?: string[];
            redemption_limits?: {
                total_redemptions?: number | null;
                per_customer_redemptions?: number | null;
                per_coupon_code_redemptions?: number | null;
            };
            redemption_count?: number;
            minimum_order_total?: number;
            /** Format: date-time */
            starts_at?: string | null;
            /** Format: date-time */
            expires_at?: string | null;
            details?: {
                discount_type?: string | null;
                discount_percent?: number;
                maximum_discount_amount?: number;
                products?: string[];
                category_id?: string[];
            };
            /** @description Scope of the promotion. Defaults to `all`. */
            applies_to_product?: string;
            promotion_type: string;
            can_be_used_with_other_promotion?: boolean;
        };
        /**
         * BankTransfer
         * @description Bank transfer payment - IMPS, NEFT, RTGS
         */
}

OpenAPI Schema ​

json
{
  "title": "AvailablePromotion",
  "description": "A promotion as returned by the available-promotions endpoint. This is a reduced/flattened projection built by the cart service (`get_promotions`), NOT the full promotion entity — do not confuse with the webhook `Promotion` schema.",
  "type": "object",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/AvailablePromotion",
    "description": "API reference for the AvailablePromotion schema"
  },
  "required": [
    "id",
    "name",
    "promotion_type"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "redemption_limits": {
      "type": "object",
      "properties": {
        "total_redemptions": {
          "type": [
            "integer",
            "null"
          ]
        },
        "per_customer_redemptions": {
          "type": [
            "integer",
            "null"
          ]
        },
        "per_coupon_code_redemptions": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    },
    "redemption_count": {
      "type": "integer"
    },
    "minimum_order_total": {
      "type": "number"
    },
    "starts_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "details": {
      "type": "object",
      "properties": {
        "discount_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "discount_percent": {
          "type": "number"
        },
        "maximum_discount_amount": {
          "type": "number"
        },
        "products": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "category_id": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "applies_to_product": {
      "description": "Scope of the promotion. Defaults to `all`.",
      "type": "string"
    },
    "promotion_type": {
      "type": "string"
    },
    "can_be_used_with_other_promotion": {
      "type": "boolean"
    }
  }
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: