---
title: Create time-limited absolute item discount
slug: reference/create-time-limited-absolute-item-discount
docTags: 
createdAt: 2025-03-18T18:28:02.919Z
---

{
  "id": "QBCSnynx9yHbm65iJGx-l",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_absolute_item_discount",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_absolute_item_discount"
      }
    ],
    "name": "Create time-limited absolute item discount",
    "description": "<p>Creates a fixed-amount discount promotion for specific product items that automatically expires after a defined time period.</p>\n<p>This applies fixed dollar amount discounts to individual product items with automatic start and end times.\nThe promotion automatically activates and deactivates based on the configured time limits.</p>\n<p>Use this for flash sales on specific items, limited-time offers, or scheduled promotional campaigns\nwhere you want fixed-amount discounts that automatically expire.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Time-limited promotion configuration with product item targeting, discount amount, and time limits",
          "customType": "payment.pricing.promotions.pre_created.TimeLimitedAbsoluteProductItemDiscount.in",
          "schema": [
            {
              "name": "id",
              "kind": "required",
              "type": "string",
              "description": "Unique identifier for the time-limited absolute product item discount promotion configuration.",
              "example": ""
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "string",
              "description": "Fixed promotion type identifier for time-limited absolute product item discount promotions.",
              "example": "",
              "default": "time_limited_absolute_item_discount"
            },
            {
              "name": "promotionName",
              "kind": "required",
              "type": "string",
              "description": "Display name for the time-limited absolute product item discount promotion in billing interfaces.",
              "example": ""
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Optional detailed description explaining the time-limited item discount promotion's purpose and activation schedule.",
              "example": ""
            },
            {
              "name": "lockingStatus",
              "kind": "optional",
              "type": "string",
              "description": "Administrative lock status controlling whether the time-limited 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 absolute 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": "discount",
              "kind": "optional",
              "type": "number",
              "description": "Fixed monetary amount to discount from product item charges during the active promotion period.",
              "example": ""
            },
            {
              "name": "totalMaxDiscount",
              "kind": "optional",
              "type": "number",
              "description": "Optional maximum total discount amount across the entire promotion lifetime for cost control.",
              "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": "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.TimeLimitedAbsoluteProductItemDiscount.in",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Time-limited promotion successfully created",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Created time-limited promotion applying fixed-amount discounts to specific product item charges with automatic activation and dimension filtering.",
            "customType": "payment.pricing.promotions.pre_created.TimeLimitedAbsoluteProductItemDiscount.out",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier for the created time-limited absolute product item discount promotion configuration.",
                "example": ""
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string",
                "description": "Fixed promotion type identifier confirming time-limited absolute product item discount promotion.",
                "example": "",
                "default": "time_limited_absolute_item_discount"
              },
              {
                "name": "promotionName",
                "kind": "required",
                "type": "string",
                "description": "Display name for the created time-limited absolute product item discount promotion in billing interfaces.",
                "example": ""
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Optional detailed description explaining the time-limited item discount promotion's purpose and activation schedule.",
                "example": ""
              },
              {
                "name": "lockingStatus",
                "kind": "optional",
                "type": "string",
                "description": "Current administrative lock status controlling whether the time-limited 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 item promotion was last modified.",
                "example": 0
              },
              {
                "name": "targetProductItemId",
                "kind": "optional",
                "type": "string",
                "description": "Specific product item identifier that this time-limited absolute 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": "discount",
                "kind": "optional",
                "type": "number",
                "description": "Applied fixed monetary amount discounted from product item charges during the active promotion period.",
                "example": ""
              },
              {
                "name": "totalMaxDiscount",
                "kind": "optional",
                "type": "number",
                "description": "Configured maximum total discount amount across the entire promotion lifetime for cost control.",
                "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": "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.TimeLimitedAbsoluteProductItemDiscount.out",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad request - invalid promotion configuration",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Product item not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "Conflict with existing promotion",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "QTnJoJrOKTgB5WTFJOGkR",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_absolute_item_discount \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"id\": \"\",\n     \"type\": \"time_limited_absolute_item_discount\",\n     \"promotionName\": \"\"\n     }'"
        },
        {
          "id": "jMU2kSSfOIOsu9xt2SZpT",
          "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_absolute_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_absolute_item_discount\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "UHyUMYqDPR55CIqeF1-ep",
          "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_absolute_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_absolute_item_discount\",\n   \"promotionName\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "oWeW8eh5EyrSzf94NrJV7",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/time_limited_absolute_item_discount\"\n\npayload = json.dumps({\n   \"id\": \"\",\n   \"type\": \"time_limited_absolute_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": "QTnJoJrOKTgB5WTFJOGkR"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Time-limited promotion successfully created\n{\n  \"id\": \"\",\n  \"type\": \"\",\n  \"promotionName\": \"\",\n  \"description\": \"\",\n  \"lockingStatus\": \"\",\n  \"lastUpdateTimeInMillis\": \"\",\n  \"targetProductItemId\": \"\",\n  \"promotionTimeLimit\": {\n    \"cycles\": \"\",\n    \"months\": \"\"\n  },\n  \"discount\": 0,\n  \"totalMaxDiscount\": 0,\n  \"dimensionConstraintMap\": \"\",\n  \"isRegEx\": false\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad request - invalid promotion configuration\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Product item not found\n"
        },
        {
          "id": "response-3-409",
          "language": "409",
          "code": "// Conflict with existing promotion\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}