---
title: Delete customer pricing plan
slug: reference/delete-customer-pricing-plan
docTags: 
createdAt: 2025-03-18T18:28:02.918Z
---

{
  "id": "tW5-jOK75xtPjD6EbRNWT",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://app.amberflo.io/payments/pricing/amberflo/customer-pricing",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/pricing/amberflo/customer-pricing"
      }
    ],
    "name": "Delete customer pricing plan",
    "description": "<p>Deletes the most recent customer pricing plan assignment. This operation can only delete future plans\nthat have not yet taken effect - active plans cannot be deleted.</p>\n<p>Use this endpoint to:</p>\n<ul>\n<li>Cancel scheduled plan changes before they take effect</li>\n<li>Remove future plan assignments due to business changes</li>\n<li>Clean up incorrect plan assignments</li>\n<li>Revert customers to their previous pricing plan</li>\n</ul>\n<p><strong>Important</strong>: Only future plans (not yet active) can be deleted. Use the plan assignment endpoint to change active plans.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "CustomerId",
          "type": "string",
          "example": "customer_123",
          "description": "Unique identifier of the customer whose pricing plan should be deleted.\nRequired unless RelationId is provided.\n"
        },
        {
          "kind": "optional",
          "name": "RelationId",
          "type": "string",
          "example": "relation_456",
          "description": "<p>Serialized relationship identifier that contains customer and product plan information.\nIf provided, this parameter takes precedence over CustomerId, ProductId, and ProductPlanTimeInSeconds.</p>"
        },
        {
          "kind": "optional",
          "name": "ProductId",
          "type": "string",
          "example": "product_789",
          "description": "<p>Unique identifier for the specific product plan to delete.\nIf not provided, defaults to the account's default product ID.</p>"
        },
        {
          "kind": "optional",
          "name": "ProductPlanTimeInSeconds",
          "type": "integer<int64>",
          "example": 1703980800,
          "description": "<p>Unix timestamp (in seconds) specifying the exact plan assignment to delete.\nIf not provided, deletes the most recent future plan assignment.</p>"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successfully deleted the customer pricing plan and returns confirmation message",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "string",
            "description": "",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid customer ID, cannot delete active plan, or malformed request parameters",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "Authentication required or invalid API key provided",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Insufficient permissions to delete customer pricing plans",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Customer not found or no future plans available for deletion",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "Cannot delete active pricing plan - only future plans can be deleted",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Internal server error occurred while deleting customer pricing plan",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "InJ68E2t-h2GYa8gMM_O_",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url 'https://app.amberflo.io/payments/pricing/amberflo/customer-pricing?CustomerId=customer_123' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "jpSTTl1NmlV5tQUeJqpdk",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/payments/pricing/amberflo/customer-pricing?CustomerId=customer_123\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Hp15EZEGLB-ZCMSz6SHnI",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/payments/pricing/amberflo/customer-pricing?CustomerId=customer_123\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "C6mXpI1fd9ZWbDm8VVkIb",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/pricing/amberflo/customer-pricing?CustomerId=customer_123\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "InJ68E2t-h2GYa8gMM_O_"
    },
    "results": {
      "languages": [
        {
          "id": "UIWPmR4LYuPkXf-i8KZLq",
          "language": "200",
          "code": "// Successfully deleted the customer pricing plan and returns confirmation message\n\"\""
        },
        {
          "id": "TyXu-8aidDfvbbTvIocCD",
          "language": "400",
          "code": "// Invalid customer ID, cannot delete active plan, or malformed request parameters\n"
        },
        {
          "id": "huP1a6MZ_-PjkdUdhZZvs",
          "language": "401",
          "code": "// Authentication required or invalid API key provided\n"
        },
        {
          "id": "ttpGMgsGZ0p3johQWR1O0",
          "language": "403",
          "code": "// Insufficient permissions to delete customer pricing plans\n"
        },
        {
          "id": "QUdMSp8JLytharonI2NY4",
          "language": "404",
          "code": "// Customer not found or no future plans available for deletion\n"
        },
        {
          "id": "VdC_nLG9mwGSfouNrAUYr",
          "language": "409",
          "code": "// Cannot delete active pricing plan - only future plans can be deleted\n"
        },
        {
          "id": "nSBUkNi005nvaMJFH00Dl",
          "language": "500",
          "code": "// Internal server error occurred while deleting customer pricing plan\n"
        }
      ],
      "selectedLanguageId": "UIWPmR4LYuPkXf-i8KZLq"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}