---
title: Create automatic tiered percentage discount based on customer tags
slug: reference/create-automatic-tiered-percentage-discount-based-on-customer-tags
docTags: 
createdAt: 2025-03-18T18:28:02.919Z
---

{
  "id": "xIdmuZ7kMUSmUgkce0kqg",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/tiered_relative_product_item_automatic_promotion",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/tiered_relative_product_item_automatic_promotion"
      }
    ],
    "name": "Create automatic tiered percentage discount based on customer tags",
    "description": "<p>Creates an automatic tiered percentage discount for specific product items based on customer tags and usage.\nUse this for customer loyalty programs and volume-based incentives that activate automatically.</p>\n<p>Use this endpoint to:</p>\n<ul>\n<li>Set up automatic loyalty rewards for tagged customers</li>\n<li>Create volume-based discounts that scale with usage</li>\n<li>Configure hands-off promotional incentives</li>\n</ul>\n<p><strong>Important Note:</strong> Monitors customer tags and usage continuously to apply appropriate discount tiers.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "Automatic tiered promotion applying percentage-based discounts to specific product item charges based on price thresholds and customer tags.",
          "customType": "payment.pricing.promotions.pre_created.TieredRelativeProductItemAutomaticPromotion.in",
          "schema": [
            {
              "name": "id",
              "kind": "required",
              "type": "string",
              "description": "Unique identifier for the tiered relative product item automatic promotion configuration.",
              "example": ""
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "string",
              "description": "Fixed promotion type identifier for item-level tiered relative percentage automatic promotions.",
              "example": "",
              "default": "tiered_relative_product_item_automatic_promotion"
            },
            {
              "name": "promotionName",
              "kind": "required",
              "type": "string",
              "description": "Display name for the tiered relative product item promotion in billing interfaces.",
              "example": ""
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Optional detailed description explaining the tiered item percentage promotion's purpose and discount structure.",
              "example": ""
            },
            {
              "name": "lockingStatus",
              "kind": "optional",
              "type": "string",
              "description": "Administrative lock status controlling whether the tiered item promotion settings can be modified.",
              "modelRef": "#/components/schemas/common.LockingStatus.in",
              "customType": "common.LockingStatus.in",
              "schema": []
            },
            {
              "name": "dimensionConstraintMap",
              "kind": "optional",
              "type": "map",
              "description": "Optional dimension filters restricting when the tiered item promotion applies to specific usage characteristics.",
              "example": "",
              "customType": "map<string, string>",
              "schema": []
            },
            {
              "name": "customerTags",
              "kind": "optional",
              "type": "map",
              "description": "Required customer tag criteria that automatically trigger tiered item percentage discount promotion activation.",
              "example": "",
              "customType": "map<string, string>",
              "schema": []
            },
            {
              "name": "isHidden",
              "kind": "optional",
              "type": "boolean",
              "description": "Controls whether the tiered item promotion appears in customer-facing billing statements and interfaces.",
              "example": ""
            },
            {
              "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": "Optional maximum total discount amount across all billing cycles for cost control.",
              "example": ""
            },
            {
              "name": "cycleMaxDiscount",
              "kind": "optional",
              "type": "number",
              "description": "Optional maximum discount amount per billing cycle for consistent budget management.",
              "example": ""
            },
            {
              "name": "targetProductItemId",
              "kind": "optional",
              "type": "string",
              "description": "Specific product item identifier that this tiered percentage promotion targets for discount application.",
              "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.TieredRelativeProductItemAutomaticPromotion.in",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Automatic promotion created with tier thresholds and customer tag criteria",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Created tiered promotion applying percentage-based discounts to specific product item charges based on price thresholds and customer tags.",
            "customType": "payment.pricing.promotions.pre_created.TieredRelativeProductItemAutomaticPromotion.out",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier for the created tiered relative product item automatic promotion configuration.",
                "example": ""
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string",
                "description": "Fixed promotion type identifier confirming item-level tiered relative percentage automatic promotion.",
                "example": "",
                "default": "tiered_relative_product_item_automatic_promotion"
              },
              {
                "name": "promotionName",
                "kind": "required",
                "type": "string",
                "description": "Display name for the created tiered relative product item promotion in billing interfaces.",
                "example": ""
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Optional detailed description explaining the tiered item percentage promotion's purpose and discount structure.",
                "example": ""
              },
              {
                "name": "lockingStatus",
                "kind": "optional",
                "type": "string",
                "description": "Current administrative lock status controlling whether the 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 tiered item promotion was last modified.",
                "example": 0
              },
              {
                "name": "dimensionConstraintMap",
                "kind": "optional",
                "type": "map",
                "description": "Applied dimension filters restricting when the tiered item promotion applies to specific usage characteristics.",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "customerTags",
                "kind": "optional",
                "type": "map",
                "description": "Configured customer tag criteria that automatically trigger tiered item percentage discount promotion activation.",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "isHidden",
                "kind": "optional",
                "type": "boolean",
                "description": "Current visibility setting controlling whether tiered item promotion appears in customer billing statements.",
                "example": ""
              },
              {
                "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 all billing cycles for cost control.",
                "example": ""
              },
              {
                "name": "cycleMaxDiscount",
                "kind": "optional",
                "type": "number",
                "description": "Configured maximum discount amount per billing cycle for consistent budget management.",
                "example": ""
              },
              {
                "name": "targetProductItemId",
                "kind": "optional",
                "type": "string",
                "description": "Specific product item identifier that this tiered percentage promotion targets for discount application.",
                "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.TieredRelativeProductItemAutomaticPromotion.out",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid tier configuration or customer tag criteria 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 automatic promotion",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "kRxBDUPVfkmHzUXnSilvM",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/tiered_relative_product_item_automatic_promotion \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"id\": \"\",\n     \"type\": \"tiered_relative_product_item_automatic_promotion\",\n     \"promotionName\": \"\"\n     }'"
        },
        {
          "id": "IIXjryaWRb04LY17Rd05B",
          "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\": \"tiered_relative_product_item_automatic_promotion\",\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/tiered_relative_product_item_automatic_promotion\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "BhYUncqVOS7KU6PGrPmtz",
          "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/tiered_relative_product_item_automatic_promotion\")\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\": \"tiered_relative_product_item_automatic_promotion\",\n   \"promotionName\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "K2HtGj651YBWxiB7FhOKP",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/tiered_relative_product_item_automatic_promotion\"\n\npayload = json.dumps({\n   \"id\": \"\",\n   \"type\": \"tiered_relative_product_item_automatic_promotion\",\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": "kRxBDUPVfkmHzUXnSilvM"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Automatic promotion created with tier thresholds and customer tag criteria\n{\n  \"id\": \"\",\n  \"type\": \"\",\n  \"promotionName\": \"\",\n  \"description\": \"\",\n  \"lockingStatus\": \"\",\n  \"lastUpdateTimeInMillis\": \"\",\n  \"dimensionConstraintMap\": \"\",\n  \"customerTags\": \"\",\n  \"isHidden\": false,\n  \"priceToDiscountMap\": \"\",\n  \"discountCalculationStrategy\": \"\",\n  \"totalMaxDiscount\": 0,\n  \"cycleMaxDiscount\": 0,\n  \"targetProductItemId\": \"\",\n  \"isRegEx\": false\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid tier configuration or customer tag criteria 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 automatic promotion\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}