---
title: Create percentage discount for partner-referred customers
slug: reference/create-percentage-discount-for-partner-referred-customers
docTags: 
createdAt: 2025-03-18T18:28:02.919Z
---

{
  "id": "FrDQKcggLeBKekHmGNqfv",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/product_item_relative_partner_discount",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/product_item_relative_partner_discount"
      }
    ],
    "name": "Create percentage discount for partner-referred customers",
    "description": "<p>Creates a percentage discount for specific product items available to partner-referred customers.\nUse this to offer special pricing through channel partner programs and reseller networks.</p>\n<p>Use this endpoint to:</p>\n<ul>\n<li>Provide preferential pricing to partner-referred customers</li>\n<li>Configure channel partner incentive programs</li>\n<li>Set up reseller discount structures</li>\n</ul>\n<p><strong>Important Note:</strong> Applies only to customers with valid partner referral attribution.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "Automatic partner discount promotion providing percentage-based discounts to specific product items for customers sourced through channel partners.",
          "customType": "payment.pricing.promotions.pre_created.RelativeProductItemPartnerDiscount.in",
          "schema": [
            {
              "name": "id",
              "kind": "required",
              "type": "string",
              "description": "Unique identifier for the relative product item partner discount promotion configuration.",
              "example": ""
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "string",
              "description": "Fixed promotion type identifier for item-level percentage-based partner discount promotions.",
              "example": "",
              "default": "product_item_relative_partner_discount"
            },
            {
              "name": "promotionName",
              "kind": "required",
              "type": "string",
              "description": "Display name for the item-level partner discount promotion in billing interfaces.",
              "example": ""
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Optional explanation of the percentage partner discount promotion's purpose and business context.",
              "example": ""
            },
            {
              "name": "lockingStatus",
              "kind": "optional",
              "type": "string",
              "description": "Administrative lock state controlling whether the partner discount promotion 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 percentage item discount applies based on usage characteristics.",
              "example": "",
              "customType": "map<string, string>",
              "schema": []
            },
            {
              "name": "customerTags",
              "kind": "optional",
              "type": "map",
              "description": "Required key-value pairs identifying customers eligible for item-level partner discounts based on channel source.",
              "example": "",
              "customType": "map<string, string>",
              "schema": []
            },
            {
              "name": "isHidden",
              "kind": "optional",
              "type": "boolean",
              "description": "Controls whether the item partner discount promotion appears in customer-facing billing statements.",
              "example": ""
            },
            {
              "name": "discountRatio",
              "kind": "optional",
              "type": "number",
              "description": "Percentage discount ratio applied to product item charges, expressed as decimal between 0 and 1.",
              "example": ""
            },
            {
              "name": "totalMaxDiscount",
              "kind": "optional",
              "type": "number",
              "description": "Optional maximum cumulative discount amount across all billing cycles for this item and partner customer.",
              "example": ""
            },
            {
              "name": "cycleMaxDiscount",
              "kind": "optional",
              "type": "number",
              "description": "Optional maximum discount amount per billing cycle for this product item and partner customer.",
              "example": ""
            },
            {
              "name": "targetProductItemId",
              "kind": "optional",
              "type": "string",
              "description": "Specific product item identifier that this percentage-based partner discount promotion targets for billing.",
              "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.RelativeProductItemPartnerDiscount.in",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Partner discount created with percentage rates and eligibility criteria",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Created partner discount promotion providing percentage-based discounts to specific product items for customers sourced through channel partners.",
            "customType": "payment.pricing.promotions.pre_created.RelativeProductItemPartnerDiscount.out",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier for the created relative product item partner discount promotion configuration.",
                "example": ""
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string",
                "description": "Fixed promotion type identifier confirming item-level percentage-based partner discount promotion.",
                "example": "",
                "default": "product_item_relative_partner_discount"
              },
              {
                "name": "promotionName",
                "kind": "required",
                "type": "string",
                "description": "Display name for the created item-level partner discount promotion in billing interfaces.",
                "example": ""
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Optional explanation of the percentage partner discount promotion's purpose and business context.",
                "example": ""
              },
              {
                "name": "lockingStatus",
                "kind": "optional",
                "type": "string",
                "description": "Current administrative lock state controlling whether the partner discount promotion 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 partner discount promotion was last modified.",
                "example": 0
              },
              {
                "name": "dimensionConstraintMap",
                "kind": "optional",
                "type": "map",
                "description": "Applied dimension filters restricting when percentage item discount applies based on usage characteristics.",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "customerTags",
                "kind": "optional",
                "type": "map",
                "description": "Configured key-value pairs identifying customers eligible for item-level partner discounts based on channel source.",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "isHidden",
                "kind": "optional",
                "type": "boolean",
                "description": "Current visibility setting controlling whether item partner discount appears in customer billing statements.",
                "example": ""
              },
              {
                "name": "discountRatio",
                "kind": "optional",
                "type": "number",
                "description": "Applied percentage discount ratio for product item charges, expressed as decimal between 0 and 1.",
                "example": ""
              },
              {
                "name": "totalMaxDiscount",
                "kind": "optional",
                "type": "number",
                "description": "Configured maximum cumulative discount amount across all billing cycles for this item and partner customer.",
                "example": ""
              },
              {
                "name": "cycleMaxDiscount",
                "kind": "optional",
                "type": "number",
                "description": "Configured maximum discount amount per billing cycle for this product item and partner customer.",
                "example": ""
              },
              {
                "name": "targetProductItemId",
                "kind": "optional",
                "type": "string",
                "description": "Specific product item identifier that this percentage-based partner discount promotion targets for billing.",
                "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.RelativeProductItemPartnerDiscount.out",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid discount percentage or partner configuration 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 partner discount",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "QW40hC4tB85-xdc_vXlhr",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/product_item_relative_partner_discount \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"id\": \"\",\n     \"type\": \"product_item_relative_partner_discount\",\n     \"promotionName\": \"\"\n     }'"
        },
        {
          "id": "Y486LEhLSDeiuEyYTVAwC",
          "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\": \"product_item_relative_partner_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/product_item_relative_partner_discount\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "-YLowd7koSLPN3ExGP7uM",
          "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/product_item_relative_partner_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\": \"product_item_relative_partner_discount\",\n   \"promotionName\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "Nj7sk_JJOvqX_Ic-vwzzy",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/pricing/amberflo/account-pricing/promotions/product_item_relative_partner_discount\"\n\npayload = json.dumps({\n   \"id\": \"\",\n   \"type\": \"product_item_relative_partner_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": "QW40hC4tB85-xdc_vXlhr"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Partner discount created with percentage rates and eligibility criteria\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  \"targetProductItemId\": \"\",\n  \"isRegEx\": false\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid discount percentage or partner configuration 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 partner discount\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}