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

{
  "id": "rSw4gWYW792cBLzIA5uHa",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_tiered_absolute_product_discount",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_tiered_absolute_product_discount"
      }
    ],
    "name": "Create tiered absolute product discount with automatic expiration",
    "description": "<p>Creates a tiered fixed-amount discount promotion for entire products that automatically expires at a specified time.\nUse this for time-limited campaigns that reward higher usage with escalating discounts.</p>\n<p>Use this endpoint to:</p>\n<ul>\n<li>Apply escalating fixed-amount discounts based on usage tiers</li>\n<li>Create time-limited promotions that encourage increased product usage</li>\n<li>Set up automatic discount campaigns with defined start and end times</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, discount amounts, and time limits",
          "customType": "payment.pricing.promotions.pre_created.TimeLimitedTieredAbsoluteProductDiscount.in",
          "schema": [
            {
              "name": "id",
              "kind": "required",
              "type": "string",
              "description": "Unique identifier for the time-limited tiered absolute product discount promotion configuration.",
              "example": ""
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "string",
              "description": "Fixed promotion type identifier for time-limited tiered absolute product discount promotions.",
              "example": "",
              "default": "time_limited_tiered_absolute_product_discount"
            },
            {
              "name": "promotionName",
              "kind": "required",
              "type": "string",
              "description": "Display name for the time-limited tiered absolute product discount promotion in billing interfaces.",
              "example": ""
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Optional detailed description explaining the time-limited tiered discount promotion's purpose and activation schedule.",
              "example": ""
            },
            {
              "name": "lockingStatus",
              "kind": "optional",
              "type": "string",
              "description": "Administrative lock status controlling whether the time-limited tiered promotion settings can be modified.",
              "modelRef": "#/components/schemas/common.LockingStatus.in",
              "customType": "common.LockingStatus.in",
              "schema": []
            },
            {
              "name": "targetProductId",
              "kind": "optional",
              "type": "string",
              "description": "Specific product identifier that this time-limited tiered 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": "discountMap",
              "kind": "optional",
              "type": "map",
              "description": "Usage threshold map defining fixed discount amounts for each tier level.",
              "example": "",
              "customType": "map<string, number>",
              "schema": []
            },
            {
              "name": "totalMaxDiscount",
              "kind": "optional",
              "type": "number",
              "description": "Maximum total discount amount across the entire promotion lifetime for cost control.",
              "example": ""
            },
            {
              "name": "measure",
              "kind": "optional",
              "type": "object",
              "description": "Measure for calculating discount thresholds, defaults to TotalPrice when not specified.",
              "modelRef": "#/components/schemas/payment.pricing.promotions.attributes.measure.Measure.in",
              "customType": "payment.pricing.promotions.attributes.measure.Measure.in",
              "schema": [],
              "complexType": "oneOf",
              "complexItems": [
                {
                  "name": "payment.pricing.promotions.attributes.measure.PerUnitBatch.in",
                  "description": "",
                  "modelRef": "#/components/schemas/payment.pricing.promotions.attributes.measure.PerUnitBatch.in",
                  "schema": [
                    {
                      "name": "type",
                      "kind": "optional",
                      "type": "string",
                      "description": "Measure type identifier always set to 'per_batch' for batch-based discount calculations.",
                      "example": "",
                      "default": "per_batch"
                    },
                    {
                      "name": "batchSize",
                      "kind": "optional",
                      "type": "integer<int64>",
                      "description": "Number of usage units grouped together to form a single discountable batch for promotion calculations.",
                      "example": 0
                    }
                  ]
                },
                {
                  "name": "payment.pricing.promotions.attributes.measure.PerUnit.in",
                  "description": "",
                  "modelRef": "#/components/schemas/payment.pricing.promotions.attributes.measure.PerUnit.in",
                  "schema": [
                    {
                      "name": "type",
                      "kind": "optional",
                      "type": "string",
                      "description": "Measure type identifier always set to 'per_unit' for per-unit discount calculations.",
                      "example": "",
                      "default": "per_unit"
                    }
                  ]
                },
                {
                  "name": "payment.pricing.promotions.attributes.measure.TotalPrice.in",
                  "description": "",
                  "modelRef": "#/components/schemas/payment.pricing.promotions.attributes.measure.TotalPrice.in",
                  "schema": [
                    {
                      "name": "type",
                      "kind": "optional",
                      "type": "string",
                      "description": "Measure type identifier always set to 'total_price' for total price discount calculations.",
                      "example": "",
                      "default": "total_price"
                    }
                  ]
                }
              ]
            },
            {
              "name": "acrossBillingPeriods",
              "kind": "optional",
              "type": "boolean",
              "description": "Controls whether discount tiers accumulate across billing periods or reset per cycle.",
              "example": ""
            }
          ],
          "modelRef": "#/components/schemas/payment.pricing.promotions.pre_created.TimeLimitedTieredAbsoluteProductDiscount.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 usage thresholds and expiration schedule",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Created time-limited promotion applying tiered fixed-amount discounts to product charges based on usage thresholds with automatic activation and deactivation.",
            "customType": "payment.pricing.promotions.pre_created.TimeLimitedTieredAbsoluteProductDiscount.out",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier for the created time-limited tiered absolute product discount promotion configuration.",
                "example": ""
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string",
                "description": "Fixed promotion type identifier confirming time-limited tiered absolute product discount promotion.",
                "example": "",
                "default": "time_limited_tiered_absolute_product_discount"
              },
              {
                "name": "promotionName",
                "kind": "required",
                "type": "string",
                "description": "Display name for the created time-limited tiered absolute product discount promotion in billing interfaces.",
                "example": ""
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Optional detailed description explaining the time-limited tiered 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 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 promotion was last modified.",
                "example": 0
              },
              {
                "name": "targetProductId",
                "kind": "optional",
                "type": "string",
                "description": "Specific product identifier that this time-limited tiered 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": "discountMap",
                "kind": "optional",
                "type": "map",
                "description": "Configured usage threshold map defining fixed discount amounts for each tier level.",
                "example": "",
                "customType": "map<string, number>",
                "schema": []
              },
              {
                "name": "totalMaxDiscount",
                "kind": "optional",
                "type": "number",
                "description": "Configured maximum total discount amount across the entire promotion lifetime for cost control.",
                "example": ""
              },
              {
                "name": "measure",
                "kind": "optional",
                "type": "object",
                "description": "Applied measure for calculating discount thresholds, defaults to TotalPrice when not specified.",
                "modelRef": "#/components/schemas/payment.pricing.promotions.attributes.measure.Measure.out",
                "customType": "payment.pricing.promotions.attributes.measure.Measure.out",
                "schema": [],
                "complexType": "oneOf",
                "complexItems": [
                  {
                    "name": "payment.pricing.promotions.attributes.measure.PerUnitBatch.in",
                    "description": "",
                    "modelRef": "#/components/schemas/payment.pricing.promotions.attributes.measure.PerUnitBatch.in",
                    "schema": [
                      {
                        "name": "type",
                        "kind": "optional",
                        "type": "string",
                        "description": "Measure type identifier always set to 'per_batch' for batch-based discount calculations.",
                        "example": "",
                        "default": "per_batch"
                      },
                      {
                        "name": "batchSize",
                        "kind": "optional",
                        "type": "integer<int64>",
                        "description": "Number of usage units grouped together to form a single discountable batch for promotion calculations.",
                        "example": 0
                      }
                    ]
                  },
                  {
                    "name": "payment.pricing.promotions.attributes.measure.PerUnit.in",
                    "description": "",
                    "modelRef": "#/components/schemas/payment.pricing.promotions.attributes.measure.PerUnit.in",
                    "schema": [
                      {
                        "name": "type",
                        "kind": "optional",
                        "type": "string",
                        "description": "Measure type identifier always set to 'per_unit' for per-unit discount calculations.",
                        "example": "",
                        "default": "per_unit"
                      }
                    ]
                  },
                  {
                    "name": "payment.pricing.promotions.attributes.measure.TotalPrice.in",
                    "description": "",
                    "modelRef": "#/components/schemas/payment.pricing.promotions.attributes.measure.TotalPrice.in",
                    "schema": [
                      {
                        "name": "type",
                        "kind": "optional",
                        "type": "string",
                        "description": "Measure type identifier always set to 'total_price' for total price discount calculations.",
                        "example": "",
                        "default": "total_price"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "acrossBillingPeriods",
                "kind": "optional",
                "type": "boolean",
                "description": "Current setting controlling whether discount tiers accumulate across billing periods or reset per cycle.",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/payment.pricing.promotions.pre_created.TimeLimitedTieredAbsoluteProductDiscount.out",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid tier configuration or time limit 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": "IHLdHD9e6NuIBJ9MeHJps",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_tiered_absolute_product_discount \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"id\": \"\",\n     \"type\": \"time_limited_tiered_absolute_product_discount\",\n     \"promotionName\": \"\",\n     \"measure\": {\n     \"type\": \"per_batch\"\n     }\n     }'"
        },
        {
          "id": "-GNZf-c1HdnBN2wB5X6gx",
          "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_absolute_product_discount\",\n   \"promotionName\": \"\",\n   \"measure\": {\n      \"type\": \"per_batch\"\n   }\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_absolute_product_discount\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "ahJlGkCXikI8qbXqqZQVt",
          "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_absolute_product_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_absolute_product_discount\",\n   \"promotionName\": \"\",\n   \"measure\": {\n      \"type\": \"per_batch\"\n   }\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "eOPx6QlGhWKwG28qsYw9U",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_tiered_absolute_product_discount\"\n\npayload = json.dumps({\n   \"id\": \"\",\n   \"type\": \"time_limited_tiered_absolute_product_discount\",\n   \"promotionName\": \"\",\n   \"measure\": {\n      \"type\": \"per_batch\"\n   }\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": "IHLdHD9e6NuIBJ9MeHJps"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Time-limited tiered promotion created with usage thresholds and expiration schedule\n{\n  \"id\": \"\",\n  \"type\": \"\",\n  \"promotionName\": \"\",\n  \"description\": \"\",\n  \"lockingStatus\": \"\",\n  \"lastUpdateTimeInMillis\": \"\",\n  \"targetProductId\": \"\",\n  \"promotionTimeLimit\": {\n    \"cycles\": \"\",\n    \"months\": \"\"\n  },\n  \"discountMap\": \"\",\n  \"totalMaxDiscount\": 0,\n  \"measure\": {},\n  \"acrossBillingPeriods\": false\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid tier configuration or time limit 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": ""
    }
  ]
}