---
title: Create tiered percentage item discount with automatic expiration
slug: reference/create-tiered-percentage-item-discount-with-automatic-expiration
docTags: 
createdAt: 2025-03-18T18:28:02.919Z
---

{
  "id": "5GOUUbHqsFOimF6TyHe3o",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_tiered_relative_item_discount",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_tiered_relative_item_discount"
      }
    ],
    "name": "Create tiered percentage item discount with automatic expiration",
    "description": "<p>Creates a tiered percentage discount promotion for specific product items that automatically expires at a specified time.\nUse this for time-limited campaigns that reward higher item usage with escalating percentage discounts.</p>\n<p>Use this endpoint to:</p>\n<ul>\n<li>Apply escalating percentage discounts based on item usage tiers</li>\n<li>Encourage increased usage of specific product features</li>\n<li>Set up automatic discount campaigns with progressive savings</li>\n</ul>\n<p><strong>Important Note:</strong> Promotion automatically activates and deactivates based on configured time limits.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Tiered promotion configuration with usage thresholds, percentage rates, and time limits",
          "customType": "payment.pricing.promotions.pre_created.TimeLimitedTieredRelativeProductItemDiscount.in",
          "schema": [
            {
              "name": "id",
              "kind": "required",
              "type": "string",
              "description": "Unique identifier for the time-limited tiered relative product item discount promotion configuration.",
              "example": ""
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "string",
              "description": "Fixed promotion type identifier for time-limited tiered relative product item discount promotions.",
              "example": "",
              "default": "time_limited_tiered_relative_item_discount"
            },
            {
              "name": "promotionName",
              "kind": "required",
              "type": "string",
              "description": "Display name for the time-limited tiered relative product item discount promotion in billing interfaces.",
              "example": ""
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Optional detailed description explaining the time-limited tiered item percentage discount promotion's purpose and activation schedule.",
              "example": ""
            },
            {
              "name": "lockingStatus",
              "kind": "optional",
              "type": "string",
              "description": "Administrative lock status controlling whether the time-limited tiered item promotion settings can be modified.",
              "modelRef": "#/components/schemas/common.LockingStatus.in",
              "customType": "common.LockingStatus.in",
              "schema": []
            },
            {
              "name": "targetProductItemId",
              "kind": "optional",
              "type": "string",
              "description": "Specific product item identifier that this time-limited tiered percentage discount promotion targets for discounting.",
              "example": ""
            },
            {
              "name": "promotionTimeLimit",
              "kind": "optional",
              "type": "object",
              "description": "Time constraints defining promotion duration and automatic activation schedule based on history requirements.",
              "modelRef": "#/components/schemas/payment.pricing.promotions.attributes.HistoryRequirements.in",
              "customType": "payment.pricing.promotions.attributes.HistoryRequirements.in",
              "schema": [
                {
                  "name": "cycles",
                  "kind": "optional",
                  "type": "integer<int32>",
                  "description": "Minimum number of billing cycles of customer invoice history required for promotion calculations.",
                  "example": 0
                },
                {
                  "name": "months",
                  "kind": "optional",
                  "type": "integer<int32>",
                  "description": "Minimum number of months of customer invoice history required for promotion calculations.",
                  "example": 0
                }
              ]
            },
            {
              "name": "priceToDiscountMap",
              "kind": "optional",
              "type": "map",
              "description": "Price threshold map defining percentage discount ratios for each item tier level.",
              "example": "",
              "customType": "map<string, number>",
              "schema": []
            },
            {
              "name": "discountCalculationStrategy",
              "kind": "optional",
              "type": "string",
              "description": "Calculation strategy for applying tiered discounts, defaults to CHOOSE_SINGLE_TIER when not specified.",
              "modelRef": "#/components/schemas/payment.pricing.prepaid.OfferCalculationStrategy.out",
              "customType": "payment.pricing.prepaid.OfferCalculationStrategy.out",
              "schema": []
            },
            {
              "name": "totalMaxDiscount",
              "kind": "optional",
              "type": "number",
              "description": "Maximum total discount amount across the entire promotion lifetime for cost control.",
              "example": ""
            },
            {
              "name": "cycleMaxDiscount",
              "kind": "optional",
              "type": "number",
              "description": "Maximum discount amount per billing cycle for consistent budget management during promotion period.",
              "example": ""
            },
            {
              "name": "dimensionConstraintMap",
              "kind": "optional",
              "type": "map",
              "description": "Optional dimension filters restricting when the promotion applies to specific usage characteristics.",
              "example": "",
              "customType": "map<string, string>",
              "schema": []
            },
            {
              "name": "acrossBillingPeriods",
              "kind": "optional",
              "type": "boolean",
              "description": "Controls whether discount tiers accumulate across billing periods or reset per cycle.",
              "example": ""
            },
            {
              "name": "isRegEx",
              "kind": "optional",
              "type": "boolean",
              "description": "Enables regular expression pattern matching for dimension constraint values providing flexible targeting rules.",
              "example": ""
            }
          ],
          "modelRef": "#/components/schemas/payment.pricing.promotions.pre_created.TimeLimitedTieredRelativeProductItemDiscount.in",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Time-limited tiered promotion created with percentage rates and expiration schedule",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Created time-limited promotion applying tiered percentage-based discounts to specific product item charges based on price thresholds with automatic activation and dimension filtering.",
            "customType": "payment.pricing.promotions.pre_created.TimeLimitedTieredRelativeProductItemDiscount.out",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier for the created time-limited tiered relative product item discount promotion configuration.",
                "example": ""
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string",
                "description": "Fixed promotion type identifier confirming time-limited tiered relative product item discount promotion.",
                "example": "",
                "default": "time_limited_tiered_relative_item_discount"
              },
              {
                "name": "promotionName",
                "kind": "required",
                "type": "string",
                "description": "Display name for the created time-limited tiered relative product item discount promotion in billing interfaces.",
                "example": ""
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Optional detailed description explaining the time-limited tiered item percentage discount promotion's purpose and activation schedule.",
                "example": ""
              },
              {
                "name": "lockingStatus",
                "kind": "optional",
                "type": "string",
                "description": "Current administrative lock status controlling whether the time-limited tiered item promotion settings can be modified.",
                "modelRef": "#/components/schemas/common.LockingStatus.in",
                "customType": "common.LockingStatus.in",
                "schema": []
              },
              {
                "name": "lastUpdateTimeInMillis",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "Unix timestamp in milliseconds when the time-limited tiered item promotion was last modified.",
                "example": 0
              },
              {
                "name": "targetProductItemId",
                "kind": "optional",
                "type": "string",
                "description": "Specific product item identifier that this time-limited tiered percentage discount promotion targets for discounting.",
                "example": ""
              },
              {
                "name": "promotionTimeLimit",
                "kind": "optional",
                "type": "object",
                "description": "Configured time constraints defining promotion duration and automatic activation schedule based on history requirements.",
                "modelRef": "#/components/schemas/payment.pricing.promotions.attributes.HistoryRequirements.in",
                "customType": "payment.pricing.promotions.attributes.HistoryRequirements.in",
                "schema": [
                  {
                    "name": "cycles",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "Minimum number of billing cycles of customer invoice history required for promotion calculations.",
                    "example": 0
                  },
                  {
                    "name": "months",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "Minimum number of months of customer invoice history required for promotion calculations.",
                    "example": 0
                  }
                ]
              },
              {
                "name": "priceToDiscountMap",
                "kind": "optional",
                "type": "map",
                "description": "Configured price threshold map defining percentage discount ratios for each item tier level.",
                "example": "",
                "customType": "map<string, number>",
                "schema": []
              },
              {
                "name": "discountCalculationStrategy",
                "kind": "optional",
                "type": "string",
                "description": "Applied calculation strategy for tiered discounts, defaults to CHOOSE_SINGLE_TIER when not specified.",
                "modelRef": "#/components/schemas/payment.pricing.prepaid.OfferCalculationStrategy.out",
                "customType": "payment.pricing.prepaid.OfferCalculationStrategy.out",
                "schema": []
              },
              {
                "name": "totalMaxDiscount",
                "kind": "optional",
                "type": "number",
                "description": "Configured maximum total discount amount across the entire promotion lifetime for cost control.",
                "example": ""
              },
              {
                "name": "cycleMaxDiscount",
                "kind": "optional",
                "type": "number",
                "description": "Configured maximum discount amount per billing cycle for consistent budget management during promotion period.",
                "example": ""
              },
              {
                "name": "dimensionConstraintMap",
                "kind": "optional",
                "type": "map",
                "description": "Applied dimension filters restricting when the promotion applies to specific usage characteristics.",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "acrossBillingPeriods",
                "kind": "optional",
                "type": "boolean",
                "description": "Current setting controlling whether discount tiers accumulate across billing periods or reset per cycle.",
                "example": ""
              },
              {
                "name": "isRegEx",
                "kind": "optional",
                "type": "boolean",
                "description": "Current setting enabling regular expression pattern matching for dimension constraint values.",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/payment.pricing.promotions.pre_created.TimeLimitedTieredRelativeProductItemDiscount.out",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid tier configuration or percentage rate parameters",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "Authentication required or invalid API key provided",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Internal server error occurred while creating tiered promotion",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "NhiohVv5ulYSBHuJ4hO-x",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_tiered_relative_item_discount \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"id\": \"\",\n     \"type\": \"time_limited_tiered_relative_item_discount\",\n     \"promotionName\": \"\"\n     }'"
        },
        {
          "id": "7E8pWo_WfpWlaboh5AfcD",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"id\": \"\",\n   \"type\": \"time_limited_tiered_relative_item_discount\",\n   \"promotionName\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_tiered_relative_item_discount\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "oQremSNOupcWtXGa013mE",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_tiered_relative_item_discount\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"id\": \"\",\n   \"type\": \"time_limited_tiered_relative_item_discount\",\n   \"promotionName\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "J6JH-FmCs_kxTJdBsmP7z",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_tiered_relative_item_discount\"\n\npayload = json.dumps({\n   \"id\": \"\",\n   \"type\": \"time_limited_tiered_relative_item_discount\",\n   \"promotionName\": \"\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "NhiohVv5ulYSBHuJ4hO-x"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Time-limited tiered promotion created with percentage rates and expiration schedule\n{\n  \"id\": \"\",\n  \"type\": \"\",\n  \"promotionName\": \"\",\n  \"description\": \"\",\n  \"lockingStatus\": \"\",\n  \"lastUpdateTimeInMillis\": \"\",\n  \"targetProductItemId\": \"\",\n  \"promotionTimeLimit\": {\n    \"cycles\": \"\",\n    \"months\": \"\"\n  },\n  \"priceToDiscountMap\": \"\",\n  \"discountCalculationStrategy\": \"\",\n  \"totalMaxDiscount\": 0,\n  \"cycleMaxDiscount\": 0,\n  \"dimensionConstraintMap\": \"\",\n  \"acrossBillingPeriods\": false,\n  \"isRegEx\": false\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid tier configuration or percentage rate parameters\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Authentication required or invalid API key provided\n"
        },
        {
          "id": "response-3-500",
          "language": "500",
          "code": "// Internal server error occurred while creating tiered promotion\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}