---
title: /payments/pricing/amberflo/account-pricing/product-item-rewards-rule
slug: amberflo-api/JfBB-paymentspricingamberfloaccount-pricingproduct-item-rewards-rule
docTags: 
createdAt: 2024-11-07T15:10:16.976Z
---

{
  "id": "tXDW4ttsYdKfjdo0TvD9x",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/product-item-rewards-rule",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/pricing/amberflo/account-pricing/product-item-rewards-rule"
      }
    ],
    "name": "",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "payment.pricing.rewards.ProductItemRewardsRule.in",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "string",
              "example": ""
            },
            {
              "name": "productItemId",
              "kind": "optional",
              "type": "string",
              "example": ""
            },
            {
              "name": "rewardRule",
              "kind": "optional",
              "type": "object",
              "description": "",
              "modelRef": "#/components/schemas/payment.pricing.rewards.RewardRule.in",
              "customType": "payment.pricing.rewards.RewardRule.in",
              "schema": [],
              "complexType": "oneOf",
              "complexItems": [
                {
                  "name": "payment.pricing.rewards.ConstantRatioRewardsRule.in",
                  "description": "",
                  "modelRef": "#/components/schemas/payment.pricing.rewards.ConstantRatioRewardsRule.in",
                  "schema": [
                    {
                      "name": "type",
                      "kind": "optional",
                      "type": "string",
                      "example": "",
                      "default": "ConstantRatio"
                    },
                    {
                      "name": "usagePerBatch",
                      "kind": "optional",
                      "type": "number",
                      "example": ""
                    },
                    {
                      "name": "rewardsBatchSize",
                      "kind": "optional",
                      "type": "number",
                      "example": ""
                    },
                    {
                      "name": "rewardsLimit",
                      "kind": "optional",
                      "type": "object",
                      "description": "",
                      "modelRef": "#/components/schemas/payment.pricing.rewards.RewardsLimit.in",
                      "customType": "payment.pricing.rewards.RewardsLimit.in",
                      "schema": [],
                      "complexType": "oneOf",
                      "complexItems": [
                        {
                          "name": "payment.pricing.rewards.RewardsLimitSequence.in",
                          "description": "",
                          "modelRef": "#/components/schemas/payment.pricing.rewards.RewardsLimitSequence.in",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string",
                              "example": "",
                              "default": "RewardsLimitSequence"
                            },
                            {
                              "name": "rules",
                              "kind": "optional",
                              "type": "array",
                              "description": "",
                              "modelRef": "#/components/schemas/payment.pricing.rewards.SimpleRewardsLimit.in",
                              "customType": "payment.pricing.rewards.SimpleRewardsLimit.in[]",
                              "schema": [
                                {
                                  "name": "type",
                                  "kind": "optional",
                                  "type": "string",
                                  "example": "",
                                  "default": "SimpleRewardsLimit"
                                },
                                {
                                  "name": "maxRewards",
                                  "kind": "optional",
                                  "type": "number",
                                  "example": ""
                                },
                                {
                                  "name": "rewardsPeriod",
                                  "kind": "optional",
                                  "type": "string",
                                  "description": "",
                                  "modelRef": "#/components/schemas/payment.pricing.rewards.RewardsPeriod.in",
                                  "customType": "payment.pricing.rewards.RewardsPeriod.in",
                                  "schema": [
                                    {
                                      "name": "",
                                      "description": "",
                                      "customType": "Max depth limit reached"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name": "payment.pricing.rewards.SimpleRewardsLimit.in",
                          "description": "",
                          "modelRef": "#/components/schemas/payment.pricing.rewards.SimpleRewardsLimit.in",
                          "schema": [
                            {
                              "name": "type",
                              "kind": "optional",
                              "type": "string",
                              "example": "",
                              "default": "SimpleRewardsLimit"
                            },
                            {
                              "name": "maxRewards",
                              "kind": "optional",
                              "type": "number",
                              "example": ""
                            },
                            {
                              "name": "rewardsPeriod",
                              "kind": "optional",
                              "type": "string",
                              "description": "",
                              "modelRef": "#/components/schemas/payment.pricing.rewards.RewardsPeriod.in",
                              "customType": "payment.pricing.rewards.RewardsPeriod.in",
                              "schema": [
                                {
                                  "name": "",
                                  "description": "",
                                  "customType": "Max depth limit reached"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name": "expiredAfter",
              "kind": "optional",
              "type": "object",
              "description": "",
              "modelRef": "#/components/schemas/payment.pricing.BillingPeriod.in",
              "customType": "payment.pricing.BillingPeriod.in",
              "schema": [
                {
                  "name": "interval",
                  "kind": "optional",
                  "type": "string",
                  "description": "",
                  "modelRef": "#/components/schemas/payment.pricing.BillingPeriodInterval.in",
                  "customType": "payment.pricing.BillingPeriodInterval.in",
                  "schema": []
                },
                {
                  "name": "intervalsCount",
                  "kind": "optional",
                  "type": "integer<int32>",
                  "example": 0
                }
              ]
            },
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "example": ""
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "example": ""
            },
            {
              "name": "isDefault",
              "kind": "optional",
              "type": "boolean",
              "example": ""
            },
            {
              "name": "lockingStatus",
              "kind": "optional",
              "type": "string",
              "description": "",
              "modelRef": "#/components/schemas/com.amberflo.service.common.LockingStatus.in",
              "customType": "com.amberflo.service.common.LockingStatus.in",
              "schema": []
            },
            {
              "name": "lastUpdateTimeInMillis",
              "kind": "optional",
              "type": "integer<int64>",
              "example": 0
            }
          ],
          "modelRef": "#/components/schemas/payment.pricing.rewards.ProductItemRewardsRule.in",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "payment.pricing.rewards.ProductItemRewardsRule.out",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "productItemId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "rewardRule",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/payment.pricing.rewards.RewardRule.out",
                "customType": "payment.pricing.rewards.RewardRule.out",
                "schema": [],
                "complexType": "oneOf",
                "complexItems": [
                  {
                    "name": "payment.pricing.rewards.ConstantRatioRewardsRule.out",
                    "description": "",
                    "modelRef": "#/components/schemas/payment.pricing.rewards.ConstantRatioRewardsRule.out",
                    "schema": [
                      {
                        "name": "type",
                        "kind": "optional",
                        "type": "string",
                        "example": "",
                        "default": "ConstantRatio"
                      },
                      {
                        "name": "usagePerBatch",
                        "kind": "optional",
                        "type": "number",
                        "example": ""
                      },
                      {
                        "name": "rewardsBatchSize",
                        "kind": "optional",
                        "type": "number",
                        "example": ""
                      },
                      {
                        "name": "rewardsLimit",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "modelRef": "#/components/schemas/payment.pricing.rewards.RewardsLimit.out",
                        "customType": "payment.pricing.rewards.RewardsLimit.out",
                        "schema": [],
                        "complexType": "oneOf",
                        "complexItems": [
                          {
                            "name": "payment.pricing.rewards.RewardsLimitSequence.out",
                            "description": "",
                            "modelRef": "#/components/schemas/payment.pricing.rewards.RewardsLimitSequence.out",
                            "schema": [
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string",
                                "example": "",
                                "default": "RewardsLimitSequence"
                              },
                              {
                                "name": "rules",
                                "kind": "optional",
                                "type": "array",
                                "description": "",
                                "modelRef": "#/components/schemas/payment.pricing.rewards.SimpleRewardsLimit.out",
                                "customType": "payment.pricing.rewards.SimpleRewardsLimit.out[]",
                                "schema": [
                                  {
                                    "name": "type",
                                    "kind": "optional",
                                    "type": "string",
                                    "example": "",
                                    "default": "SimpleRewardsLimit"
                                  },
                                  {
                                    "name": "maxRewards",
                                    "kind": "optional",
                                    "type": "number",
                                    "example": ""
                                  },
                                  {
                                    "name": "rewardsPeriod",
                                    "kind": "optional",
                                    "type": "string",
                                    "description": "",
                                    "modelRef": "#/components/schemas/payment.pricing.rewards.RewardsPeriod.out",
                                    "customType": "payment.pricing.rewards.RewardsPeriod.out",
                                    "schema": [
                                      {
                                        "name": "",
                                        "description": "",
                                        "customType": "Max depth limit reached"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "payment.pricing.rewards.SimpleRewardsLimit.out",
                            "description": "",
                            "modelRef": "#/components/schemas/payment.pricing.rewards.SimpleRewardsLimit.out",
                            "schema": [
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string",
                                "example": "",
                                "default": "SimpleRewardsLimit"
                              },
                              {
                                "name": "maxRewards",
                                "kind": "optional",
                                "type": "number",
                                "example": ""
                              },
                              {
                                "name": "rewardsPeriod",
                                "kind": "optional",
                                "type": "string",
                                "description": "",
                                "modelRef": "#/components/schemas/payment.pricing.rewards.RewardsPeriod.out",
                                "customType": "payment.pricing.rewards.RewardsPeriod.out",
                                "schema": [
                                  {
                                    "name": "",
                                    "description": "",
                                    "customType": "Max depth limit reached"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                "name": "expiredAfter",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/payment.pricing.BillingPeriod.out",
                "customType": "payment.pricing.BillingPeriod.out",
                "schema": [
                  {
                    "name": "interval",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "modelRef": "#/components/schemas/payment.pricing.BillingPeriodInterval.out",
                    "customType": "payment.pricing.BillingPeriodInterval.out",
                    "schema": []
                  },
                  {
                    "name": "intervalsCount",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "example": 0
                  }
                ]
              },
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "isDefault",
                "kind": "optional",
                "type": "boolean",
                "example": ""
              },
              {
                "name": "lockingStatus",
                "kind": "optional",
                "type": "string",
                "description": "",
                "modelRef": "#/components/schemas/com.amberflo.service.common.LockingStatus.out",
                "customType": "com.amberflo.service.common.LockingStatus.out",
                "schema": []
              },
              {
                "name": "lastUpdateTimeInMillis",
                "kind": "optional",
                "type": "integer<int64>",
                "example": 0
              }
            ],
            "modelRef": "#/components/schemas/payment.pricing.rewards.ProductItemRewardsRule.out",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "aNdHOhh3TnzALqIM7Ht4c",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/payments/pricing/amberflo/account-pricing/product-item-rewards-rule \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"rewardRule\": {\n     \"type\": \"ConstantRatio\",\n     \"rewardsLimit\": {\n     \"type\": \"RewardsLimitSequence\",\n     \"rules\": [\n     {\n     \"type\": \"SimpleRewardsLimit\"\n     }\n     ]\n     }\n     }\n     }'"
        },
        {
          "id": "ub1kdqq_dl-LS0c8zcPqC",
          "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   \"rewardRule\": {\n      \"type\": \"ConstantRatio\",\n      \"rewardsLimit\": {\n         \"type\": \"RewardsLimitSequence\",\n         \"rules\": [\n            {\n               \"type\": \"SimpleRewardsLimit\"\n            }\n         ]\n      }\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/product-item-rewards-rule\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "662r-v2-6Wk2EDFYUecG3",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/payments/pricing/amberflo/account-pricing/product-item-rewards-rule\")\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   \"rewardRule\": {\n      \"type\": \"ConstantRatio\",\n      \"rewardsLimit\": {\n         \"type\": \"RewardsLimitSequence\",\n         \"rules\": [\n            {\n               \"type\": \"SimpleRewardsLimit\"\n            }\n         ]\n      }\n   }\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "W-nfQKQUEMRHGs9YEJtku",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/pricing/amberflo/account-pricing/product-item-rewards-rule\"\n\npayload = json.dumps({\n   \"rewardRule\": {\n      \"type\": \"ConstantRatio\",\n      \"rewardsLimit\": {\n         \"type\": \"RewardsLimitSequence\",\n         \"rules\": [\n            {\n               \"type\": \"SimpleRewardsLimit\"\n            }\n         ]\n      }\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": "aNdHOhh3TnzALqIM7Ht4c"
    },
    "results": {
      "languages": [
        {
          "id": "7LZTXfBnrugVt-H3sqFBV",
          "language": "200",
          "code": "// Successful request\n{\n  \"id\": \"\",\n  \"productItemId\": \"\",\n  \"rewardRule\": {},\n  \"expiredAfter\": {\n    \"interval\": \"\",\n    \"intervalsCount\": \"\"\n  },\n  \"name\": \"\",\n  \"description\": \"\",\n  \"isDefault\": false,\n  \"lockingStatus\": \"\",\n  \"lastUpdateTimeInMillis\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "7LZTXfBnrugVt-H3sqFBV"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}