---
title: Create relative product partner automatic promotion
slug: reference/create-relative-product-partner-automatic-promotion
docTags: 
createdAt: 2025-03-18T18:28:02.919Z
---

{
  "id": "qjOjCZcroxXiVMtefXIUo",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/relative_product_partner_automatic_promotion",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/relative_product_partner_automatic_promotion"
      }
    ],
    "name": "Create relative product partner automatic promotion",
    "description": "<p>Creates a percentage-based discount promotion for partner channel customers that automatically applies based on partner tags.</p>\n<p>This provides scalable partner program discounts where benefits increase with customer usage. Partners receive\npercentage discounts on their customers' product billing, and higher usage results in greater absolute savings.</p>\n<p>Use this for partner channel programs, reseller discounts, or strategic alliance programs where you want\npartner benefits to scale automatically with customer success and usage growth.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Partner promotion configuration with percentage discount rates and partner qualification criteria",
          "customType": "payment.pricing.promotions.pre_created.ProductRelativePartnerDiscount.in",
          "schema": [
            {
              "name": "id",
              "kind": "required",
              "type": "string",
              "description": "Unique identifier for the partner discount within the account scope.",
              "example": ""
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "string",
              "description": "Fixed promotion type identifier for product-level relative partner discounts.",
              "example": "",
              "default": "relative_product_partner_automatic_promotion"
            },
            {
              "name": "promotionName",
              "kind": "required",
              "type": "string",
              "description": "Human-readable name for partner discount display and management purposes.",
              "example": ""
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Optional detailed description explaining partner discount purpose and terms.",
              "example": ""
            },
            {
              "name": "lockingStatus",
              "kind": "optional",
              "type": "string",
              "description": "Modification permissions controlling partner discount lifecycle and editing capabilities.",
              "modelRef": "#/components/schemas/common.LockingStatus.in",
              "customType": "common.LockingStatus.in",
              "schema": []
            },
            {
              "name": "dimensionConstraintMap",
              "kind": "optional",
              "type": "map",
              "description": "Optional dimension filters restricting discount to specific usage characteristics.",
              "example": "",
              "customType": "map<string, string>",
              "schema": []
            },
            {
              "name": "customerTags",
              "kind": "optional",
              "type": "map",
              "description": "Required customer tag criteria identifying customers eligible for partner discounts.",
              "example": "",
              "customType": "map<string, string>",
              "schema": []
            },
            {
              "name": "isHidden",
              "kind": "optional",
              "type": "boolean",
              "description": "Controls partner discount visibility in customer interfaces and billing communications.",
              "example": ""
            },
            {
              "name": "discountRatio",
              "kind": "optional",
              "type": "number",
              "description": "Percentage discount ratio applied to product charges expressed as decimal between 0 and 1.",
              "example": ""
            },
            {
              "name": "totalMaxDiscount",
              "kind": "optional",
              "type": "number",
              "description": "Optional maximum total discount amount across all billing periods.",
              "example": ""
            },
            {
              "name": "cycleMaxDiscount",
              "kind": "optional",
              "type": "number",
              "description": "Optional maximum discount amount per billing cycle for cost control.",
              "example": ""
            },
            {
              "name": "targetProductId",
              "kind": "optional",
              "type": "string",
              "description": "Identifier of the specific product receiving partner discount benefits.",
              "example": ""
            }
          ],
          "modelRef": "#/components/schemas/payment.pricing.promotions.pre_created.ProductRelativePartnerDiscount.in",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Partner promotion successfully created",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Response format for successfully created or updated product-level percentage-based partner discount promotions. Returns complete promotion configuration enabling scalable partner incentives that adjust proportionally to product usage volumes, supporting sophisticated tiered partner programs and volume-based commission structures across entire product lines.",
            "customType": "payment.pricing.promotions.pre_created.ProductRelativePartnerDiscount.out",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier for the relative product partner discount promotion instance within your account pricing configuration.",
                "example": ""
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string",
                "description": "Fixed promotion type identifier confirming this is a product-level percentage-based partner discount promotion targeting entire products.",
                "example": "",
                "default": "relative_product_partner_automatic_promotion"
              },
              {
                "name": "promotionName",
                "kind": "required",
                "type": "string",
                "description": "Human-readable display name for the percentage-based product partner discount promotion shown in billing interfaces and reports.",
                "example": ""
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Optional detailed explanation of the percentage partner discount promotion's purpose and product-level business context for internal reference.",
                "example": ""
              },
              {
                "name": "lockingStatus",
                "kind": "optional",
                "type": "string",
                "description": "Current administrative lock state indicating whether the percentage-based product partner discount promotion can be modified or deleted.",
                "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 percentage-based product partner discount promotion was last modified or created.",
                "example": 0
              },
              {
                "name": "dimensionConstraintMap",
                "kind": "optional",
                "type": "map",
                "description": "Active dimension filters restricting when the percentage product discount applies based on usage characteristics, geographic regions, or metadata attributes.",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "customerTags",
                "kind": "optional",
                "type": "map",
                "description": "Key-value pairs identifying customers eligible for percentage-based product partner discounts based on channel source or partner relationship status.",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "isHidden",
                "kind": "optional",
                "type": "boolean",
                "description": "Visibility setting controlling whether the percentage-based product partner discount promotion appears in customer-facing billing statements and invoices.",
                "example": ""
              },
              {
                "name": "discountRatio",
                "kind": "optional",
                "type": "number",
                "description": "Percentage discount ratio that will be applied to product billing totals, expressed as decimal value between 0 and 1.",
                "example": ""
              },
              {
                "name": "totalMaxDiscount",
                "kind": "optional",
                "type": "number",
                "description": "Maximum cumulative discount amount applicable across all billing cycles for this specific product and partner customer relationship.",
                "example": ""
              },
              {
                "name": "cycleMaxDiscount",
                "kind": "optional",
                "type": "number",
                "description": "Maximum discount amount that can be applied within a single billing cycle for this product and partner customer combination.",
                "example": ""
              },
              {
                "name": "targetProductId",
                "kind": "optional",
                "type": "string",
                "description": "Specific product identifier that this percentage-based partner discount promotion applies to within your account's pricing structure.",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/payment.pricing.promotions.pre_created.ProductRelativePartnerDiscount.out",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad request - invalid promotion configuration",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Forbidden - insufficient permissions",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "Conflict with existing partner promotion",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "v3kKwUAMzuo1FxDK26kZu",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/relative_product_partner_automatic_promotion \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"id\": \"\",\n     \"type\": \"relative_product_partner_automatic_promotion\",\n     \"promotionName\": \"\"\n     }'"
        },
        {
          "id": "QN9j8AWw2PKG2ySXfCbbG",
          "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\": \"relative_product_partner_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/relative_product_partner_automatic_promotion\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "AfxP78CkY_bd3QNnuDE1R",
          "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/relative_product_partner_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\": \"relative_product_partner_automatic_promotion\",\n   \"promotionName\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "2-NEPx7m2QZ13DyQ5y8o8",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/relative_product_partner_automatic_promotion\"\n\npayload = json.dumps({\n   \"id\": \"\",\n   \"type\": \"relative_product_partner_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": "v3kKwUAMzuo1FxDK26kZu"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Partner promotion successfully created\n{\n  \"id\": \"\",\n  \"type\": \"\",\n  \"promotionName\": \"\",\n  \"description\": \"\",\n  \"lockingStatus\": \"\",\n  \"lastUpdateTimeInMillis\": \"\",\n  \"dimensionConstraintMap\": \"\",\n  \"customerTags\": \"\",\n  \"isHidden\": false,\n  \"discountRatio\": 0,\n  \"totalMaxDiscount\": 0,\n  \"cycleMaxDiscount\": 0,\n  \"targetProductId\": \"\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad request - invalid promotion configuration\n"
        },
        {
          "id": "response-2-403",
          "language": "403",
          "code": "// Forbidden - insufficient permissions\n"
        },
        {
          "id": "response-3-409",
          "language": "409",
          "code": "// Conflict with existing partner promotion\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}