---
title: Calculate End Date
slug: calculate-end-date
createdAt: 2026-08-25T19:28:59.170Z
---

{
  "id": "olp2EHiBANn2qCdWFaSYD",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.nue.io/pricing/terms/calculateEndDate",
    "servers": [
      {
        "url": "https://api.nue.io/pricing/terms/calculateEndDate",
        "description": "**Production Environment** - Live production server for all customer-facing operations. Use this for production integrations with real customer data and transactions."
      },
      {
        "url": "https://api.sandbox.nue.io/pricing/terms/calculateEndDate",
        "description": "**Sandbox Environment** - Safe testing environment with sample data for development and integration testing. No rate limits apply. Data is reset weekly. Perfect for prototyping and QA testing."
      }
    ],
    "name": "Calculate End Date",
    "description": "<p>Given a subscription start date and a term length, calculates the end date. This is the inverse of <code>Calculate Term</code> and mirrors how the order engine derives <code>subscriptionEndDate</code> from start + term during order creation.</p>\n<p>Use it to preview the end date a customer's order will land on before you submit it, or to display an end date in a UI where the user enters a term.</p>\n<p>The endpoint is <strong>batch</strong>: send one or more calculations in the <code>requests</code> array and receive a <code>results</code> array in the same order.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "requests",
              "kind": "required",
              "type": "array",
              "description": "<p>One or more end-date calculations to perform. Must be non-empty.</p>",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "startDate",
                  "kind": "required",
                  "type": "string<date>",
                  "description": "<p>Subscription start date (ISO 8601, e.g. '2026-01-01').</p>",
                  "format": "date"
                },
                {
                  "name": "term",
                  "kind": "required",
                  "type": "number",
                  "description": "<p>Term length, expressed in 'termType' units (e.g. 12 with termType 'month' = one year).</p>"
                },
                {
                  "name": "termType",
                  "kind": "optional",
                  "type": "string<year | month | quarter | semi-annual | week>",
                  "description": "<p>Optional. Dimension the term is expressed in. Case-insensitive (one of: year, month, quarter, semi-annual, week). Defaults to 'month' when omitted.</p>",
                  "enum": [
                    "year",
                    "month",
                    "quarter",
                    "semi-annual",
                    "week"
                  ]
                },
                {
                  "name": "termBasis",
                  "kind": "optional",
                  "type": "string<30/360 | eu30/360 | actual/actual | actual/360 | actual/365>",
                  "description": "<p>Optional. Day-count convention used to measure the period. Case-insensitive. Defaults to 'eu30/360' when omitted. Most subscription products use '30/360', so pass it explicitly unless you specifically want EU 30/360.</p>",
                  "enum": [
                    "30/360",
                    "eu30/360",
                    "actual/actual",
                    "actual/360",
                    "actual/365"
                  ]
                }
              ]
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>End date(s) calculated successfully.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// End date(s) calculated successfully.\n{\n  \"results\": [\n    {\n      \"endDate\": \"\",\n      \"termType\": \"\",\n      \"termBasis\": \"\"\n    }\n  ]\n}"
          },
          {
            "label": "twelveMonths",
            "code": "// End of the year\n{\n  \"results\": [\n    {\n      \"endDate\": \"2026-12-31\",\n      \"termType\": \"Month\",\n      \"termBasis\": \"30/360\"\n    }\n  ]\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "results",
                "kind": "optional",
                "type": "array",
                "description": "<p>Calculated end dates, in the same order as the requests.</p>",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "endDate",
                    "kind": "optional",
                    "type": "string<date>",
                    "description": "<p>Calculated subscription end date (ISO 8601).</p>",
                    "format": "date"
                  },
                  {
                    "name": "termType",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>Dimension the term was expressed in (e.g. 'Month').</p>"
                  },
                  {
                    "name": "termBasis",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>Day-count convention applied.</p>"
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Validation error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ValidationError",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "string<FAILURE>",
                "description": "",
                "enum": [
                  "FAILURE"
                ]
              },
              {
                "name": "errorCode",
                "kind": "optional",
                "type": "string",
                "description": "Specific validation error code"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "Detailed validation error message"
              }
            ],
            "modelRef": "#/components/schemas/ValidationError",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "y71nZMw2kezq-LWMsROCq",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.nue.io/pricing/terms/calculateEndDate \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"requests\": [\n     {\n     \"startDate\": \"\",\n     \"term\": \"\"\n     }\n     ]\n     }'"
        },
        {
          "id": "2DQM6Ra_s5Idw0e5NoC9X",
          "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   \"requests\": [\n      {\n         \"startDate\": \"\",\n         \"term\": \"\"\n      }\n   ]\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.nue.io/pricing/terms/calculateEndDate\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "QhLsYS3LFmZcq2SWMA8ga",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/pricing/terms/calculateEndDate\")\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   \"requests\": [\n      {\n         \"startDate\": \"\",\n         \"term\": \"\"\n      }\n   ]\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "f2OzEJNbLhEKNxTWpyclS",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/pricing/terms/calculateEndDate\"\n\npayload = json.dumps({\n   \"requests\": [\n      {\n         \"startDate\": \"\",\n         \"term\": \"\"\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": "y71nZMw2kezq-LWMsROCq"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// End date(s) calculated successfully.\n{\n  \"results\": [\n    {\n      \"endDate\": \"\",\n      \"termType\": \"\",\n      \"termBasis\": \"\"\n    }\n  ]\n}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// End date(s) calculated successfully.\n{\n  \"results\": [\n    {\n      \"endDate\": \"\",\n      \"termType\": \"\",\n      \"termBasis\": \"\"\n    }\n  ]\n}"
            },
            {
              "label": "twelveMonths",
              "code": "// End of the year\n{\n  \"results\": [\n    {\n      \"endDate\": \"2026-12-31\",\n      \"termType\": \"Month\",\n      \"termBasis\": \"30/360\"\n    }\n  ]\n}"
            }
          ]
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Validation error\n{\n  \"status\": \"\",\n  \"errorCode\": \"\",\n  \"message\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}