Skip to content

LoyaltyProgram ​

Type: schema

TypeScript Definition ​

typescript
LoyaltyProgram: {{
            id?: $Read<string>;
            /** @description name of loyalty program */
            name: string;
            /** @description Restricts the program to these sellers. Use `null` or omit to apply it across all sellers. */
            seller_id?: string[] | null;
            /** @description Restricts the program to these customer groups. Use `null` or omit to apply it to all customers. */
            customer_group_id?: string[] | null;
            /**
             * @description frequency at which loyalty program will be renewed.
             * @enum {unknown}
             */
            renewal_type: "yearly" | "never" | "custom";
            /**
             * Format: date-time
             * @description If renewal_type is "custom", a corresponding valid date must be specified; for other types, the value should be null.
             */
            starts_at: string | null;
            /**
             * Format: date
             * @description If renewal_type is "custom", a corresponding valid date must be specified; for other types, the value should be null.
             */
            date_of_reset: string | null;
            /**
             * @description to decide tier upgradation based on no of orders or total purchase value
             * @enum {unknown}
             */
            tier_upgrade_criteria: "total-spent" | "total-orders" | "custom";
            /**
             * @description Defines how points are earned. "dynamic" means points are calculated based on a rate (points_earning_rate), "fixed" means a fixed number of points are given.
             * @enum {unknown}
             */
            points_earning_type: "dynamic" | "fixed";
            /**
             * @description The monetary value of one loyalty point.
             * @default 1
             */
            point_value: number;
            /**
             * @description Defines when loyalty points are expired. "never" means the points never expire, "inactivity" means the points expire after a certain number of days of inactivity, "reset_date" means the points expire when the loyalty program is reset.
             * @enum {unknown}
             */
            redemption_expiry_type: "never" | "inactivity" | "reset_date";
            /** @description The number of days after the last order was placed, after which the points expire if redemption_expiry_type is "inactivity". required if redemption_expiry_type is "inactivity", otherwise should be null. */
            redemption_inactivity_days: number | null;
            status?: $Read<components["schemas"]["LoyaltyProgramStatus"]>;
            /**
             * Format: date-time
             * @description If status is "paused", the date and time from which the loyalty program will be paused. If not specified, the loyalty program will be paused immediately.
             */
            pause_starts_at?: string | null;
            /**
             * Format: date-time
             * @description If status is "paused", the date and time until which the loyalty program will be paused. If not specified, the loyalty program will remain paused until it is resumed.
             */
            pause_ends_at?: string | null;
            /** Format: date-time */
            created_at?: $Read<string>;
            /** Format: date-time */
            modified_at?: $Read<string>;
            tiers: components["schemas"]["LoyaltyTier"][];
        };
        /**
         * LoyaltyProgramStatus
         * @description The operational status of the loyalty program.
         * @enum {string}
         */
}

Component References ​

ReferenceResolves To
components["schemas"]["LoyaltyProgramStatus"]LoyaltyProgramStatus
components["schemas"]["LoyaltyTier"]LoyaltyTier

OpenAPI Schema ​

json
{
  "title": "LoyaltyProgram",
  "type": "object",
  "required": [
    "name",
    "renewal_type",
    "starts_at",
    "date_of_reset",
    "tier_upgrade_criteria",
    "points_earning_type",
    "point_value",
    "redemption_expiry_type",
    "redemption_inactivity_days",
    "tiers"
  ],
  "properties": {
    "id": {
      "type": "string",
      "readOnly": true
    },
    "name": {
      "description": "name of loyalty program",
      "type": "string"
    },
    "seller_id": {
      "description": "Restricts the program to these sellers. Use `null` or omit to apply it across all sellers.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "customer_group_id": {
      "description": "Restricts the program to these customer groups. Use `null` or omit to apply it to all customers.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "renewal_type": {
      "description": "frequency at which loyalty program will be renewed.",
      "enum": [
        "yearly",
        "never",
        "custom"
      ]
    },
    "starts_at": {
      "description": "If renewal_type is \"custom\", a corresponding valid date must be specified; for other types, the value should be null.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "date_of_reset": {
      "description": "If renewal_type is \"custom\", a corresponding valid date must be specified; for other types, the value should be null.",
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "tier_upgrade_criteria": {
      "description": "to decide tier upgradation based on no of orders or total purchase value",
      "enum": [
        "total-spent",
        "total-orders",
        "custom"
      ]
    },
    "points_earning_type": {
      "description": "Defines how points are earned. \"dynamic\" means points are calculated based on a rate (points_earning_rate), \"fixed\" means a fixed number of points are given.",
      "enum": [
        "dynamic",
        "fixed"
      ]
    },
    "point_value": {
      "description": "The monetary value of one loyalty point.",
      "type": "number",
      "default": 1
    },
    "redemption_expiry_type": {
      "description": "Defines when loyalty points are expired. \"never\" means the points never expire, \"inactivity\" means the points expire after a certain number of days of inactivity, \"reset_date\" means the points expire when the loyalty program is reset.",
      "enum": [
        "never",
        "inactivity",
        "reset_date"
      ]
    },
    "redemption_inactivity_days": {
      "description": "The number of days after the last order was placed, after which the points expire if redemption_expiry_type is \"inactivity\". required if redemption_expiry_type is \"inactivity\", otherwise should be null.",
      "type": [
        "integer",
        "null"
      ]
    },
    "status": {
      "$ref": "#/components/schemas/LoyaltyProgramStatus",
      "readOnly": true
    },
    "pause_starts_at": {
      "description": "If status is \"paused\", the date and time from which the loyalty program will be paused. If not specified, the loyalty program will be paused immediately.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "pause_ends_at": {
      "description": "If status is \"paused\", the date and time until which the loyalty program will be paused. If not specified, the loyalty program will remain paused until it is resumed.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "modified_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "tiers": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/LoyaltyTier"
      }
    }
  },
  "x-tags": [
    "Customers"
  ]
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: