---
title: Change the CustomerProductPlan
slug: amberflo-api/change-the-customerproductplan
docTags: 
createdAt: 2024-11-07T15:10:16.978Z
---

{
  "id": "Hu2A3hZx9WJ_mJSYK2QrU",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/payments/pricing/amberflo/customer-pricing/product-plan-cancellation",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/pricing/amberflo/customer-pricing/product-plan-cancellation"
      }
    ],
    "name": "Change the CustomerProductPlan",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "payment.pricing.ProductPlanCancellationRequest.in",
          "schema": [
            {
              "name": "customerId",
              "kind": "required",
              "type": "string",
              "description": "The unique ID for the customer.",
              "example": ""
            },
            {
              "name": "newProductPlanId",
              "kind": "required",
              "type": "string",
              "description": "The new product plan id",
              "example": ""
            },
            {
              "name": "startTimeInSeconds",
              "kind": "optional",
              "type": "integer<int64>",
              "description": "The start time for the new pricing plan.",
              "example": 0
            }
          ],
          "modelRef": "#/components/schemas/payment.pricing.ProductPlanCancellationRequest.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.customer.CustomerProductPlan.out",
            "schema": [
              {
                "name": "productId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "productPlanId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "customerId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "startTimeInSeconds",
                "kind": "optional",
                "type": "integer<int64>",
                "example": 0
              },
              {
                "name": "endTimeInSeconds",
                "kind": "optional",
                "type": "integer<int64>",
                "example": 0
              },
              {
                "name": "relationId",
                "kind": "optional",
                "type": "string",
                "example": ""
              },
              {
                "name": "createdTimeInSeconds",
                "kind": "optional",
                "type": "integer<int64>",
                "example": 0
              }
            ],
            "modelRef": "#/components/schemas/payment.pricing.customer.CustomerProductPlan.out",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "pWM3ieO1oZYxNKeBp0hJx",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/payments/pricing/amberflo/customer-pricing/product-plan-cancellation \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"customerId\": \"\",\n     \"newProductPlanId\": \"\"\n     }'"
        },
        {
          "id": "nDyuQOW7RdqWIqsD8VgjY",
          "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   \"customerId\": \"\",\n   \"newProductPlanId\": \"\"\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/customer-pricing/product-plan-cancellation\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "FQR5FL3gan5_IAL7y7JMi",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/payments/pricing/amberflo/customer-pricing/product-plan-cancellation\")\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   \"customerId\": \"\",\n   \"newProductPlanId\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "JAkXfJ9sK3H5FKPyv5wvG",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/pricing/amberflo/customer-pricing/product-plan-cancellation\"\n\npayload = json.dumps({\n   \"customerId\": \"\",\n   \"newProductPlanId\": \"\"\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": "pWM3ieO1oZYxNKeBp0hJx"
    },
    "results": {
      "languages": [
        {
          "id": "Xboyh2uUSLEZfNYWbcGd2",
          "language": "200",
          "code": "// Successful request\n{\n  \"productId\": \"\",\n  \"productPlanId\": \"\",\n  \"customerId\": \"\",\n  \"startTimeInSeconds\": \"\",\n  \"endTimeInSeconds\": \"\",\n  \"relationId\": \"\",\n  \"createdTimeInSeconds\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "Xboyh2uUSLEZfNYWbcGd2"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}