{
  "openapi": "3.1.0",
  "info": {
    "title": "curatedapi",
    "version": "0.4.2",
    "description": "Exact calculator APIs. Every result is computed with exact or certified arithmetic, rounded once as you choose, and says which calculator version produced it, the formula and its published references.\n\nE-invoice validators under `/v1/validate/einvoice/` run each standard's official rules and list every rule an invoice breaks; each check counts as 5 units.\n\n**Authentication.** Send your key as `Authorization: Bearer <key>` (or `X-API-Key`). Live keys are billed, test keys are free and use a separate monthly allowance, and public keys work only from the websites registered for them.\n\n**Billing.** Only successful (2xx) calls with live or public keys are billable. Every response carries `X-Request-Id`, `X-Billable` and the period's `X-Usage-Count` and `X-Usage-Limit`; `GET /v1/account/usage/events.csv` lists every recorded request.\n\n**Spend cap.** `PUT /v1/account/spend-cap` sets the most a month may cost; requests that would go past it are refused with `429 SPEND_CAP_REACHED` and never billed.\n\n**Retries.** Send an `Idempotency-Key` header; repeating a request with the same key and body within 24 hours returns the same result and is not billed again.\n\n**Versions.** `POST /v1/calc/finance/loan/emi` runs the latest version; `.../emi@1` pins version 1. A change in behaviour always gets a new version.\n\n**Batches.** `POST /v1/batch` runs up to 25 calls in one request. Each item is metered and billed exactly like the same call on its own; send an `Idempotency-Key` so a batch repeated after a lost connection is not billed twice.\n\n**Signed receipts.** Add `?receipt=true` to a call (or a batch) and the answer includes `receipt`: a JSON Web Token signed with Ed25519 that holds the whole response, the request id, the endpoint version and the time. Anyone can check it offline with the keys at `/.well-known/jwks.json`, or with `POST /v1/receipts/verify`. Receipts cost nothing extra.\n",
    "contact": {
      "url": "https://curatedapi.com"
    }
  },
  "servers": [
    {
      "url": "https://api.curatedapi.com"
    }
  ],
  "security": [
    {
      "bearer": []
    },
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Discovery"
    },
    {
      "name": "Account"
    },
    {
      "name": "Receipts"
    },
    {
      "name": "Accounting"
    },
    {
      "name": "Billing"
    },
    {
      "name": "Check"
    },
    {
      "name": "Date"
    },
    {
      "name": "Einvoice"
    },
    {
      "name": "Everyday"
    },
    {
      "name": "Excel"
    },
    {
      "name": "Finance"
    },
    {
      "name": "Health"
    },
    {
      "name": "Math"
    },
    {
      "name": "Money"
    },
    {
      "name": "Payments"
    },
    {
      "name": "Tax"
    },
    {
      "name": "Units"
    }
  ],
  "paths": {
    "/v1/calc/calculators": {
      "get": {
        "operationId": "calc_list",
        "summary": "List the calculators",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Every endpoint with its schemas.",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/v1/validate/validators": {
      "get": {
        "operationId": "validate_list",
        "summary": "List the validators",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Every endpoint with its schemas.",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/v1/calc/accounting/depreciation/india-companies-act": {
      "post": {
        "operationId": "calc_accounting_depreciation_india_companies_act",
        "summary": "Schedule II depreciation (India)",
        "description": "Book depreciation for Indian companies over the Schedule II useful life, straight line (SLM) or written down value (WDV), pro rata by days.\n\nThe depreciable amount (cost less residual value, 5% of cost unless you choose otherwise) is spread over the useful life. SLM charges the same amount each year; WDV uses the rate 1 − (residual / cost)^(1 / life), which brings the carrying amount to the residual value at the end of the life. The first year is charged pro rata from the date put to use to 31 March, and the last year ends when the useful life does, at exactly the residual value.",
        "tags": [
          "Accounting"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cost": {
                    "description": "Cost of the asset. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "100000"
                    ]
                  },
                  "useful_life_years": {
                    "description": "Useful life in years (Schedule II Part C, or your own estimate). Allowed: >= 1 and <= 100.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "examples": [
                      5
                    ]
                  },
                  "method": {
                    "description": "Depreciation method. Options: slm: straight line; wdv: written down value",
                    "type": "string",
                    "enum": [
                      "slm",
                      "wdv"
                    ],
                    "examples": [
                      "wdv"
                    ]
                  },
                  "date_put_to_use": {
                    "description": "The day the asset was available for use.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-04-01"
                    ]
                  },
                  "residual_percent": {
                    "description": "Residual value as a percentage of cost. Allowed: >= 0 and < 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "5"
                  },
                  "wdv_rate_percent": {
                    "description": "WDV only: use this rate instead of the exact one, e.g. a rate rounded to 2 decimals. The last year still brings the carrying amount to the residual value. Allowed: > 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "cost",
                  "useful_life_years",
                  "method",
                  "date_put_to_use"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "₹1,00,000, 5 years, WDV: rate 45.07%",
                  "value": {
                    "cost": "100000",
                    "useful_life_years": 5,
                    "method": "wdv",
                    "date_put_to_use": "2026-04-01"
                  }
                },
                "example2": {
                  "summary": "₹1,00,000, 10 years, SLM: ₹9,500 a year",
                  "value": {
                    "cost": "100000",
                    "useful_life_years": 10,
                    "method": "slm",
                    "date_put_to_use": "2026-04-01"
                  }
                },
                "example3": {
                  "summary": "₹5,00,000, 8 years, SLM, put to use on 1 October: 182 days in the first year",
                  "value": {
                    "cost": "500000",
                    "useful_life_years": 8,
                    "method": "slm",
                    "date_put_to_use": "2026-10-01"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "accounting/depreciation/india-companies-act@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "rate_percent": {
                          "description": "Annual rate, in percent (4 decimals).",
                          "type": "string"
                        },
                        "residual_value": {
                          "description": "Residual value. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "depreciable_amount": {
                          "description": "Cost less residual value. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "schedule": {
                          "description": "Depreciation by financial year (April to March).",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "year": {
                                "description": "Financial year number, from 1.",
                                "type": "integer"
                              },
                              "start": {
                                "description": "First day depreciated in the year.",
                                "type": "string",
                                "format": "date"
                              },
                              "end": {
                                "description": "Last day depreciated in the year.",
                                "type": "string",
                                "format": "date"
                              },
                              "days": {
                                "description": "Days depreciated in the year.",
                                "type": "integer"
                              },
                              "depreciation": {
                                "description": "Depreciation for the year. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "accumulated": {
                                "description": "Accumulated depreciation. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "closing_value": {
                                "description": "Carrying amount at the end of the year. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "year",
                              "start",
                              "end",
                              "days",
                              "depreciation",
                              "accumulated",
                              "closing_value"
                            ]
                          }
                        }
                      },
                      "required": [
                        "rate_percent",
                        "residual_value",
                        "depreciable_amount",
                        "schedule"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "₹1,00,000, 5 years, WDV: rate 45.07%",
                    "value": {
                      "calculator": "accounting/depreciation/india-companies-act@1",
                      "result": {
                        "rate_percent": "45.0720",
                        "residual_value": "5000.00",
                        "depreciable_amount": "95000.00",
                        "schedule": [
                          {
                            "year": 1,
                            "start": "2026-04-01",
                            "end": "2027-03-31",
                            "days": 365,
                            "depreciation": "45071.97",
                            "accumulated": "45071.97",
                            "closing_value": "54928.03"
                          },
                          {
                            "year": 2,
                            "start": "2027-04-01",
                            "end": "2028-03-31",
                            "days": 366,
                            "depreciation": "24757.15",
                            "accumulated": "69829.12",
                            "closing_value": "30170.88"
                          },
                          {
                            "year": 3,
                            "start": "2028-04-01",
                            "end": "2029-03-31",
                            "days": 365,
                            "depreciation": "13598.61",
                            "accumulated": "83427.73",
                            "closing_value": "16572.27"
                          },
                          {
                            "year": 4,
                            "start": "2029-04-01",
                            "end": "2030-03-31",
                            "days": 365,
                            "depreciation": "7469.45",
                            "accumulated": "90897.18",
                            "closing_value": "9102.82"
                          },
                          {
                            "year": 5,
                            "start": "2030-04-01",
                            "end": "2031-03-31",
                            "days": 365,
                            "depreciation": "4102.82",
                            "accumulated": "95000.00",
                            "closing_value": "5000.00"
                          }
                        ]
                      },
                      "exactness": {
                        "residual_value": "exact",
                        "depreciable_amount": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "100000",
                        "useful_life_years": 5,
                        "method": "wdv",
                        "date_put_to_use": "2026-04-01",
                        "residual_percent": "5"
                      },
                      "formula": "SLM: (cost − residual) / life a year. WDV rate: 1 − (residual / cost)^(1 / life)",
                      "references": [
                        {
                          "title": "Companies Act 2013, Schedule II (useful lives to compute depreciation)",
                          "url": "https://www.mca.gov.in/Ministry/pdf/CompaniesAct2013.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "₹1,00,000, 10 years, SLM: ₹9,500 a year",
                    "value": {
                      "calculator": "accounting/depreciation/india-companies-act@1",
                      "result": {
                        "rate_percent": "10.0000",
                        "residual_value": "5000.00",
                        "depreciable_amount": "95000.00",
                        "schedule": [
                          {
                            "year": 1,
                            "start": "2026-04-01",
                            "end": "2027-03-31",
                            "days": 365,
                            "depreciation": "9500.00",
                            "accumulated": "9500.00",
                            "closing_value": "90500.00"
                          },
                          {
                            "year": 2,
                            "start": "2027-04-01",
                            "end": "2028-03-31",
                            "days": 366,
                            "depreciation": "9500.00",
                            "accumulated": "19000.00",
                            "closing_value": "81000.00"
                          },
                          {
                            "year": 3,
                            "start": "2028-04-01",
                            "end": "2029-03-31",
                            "days": 365,
                            "depreciation": "9500.00",
                            "accumulated": "28500.00",
                            "closing_value": "71500.00"
                          },
                          {
                            "year": 4,
                            "start": "2029-04-01",
                            "end": "2030-03-31",
                            "days": 365,
                            "depreciation": "9500.00",
                            "accumulated": "38000.00",
                            "closing_value": "62000.00"
                          },
                          {
                            "year": 5,
                            "start": "2030-04-01",
                            "end": "2031-03-31",
                            "days": 365,
                            "depreciation": "9500.00",
                            "accumulated": "47500.00",
                            "closing_value": "52500.00"
                          },
                          {
                            "year": 6,
                            "start": "2031-04-01",
                            "end": "2032-03-31",
                            "days": 366,
                            "depreciation": "9500.00",
                            "accumulated": "57000.00",
                            "closing_value": "43000.00"
                          },
                          {
                            "year": 7,
                            "start": "2032-04-01",
                            "end": "2033-03-31",
                            "days": 365,
                            "depreciation": "9500.00",
                            "accumulated": "66500.00",
                            "closing_value": "33500.00"
                          },
                          {
                            "year": 8,
                            "start": "2033-04-01",
                            "end": "2034-03-31",
                            "days": 365,
                            "depreciation": "9500.00",
                            "accumulated": "76000.00",
                            "closing_value": "24000.00"
                          },
                          {
                            "year": 9,
                            "start": "2034-04-01",
                            "end": "2035-03-31",
                            "days": 365,
                            "depreciation": "9500.00",
                            "accumulated": "85500.00",
                            "closing_value": "14500.00"
                          },
                          {
                            "year": 10,
                            "start": "2035-04-01",
                            "end": "2036-03-31",
                            "days": 366,
                            "depreciation": "9500.00",
                            "accumulated": "95000.00",
                            "closing_value": "5000.00"
                          }
                        ]
                      },
                      "exactness": {
                        "residual_value": "exact",
                        "depreciable_amount": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "100000",
                        "useful_life_years": 10,
                        "method": "slm",
                        "date_put_to_use": "2026-04-01",
                        "residual_percent": "5"
                      },
                      "formula": "SLM: (cost − residual) / life a year. WDV rate: 1 − (residual / cost)^(1 / life)",
                      "references": [
                        {
                          "title": "Companies Act 2013, Schedule II (useful lives to compute depreciation)",
                          "url": "https://www.mca.gov.in/Ministry/pdf/CompaniesAct2013.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "₹5,00,000, 8 years, SLM, put to use on 1 October: 182 days in the first year",
                    "value": {
                      "calculator": "accounting/depreciation/india-companies-act@1",
                      "result": {
                        "rate_percent": "12.5000",
                        "residual_value": "25000.00",
                        "depreciable_amount": "475000.00",
                        "schedule": [
                          {
                            "year": 1,
                            "start": "2026-10-01",
                            "end": "2027-03-31",
                            "days": 182,
                            "depreciation": "29606.16",
                            "accumulated": "29606.16",
                            "closing_value": "470393.84"
                          },
                          {
                            "year": 2,
                            "start": "2027-04-01",
                            "end": "2028-03-31",
                            "days": 366,
                            "depreciation": "59375.00",
                            "accumulated": "88981.16",
                            "closing_value": "411018.84"
                          },
                          {
                            "year": 3,
                            "start": "2028-04-01",
                            "end": "2029-03-31",
                            "days": 365,
                            "depreciation": "59375.00",
                            "accumulated": "148356.16",
                            "closing_value": "351643.84"
                          },
                          {
                            "year": 4,
                            "start": "2029-04-01",
                            "end": "2030-03-31",
                            "days": 365,
                            "depreciation": "59375.00",
                            "accumulated": "207731.16",
                            "closing_value": "292268.84"
                          },
                          {
                            "year": 5,
                            "start": "2030-04-01",
                            "end": "2031-03-31",
                            "days": 365,
                            "depreciation": "59375.00",
                            "accumulated": "267106.16",
                            "closing_value": "232893.84"
                          },
                          {
                            "year": 6,
                            "start": "2031-04-01",
                            "end": "2032-03-31",
                            "days": 366,
                            "depreciation": "59375.00",
                            "accumulated": "326481.16",
                            "closing_value": "173518.84"
                          },
                          {
                            "year": 7,
                            "start": "2032-04-01",
                            "end": "2033-03-31",
                            "days": 365,
                            "depreciation": "59375.00",
                            "accumulated": "385856.16",
                            "closing_value": "114143.84"
                          },
                          {
                            "year": 8,
                            "start": "2033-04-01",
                            "end": "2034-03-31",
                            "days": 365,
                            "depreciation": "59375.00",
                            "accumulated": "445231.16",
                            "closing_value": "54768.84"
                          },
                          {
                            "year": 9,
                            "start": "2034-04-01",
                            "end": "2034-09-30",
                            "days": 183,
                            "depreciation": "29768.84",
                            "accumulated": "475000.00",
                            "closing_value": "25000.00"
                          }
                        ]
                      },
                      "exactness": {
                        "residual_value": "exact",
                        "depreciable_amount": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "500000",
                        "useful_life_years": 8,
                        "method": "slm",
                        "date_put_to_use": "2026-10-01",
                        "residual_percent": "5"
                      },
                      "formula": "SLM: (cost − residual) / life a year. WDV rate: 1 − (residual / cost)^(1 / life)",
                      "references": [
                        {
                          "title": "Companies Act 2013, Schedule II (useful lives to compute depreciation)",
                          "url": "https://www.mca.gov.in/Ministry/pdf/CompaniesAct2013.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "accounting/depreciation/india-companies-act@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/accounting/depreciation/india-income-tax": {
      "post": {
        "operationId": "calc_accounting_depreciation_india_income_tax",
        "summary": "Indian income-tax depreciation",
        "description": "Tax depreciation on a block of assets: opening WDV plus additions less sale proceeds, with half the rate for additions used under 180 days.\n\nDepreciation is the block's rate on its written down value: the opening WDV, plus the year's additions, less the money received for assets sold. An asset acquired in the year and put to use for less than 180 days gets half the rate. If the sale proceeds exceed the block, there is no depreciation and the excess is a short-term capital gain; if every asset in the block was sold, what is left is a short-term capital loss.",
        "tags": [
          "Accounting"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rate_percent": {
                    "description": "The block's rate, e.g. 15 (general plant and machinery), 40 (computers), 10 (furniture), 5 or 10 (buildings). Allowed: > 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "15"
                    ]
                  },
                  "tax_year_start": {
                    "description": "Year the tax year starts: 2026 means 1 April 2026 to 31 March 2027. Allowed: >= 1990 and <= 2200.",
                    "type": "integer",
                    "minimum": 1990,
                    "maximum": 2200,
                    "examples": [
                      2026
                    ]
                  },
                  "opening_wdv": {
                    "description": "WDV of the block at the start of the year. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0",
                    "examples": [
                      "500000"
                    ]
                  },
                  "additions": {
                    "description": "Cost of each asset added in the year. Up to 500 items. Each item: >= 0 and <= 1000000000000000.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 0,
                    "maxItems": 500,
                    "examples": [
                      [
                        "200000",
                        "100000"
                      ]
                    ]
                  },
                  "put_to_use_dates": {
                    "description": "The day each addition was put to use, in the same order. Up to 500 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "date"
                    },
                    "minItems": 0,
                    "maxItems": 500,
                    "examples": [
                      [
                        "2026-06-10",
                        "2026-12-01"
                      ]
                    ]
                  },
                  "sale_proceeds": {
                    "description": "Money payable for assets of the block sold, discarded or destroyed in the year (with any scrap value). Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "all_assets_sold": {
                    "description": "True when no asset is left in the block at the end of the year.",
                    "type": "boolean",
                    "default": false
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "rate_percent",
                  "tax_year_start"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Plant at 15%: ₹5,00,000 opening, ₹2,00,000 added in June, ₹1,00,000 in December",
                  "value": {
                    "rate_percent": "15",
                    "tax_year_start": 2026,
                    "opening_wdv": "500000",
                    "additions": [
                      "200000",
                      "100000"
                    ],
                    "put_to_use_dates": [
                      "2026-06-10",
                      "2026-12-01"
                    ]
                  }
                },
                "example2": {
                  "summary": "Sale proceeds above the block: no depreciation, a short-term capital gain",
                  "value": {
                    "rate_percent": "15",
                    "tax_year_start": 2026,
                    "opening_wdv": "100000",
                    "sale_proceeds": "130000"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "accounting/depreciation/india-income-tax@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "wdv_before_depreciation": {
                          "description": "Opening + additions − sale proceeds. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "full_rate_base": {
                          "description": "Part depreciated at the full rate. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "half_rate_base": {
                          "description": "Part depreciated at half the rate. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "depreciation": {
                          "description": "Depreciation for the year. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "closing_wdv": {
                          "description": "WDV carried to next year. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "short_term_capital_gain": {
                          "description": "Sale proceeds above the block. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "short_term_capital_loss": {
                          "description": "WDV left when the block ceases. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "additions": {
                          "description": "Each addition and the rate it got.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "description": "Cost of the addition. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "put_to_use": {
                                "description": "Day put to use.",
                                "type": "string",
                                "format": "date"
                              },
                              "days_used": {
                                "description": "Days of use in the tax year, counting both ends.",
                                "type": "integer"
                              },
                              "rate_percent": {
                                "description": "Rate applied: full, or half under 180 days.",
                                "type": "string"
                              }
                            },
                            "required": [
                              "amount",
                              "put_to_use",
                              "days_used",
                              "rate_percent"
                            ]
                          }
                        }
                      },
                      "required": [
                        "wdv_before_depreciation",
                        "full_rate_base",
                        "half_rate_base",
                        "depreciation",
                        "closing_wdv",
                        "short_term_capital_gain",
                        "short_term_capital_loss",
                        "additions"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Plant at 15%: ₹5,00,000 opening, ₹2,00,000 added in June, ₹1,00,000 in December",
                    "value": {
                      "calculator": "accounting/depreciation/india-income-tax@1",
                      "result": {
                        "wdv_before_depreciation": "800000.00",
                        "full_rate_base": "700000.00",
                        "half_rate_base": "100000.00",
                        "depreciation": "112500.00",
                        "closing_wdv": "687500.00",
                        "short_term_capital_gain": "0.00",
                        "short_term_capital_loss": "0.00",
                        "additions": [
                          {
                            "amount": "200000.00",
                            "put_to_use": "2026-06-10",
                            "days_used": 295,
                            "rate_percent": "15.00"
                          },
                          {
                            "amount": "100000.00",
                            "put_to_use": "2026-12-01",
                            "days_used": 121,
                            "rate_percent": "7.50"
                          }
                        ]
                      },
                      "exactness": {
                        "wdv_before_depreciation": "exact",
                        "full_rate_base": "exact",
                        "half_rate_base": "exact",
                        "depreciation": "exact",
                        "closing_wdv": "exact",
                        "short_term_capital_gain": "exact",
                        "short_term_capital_loss": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate_percent": "15",
                        "tax_year_start": 2026,
                        "opening_wdv": "500000",
                        "additions": [
                          "200000",
                          "100000"
                        ],
                        "put_to_use_dates": [
                          "2026-06-10",
                          "2026-12-01"
                        ],
                        "sale_proceeds": "0",
                        "all_assets_sold": false
                      },
                      "formula": "rate × (opening + additions ≥180 days − sales) + rate/2 × additions <180 days",
                      "references": [
                        {
                          "title": "Income-tax Act, 2025, section 33 (depreciation), in force from tax year 2026-27: sub-sections (3)(a), (4) and (12)(d)",
                          "url": "https://incometaxindia.gov.in/w/section-33-180"
                        },
                        {
                          "title": "Income-tax Act, 1961, sections 32, 43(6) and 50 (up to tax year 2025-26)",
                          "url": "https://incometaxindia.gov.in/"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Sale proceeds above the block: no depreciation, a short-term capital gain",
                    "value": {
                      "calculator": "accounting/depreciation/india-income-tax@1",
                      "result": {
                        "wdv_before_depreciation": "-30000.00",
                        "full_rate_base": "0.00",
                        "half_rate_base": "0.00",
                        "depreciation": "0.00",
                        "closing_wdv": "0.00",
                        "short_term_capital_gain": "30000.00",
                        "short_term_capital_loss": "0.00",
                        "additions": []
                      },
                      "exactness": {
                        "wdv_before_depreciation": "exact",
                        "full_rate_base": "exact",
                        "half_rate_base": "exact",
                        "depreciation": "exact",
                        "closing_wdv": "exact",
                        "short_term_capital_gain": "exact",
                        "short_term_capital_loss": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate_percent": "15",
                        "tax_year_start": 2026,
                        "opening_wdv": "100000",
                        "sale_proceeds": "130000",
                        "all_assets_sold": false
                      },
                      "formula": "rate × (opening + additions ≥180 days − sales) + rate/2 × additions <180 days",
                      "references": [
                        {
                          "title": "Income-tax Act, 2025, section 33 (depreciation), in force from tax year 2026-27: sub-sections (3)(a), (4) and (12)(d)",
                          "url": "https://incometaxindia.gov.in/w/section-33-180"
                        },
                        {
                          "title": "Income-tax Act, 1961, sections 32, 43(6) and 50 (up to tax year 2025-26)",
                          "url": "https://incometaxindia.gov.in/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "accounting/depreciation/india-income-tax@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/accounting/depreciation/macrs": {
      "post": {
        "operationId": "calc_accounting_depreciation_macrs",
        "summary": "MACRS depreciation calculator (IRS tables, GDS)",
        "description": "US tax depreciation under MACRS (GDS) with the IRS percentage tables, Section 179 and bonus depreciation.\n\nApplies the Publication 946 Appendix A tables: half-year or mid-quarter for personal property (Tables A-1 to A-5), mid-month for residential rental (A-6, 27.5 years) and nonresidential real property (A-7a, 39 years). Section 179 comes off first, then bonus depreciation on what is left, then MACRS on the rest. Each year is basis × the table percentage, rounded; the last year takes whatever rounding left over, so the years add up exactly to the basis.",
        "tags": [
          "Accounting"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "basis": {
                    "description": "Depreciable basis: the cost, plus costs to get the property ready, less any business-use reduction. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10000"
                    ]
                  },
                  "property_class": {
                    "description": "Recovery period (property class). Options: 3: 3-year property (200% declining balance); 5: 5-year property such as cars, computers and office machinery (200% DB); 7: 7-year property such as office furniture and fixtures (200% DB); 10: 10-year property (200% DB); 15: 15-year property such as land improvements (150% DB); 20: 20-year property such as farm buildings (150% DB); 27.5: 27.5-year residential rental property (straight line, mid-month); 39: 39-year nonresidential real property (straight line, mid-month)",
                    "type": "string",
                    "enum": [
                      "3",
                      "5",
                      "7",
                      "10",
                      "15",
                      "20",
                      "27.5",
                      "39"
                    ],
                    "examples": [
                      "5"
                    ]
                  },
                  "placed_in_service": {
                    "description": "The day the property was placed in service.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-03-15"
                    ]
                  },
                  "convention": {
                    "description": "Convention for personal property. 27.5- and 39-year property always use mid-month, whatever is passed. Options: half_year: half a year of depreciation in the first year (the usual case); mid_quarter: when more than 40% of the year's basis was placed in service in the last quarter",
                    "type": "string",
                    "enum": [
                      "half_year",
                      "mid_quarter"
                    ],
                    "default": "half_year"
                  },
                  "tax_year_start_month": {
                    "description": "Month your tax year starts (1 = calendar year). Short tax years are not supported. Allowed: >= 1 and <= 12.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12,
                    "default": 1
                  },
                  "section_179": {
                    "description": "Section 179 deduction taken for the property. The dollar limit and business-income limit are not checked. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "bonus_percent": {
                    "description": "Special (bonus) depreciation percentage, e.g. 100 or 40, or 0 if you elect out. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "basis",
                  "property_class",
                  "placed_in_service"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "5-year property, $10,000, half-year: 20%, 32%, 19.2%, 11.52%, 11.52%, 5.76%",
                  "value": {
                    "basis": "10000",
                    "property_class": "5",
                    "placed_in_service": "2026-03-15"
                  }
                },
                "example2": {
                  "summary": "39-year building placed in service in January: 2.461% in year 1",
                  "value": {
                    "basis": "1000000",
                    "property_class": "39",
                    "placed_in_service": "2026-01-10"
                  }
                },
                "example3": {
                  "summary": "7-year equipment: $100,000 with $20,000 Section 179 and 40% bonus",
                  "value": {
                    "basis": "100000",
                    "property_class": "7",
                    "placed_in_service": "2026-05-01",
                    "section_179": "20000",
                    "bonus_percent": "40"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "accounting/depreciation/macrs@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "convention": {
                          "description": "Convention used.",
                          "type": "string"
                        },
                        "section_179": {
                          "description": "Section 179 deduction. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "bonus_depreciation": {
                          "description": "Special depreciation allowance. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "macrs_basis": {
                          "description": "Basis left for MACRS. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "first_year_total": {
                          "description": "Section 179 + bonus + year 1 MACRS. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "schedule": {
                          "description": "MACRS by recovery year.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "year": {
                                "description": "Recovery year, from 1.",
                                "type": "integer"
                              },
                              "tax_year_start": {
                                "description": "First day of the tax year.",
                                "type": "string",
                                "format": "date"
                              },
                              "percent": {
                                "description": "The IRS table percentage for the year.",
                                "type": "string"
                              },
                              "depreciation": {
                                "description": "MACRS depreciation for the year. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "accumulated": {
                                "description": "MACRS depreciation to the end of the year. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "remaining": {
                                "description": "MACRS basis not yet recovered. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "year",
                              "tax_year_start",
                              "percent",
                              "depreciation",
                              "accumulated",
                              "remaining"
                            ]
                          }
                        }
                      },
                      "required": [
                        "convention",
                        "section_179",
                        "bonus_depreciation",
                        "macrs_basis",
                        "first_year_total",
                        "schedule"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "5-year property, $10,000, half-year: 20%, 32%, 19.2%, 11.52%, 11.52%, 5.76%",
                    "value": {
                      "calculator": "accounting/depreciation/macrs@1",
                      "result": {
                        "convention": "half_year",
                        "section_179": "0.00",
                        "bonus_depreciation": "0.00",
                        "macrs_basis": "10000.00",
                        "first_year_total": "2000.00",
                        "schedule": [
                          {
                            "year": 1,
                            "tax_year_start": "2026-01-01",
                            "percent": "20.00",
                            "depreciation": "2000.00",
                            "accumulated": "2000.00",
                            "remaining": "8000.00"
                          },
                          {
                            "year": 2,
                            "tax_year_start": "2027-01-01",
                            "percent": "32.00",
                            "depreciation": "3200.00",
                            "accumulated": "5200.00",
                            "remaining": "4800.00"
                          },
                          {
                            "year": 3,
                            "tax_year_start": "2028-01-01",
                            "percent": "19.20",
                            "depreciation": "1920.00",
                            "accumulated": "7120.00",
                            "remaining": "2880.00"
                          },
                          {
                            "year": 4,
                            "tax_year_start": "2029-01-01",
                            "percent": "11.52",
                            "depreciation": "1152.00",
                            "accumulated": "8272.00",
                            "remaining": "1728.00"
                          },
                          {
                            "year": 5,
                            "tax_year_start": "2030-01-01",
                            "percent": "11.52",
                            "depreciation": "1152.00",
                            "accumulated": "9424.00",
                            "remaining": "576.00"
                          },
                          {
                            "year": 6,
                            "tax_year_start": "2031-01-01",
                            "percent": "5.76",
                            "depreciation": "576.00",
                            "accumulated": "10000.00",
                            "remaining": "0.00"
                          }
                        ]
                      },
                      "exactness": {
                        "section_179": "exact",
                        "bonus_depreciation": "exact",
                        "macrs_basis": "exact",
                        "first_year_total": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "basis": "10000",
                        "property_class": "5",
                        "placed_in_service": "2026-03-15",
                        "convention": "half_year",
                        "tax_year_start_month": 1,
                        "section_179": "0",
                        "bonus_percent": "0"
                      },
                      "formula": "depreciation = (basis − §179 − bonus) × table percentage",
                      "references": [
                        {
                          "title": "IRS Publication 946, How To Depreciate Property, Appendix A tables",
                          "url": "https://www.irs.gov/publications/p946"
                        },
                        {
                          "title": "26 U.S. Code § 168 (MACRS)",
                          "url": "https://www.law.cornell.edu/uscode/text/26/168"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "39-year building placed in service in January: 2.461% in year 1",
                    "value": {
                      "calculator": "accounting/depreciation/macrs@1",
                      "result": {
                        "convention": "mid_month",
                        "section_179": "0.00",
                        "bonus_depreciation": "0.00",
                        "macrs_basis": "1000000.00",
                        "first_year_total": "24610.00",
                        "schedule": [
                          {
                            "year": 1,
                            "tax_year_start": "2026-01-01",
                            "percent": "2.461",
                            "depreciation": "24610.00",
                            "accumulated": "24610.00",
                            "remaining": "975390.00"
                          },
                          {
                            "year": 2,
                            "tax_year_start": "2027-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "50250.00",
                            "remaining": "949750.00"
                          },
                          {
                            "year": 3,
                            "tax_year_start": "2028-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "75890.00",
                            "remaining": "924110.00"
                          },
                          {
                            "year": 4,
                            "tax_year_start": "2029-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "101530.00",
                            "remaining": "898470.00"
                          },
                          {
                            "year": 5,
                            "tax_year_start": "2030-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "127170.00",
                            "remaining": "872830.00"
                          },
                          {
                            "year": 6,
                            "tax_year_start": "2031-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "152810.00",
                            "remaining": "847190.00"
                          },
                          {
                            "year": 7,
                            "tax_year_start": "2032-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "178450.00",
                            "remaining": "821550.00"
                          },
                          {
                            "year": 8,
                            "tax_year_start": "2033-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "204090.00",
                            "remaining": "795910.00"
                          },
                          {
                            "year": 9,
                            "tax_year_start": "2034-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "229730.00",
                            "remaining": "770270.00"
                          },
                          {
                            "year": 10,
                            "tax_year_start": "2035-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "255370.00",
                            "remaining": "744630.00"
                          },
                          {
                            "year": 11,
                            "tax_year_start": "2036-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "281010.00",
                            "remaining": "718990.00"
                          },
                          {
                            "year": 12,
                            "tax_year_start": "2037-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "306650.00",
                            "remaining": "693350.00"
                          },
                          {
                            "year": 13,
                            "tax_year_start": "2038-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "332290.00",
                            "remaining": "667710.00"
                          },
                          {
                            "year": 14,
                            "tax_year_start": "2039-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "357930.00",
                            "remaining": "642070.00"
                          },
                          {
                            "year": 15,
                            "tax_year_start": "2040-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "383570.00",
                            "remaining": "616430.00"
                          },
                          {
                            "year": 16,
                            "tax_year_start": "2041-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "409210.00",
                            "remaining": "590790.00"
                          },
                          {
                            "year": 17,
                            "tax_year_start": "2042-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "434850.00",
                            "remaining": "565150.00"
                          },
                          {
                            "year": 18,
                            "tax_year_start": "2043-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "460490.00",
                            "remaining": "539510.00"
                          },
                          {
                            "year": 19,
                            "tax_year_start": "2044-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "486130.00",
                            "remaining": "513870.00"
                          },
                          {
                            "year": 20,
                            "tax_year_start": "2045-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "511770.00",
                            "remaining": "488230.00"
                          },
                          {
                            "year": 21,
                            "tax_year_start": "2046-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "537410.00",
                            "remaining": "462590.00"
                          },
                          {
                            "year": 22,
                            "tax_year_start": "2047-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "563050.00",
                            "remaining": "436950.00"
                          },
                          {
                            "year": 23,
                            "tax_year_start": "2048-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "588690.00",
                            "remaining": "411310.00"
                          },
                          {
                            "year": 24,
                            "tax_year_start": "2049-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "614330.00",
                            "remaining": "385670.00"
                          },
                          {
                            "year": 25,
                            "tax_year_start": "2050-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "639970.00",
                            "remaining": "360030.00"
                          },
                          {
                            "year": 26,
                            "tax_year_start": "2051-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "665610.00",
                            "remaining": "334390.00"
                          },
                          {
                            "year": 27,
                            "tax_year_start": "2052-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "691250.00",
                            "remaining": "308750.00"
                          },
                          {
                            "year": 28,
                            "tax_year_start": "2053-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "716890.00",
                            "remaining": "283110.00"
                          },
                          {
                            "year": 29,
                            "tax_year_start": "2054-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "742530.00",
                            "remaining": "257470.00"
                          },
                          {
                            "year": 30,
                            "tax_year_start": "2055-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "768170.00",
                            "remaining": "231830.00"
                          },
                          {
                            "year": 31,
                            "tax_year_start": "2056-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "793810.00",
                            "remaining": "206190.00"
                          },
                          {
                            "year": 32,
                            "tax_year_start": "2057-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "819450.00",
                            "remaining": "180550.00"
                          },
                          {
                            "year": 33,
                            "tax_year_start": "2058-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "845090.00",
                            "remaining": "154910.00"
                          },
                          {
                            "year": 34,
                            "tax_year_start": "2059-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "870730.00",
                            "remaining": "129270.00"
                          },
                          {
                            "year": 35,
                            "tax_year_start": "2060-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "896370.00",
                            "remaining": "103630.00"
                          },
                          {
                            "year": 36,
                            "tax_year_start": "2061-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "922010.00",
                            "remaining": "77990.00"
                          },
                          {
                            "year": 37,
                            "tax_year_start": "2062-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "947650.00",
                            "remaining": "52350.00"
                          },
                          {
                            "year": 38,
                            "tax_year_start": "2063-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "973290.00",
                            "remaining": "26710.00"
                          },
                          {
                            "year": 39,
                            "tax_year_start": "2064-01-01",
                            "percent": "2.564",
                            "depreciation": "25640.00",
                            "accumulated": "998930.00",
                            "remaining": "1070.00"
                          },
                          {
                            "year": 40,
                            "tax_year_start": "2065-01-01",
                            "percent": "0.107",
                            "depreciation": "1070.00",
                            "accumulated": "1000000.00",
                            "remaining": "0.00"
                          }
                        ]
                      },
                      "exactness": {
                        "section_179": "exact",
                        "bonus_depreciation": "exact",
                        "macrs_basis": "exact",
                        "first_year_total": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "basis": "1000000",
                        "property_class": "39",
                        "placed_in_service": "2026-01-10",
                        "convention": "half_year",
                        "tax_year_start_month": 1,
                        "section_179": "0",
                        "bonus_percent": "0"
                      },
                      "formula": "depreciation = (basis − §179 − bonus) × table percentage",
                      "references": [
                        {
                          "title": "IRS Publication 946, How To Depreciate Property, Appendix A tables",
                          "url": "https://www.irs.gov/publications/p946"
                        },
                        {
                          "title": "26 U.S. Code § 168 (MACRS)",
                          "url": "https://www.law.cornell.edu/uscode/text/26/168"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "7-year equipment: $100,000 with $20,000 Section 179 and 40% bonus",
                    "value": {
                      "calculator": "accounting/depreciation/macrs@1",
                      "result": {
                        "convention": "half_year",
                        "section_179": "20000.00",
                        "bonus_depreciation": "32000.00",
                        "macrs_basis": "48000.00",
                        "first_year_total": "58859.20",
                        "schedule": [
                          {
                            "year": 1,
                            "tax_year_start": "2026-01-01",
                            "percent": "14.29",
                            "depreciation": "6859.20",
                            "accumulated": "6859.20",
                            "remaining": "41140.80"
                          },
                          {
                            "year": 2,
                            "tax_year_start": "2027-01-01",
                            "percent": "24.49",
                            "depreciation": "11755.20",
                            "accumulated": "18614.40",
                            "remaining": "29385.60"
                          },
                          {
                            "year": 3,
                            "tax_year_start": "2028-01-01",
                            "percent": "17.49",
                            "depreciation": "8395.20",
                            "accumulated": "27009.60",
                            "remaining": "20990.40"
                          },
                          {
                            "year": 4,
                            "tax_year_start": "2029-01-01",
                            "percent": "12.49",
                            "depreciation": "5995.20",
                            "accumulated": "33004.80",
                            "remaining": "14995.20"
                          },
                          {
                            "year": 5,
                            "tax_year_start": "2030-01-01",
                            "percent": "8.93",
                            "depreciation": "4286.40",
                            "accumulated": "37291.20",
                            "remaining": "10708.80"
                          },
                          {
                            "year": 6,
                            "tax_year_start": "2031-01-01",
                            "percent": "8.92",
                            "depreciation": "4281.60",
                            "accumulated": "41572.80",
                            "remaining": "6427.20"
                          },
                          {
                            "year": 7,
                            "tax_year_start": "2032-01-01",
                            "percent": "8.93",
                            "depreciation": "4286.40",
                            "accumulated": "45859.20",
                            "remaining": "2140.80"
                          },
                          {
                            "year": 8,
                            "tax_year_start": "2033-01-01",
                            "percent": "4.46",
                            "depreciation": "2140.80",
                            "accumulated": "48000.00",
                            "remaining": "0.00"
                          }
                        ]
                      },
                      "exactness": {
                        "section_179": "exact",
                        "bonus_depreciation": "exact",
                        "macrs_basis": "exact",
                        "first_year_total": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "basis": "100000",
                        "property_class": "7",
                        "placed_in_service": "2026-05-01",
                        "convention": "half_year",
                        "tax_year_start_month": 1,
                        "section_179": "20000",
                        "bonus_percent": "40"
                      },
                      "formula": "depreciation = (basis − §179 − bonus) × table percentage",
                      "references": [
                        {
                          "title": "IRS Publication 946, How To Depreciate Property, Appendix A tables",
                          "url": "https://www.irs.gov/publications/p946"
                        },
                        {
                          "title": "26 U.S. Code § 168 (MACRS)",
                          "url": "https://www.law.cornell.edu/uscode/text/26/168"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "accounting/depreciation/macrs@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/accounting/lease/asc842": {
      "post": {
        "operationId": "calc_accounting_lease_asc842",
        "summary": "ASC 842 lease calculator: finance and operating leases",
        "description": "Lessee accounting under US GAAP ASC 842: lease liability, right-of-use asset and the schedule for a finance or an operating lease.\n\nBoth classes start the same way: the liability is the present value of the unpaid lease payments, and the right-of-use asset adds initial direct costs and payments made at or before commencement, less incentives received. A finance lease then has interest on the liability and straight-line amortization of the asset. An operating lease has one straight-line lease cost (all payments plus initial direct costs, less incentives, spread evenly), and the asset is reduced by that cost less the interest on the liability (ASC 842-20-25-6 and 35-3).",
        "tags": [
          "Accounting"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "classification": {
                    "description": "Lease classification. Options: finance: finance lease; operating: operating lease",
                    "type": "string",
                    "enum": [
                      "finance",
                      "operating"
                    ],
                    "examples": [
                      "operating"
                    ]
                  },
                  "payment": {
                    "description": "The first lease payment. Later payments rise by annual_increase_percent once a year. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "100000"
                    ]
                  },
                  "payments_per_year": {
                    "description": "How often payments are made. Options: 1: yearly; 2: half-yearly; 4: quarterly; 12: monthly",
                    "type": "string",
                    "enum": [
                      "1",
                      "2",
                      "4",
                      "12"
                    ],
                    "default": "1"
                  },
                  "number_of_payments": {
                    "description": "Number of payments over the lease term. Allowed: >= 1 and <= 600.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 600,
                    "examples": [
                      10
                    ]
                  },
                  "timing": {
                    "description": "When each payment is made within its period. Options: arrears: at the end of each period; advance: at the start of each period (the first at commencement)",
                    "type": "string",
                    "enum": [
                      "arrears",
                      "advance"
                    ],
                    "default": "arrears"
                  },
                  "discount_rate_percent": {
                    "description": "Annual discount rate: the rate implicit in the lease or your incremental borrowing rate. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "6"
                    ]
                  },
                  "rate_convention": {
                    "description": "How the annual rate becomes a rate per period when payments are more often than yearly. Options: nominal: annual rate ÷ payments a year; effective: (1 + annual rate)^(1 / payments a year) − 1, to 15 decimals",
                    "type": "string",
                    "enum": [
                      "nominal",
                      "effective"
                    ],
                    "default": "nominal"
                  },
                  "annual_increase_percent": {
                    "description": "Fixed yearly increase in the payments (each new year's payment is rounded like the results). Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "end_payment": {
                    "description": "Paid at the end of the term: a purchase option you are reasonably certain to exercise, a termination penalty, or the amount expected under a residual value guarantee. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "initial_direct_costs": {
                    "description": "Initial direct costs (added to the asset). Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "lease_incentives": {
                    "description": "Lease incentives received (taken off the asset). Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "prepaid_payments": {
                    "description": "Lease payments made before commencement, other than the first payment in advance. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "rou_life_periods": {
                    "description": "Periods to depreciate the asset over: the lease term (the default) or the useful life when ownership transfers or a purchase option is reasonably certain. Allowed: >= 1 and <= 1200.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1200
                  },
                  "commencement_date": {
                    "description": "Commencement date of the lease.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-01-01"
                    ]
                  },
                  "schedule_rounding": {
                    "description": "How the schedule is rounded. Options: ledger: each period's interest and depreciation is rounded and the next period works from the rounded balance, as in a ledger; exact: each balance is the exact balance rounded, and each period's charge is the change in the rounded balances",
                    "type": "string",
                    "enum": [
                      "ledger",
                      "exact"
                    ],
                    "default": "ledger"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "classification",
                  "payment",
                  "number_of_payments",
                  "discount_rate_percent",
                  "commencement_date"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "ASC 842 Example 4: operating lease, $10,000 rising 5% a year, 10 years at 6%",
                  "value": {
                    "classification": "operating",
                    "payment": "10000",
                    "number_of_payments": 10,
                    "annual_increase_percent": "5",
                    "discount_rate_percent": "6",
                    "initial_direct_costs": "5000",
                    "lease_incentives": "10000",
                    "commencement_date": "2026-01-01",
                    "options": {
                      "decimals": 0
                    }
                  }
                },
                "example2": {
                  "summary": "ASC 842 Example 23: finance lease with a purchase option, asset amortized over its 7-year life",
                  "value": {
                    "classification": "finance",
                    "payment": "59000",
                    "number_of_payments": 5,
                    "end_payment": "5000",
                    "discount_rate_percent": "6.5",
                    "rou_life_periods": 7,
                    "commencement_date": "2026-01-01",
                    "options": {
                      "decimals": 0
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "accounting/lease/asc842@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "classification": {
                          "description": "Lease classification.",
                          "type": "string"
                        },
                        "periodic_rate_percent": {
                          "description": "Discount rate per period, in percent.",
                          "type": "string"
                        },
                        "initial_liability": {
                          "description": "Lease liability at commencement. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "initial_rou_asset": {
                          "description": "Right-of-use asset at commencement. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_payments": {
                          "description": "All payments in the schedule. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_interest": {
                          "description": "Interest over the term. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "rou_asset_end_of_term": {
                          "description": "Right-of-use asset left at the end of the term (above 0 when it is depreciated over a longer useful life). Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_depreciation": {
                          "description": "Finance lease: amortization over the term. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_lease_cost": {
                          "description": "Operating lease: total straight-line lease cost. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "schedule": {
                          "description": "One row per payment period.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "period": {
                                "description": "Period number, from 1.",
                                "type": "integer"
                              },
                              "start": {
                                "description": "First day of the period.",
                                "type": "string",
                                "format": "date"
                              },
                              "end": {
                                "description": "Last day of the period.",
                                "type": "string",
                                "format": "date"
                              },
                              "payment": {
                                "description": "Payment made in the period (the last includes end_payment). Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "interest": {
                                "description": "Interest on the liability. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "liability": {
                                "description": "Lease liability at the end of the period. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "depreciation": {
                                "description": "Depreciation (amortization) of the asset. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "lease_cost": {
                                "description": "Single straight-line lease cost. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "rou_amortization": {
                                "description": "Lease cost less interest. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "rou_asset": {
                                "description": "Right-of-use asset at the end of the period. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "period",
                              "start",
                              "end",
                              "payment",
                              "interest",
                              "liability",
                              "rou_asset"
                            ]
                          }
                        }
                      },
                      "required": [
                        "classification",
                        "periodic_rate_percent",
                        "initial_liability",
                        "initial_rou_asset",
                        "total_payments",
                        "total_interest",
                        "rou_asset_end_of_term",
                        "schedule"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "ASC 842 Example 4: operating lease, $10,000 rising 5% a year, 10 years at 6%",
                    "value": {
                      "calculator": "accounting/lease/asc842@1",
                      "result": {
                        "classification": "operating",
                        "periodic_rate_percent": "6",
                        "initial_liability": "90434",
                        "initial_rou_asset": "85434",
                        "total_payments": "125779",
                        "total_interest": "35345",
                        "rou_asset_end_of_term": "0",
                        "total_lease_cost": "120779",
                        "schedule": [
                          {
                            "period": 1,
                            "start": "2026-01-01",
                            "end": "2026-12-31",
                            "payment": "10000",
                            "interest": "5426",
                            "liability": "85860",
                            "lease_cost": "12078",
                            "rou_amortization": "6652",
                            "rou_asset": "78782"
                          },
                          {
                            "period": 2,
                            "start": "2027-01-01",
                            "end": "2027-12-31",
                            "payment": "10500",
                            "interest": "5152",
                            "liability": "80512",
                            "lease_cost": "12078",
                            "rou_amortization": "6926",
                            "rou_asset": "71856"
                          },
                          {
                            "period": 3,
                            "start": "2028-01-01",
                            "end": "2028-12-31",
                            "payment": "11025",
                            "interest": "4831",
                            "liability": "74318",
                            "lease_cost": "12078",
                            "rou_amortization": "7247",
                            "rou_asset": "64609"
                          },
                          {
                            "period": 4,
                            "start": "2029-01-01",
                            "end": "2029-12-31",
                            "payment": "11576",
                            "interest": "4459",
                            "liability": "67201",
                            "lease_cost": "12078",
                            "rou_amortization": "7619",
                            "rou_asset": "56990"
                          },
                          {
                            "period": 5,
                            "start": "2030-01-01",
                            "end": "2030-12-31",
                            "payment": "12155",
                            "interest": "4032",
                            "liability": "59078",
                            "lease_cost": "12078",
                            "rou_amortization": "8046",
                            "rou_asset": "48944"
                          },
                          {
                            "period": 6,
                            "start": "2031-01-01",
                            "end": "2031-12-31",
                            "payment": "12763",
                            "interest": "3545",
                            "liability": "49860",
                            "lease_cost": "12077",
                            "rou_amortization": "8532",
                            "rou_asset": "40412"
                          },
                          {
                            "period": 7,
                            "start": "2032-01-01",
                            "end": "2032-12-31",
                            "payment": "13401",
                            "interest": "2992",
                            "liability": "39451",
                            "lease_cost": "12078",
                            "rou_amortization": "9086",
                            "rou_asset": "31326"
                          },
                          {
                            "period": 8,
                            "start": "2033-01-01",
                            "end": "2033-12-31",
                            "payment": "14071",
                            "interest": "2367",
                            "liability": "27747",
                            "lease_cost": "12078",
                            "rou_amortization": "9711",
                            "rou_asset": "21615"
                          },
                          {
                            "period": 9,
                            "start": "2034-01-01",
                            "end": "2034-12-31",
                            "payment": "14775",
                            "interest": "1665",
                            "liability": "14637",
                            "lease_cost": "12078",
                            "rou_amortization": "10413",
                            "rou_asset": "11202"
                          },
                          {
                            "period": 10,
                            "start": "2035-01-01",
                            "end": "2035-12-31",
                            "payment": "15513",
                            "interest": "876",
                            "liability": "0",
                            "lease_cost": "12078",
                            "rou_amortization": "11202",
                            "rou_asset": "0"
                          }
                        ]
                      },
                      "exactness": {
                        "initial_liability": "rounded",
                        "initial_rou_asset": "rounded",
                        "total_payments": "exact",
                        "total_interest": "exact",
                        "rou_asset_end_of_term": "exact",
                        "total_lease_cost": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "classification": "operating",
                        "payment": "10000",
                        "payments_per_year": "1",
                        "number_of_payments": 10,
                        "timing": "arrears",
                        "discount_rate_percent": "6",
                        "rate_convention": "nominal",
                        "annual_increase_percent": "5",
                        "end_payment": "0",
                        "initial_direct_costs": "5000",
                        "lease_incentives": "10000",
                        "prepaid_payments": "0",
                        "commencement_date": "2026-01-01",
                        "schedule_rounding": "ledger"
                      },
                      "formula": "liability = Σ payment × (1 + i)^−t; operating cost = (payments + IDC − incentives) / periods",
                      "references": [
                        {
                          "title": "FASB ASC 842-20 Leases, Lessee",
                          "url": "https://asc.fasb.org/842/tableOfContent"
                        },
                        {
                          "title": "ASC 842-20-55 Illustrations: Examples 3, 4 and 23 (Deloitte Roadmap: Leases)",
                          "url": "https://dart.deloitte.com/USDART/home/codification/broad-transactions/asc842-10/roadmap-leases"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "ASC 842 Example 23: finance lease with a purchase option, asset amortized over its 7-year life",
                    "value": {
                      "calculator": "accounting/lease/asc842@1",
                      "result": {
                        "classification": "finance",
                        "periodic_rate_percent": "6.5",
                        "initial_liability": "248834",
                        "initial_rou_asset": "248834",
                        "total_payments": "300000",
                        "total_interest": "51166",
                        "rou_asset_end_of_term": "71094",
                        "total_depreciation": "177740",
                        "schedule": [
                          {
                            "period": 1,
                            "start": "2026-01-01",
                            "end": "2026-12-31",
                            "payment": "59000",
                            "interest": "16174",
                            "liability": "206008",
                            "depreciation": "35548",
                            "rou_asset": "213286"
                          },
                          {
                            "period": 2,
                            "start": "2027-01-01",
                            "end": "2027-12-31",
                            "payment": "59000",
                            "interest": "13391",
                            "liability": "160399",
                            "depreciation": "35548",
                            "rou_asset": "177738"
                          },
                          {
                            "period": 3,
                            "start": "2028-01-01",
                            "end": "2028-12-31",
                            "payment": "59000",
                            "interest": "10426",
                            "liability": "111825",
                            "depreciation": "35548",
                            "rou_asset": "142190"
                          },
                          {
                            "period": 4,
                            "start": "2029-01-01",
                            "end": "2029-12-31",
                            "payment": "59000",
                            "interest": "7269",
                            "liability": "60094",
                            "depreciation": "35548",
                            "rou_asset": "106642"
                          },
                          {
                            "period": 5,
                            "start": "2030-01-01",
                            "end": "2030-12-31",
                            "payment": "64000",
                            "interest": "3906",
                            "liability": "0",
                            "depreciation": "35548",
                            "rou_asset": "71094"
                          }
                        ]
                      },
                      "exactness": {
                        "initial_liability": "rounded",
                        "initial_rou_asset": "rounded",
                        "total_payments": "exact",
                        "total_interest": "exact",
                        "rou_asset_end_of_term": "exact",
                        "total_depreciation": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "classification": "finance",
                        "payment": "59000",
                        "payments_per_year": "1",
                        "number_of_payments": 5,
                        "timing": "arrears",
                        "discount_rate_percent": "6.5",
                        "rate_convention": "nominal",
                        "annual_increase_percent": "0",
                        "end_payment": "5000",
                        "initial_direct_costs": "0",
                        "lease_incentives": "0",
                        "prepaid_payments": "0",
                        "rou_life_periods": 7,
                        "commencement_date": "2026-01-01",
                        "schedule_rounding": "ledger"
                      },
                      "formula": "liability = Σ payment × (1 + i)^−t; operating cost = (payments + IDC − incentives) / periods",
                      "references": [
                        {
                          "title": "FASB ASC 842-20 Leases, Lessee",
                          "url": "https://asc.fasb.org/842/tableOfContent"
                        },
                        {
                          "title": "ASC 842-20-55 Illustrations: Examples 3, 4 and 23 (Deloitte Roadmap: Leases)",
                          "url": "https://dart.deloitte.com/USDART/home/codification/broad-transactions/asc842-10/roadmap-leases"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "accounting/lease/asc842@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/accounting/lease/ifrs16": {
      "post": {
        "operationId": "calc_accounting_lease_ifrs16",
        "summary": "IFRS 16 lease calculator: liability and right-of-use asset",
        "description": "Lessee accounting under IFRS 16: the initial lease liability and right-of-use asset, and a schedule of interest, depreciation and balances.\n\nThe liability is the present value of the payments not paid at commencement, discounted at the rate implicit in the lease or the incremental borrowing rate (IFRS 16.26). The right-of-use asset is that liability plus payments made at or before commencement, initial direct costs and restoration costs, less incentives received (IFRS 16.24). Interest uses the effective interest method; the asset is depreciated straight line over the term or the useful life.",
        "tags": [
          "Accounting"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "payment": {
                    "description": "The first lease payment. Later payments rise by annual_increase_percent once a year. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "100000"
                    ]
                  },
                  "payments_per_year": {
                    "description": "How often payments are made. Options: 1: yearly; 2: half-yearly; 4: quarterly; 12: monthly",
                    "type": "string",
                    "enum": [
                      "1",
                      "2",
                      "4",
                      "12"
                    ],
                    "default": "1"
                  },
                  "number_of_payments": {
                    "description": "Number of payments over the lease term. Allowed: >= 1 and <= 600.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 600,
                    "examples": [
                      10
                    ]
                  },
                  "timing": {
                    "description": "When each payment is made within its period. Options: arrears: at the end of each period; advance: at the start of each period (the first at commencement)",
                    "type": "string",
                    "enum": [
                      "arrears",
                      "advance"
                    ],
                    "default": "arrears"
                  },
                  "discount_rate_percent": {
                    "description": "Annual discount rate: the rate implicit in the lease or your incremental borrowing rate. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "6"
                    ]
                  },
                  "rate_convention": {
                    "description": "How the annual rate becomes a rate per period when payments are more often than yearly. Options: nominal: annual rate ÷ payments a year; effective: (1 + annual rate)^(1 / payments a year) − 1, to 15 decimals",
                    "type": "string",
                    "enum": [
                      "nominal",
                      "effective"
                    ],
                    "default": "nominal"
                  },
                  "annual_increase_percent": {
                    "description": "Fixed yearly increase in the payments (each new year's payment is rounded like the results). Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "end_payment": {
                    "description": "Paid at the end of the term: a purchase option you are reasonably certain to exercise, a termination penalty, or the amount expected under a residual value guarantee. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "initial_direct_costs": {
                    "description": "Initial direct costs (added to the asset). Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "lease_incentives": {
                    "description": "Lease incentives received (taken off the asset). Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "prepaid_payments": {
                    "description": "Lease payments made before commencement, other than the first payment in advance. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "restoration_costs": {
                    "description": "Present value of the costs to dismantle or restore (IAS 37 provision, added to the asset). Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "rou_life_periods": {
                    "description": "Periods to depreciate the asset over: the lease term (the default) or the useful life when ownership transfers or a purchase option is reasonably certain. Allowed: >= 1 and <= 1200.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1200
                  },
                  "commencement_date": {
                    "description": "Commencement date of the lease.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-01-01"
                    ]
                  },
                  "schedule_rounding": {
                    "description": "How the schedule is rounded. Options: ledger: each period's interest and depreciation is rounded and the next period works from the rounded balance, as in a ledger; exact: each balance is the exact balance rounded, and each period's charge is the change in the rounded balances",
                    "type": "string",
                    "enum": [
                      "ledger",
                      "exact"
                    ],
                    "default": "ledger"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "payment",
                  "number_of_payments",
                  "discount_rate_percent",
                  "commencement_date"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "IFRS 16 Example 18: ten yearly payments of 100,000 in arrears at 6%",
                  "value": {
                    "payment": "100000",
                    "number_of_payments": 10,
                    "discount_rate_percent": "6",
                    "commencement_date": "2026-01-01",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example2": {
                  "summary": "Office lease: 2,500 a month in advance for 3 years at 5%, 1,000 initial direct costs",
                  "value": {
                    "payment": "2500",
                    "payments_per_year": "12",
                    "number_of_payments": 36,
                    "timing": "advance",
                    "discount_rate_percent": "5",
                    "initial_direct_costs": "1000",
                    "commencement_date": "2026-11-01"
                  }
                },
                "example3": {
                  "summary": "HMRC BLM18000: £100,000 a year in advance for 10 years at 5%, with a premium and restoration costs",
                  "value": {
                    "payment": "100000",
                    "number_of_payments": 10,
                    "timing": "advance",
                    "discount_rate_percent": "5",
                    "prepaid_payments": "9998",
                    "restoration_costs": "20000",
                    "commencement_date": "2026-01-01",
                    "schedule_rounding": "exact",
                    "options": {
                      "decimals": 0
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "accounting/lease/ifrs16@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "periodic_rate_percent": {
                          "description": "Discount rate per period, in percent.",
                          "type": "string"
                        },
                        "initial_liability": {
                          "description": "Lease liability at commencement. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "initial_rou_asset": {
                          "description": "Right-of-use asset at commencement. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_payments": {
                          "description": "All payments in the schedule. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_interest": {
                          "description": "Interest over the term. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "rou_asset_end_of_term": {
                          "description": "Right-of-use asset left at the end of the term (above 0 when it is depreciated over a longer useful life). Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_depreciation": {
                          "description": "Depreciation over the term. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "schedule": {
                          "description": "One row per payment period.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "period": {
                                "description": "Period number, from 1.",
                                "type": "integer"
                              },
                              "start": {
                                "description": "First day of the period.",
                                "type": "string",
                                "format": "date"
                              },
                              "end": {
                                "description": "Last day of the period.",
                                "type": "string",
                                "format": "date"
                              },
                              "payment": {
                                "description": "Payment made in the period (the last includes end_payment). Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "interest": {
                                "description": "Interest on the liability. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "liability": {
                                "description": "Lease liability at the end of the period. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "depreciation": {
                                "description": "Depreciation (amortization) of the asset. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "rou_asset": {
                                "description": "Right-of-use asset at the end of the period. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "period",
                              "start",
                              "end",
                              "payment",
                              "interest",
                              "liability",
                              "depreciation",
                              "rou_asset"
                            ]
                          }
                        }
                      },
                      "required": [
                        "periodic_rate_percent",
                        "initial_liability",
                        "initial_rou_asset",
                        "total_payments",
                        "total_interest",
                        "rou_asset_end_of_term",
                        "total_depreciation",
                        "schedule"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "IFRS 16 Example 18: ten yearly payments of 100,000 in arrears at 6%",
                    "value": {
                      "calculator": "accounting/lease/ifrs16@1",
                      "result": {
                        "periodic_rate_percent": "6",
                        "initial_liability": "736008.71",
                        "initial_rou_asset": "736008.71",
                        "total_payments": "1000000.00",
                        "total_interest": "263991.29",
                        "rou_asset_end_of_term": "0.00",
                        "total_depreciation": "736008.71",
                        "schedule": [
                          {
                            "period": 1,
                            "start": "2026-01-01",
                            "end": "2026-12-31",
                            "payment": "100000.00",
                            "interest": "44160.52",
                            "liability": "680169.23",
                            "depreciation": "73600.87",
                            "rou_asset": "662407.84"
                          },
                          {
                            "period": 2,
                            "start": "2027-01-01",
                            "end": "2027-12-31",
                            "payment": "100000.00",
                            "interest": "40810.15",
                            "liability": "620979.38",
                            "depreciation": "73600.87",
                            "rou_asset": "588806.97"
                          },
                          {
                            "period": 3,
                            "start": "2028-01-01",
                            "end": "2028-12-31",
                            "payment": "100000.00",
                            "interest": "37258.76",
                            "liability": "558238.14",
                            "depreciation": "73600.87",
                            "rou_asset": "515206.10"
                          },
                          {
                            "period": 4,
                            "start": "2029-01-01",
                            "end": "2029-12-31",
                            "payment": "100000.00",
                            "interest": "33494.29",
                            "liability": "491732.43",
                            "depreciation": "73600.87",
                            "rou_asset": "441605.23"
                          },
                          {
                            "period": 5,
                            "start": "2030-01-01",
                            "end": "2030-12-31",
                            "payment": "100000.00",
                            "interest": "29503.95",
                            "liability": "421236.38",
                            "depreciation": "73600.87",
                            "rou_asset": "368004.36"
                          },
                          {
                            "period": 6,
                            "start": "2031-01-01",
                            "end": "2031-12-31",
                            "payment": "100000.00",
                            "interest": "25274.18",
                            "liability": "346510.56",
                            "depreciation": "73600.87",
                            "rou_asset": "294403.49"
                          },
                          {
                            "period": 7,
                            "start": "2032-01-01",
                            "end": "2032-12-31",
                            "payment": "100000.00",
                            "interest": "20790.63",
                            "liability": "267301.19",
                            "depreciation": "73600.87",
                            "rou_asset": "220802.62"
                          },
                          {
                            "period": 8,
                            "start": "2033-01-01",
                            "end": "2033-12-31",
                            "payment": "100000.00",
                            "interest": "16038.07",
                            "liability": "183339.26",
                            "depreciation": "73600.87",
                            "rou_asset": "147201.75"
                          },
                          {
                            "period": 9,
                            "start": "2034-01-01",
                            "end": "2034-12-31",
                            "payment": "100000.00",
                            "interest": "11000.36",
                            "liability": "94339.62",
                            "depreciation": "73600.87",
                            "rou_asset": "73600.88"
                          },
                          {
                            "period": 10,
                            "start": "2035-01-01",
                            "end": "2035-12-31",
                            "payment": "100000.00",
                            "interest": "5660.38",
                            "liability": "0.00",
                            "depreciation": "73600.88",
                            "rou_asset": "0.00"
                          }
                        ]
                      },
                      "exactness": {
                        "initial_liability": "rounded",
                        "initial_rou_asset": "rounded",
                        "total_payments": "exact",
                        "total_interest": "exact",
                        "rou_asset_end_of_term": "exact",
                        "total_depreciation": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "payment": "100000",
                        "payments_per_year": "1",
                        "number_of_payments": 10,
                        "timing": "arrears",
                        "discount_rate_percent": "6",
                        "rate_convention": "nominal",
                        "annual_increase_percent": "0",
                        "end_payment": "0",
                        "initial_direct_costs": "0",
                        "lease_incentives": "0",
                        "prepaid_payments": "0",
                        "restoration_costs": "0",
                        "commencement_date": "2026-01-01",
                        "schedule_rounding": "ledger"
                      },
                      "formula": "liability = Σ payment × (1 + i)^−t; ROU = liability + paid at start + IDC + restoration − incentives",
                      "references": [
                        {
                          "title": "IFRS 16 Leases, paragraphs 23 to 38",
                          "url": "https://www.ifrs.org/issued-standards/list-of-standards/ifrs-16-leases/"
                        },
                        {
                          "title": "IFRS 16 Illustrative Examples 13 to 18",
                          "url": "https://www.ifrs.org/issued-standards/list-of-standards/ifrs-16-leases/"
                        },
                        {
                          "title": "HMRC Business Leasing Manual BLM18000: lessee accounting example",
                          "url": "https://www.gov.uk/hmrc-internal-manuals/business-leasing-manual/blm18000"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Office lease: 2,500 a month in advance for 3 years at 5%, 1,000 initial direct costs",
                    "value": {
                      "calculator": "accounting/lease/ifrs16@1",
                      "result": {
                        "periodic_rate_percent": "0.4166666666667",
                        "initial_liability": "81261.81",
                        "initial_rou_asset": "84761.81",
                        "total_payments": "90000.00",
                        "total_interest": "6238.19",
                        "rou_asset_end_of_term": "0.00",
                        "total_depreciation": "84761.81",
                        "schedule": [
                          {
                            "period": 1,
                            "start": "2026-11-01",
                            "end": "2026-11-30",
                            "payment": "2500.00",
                            "interest": "338.59",
                            "liability": "81600.40",
                            "depreciation": "2354.49",
                            "rou_asset": "82407.32"
                          },
                          {
                            "period": 2,
                            "start": "2026-12-01",
                            "end": "2026-12-31",
                            "payment": "2500.00",
                            "interest": "329.58",
                            "liability": "79429.98",
                            "depreciation": "2354.49",
                            "rou_asset": "80052.83"
                          },
                          {
                            "period": 3,
                            "start": "2027-01-01",
                            "end": "2027-01-31",
                            "payment": "2500.00",
                            "interest": "320.54",
                            "liability": "77250.52",
                            "depreciation": "2354.49",
                            "rou_asset": "77698.34"
                          },
                          {
                            "period": 4,
                            "start": "2027-02-01",
                            "end": "2027-02-28",
                            "payment": "2500.00",
                            "interest": "311.46",
                            "liability": "75061.98",
                            "depreciation": "2354.49",
                            "rou_asset": "75343.85"
                          },
                          {
                            "period": 5,
                            "start": "2027-03-01",
                            "end": "2027-03-31",
                            "payment": "2500.00",
                            "interest": "302.34",
                            "liability": "72864.32",
                            "depreciation": "2354.49",
                            "rou_asset": "72989.36"
                          },
                          {
                            "period": 6,
                            "start": "2027-04-01",
                            "end": "2027-04-30",
                            "payment": "2500.00",
                            "interest": "293.18",
                            "liability": "70657.50",
                            "depreciation": "2354.49",
                            "rou_asset": "70634.87"
                          },
                          {
                            "period": 7,
                            "start": "2027-05-01",
                            "end": "2027-05-31",
                            "payment": "2500.00",
                            "interest": "283.99",
                            "liability": "68441.49",
                            "depreciation": "2354.49",
                            "rou_asset": "68280.38"
                          },
                          {
                            "period": 8,
                            "start": "2027-06-01",
                            "end": "2027-06-30",
                            "payment": "2500.00",
                            "interest": "274.76",
                            "liability": "66216.25",
                            "depreciation": "2354.49",
                            "rou_asset": "65925.89"
                          },
                          {
                            "period": 9,
                            "start": "2027-07-01",
                            "end": "2027-07-31",
                            "payment": "2500.00",
                            "interest": "265.48",
                            "liability": "63981.73",
                            "depreciation": "2354.49",
                            "rou_asset": "63571.40"
                          },
                          {
                            "period": 10,
                            "start": "2027-08-01",
                            "end": "2027-08-31",
                            "payment": "2500.00",
                            "interest": "256.17",
                            "liability": "61737.90",
                            "depreciation": "2354.49",
                            "rou_asset": "61216.91"
                          },
                          {
                            "period": 11,
                            "start": "2027-09-01",
                            "end": "2027-09-30",
                            "payment": "2500.00",
                            "interest": "246.82",
                            "liability": "59484.72",
                            "depreciation": "2354.49",
                            "rou_asset": "58862.42"
                          },
                          {
                            "period": 12,
                            "start": "2027-10-01",
                            "end": "2027-10-31",
                            "payment": "2500.00",
                            "interest": "237.44",
                            "liability": "57222.16",
                            "depreciation": "2354.49",
                            "rou_asset": "56507.93"
                          },
                          {
                            "period": 13,
                            "start": "2027-11-01",
                            "end": "2027-11-30",
                            "payment": "2500.00",
                            "interest": "228.01",
                            "liability": "54950.17",
                            "depreciation": "2354.49",
                            "rou_asset": "54153.44"
                          },
                          {
                            "period": 14,
                            "start": "2027-12-01",
                            "end": "2027-12-31",
                            "payment": "2500.00",
                            "interest": "218.54",
                            "liability": "52668.71",
                            "depreciation": "2354.49",
                            "rou_asset": "51798.95"
                          },
                          {
                            "period": 15,
                            "start": "2028-01-01",
                            "end": "2028-01-31",
                            "payment": "2500.00",
                            "interest": "209.04",
                            "liability": "50377.75",
                            "depreciation": "2354.49",
                            "rou_asset": "49444.46"
                          },
                          {
                            "period": 16,
                            "start": "2028-02-01",
                            "end": "2028-02-29",
                            "payment": "2500.00",
                            "interest": "199.49",
                            "liability": "48077.24",
                            "depreciation": "2354.49",
                            "rou_asset": "47089.97"
                          },
                          {
                            "period": 17,
                            "start": "2028-03-01",
                            "end": "2028-03-31",
                            "payment": "2500.00",
                            "interest": "189.91",
                            "liability": "45767.15",
                            "depreciation": "2354.49",
                            "rou_asset": "44735.48"
                          },
                          {
                            "period": 18,
                            "start": "2028-04-01",
                            "end": "2028-04-30",
                            "payment": "2500.00",
                            "interest": "180.28",
                            "liability": "43447.43",
                            "depreciation": "2354.49",
                            "rou_asset": "42380.99"
                          },
                          {
                            "period": 19,
                            "start": "2028-05-01",
                            "end": "2028-05-31",
                            "payment": "2500.00",
                            "interest": "170.61",
                            "liability": "41118.04",
                            "depreciation": "2354.49",
                            "rou_asset": "40026.50"
                          },
                          {
                            "period": 20,
                            "start": "2028-06-01",
                            "end": "2028-06-30",
                            "payment": "2500.00",
                            "interest": "160.91",
                            "liability": "38778.95",
                            "depreciation": "2354.49",
                            "rou_asset": "37672.01"
                          },
                          {
                            "period": 21,
                            "start": "2028-07-01",
                            "end": "2028-07-31",
                            "payment": "2500.00",
                            "interest": "151.16",
                            "liability": "36430.11",
                            "depreciation": "2354.49",
                            "rou_asset": "35317.52"
                          },
                          {
                            "period": 22,
                            "start": "2028-08-01",
                            "end": "2028-08-31",
                            "payment": "2500.00",
                            "interest": "141.38",
                            "liability": "34071.49",
                            "depreciation": "2354.49",
                            "rou_asset": "32963.03"
                          },
                          {
                            "period": 23,
                            "start": "2028-09-01",
                            "end": "2028-09-30",
                            "payment": "2500.00",
                            "interest": "131.55",
                            "liability": "31703.04",
                            "depreciation": "2354.49",
                            "rou_asset": "30608.54"
                          },
                          {
                            "period": 24,
                            "start": "2028-10-01",
                            "end": "2028-10-31",
                            "payment": "2500.00",
                            "interest": "121.68",
                            "liability": "29324.72",
                            "depreciation": "2354.49",
                            "rou_asset": "28254.05"
                          },
                          {
                            "period": 25,
                            "start": "2028-11-01",
                            "end": "2028-11-30",
                            "payment": "2500.00",
                            "interest": "111.77",
                            "liability": "26936.49",
                            "depreciation": "2354.49",
                            "rou_asset": "25899.56"
                          },
                          {
                            "period": 26,
                            "start": "2028-12-01",
                            "end": "2028-12-31",
                            "payment": "2500.00",
                            "interest": "101.82",
                            "liability": "24538.31",
                            "depreciation": "2354.49",
                            "rou_asset": "23545.07"
                          },
                          {
                            "period": 27,
                            "start": "2029-01-01",
                            "end": "2029-01-31",
                            "payment": "2500.00",
                            "interest": "91.83",
                            "liability": "22130.14",
                            "depreciation": "2354.49",
                            "rou_asset": "21190.58"
                          },
                          {
                            "period": 28,
                            "start": "2029-02-01",
                            "end": "2029-02-28",
                            "payment": "2500.00",
                            "interest": "81.79",
                            "liability": "19711.93",
                            "depreciation": "2354.49",
                            "rou_asset": "18836.09"
                          },
                          {
                            "period": 29,
                            "start": "2029-03-01",
                            "end": "2029-03-31",
                            "payment": "2500.00",
                            "interest": "71.72",
                            "liability": "17283.65",
                            "depreciation": "2354.49",
                            "rou_asset": "16481.60"
                          },
                          {
                            "period": 30,
                            "start": "2029-04-01",
                            "end": "2029-04-30",
                            "payment": "2500.00",
                            "interest": "61.60",
                            "liability": "14845.25",
                            "depreciation": "2354.49",
                            "rou_asset": "14127.11"
                          },
                          {
                            "period": 31,
                            "start": "2029-05-01",
                            "end": "2029-05-31",
                            "payment": "2500.00",
                            "interest": "51.44",
                            "liability": "12396.69",
                            "depreciation": "2354.49",
                            "rou_asset": "11772.62"
                          },
                          {
                            "period": 32,
                            "start": "2029-06-01",
                            "end": "2029-06-30",
                            "payment": "2500.00",
                            "interest": "41.24",
                            "liability": "9937.93",
                            "depreciation": "2354.49",
                            "rou_asset": "9418.13"
                          },
                          {
                            "period": 33,
                            "start": "2029-07-01",
                            "end": "2029-07-31",
                            "payment": "2500.00",
                            "interest": "30.99",
                            "liability": "7468.92",
                            "depreciation": "2354.49",
                            "rou_asset": "7063.64"
                          },
                          {
                            "period": 34,
                            "start": "2029-08-01",
                            "end": "2029-08-31",
                            "payment": "2500.00",
                            "interest": "20.70",
                            "liability": "4989.62",
                            "depreciation": "2354.49",
                            "rou_asset": "4709.15"
                          },
                          {
                            "period": 35,
                            "start": "2029-09-01",
                            "end": "2029-09-30",
                            "payment": "2500.00",
                            "interest": "10.37",
                            "liability": "2499.99",
                            "depreciation": "2354.49",
                            "rou_asset": "2354.66"
                          },
                          {
                            "period": 36,
                            "start": "2029-10-01",
                            "end": "2029-10-31",
                            "payment": "2500.00",
                            "interest": "0.01",
                            "liability": "0.00",
                            "depreciation": "2354.66",
                            "rou_asset": "0.00"
                          }
                        ]
                      },
                      "exactness": {
                        "initial_liability": "rounded",
                        "initial_rou_asset": "rounded",
                        "total_payments": "exact",
                        "total_interest": "exact",
                        "rou_asset_end_of_term": "exact",
                        "total_depreciation": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "payment": "2500",
                        "payments_per_year": "12",
                        "number_of_payments": 36,
                        "timing": "advance",
                        "discount_rate_percent": "5",
                        "rate_convention": "nominal",
                        "annual_increase_percent": "0",
                        "end_payment": "0",
                        "initial_direct_costs": "1000",
                        "lease_incentives": "0",
                        "prepaid_payments": "0",
                        "restoration_costs": "0",
                        "commencement_date": "2026-11-01",
                        "schedule_rounding": "ledger"
                      },
                      "formula": "liability = Σ payment × (1 + i)^−t; ROU = liability + paid at start + IDC + restoration − incentives",
                      "references": [
                        {
                          "title": "IFRS 16 Leases, paragraphs 23 to 38",
                          "url": "https://www.ifrs.org/issued-standards/list-of-standards/ifrs-16-leases/"
                        },
                        {
                          "title": "IFRS 16 Illustrative Examples 13 to 18",
                          "url": "https://www.ifrs.org/issued-standards/list-of-standards/ifrs-16-leases/"
                        },
                        {
                          "title": "HMRC Business Leasing Manual BLM18000: lessee accounting example",
                          "url": "https://www.gov.uk/hmrc-internal-manuals/business-leasing-manual/blm18000"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "HMRC BLM18000: £100,000 a year in advance for 10 years at 5%, with a premium and restoration costs",
                    "value": {
                      "calculator": "accounting/lease/ifrs16@1",
                      "result": {
                        "periodic_rate_percent": "5",
                        "initial_liability": "710782",
                        "initial_rou_asset": "840780",
                        "total_payments": "1000000",
                        "total_interest": "189218",
                        "rou_asset_end_of_term": "0",
                        "total_depreciation": "840780",
                        "schedule": [
                          {
                            "period": 1,
                            "start": "2026-01-01",
                            "end": "2026-12-31",
                            "payment": "100000",
                            "interest": "35539",
                            "liability": "746321",
                            "depreciation": "84078",
                            "rou_asset": "756702"
                          },
                          {
                            "period": 2,
                            "start": "2027-01-01",
                            "end": "2027-12-31",
                            "payment": "100000",
                            "interest": "32316",
                            "liability": "678637",
                            "depreciation": "84078",
                            "rou_asset": "672624"
                          },
                          {
                            "period": 3,
                            "start": "2028-01-01",
                            "end": "2028-12-31",
                            "payment": "100000",
                            "interest": "28932",
                            "liability": "607569",
                            "depreciation": "84078",
                            "rou_asset": "588546"
                          },
                          {
                            "period": 4,
                            "start": "2029-01-01",
                            "end": "2029-12-31",
                            "payment": "100000",
                            "interest": "25379",
                            "liability": "532948",
                            "depreciation": "84078",
                            "rou_asset": "504468"
                          },
                          {
                            "period": 5,
                            "start": "2030-01-01",
                            "end": "2030-12-31",
                            "payment": "100000",
                            "interest": "21647",
                            "liability": "454595",
                            "depreciation": "84078",
                            "rou_asset": "420390"
                          },
                          {
                            "period": 6,
                            "start": "2031-01-01",
                            "end": "2031-12-31",
                            "payment": "100000",
                            "interest": "17730",
                            "liability": "372325",
                            "depreciation": "84078",
                            "rou_asset": "336312"
                          },
                          {
                            "period": 7,
                            "start": "2032-01-01",
                            "end": "2032-12-31",
                            "payment": "100000",
                            "interest": "13616",
                            "liability": "285941",
                            "depreciation": "84078",
                            "rou_asset": "252234"
                          },
                          {
                            "period": 8,
                            "start": "2033-01-01",
                            "end": "2033-12-31",
                            "payment": "100000",
                            "interest": "9297",
                            "liability": "195238",
                            "depreciation": "84078",
                            "rou_asset": "168156"
                          },
                          {
                            "period": 9,
                            "start": "2034-01-01",
                            "end": "2034-12-31",
                            "payment": "100000",
                            "interest": "4762",
                            "liability": "100000",
                            "depreciation": "84078",
                            "rou_asset": "84078"
                          },
                          {
                            "period": 10,
                            "start": "2035-01-01",
                            "end": "2035-12-31",
                            "payment": "100000",
                            "interest": "0",
                            "liability": "0",
                            "depreciation": "84078",
                            "rou_asset": "0"
                          }
                        ]
                      },
                      "exactness": {
                        "initial_liability": "rounded",
                        "initial_rou_asset": "rounded",
                        "total_payments": "exact",
                        "total_interest": "exact",
                        "rou_asset_end_of_term": "exact",
                        "total_depreciation": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "payment": "100000",
                        "payments_per_year": "1",
                        "number_of_payments": 10,
                        "timing": "advance",
                        "discount_rate_percent": "5",
                        "rate_convention": "nominal",
                        "annual_increase_percent": "0",
                        "end_payment": "0",
                        "initial_direct_costs": "0",
                        "lease_incentives": "0",
                        "prepaid_payments": "9998",
                        "restoration_costs": "20000",
                        "commencement_date": "2026-01-01",
                        "schedule_rounding": "exact"
                      },
                      "formula": "liability = Σ payment × (1 + i)^−t; ROU = liability + paid at start + IDC + restoration − incentives",
                      "references": [
                        {
                          "title": "IFRS 16 Leases, paragraphs 23 to 38",
                          "url": "https://www.ifrs.org/issued-standards/list-of-standards/ifrs-16-leases/"
                        },
                        {
                          "title": "IFRS 16 Illustrative Examples 13 to 18",
                          "url": "https://www.ifrs.org/issued-standards/list-of-standards/ifrs-16-leases/"
                        },
                        {
                          "title": "HMRC Business Leasing Manual BLM18000: lessee accounting example",
                          "url": "https://www.gov.uk/hmrc-internal-manuals/business-leasing-manual/blm18000"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "accounting/lease/ifrs16@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/billing/discounts": {
      "post": {
        "operationId": "calc_billing_discounts",
        "summary": "Stacked discount calculator",
        "description": "Final price after several percentage and fixed-amount discounts, applied in order like Stripe's stacked coupons, with an optional cap.\n\nApplies a list of discounts to a price, one after another. A percentage discount takes that percentage of the price left after the earlier discounts, so order matters: 20% then 5 off is not the same as 5 off then 20%. This is how Stripe applies several coupons to a subscription. With additive stacking, every percentage is taken from the original price instead, so 20% and 10% make 30% off. Each discount is rounded to the cent when it is applied, the price never goes below 0, and max_total_discount caps the combined discount.",
        "tags": [
          "Billing"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "subtotal": {
                    "description": "The price before discounts. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "100"
                    ]
                  },
                  "discounts": {
                    "description": "The discounts in the order they apply: a percentage such as \"20%\" or an amount off such as \"5\" (in the subtotal's currency). 1 to 20 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 40
                    },
                    "minItems": 1,
                    "maxItems": 20,
                    "examples": [
                      [
                        "20%",
                        "5"
                      ]
                    ]
                  },
                  "stacking": {
                    "description": "How percentage discounts combine. Options: sequential: each discount applies to the price left after the earlier ones (Stripe's stacked coupons); additive: each percentage is taken from the original subtotal",
                    "type": "string",
                    "enum": [
                      "sequential",
                      "additive"
                    ],
                    "default": "sequential"
                  },
                  "max_total_discount": {
                    "description": "Optional cap on the combined discount, like Stripe's \"percent off up to maximum\" coupon. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_up."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_up, decimals=2)."
                  }
                },
                "required": [
                  "subtotal",
                  "discounts"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "100 with 20% off, then 5 off",
                  "value": {
                    "subtotal": "100",
                    "discounts": [
                      "20%",
                      "5"
                    ]
                  }
                },
                "example2": {
                  "summary": "100 with 5 off, then 20% off",
                  "value": {
                    "subtotal": "100",
                    "discounts": [
                      "5",
                      "20%"
                    ]
                  }
                },
                "example3": {
                  "summary": "Stripe example: 20% off up to 50 on 400",
                  "value": {
                    "subtotal": "400",
                    "discounts": [
                      "20%"
                    ],
                    "max_total_discount": "50"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "billing/discounts@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "description": "The price after all discounts (never below 0). Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_discount": {
                          "description": "subtotal − total. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "steps": {
                          "description": "Each discount in order.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "step": {
                                "description": "Order in which the discount was applied, starting at 1.",
                                "type": "integer"
                              },
                              "discount": {
                                "description": "The discount as given: a percentage or an amount.",
                                "type": "string"
                              },
                              "amount_off": {
                                "description": "What this discount took off. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "price_after": {
                                "description": "The price after this discount. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "step",
                              "discount",
                              "amount_off",
                              "price_after"
                            ]
                          }
                        }
                      },
                      "required": [
                        "total",
                        "total_discount",
                        "steps"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "100 with 20% off, then 5 off",
                    "value": {
                      "calculator": "billing/discounts@1",
                      "result": {
                        "total": "75.00",
                        "total_discount": "25.00",
                        "steps": [
                          {
                            "step": 1,
                            "discount": "20%",
                            "amount_off": "20.00",
                            "price_after": "80.00"
                          },
                          {
                            "step": 2,
                            "discount": "5",
                            "amount_off": "5.00",
                            "price_after": "75.00"
                          }
                        ]
                      },
                      "exactness": {
                        "total": "exact",
                        "total_discount": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "subtotal": "100",
                        "discounts": [
                          "20%",
                          "5"
                        ],
                        "stacking": "sequential"
                      },
                      "formula": "for each discount in order: off = round(p% × price left) or min(amount, price left); price left −= off; the combined discount is at most max_total_discount",
                      "references": [
                        {
                          "title": "Stripe: Stackable coupons and promotion codes (order of percent_off and amount_off matters)",
                          "url": "https://docs.stripe.com/billing/subscriptions/coupons"
                        },
                        {
                          "title": "Stripe API: Create a coupon (amount_off larger than the subtotal gives 0)",
                          "url": "https://docs.stripe.com/api/coupons/create"
                        },
                        {
                          "title": "Stripe: Percent off up to maximum (20% off up to 50 USD)",
                          "url": "https://docs.stripe.com/billing/scripts/stripe-authored/discount-calculation"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "100 with 5 off, then 20% off",
                    "value": {
                      "calculator": "billing/discounts@1",
                      "result": {
                        "total": "76.00",
                        "total_discount": "24.00",
                        "steps": [
                          {
                            "step": 1,
                            "discount": "5",
                            "amount_off": "5.00",
                            "price_after": "95.00"
                          },
                          {
                            "step": 2,
                            "discount": "20%",
                            "amount_off": "19.00",
                            "price_after": "76.00"
                          }
                        ]
                      },
                      "exactness": {
                        "total": "exact",
                        "total_discount": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "subtotal": "100",
                        "discounts": [
                          "5",
                          "20%"
                        ],
                        "stacking": "sequential"
                      },
                      "formula": "for each discount in order: off = round(p% × price left) or min(amount, price left); price left −= off; the combined discount is at most max_total_discount",
                      "references": [
                        {
                          "title": "Stripe: Stackable coupons and promotion codes (order of percent_off and amount_off matters)",
                          "url": "https://docs.stripe.com/billing/subscriptions/coupons"
                        },
                        {
                          "title": "Stripe API: Create a coupon (amount_off larger than the subtotal gives 0)",
                          "url": "https://docs.stripe.com/api/coupons/create"
                        },
                        {
                          "title": "Stripe: Percent off up to maximum (20% off up to 50 USD)",
                          "url": "https://docs.stripe.com/billing/scripts/stripe-authored/discount-calculation"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Stripe example: 20% off up to 50 on 400",
                    "value": {
                      "calculator": "billing/discounts@1",
                      "result": {
                        "total": "350.00",
                        "total_discount": "50.00",
                        "steps": [
                          {
                            "step": 1,
                            "discount": "20%",
                            "amount_off": "50.00",
                            "price_after": "350.00"
                          }
                        ]
                      },
                      "exactness": {
                        "total": "exact",
                        "total_discount": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "subtotal": "400",
                        "discounts": [
                          "20%"
                        ],
                        "stacking": "sequential",
                        "max_total_discount": "50"
                      },
                      "formula": "for each discount in order: off = round(p% × price left) or min(amount, price left); price left −= off; the combined discount is at most max_total_discount",
                      "references": [
                        {
                          "title": "Stripe: Stackable coupons and promotion codes (order of percent_off and amount_off matters)",
                          "url": "https://docs.stripe.com/billing/subscriptions/coupons"
                        },
                        {
                          "title": "Stripe API: Create a coupon (amount_off larger than the subtotal gives 0)",
                          "url": "https://docs.stripe.com/api/coupons/create"
                        },
                        {
                          "title": "Stripe: Percent off up to maximum (20% off up to 50 USD)",
                          "url": "https://docs.stripe.com/billing/scripts/stripe-authored/discount-calculation"
                        }
                      ],
                      "warnings": [
                        {
                          "code": "DISCOUNT_CAPPED",
                          "message": "The discounts are capped at 50.00 in total."
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "billing/discounts@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/billing/proration": {
      "post": {
        "operationId": "calc_billing_proration",
        "summary": "Subscription proration calculator",
        "description": "Credit for unused time and charge for the remaining time when a subscription changes plan mid-period, prorated to the second like Stripe, or by hour, day or week.\n\nWhen a customer changes plan part-way through a billing period, they are credited the unused part of what they paid for the old plan and charged the remaining part of the new one. Both are the full-period amount times the fraction of the period left: (period end − change time) ÷ (period end − period start). By default this is exact to the second, as Stripe and Chargebee prorate; with an hour, day or week granularity the change time first moves to a boundary counted from the period start, like Stripe's custom-interval proration. The credit and the charge are each rounded, and the net is charge minus credit, as on the invoice.",
        "tags": [
          "Billing"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "period_start": {
                    "description": "Start of the current billing period, ISO 8601 (2026-04-01T00:00:00Z). A time without an offset is read as UTC.",
                    "type": "string",
                    "format": "date-time",
                    "examples": [
                      "2026-04-01T00:00:00Z"
                    ]
                  },
                  "period_end": {
                    "description": "End of the current billing period (the next renewal).",
                    "type": "string",
                    "format": "date-time",
                    "examples": [
                      "2026-05-01T00:00:00Z"
                    ]
                  },
                  "change_at": {
                    "description": "When the plan changes (Stripe's proration_date). Must be within the period.",
                    "type": "string",
                    "format": "date-time",
                    "examples": [
                      "2026-04-11T06:00:00Z"
                    ]
                  },
                  "old_amount": {
                    "description": "What the old plan costs for a full period (price × quantity, after discounts). In Stripe's flexible billing mode, use what was actually billed for the period. 0 when adding a new item. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "30"
                    ]
                  },
                  "new_amount": {
                    "description": "What the new plan costs for a full period. 0 when cancelling or removing an item. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "60"
                    ]
                  },
                  "granularity": {
                    "description": "Unit of time the proration is counted in. Options: exact: to the second (to the microsecond if the times have one), as Stripe and Chargebee do by default; hour: whole hours from the period start; day: whole days from the period start; week: whole weeks from the period start",
                    "type": "string",
                    "enum": [
                      "exact",
                      "hour",
                      "day",
                      "week"
                    ],
                    "default": "exact"
                  },
                  "snap": {
                    "description": "With an hour, day or week granularity, which boundary the change time moves to. Options: nearest: the closer boundary; exactly halfway goes to the later one; up: the next boundary: the old plan runs for the whole unit; down: the previous boundary: the new plan applies for the whole unit",
                    "type": "string",
                    "enum": [
                      "nearest",
                      "up",
                      "down"
                    ],
                    "default": "nearest"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_up."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_up, decimals=2)."
                  }
                },
                "required": [
                  "period_start",
                  "period_end",
                  "change_at",
                  "old_amount",
                  "new_amount"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Stripe example: $30 to $60 on April 11 at 6:00, prorated to the second",
                  "value": {
                    "period_start": "2026-04-01T00:00:00Z",
                    "period_end": "2026-05-01T00:00:00Z",
                    "change_at": "2026-04-11T06:00:00Z",
                    "old_amount": "30",
                    "new_amount": "60"
                  }
                },
                "example2": {
                  "summary": "The same change prorated by day (nearest day boundary)",
                  "value": {
                    "period_start": "2026-04-01T00:00:00Z",
                    "period_end": "2026-05-01T00:00:00Z",
                    "change_at": "2026-04-11T06:00:00Z",
                    "old_amount": "30",
                    "new_amount": "60",
                    "granularity": "day"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "billing/proration@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "credit": {
                          "description": "Credit for the unused time on the old plan (a positive number; the invoice shows it as a negative line). Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "charge": {
                          "description": "Charge for the remaining time on the new plan. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "net": {
                          "description": "charge − credit: what the change adds to the invoice (negative: a credit). Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "remaining_fraction": {
                          "description": "Exact fraction of the period left after the change, as a decimal or p/q.",
                          "type": "string"
                        },
                        "remaining_seconds": {
                          "description": "Seconds from the change to the period end.",
                          "type": "string"
                        },
                        "period_seconds": {
                          "description": "Length of the billing period in seconds.",
                          "type": "string"
                        },
                        "effective_change_at": {
                          "description": "The change time used, in UTC: change_at, or the boundary it moved to.",
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "credit",
                        "charge",
                        "net",
                        "remaining_fraction",
                        "remaining_seconds",
                        "period_seconds",
                        "effective_change_at"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Stripe example: $30 to $60 on April 11 at 6:00, prorated to the second",
                    "value": {
                      "calculator": "billing/proration@1",
                      "result": {
                        "credit": "19.75",
                        "charge": "39.50",
                        "net": "19.75",
                        "remaining_fraction": "79/120",
                        "remaining_seconds": "1706400",
                        "period_seconds": "2592000",
                        "effective_change_at": "2026-04-11T06:00:00+00:00"
                      },
                      "exactness": {
                        "credit": "exact",
                        "charge": "exact",
                        "net": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "period_start": "2026-04-01T00:00:00+00:00",
                        "period_end": "2026-05-01T00:00:00+00:00",
                        "change_at": "2026-04-11T06:00:00+00:00",
                        "old_amount": "30",
                        "new_amount": "60",
                        "granularity": "exact",
                        "snap": "nearest"
                      },
                      "formula": "f = (period_end − change) ÷ (period_end − period_start); credit = old × f; charge = new × f; each rounded; net = charge − credit",
                      "references": [
                        {
                          "title": "Stripe: Prorations (by the second; preview invoice example)",
                          "url": "https://docs.stripe.com/billing/subscriptions/prorations"
                        },
                        {
                          "title": "Stripe: Prorate by custom interval (hour, day or week; rounding to boundaries)",
                          "url": "https://docs.stripe.com/billing/scripts/stripe-authored/proration"
                        },
                        {
                          "title": "Chargebee: Proration (millisecond- and day-based)",
                          "url": "https://www.chargebee.com/docs/billing/2.0/subscriptions/proration"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "The same change prorated by day (nearest day boundary)",
                    "value": {
                      "calculator": "billing/proration@1",
                      "result": {
                        "credit": "20.00",
                        "charge": "40.00",
                        "net": "20.00",
                        "remaining_fraction": "2/3",
                        "remaining_seconds": "1728000",
                        "period_seconds": "2592000",
                        "effective_change_at": "2026-04-11T00:00:00+00:00"
                      },
                      "exactness": {
                        "credit": "exact",
                        "charge": "exact",
                        "net": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "period_start": "2026-04-01T00:00:00+00:00",
                        "period_end": "2026-05-01T00:00:00+00:00",
                        "change_at": "2026-04-11T06:00:00+00:00",
                        "old_amount": "30",
                        "new_amount": "60",
                        "granularity": "day",
                        "snap": "nearest"
                      },
                      "formula": "f = (period_end − change) ÷ (period_end − period_start); credit = old × f; charge = new × f; each rounded; net = charge − credit",
                      "references": [
                        {
                          "title": "Stripe: Prorations (by the second; preview invoice example)",
                          "url": "https://docs.stripe.com/billing/subscriptions/prorations"
                        },
                        {
                          "title": "Stripe: Prorate by custom interval (hour, day or week; rounding to boundaries)",
                          "url": "https://docs.stripe.com/billing/scripts/stripe-authored/proration"
                        },
                        {
                          "title": "Chargebee: Proration (millisecond- and day-based)",
                          "url": "https://www.chargebee.com/docs/billing/2.0/subscriptions/proration"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "billing/proration@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/billing/tiered-price": {
      "post": {
        "operationId": "calc_billing_tiered_price",
        "summary": "Tiered pricing calculator",
        "description": "Price of a quantity under graduated or volume tiers, with optional flat fees, exactly as Stripe bills tiered prices.\n\nPrices a quantity (seats, API calls, gigabytes) on a tiered price list. With graduated tiers, each unit is charged at the price of the tier it falls in, so 12 units on tiers of 5 are charged 5 at the first price, 5 at the second and 2 at the third. With volume tiers, every unit is charged at the price of the tier the whole quantity lands in. A tier can also have a flat fee: graduated pricing charges the flat fee of every tier it reaches, volume pricing only that of the tier it lands in. The tiers table shows how the total is made up.",
        "tags": [
          "Billing"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "quantity": {
                    "description": "Number of units to price (whole or decimal, for metered usage). Allowed: >= 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "12"
                    ]
                  },
                  "pricing_model": {
                    "description": "How the tiers apply. Options: graduated: each tier's units at that tier's price, summed (Stripe tiers_mode=graduated); volume: all units at the price of the tier the quantity lands in (Stripe tiers_mode=volume)",
                    "type": "string",
                    "enum": [
                      "graduated",
                      "volume"
                    ],
                    "examples": [
                      "graduated"
                    ]
                  },
                  "tier_up_to": {
                    "description": "Upper limit of each tier except the last, inclusive and increasing. The first tier covers 0 up to the first limit, the next tier starts just above it, and the last tier has no limit (Stripe's up_to=inf), so give one item fewer than tier_unit_price. Omit it for a single tier. Up to 99 items. Each item: > 0 and <= 1000000000000000.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 0,
                    "maxItems": 99,
                    "examples": [
                      [
                        "5",
                        "10"
                      ]
                    ]
                  },
                  "tier_unit_price": {
                    "description": "Price per unit in each tier, first tier first (any number of decimals, like Stripe's unit_amount_decimal). 1 to 100 items. Each item: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 1,
                    "maxItems": 100,
                    "examples": [
                      [
                        "7",
                        "6.5",
                        "6"
                      ]
                    ]
                  },
                  "tier_flat_fee": {
                    "description": "Flat fee of each tier, one per tier like tier_unit_price (Stripe's flat_amount). Omit it for no flat fees. Up to 100 items. Each item: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 0,
                    "maxItems": 100
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_up."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_up, decimals=2)."
                  }
                },
                "required": [
                  "quantity",
                  "pricing_model",
                  "tier_unit_price"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Stripe example, graduated: 20 units on 1–5 at $7, 6–10 at $6.50, 11+ at $6",
                  "value": {
                    "quantity": "20",
                    "pricing_model": "graduated",
                    "tier_up_to": [
                      "5",
                      "10"
                    ],
                    "tier_unit_price": [
                      "7",
                      "6.5",
                      "6"
                    ]
                  }
                },
                "example2": {
                  "summary": "Stripe example, volume: 20 units on the same tiers",
                  "value": {
                    "quantity": "20",
                    "pricing_model": "volume",
                    "tier_up_to": [
                      "5",
                      "10"
                    ],
                    "tier_unit_price": [
                      "7",
                      "6.5",
                      "6"
                    ]
                  }
                },
                "example3": {
                  "summary": "Stripe example with flat fees, graduated: 12 units",
                  "value": {
                    "quantity": "12",
                    "pricing_model": "graduated",
                    "tier_up_to": [
                      "5",
                      "10",
                      "15",
                      "20"
                    ],
                    "tier_unit_price": [
                      "5",
                      "4",
                      "3",
                      "2",
                      "1"
                    ],
                    "tier_flat_fee": [
                      "10",
                      "20",
                      "30",
                      "40",
                      "50"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "billing/tiered-price@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "description": "The price of the quantity, rounded once. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "tier": {
                          "description": "The tier the quantity lands in (volume) or the highest tier it reaches (graduated).",
                          "type": "integer"
                        },
                        "tiers": {
                          "description": "Each tier that is charged: one row for volume pricing, every tier reached for graduated pricing.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tier": {
                                "description": "Tier number, starting at 1.",
                                "type": "integer"
                              },
                              "above": {
                                "description": "The tier starts above this quantity (exact).",
                                "type": "string"
                              },
                              "up_to": {
                                "description": "The tier ends at this quantity, inclusive; inf for the last tier.",
                                "type": "string"
                              },
                              "units": {
                                "description": "Units charged at this tier's price (exact).",
                                "type": "string"
                              },
                              "unit_price": {
                                "description": "This tier's price per unit, as given.",
                                "type": "string"
                              },
                              "flat_fee": {
                                "description": "This tier's flat fee, as given.",
                                "type": "string"
                              },
                              "amount": {
                                "description": "units × unit_price + flat_fee, rounded. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "tier",
                              "above",
                              "up_to",
                              "units",
                              "unit_price",
                              "flat_fee",
                              "amount"
                            ]
                          }
                        }
                      },
                      "required": [
                        "total",
                        "tier",
                        "tiers"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Stripe example, graduated: 20 units on 1–5 at $7, 6–10 at $6.50, 11+ at $6",
                    "value": {
                      "calculator": "billing/tiered-price@1",
                      "result": {
                        "total": "127.50",
                        "tier": 3,
                        "tiers": [
                          {
                            "tier": 1,
                            "above": "0",
                            "up_to": "5",
                            "units": "5",
                            "unit_price": "7",
                            "flat_fee": "0",
                            "amount": "35.00"
                          },
                          {
                            "tier": 2,
                            "above": "5",
                            "up_to": "10",
                            "units": "5",
                            "unit_price": "6.5",
                            "flat_fee": "0",
                            "amount": "32.50"
                          },
                          {
                            "tier": 3,
                            "above": "10",
                            "up_to": "inf",
                            "units": "10",
                            "unit_price": "6",
                            "flat_fee": "0",
                            "amount": "60.00"
                          }
                        ]
                      },
                      "exactness": {
                        "total": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "quantity": "20",
                        "pricing_model": "graduated",
                        "tier_up_to": [
                          "5",
                          "10"
                        ],
                        "tier_unit_price": [
                          "7",
                          "6.5",
                          "6"
                        ]
                      },
                      "formula": "graduated: Σ over tiers reached (min(q, up_to_k) − up_to_(k−1)) × price_k + fee_k; volume: q × price_k + fee_k for the first tier with q ≤ up_to_k",
                      "references": [
                        {
                          "title": "Stripe: Set up tiered pricing (volume and graduated tiers, flat amounts, quantity 0)",
                          "url": "https://docs.stripe.com/subscriptions/pricing-models/tiered-pricing"
                        },
                        {
                          "title": "Stripe API: Price tiers (up_to, unit_amount_decimal, flat_amount)",
                          "url": "https://docs.stripe.com/api/prices/object"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Stripe example, volume: 20 units on the same tiers",
                    "value": {
                      "calculator": "billing/tiered-price@1",
                      "result": {
                        "total": "120.00",
                        "tier": 3,
                        "tiers": [
                          {
                            "tier": 3,
                            "above": "10",
                            "up_to": "inf",
                            "units": "20",
                            "unit_price": "6",
                            "flat_fee": "0",
                            "amount": "120.00"
                          }
                        ]
                      },
                      "exactness": {
                        "total": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "quantity": "20",
                        "pricing_model": "volume",
                        "tier_up_to": [
                          "5",
                          "10"
                        ],
                        "tier_unit_price": [
                          "7",
                          "6.5",
                          "6"
                        ]
                      },
                      "formula": "graduated: Σ over tiers reached (min(q, up_to_k) − up_to_(k−1)) × price_k + fee_k; volume: q × price_k + fee_k for the first tier with q ≤ up_to_k",
                      "references": [
                        {
                          "title": "Stripe: Set up tiered pricing (volume and graduated tiers, flat amounts, quantity 0)",
                          "url": "https://docs.stripe.com/subscriptions/pricing-models/tiered-pricing"
                        },
                        {
                          "title": "Stripe API: Price tiers (up_to, unit_amount_decimal, flat_amount)",
                          "url": "https://docs.stripe.com/api/prices/object"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Stripe example with flat fees, graduated: 12 units",
                    "value": {
                      "calculator": "billing/tiered-price@1",
                      "result": {
                        "total": "111.00",
                        "tier": 3,
                        "tiers": [
                          {
                            "tier": 1,
                            "above": "0",
                            "up_to": "5",
                            "units": "5",
                            "unit_price": "5",
                            "flat_fee": "10",
                            "amount": "35.00"
                          },
                          {
                            "tier": 2,
                            "above": "5",
                            "up_to": "10",
                            "units": "5",
                            "unit_price": "4",
                            "flat_fee": "20",
                            "amount": "40.00"
                          },
                          {
                            "tier": 3,
                            "above": "10",
                            "up_to": "15",
                            "units": "2",
                            "unit_price": "3",
                            "flat_fee": "30",
                            "amount": "36.00"
                          }
                        ]
                      },
                      "exactness": {
                        "total": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "quantity": "12",
                        "pricing_model": "graduated",
                        "tier_up_to": [
                          "5",
                          "10",
                          "15",
                          "20"
                        ],
                        "tier_unit_price": [
                          "5",
                          "4",
                          "3",
                          "2",
                          "1"
                        ],
                        "tier_flat_fee": [
                          "10",
                          "20",
                          "30",
                          "40",
                          "50"
                        ]
                      },
                      "formula": "graduated: Σ over tiers reached (min(q, up_to_k) − up_to_(k−1)) × price_k + fee_k; volume: q × price_k + fee_k for the first tier with q ≤ up_to_k",
                      "references": [
                        {
                          "title": "Stripe: Set up tiered pricing (volume and graduated tiers, flat amounts, quantity 0)",
                          "url": "https://docs.stripe.com/subscriptions/pricing-models/tiered-pricing"
                        },
                        {
                          "title": "Stripe API: Price tiers (up_to, unit_amount_decimal, flat_amount)",
                          "url": "https://docs.stripe.com/api/prices/object"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "billing/tiered-price@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/check/abn": {
      "post": {
        "operationId": "calc_check_abn",
        "summary": "Australian Business Number (ABN) check",
        "description": "Check an 11-digit Australian Business Number with the Australian Business Register's modulus 89 rule.\n\nChecks an Australian Business Number the way the Australian Business Register describes: subtract 1 from the first digit, multiply the eleven digits by the weights 10, 1, 3, 5, 7, 9, 11, 13, 15, 17 and 19, and the total must divide by 89.",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "description": "The 11-digit ABN. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.",
                    "type": "string",
                    "maxLength": 64,
                    "examples": [
                      "51 824 753 556"
                    ]
                  }
                },
                "required": [
                  "number"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "The Australian Business Register's own example",
                  "value": {
                    "number": "51 824 753 556"
                  }
                },
                "example2": {
                  "summary": "One digit wrong",
                  "value": {
                    "number": "51 824 753 557"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "check/abn@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "description": "Whether the ABN passes every check.",
                          "type": "boolean"
                        },
                        "normalized": {
                          "description": "The number as it was checked: separators removed, letters in upper case.",
                          "type": "string"
                        },
                        "problem": {
                          "description": "What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.",
                          "type": "string"
                        },
                        "message": {
                          "description": "The result in a sentence, naming the rule that failed.",
                          "type": "string"
                        },
                        "formatted": {
                          "description": "The ABN grouped 2-3-3-3.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "valid",
                        "normalized",
                        "message"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "The Australian Business Register's own example",
                    "value": {
                      "calculator": "check/abn@1",
                      "result": {
                        "valid": true,
                        "normalized": "51824753556",
                        "message": "A well-formed ABN.",
                        "formatted": "51 824 753 556"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "51 824 753 556"
                      },
                      "formula": "((d₁ − 1)·10 + d₂·1 + d₃·3 + d₄·5 + … + d₁₁·19) mod 89 = 0",
                      "references": [
                        {
                          "title": "Australian Business Register: format of the ABN",
                          "url": "https://abr.business.gov.au/Help/AbnFormat"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "One digit wrong",
                    "value": {
                      "calculator": "check/abn@1",
                      "result": {
                        "valid": false,
                        "normalized": "51824753557",
                        "problem": "CHECK_DIGIT",
                        "message": "The digits do not pass the Australian Business Register's modulus 89 check.",
                        "formatted": "51 824 753 557"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "51 824 753 557"
                      },
                      "formula": "((d₁ − 1)·10 + d₂·1 + d₃·3 + d₄·5 + … + d₁₁·19) mod 89 = 0",
                      "references": [
                        {
                          "title": "Australian Business Register: format of the ABN",
                          "url": "https://abr.business.gov.au/Help/AbnFormat"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "check/abn@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/check/bic": {
      "post": {
        "operationId": "calc_check_bic",
        "summary": "BIC (SWIFT code) check",
        "description": "Check the structure of a BIC (SWIFT code) under ISO 9362 and split it into party, country and branch.\n\nChecks a Business Identifier Code as ISO 9362 defines it: 8 or 11 characters, a four-character party prefix, a two-letter ISO 3166 country code, a two-character party suffix and an optional three-character branch. A BIC has no check digit, so the structure and the country code are all that can be tested without the SWIFT directory.",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "description": "The BIC to check, 8 or 11 characters. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.",
                    "type": "string",
                    "maxLength": 64,
                    "examples": [
                      "DEUTDEFF500"
                    ]
                  }
                },
                "required": [
                  "number"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "An 11-character BIC with a branch",
                  "value": {
                    "number": "DEUTDEFF500"
                  }
                },
                "example2": {
                  "summary": "Not a country code",
                  "value": {
                    "number": "ABCDZZ22"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "check/bic@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "description": "Whether the BIC passes every check.",
                          "type": "boolean"
                        },
                        "normalized": {
                          "description": "The number as it was checked: separators removed, letters in upper case.",
                          "type": "string"
                        },
                        "problem": {
                          "description": "What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.",
                          "type": "string"
                        },
                        "message": {
                          "description": "The result in a sentence, naming the rule that failed.",
                          "type": "string"
                        },
                        "party_prefix": {
                          "description": "Characters 1 to 4.",
                          "type": "string"
                        },
                        "country": {
                          "description": "Characters 5 and 6.",
                          "type": "string"
                        },
                        "country_name": {
                          "description": "The country's name.",
                          "type": "string"
                        },
                        "party_suffix": {
                          "description": "Characters 7 and 8.",
                          "type": "string"
                        },
                        "branch": {
                          "description": "Characters 9 to 11, when given.",
                          "type": "string"
                        },
                        "bic8": {
                          "description": "The first eight characters.",
                          "type": "string"
                        },
                        "primary_office": {
                          "description": "True when there is no branch code or it is XXX.",
                          "type": "boolean"
                        },
                        "test_bic": {
                          "description": "True when the eighth character is 0, which SWIFT uses for test and training BICs.",
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "valid",
                        "normalized",
                        "message"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "An 11-character BIC with a branch",
                    "value": {
                      "calculator": "check/bic@1",
                      "result": {
                        "valid": true,
                        "normalized": "DEUTDEFF500",
                        "message": "A well-formed BIC for Germany.",
                        "party_prefix": "DEUT",
                        "country": "DE",
                        "country_name": "Germany",
                        "party_suffix": "FF",
                        "branch": "500",
                        "bic8": "DEUTDEFF",
                        "primary_office": false,
                        "test_bic": false
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "DEUTDEFF500"
                      },
                      "formula": "4 characters (party prefix) + 2 letters (ISO 3166 country) + 2 characters (party suffix) + optional 3 characters (branch)",
                      "references": [
                        {
                          "title": "ISO 9362:2022 Banking: Business identifier code (BIC)",
                          "url": "https://www.iso.org/standard/84108.html"
                        },
                        {
                          "title": "SWIFT: Business Identifier Code (BIC)",
                          "url": "https://www.swift.com/standards/data-standards/bic-business-identifier-code"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Not a country code",
                    "value": {
                      "calculator": "check/bic@1",
                      "result": {
                        "valid": false,
                        "normalized": "ABCDZZ22",
                        "problem": "COUNTRY",
                        "message": "ZZ (characters 5 and 6) is not an ISO 3166 country code."
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "ABCDZZ22"
                      },
                      "formula": "4 characters (party prefix) + 2 letters (ISO 3166 country) + 2 characters (party suffix) + optional 3 characters (branch)",
                      "references": [
                        {
                          "title": "ISO 9362:2022 Banking: Business identifier code (BIC)",
                          "url": "https://www.iso.org/standard/84108.html"
                        },
                        {
                          "title": "SWIFT: Business Identifier Code (BIC)",
                          "url": "https://www.swift.com/standards/data-standards/bic-business-identifier-code"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "check/bic@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/check/cusip": {
      "post": {
        "operationId": "calc_check_cusip",
        "summary": "CUSIP check",
        "description": "Check the length and check digit of a CUSIP and split it into issuer, issue and check digit.\n\nChecks a nine-character CUSIP, the identifier of US and Canadian securities: six characters for the issuer, two for the issue and a check digit worked out with the CUSIP form of the Luhn rule (the 'modulus 10 double-add-double' method).",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "description": "The nine-character CUSIP. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.",
                    "type": "string",
                    "maxLength": 64,
                    "examples": [
                      "037833100"
                    ]
                  }
                },
                "required": [
                  "number"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Apple Inc. common stock",
                  "value": {
                    "number": "037833100"
                  }
                },
                "example2": {
                  "summary": "Wrong check digit",
                  "value": {
                    "number": "037833108"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "check/cusip@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "description": "Whether the CUSIP passes every check.",
                          "type": "boolean"
                        },
                        "normalized": {
                          "description": "The number as it was checked: separators removed, letters in upper case.",
                          "type": "string"
                        },
                        "problem": {
                          "description": "What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.",
                          "type": "string"
                        },
                        "message": {
                          "description": "The result in a sentence, naming the rule that failed.",
                          "type": "string"
                        },
                        "issuer": {
                          "description": "Characters 1 to 6.",
                          "type": "string"
                        },
                        "issue": {
                          "description": "Characters 7 and 8.",
                          "type": "string"
                        },
                        "check_digit": {
                          "description": "The ninth character.",
                          "type": "string"
                        },
                        "expected_check_digit": {
                          "description": "The check digit the first eight characters give.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "valid",
                        "normalized",
                        "message"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Apple Inc. common stock",
                    "value": {
                      "calculator": "check/cusip@1",
                      "result": {
                        "valid": true,
                        "normalized": "037833100",
                        "message": "A well-formed CUSIP.",
                        "issuer": "037833",
                        "issue": "10",
                        "check_digit": "0",
                        "expected_check_digit": "0"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "037833100"
                      },
                      "formula": "value each character (digits as they are, A = 10 … Z = 35, * = 36, @ = 37, # = 38), double every second value, add the digits of all values; check digit = (10 − total mod 10) mod 10",
                      "references": [
                        {
                          "title": "CUSIP Global Services: about CUSIP identifiers",
                          "url": "https://www.cusip.com/identifiers.html"
                        },
                        {
                          "title": "CUSIP: check digit calculation",
                          "url": "https://en.wikipedia.org/wiki/CUSIP"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Wrong check digit",
                    "value": {
                      "calculator": "check/cusip@1",
                      "result": {
                        "valid": false,
                        "normalized": "037833108",
                        "problem": "CHECK_DIGIT",
                        "message": "The check digit is 8, but the first eight characters give 0.",
                        "issuer": "037833",
                        "issue": "10",
                        "check_digit": "8",
                        "expected_check_digit": "0"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "037833108"
                      },
                      "formula": "value each character (digits as they are, A = 10 … Z = 35, * = 36, @ = 37, # = 38), double every second value, add the digits of all values; check digit = (10 − total mod 10) mod 10",
                      "references": [
                        {
                          "title": "CUSIP Global Services: about CUSIP identifiers",
                          "url": "https://www.cusip.com/identifiers.html"
                        },
                        {
                          "title": "CUSIP: check digit calculation",
                          "url": "https://en.wikipedia.org/wiki/CUSIP"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "check/cusip@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/check/iban": {
      "post": {
        "operationId": "calc_check_iban",
        "summary": "IBAN check",
        "description": "Check an IBAN's country, length, structure and check digits against the SWIFT IBAN registry, and say exactly what is wrong.\n\nChecks an International Bank Account Number the way ISO 13616 defines it: the country code must be in the SWIFT IBAN registry, the length and the structure of the account part (BBAN) must be the ones registered for that country, and the two check digits must be the ones MOD 97-10 gives. When a check fails, the answer names it, and for a wrong check digit it gives the digits the rest of the number calls for.",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "description": "The IBAN to check. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.",
                    "type": "string",
                    "maxLength": 64,
                    "examples": [
                      "GB82 WEST 1234 5698 7654 32"
                    ]
                  }
                },
                "required": [
                  "number"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "The registry's United Kingdom example",
                  "value": {
                    "number": "GB29 NWBK 6016 1331 9268 19"
                  }
                },
                "example2": {
                  "summary": "A mistyped digit",
                  "value": {
                    "number": "DE89 3704 0044 0532 0130 01"
                  }
                },
                "example3": {
                  "summary": "Too short for the country",
                  "value": {
                    "number": "NL91 ABNA 0417 1643"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "check/iban@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "description": "Whether the IBAN passes every check.",
                          "type": "boolean"
                        },
                        "normalized": {
                          "description": "The number as it was checked: separators removed, letters in upper case.",
                          "type": "string"
                        },
                        "problem": {
                          "description": "What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.",
                          "type": "string"
                        },
                        "message": {
                          "description": "The result in a sentence, naming the rule that failed.",
                          "type": "string"
                        },
                        "country": {
                          "description": "The ISO 3166 country code.",
                          "type": "string"
                        },
                        "country_name": {
                          "description": "The country's name in the registry.",
                          "type": "string"
                        },
                        "check_digits": {
                          "description": "Characters 3 and 4.",
                          "type": "string"
                        },
                        "expected_check_digits": {
                          "description": "The check digits ISO 13616 gives the country code and BBAN.",
                          "type": "string"
                        },
                        "bban": {
                          "description": "The Basic Bank Account Number: everything after the check digits.",
                          "type": "string"
                        },
                        "formatted": {
                          "description": "The IBAN in groups of four.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "valid",
                        "normalized",
                        "message"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "The registry's United Kingdom example",
                    "value": {
                      "calculator": "check/iban@1",
                      "result": {
                        "valid": true,
                        "normalized": "GB29NWBK60161331926819",
                        "message": "A well-formed IBAN from United Kingdom.",
                        "country": "GB",
                        "country_name": "United Kingdom",
                        "check_digits": "29",
                        "expected_check_digits": "29",
                        "bban": "NWBK60161331926819",
                        "formatted": "GB29 NWBK 6016 1331 9268 19"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "GB29 NWBK 6016 1331 9268 19"
                      },
                      "formula": "move the first four characters to the end, read A as 10 … Z as 35, and the number must leave remainder 1 when divided by 97; check digits = 98 − (BBAN + country + 00) mod 97",
                      "references": [
                        {
                          "title": "SWIFT IBAN Registry, release 103 (September 2026) (ISO 13616)",
                          "url": "https://www.swift.com/resource/iban-registry-pdf"
                        },
                        {
                          "title": "ISO 13616-1:2020 Financial services: International bank account number (IBAN)",
                          "url": "https://www.iso.org/standard/81090.html"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "A mistyped digit",
                    "value": {
                      "calculator": "check/iban@1",
                      "result": {
                        "valid": false,
                        "normalized": "DE89370400440532013001",
                        "problem": "CHECK_DIGIT",
                        "message": "The check digits are 89, but this country code and account number give 62 (ISO 13616, MOD 97-10). One or more characters are wrong.",
                        "country": "DE",
                        "country_name": "Germany",
                        "check_digits": "89",
                        "expected_check_digits": "62",
                        "bban": "370400440532013001",
                        "formatted": "DE89 3704 0044 0532 0130 01"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "DE89 3704 0044 0532 0130 01"
                      },
                      "formula": "move the first four characters to the end, read A as 10 … Z as 35, and the number must leave remainder 1 when divided by 97; check digits = 98 − (BBAN + country + 00) mod 97",
                      "references": [
                        {
                          "title": "SWIFT IBAN Registry, release 103 (September 2026) (ISO 13616)",
                          "url": "https://www.swift.com/resource/iban-registry-pdf"
                        },
                        {
                          "title": "ISO 13616-1:2020 Financial services: International bank account number (IBAN)",
                          "url": "https://www.iso.org/standard/81090.html"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Too short for the country",
                    "value": {
                      "calculator": "check/iban@1",
                      "result": {
                        "valid": false,
                        "normalized": "NL91ABNA04171643",
                        "problem": "LENGTH",
                        "message": "An IBAN from Netherlands has 18 characters; this one has 16.",
                        "country": "NL",
                        "country_name": "Netherlands"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "NL91 ABNA 0417 1643"
                      },
                      "formula": "move the first four characters to the end, read A as 10 … Z as 35, and the number must leave remainder 1 when divided by 97; check digits = 98 − (BBAN + country + 00) mod 97",
                      "references": [
                        {
                          "title": "SWIFT IBAN Registry, release 103 (September 2026) (ISO 13616)",
                          "url": "https://www.swift.com/resource/iban-registry-pdf"
                        },
                        {
                          "title": "ISO 13616-1:2020 Financial services: International bank account number (IBAN)",
                          "url": "https://www.iso.org/standard/81090.html"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "check/iban@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/check/india-gstin": {
      "post": {
        "operationId": "calc_check_india_gstin",
        "summary": "GSTIN check (India)",
        "description": "Check the state code, structure and check character of an Indian GSTIN and read the PAN inside it.\n\nChecks a 15-character Goods and Services Tax Identification Number: a two-digit state code, the holder's ten-character PAN, an entity number, a default letter and a check character. The check character is worked out over the first 14 characters with the Luhn rule in base 36.",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "description": "The 15-character GSTIN. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.",
                    "type": "string",
                    "maxLength": 64,
                    "examples": [
                      "27AAPFU0939F1ZV"
                    ]
                  }
                },
                "required": [
                  "number"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A Maharashtra GSTIN",
                  "value": {
                    "number": "27AAPFU0939F1ZV"
                  }
                },
                "example2": {
                  "summary": "Last character wrong",
                  "value": {
                    "number": "27AAPFU0939F1ZX"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "check/india-gstin@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "description": "Whether the GSTIN passes every check.",
                          "type": "boolean"
                        },
                        "normalized": {
                          "description": "The number as it was checked: separators removed, letters in upper case.",
                          "type": "string"
                        },
                        "problem": {
                          "description": "What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.",
                          "type": "string"
                        },
                        "message": {
                          "description": "The result in a sentence, naming the rule that failed.",
                          "type": "string"
                        },
                        "state_code": {
                          "description": "The first two digits.",
                          "type": "string"
                        },
                        "state": {
                          "description": "The state or territory of the code.",
                          "type": "string"
                        },
                        "kind": {
                          "description": "A regular taxpayer's GSTIN (with a PAN inside) or another kind of registration.",
                          "type": "string"
                        },
                        "pan": {
                          "description": "Characters 3 to 12, for a regular taxpayer.",
                          "type": "string"
                        },
                        "pan_holder": {
                          "description": "The kind of holder the PAN's fourth character stands for.",
                          "type": "string"
                        },
                        "entity_number": {
                          "description": "Character 13: which of the holder's registrations in the state this is.",
                          "type": "string"
                        },
                        "check_character": {
                          "description": "The last character.",
                          "type": "string"
                        },
                        "expected_check_character": {
                          "description": "The check character the first 14 characters give.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "valid",
                        "normalized",
                        "message"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A Maharashtra GSTIN",
                    "value": {
                      "calculator": "check/india-gstin@1",
                      "result": {
                        "valid": true,
                        "normalized": "27AAPFU0939F1ZV",
                        "message": "A well-formed GSTIN registered in Maharashtra.",
                        "state_code": "27",
                        "state": "Maharashtra",
                        "kind": "regular taxpayer",
                        "pan": "AAPFU0939F",
                        "pan_holder": "Firm or limited liability partnership",
                        "entity_number": "1",
                        "check_character": "V",
                        "expected_check_character": "V"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "27AAPFU0939F1ZV"
                      },
                      "formula": "value each character 0 to 35 (digits, then A to Z); from the right, double every second value and add its base-36 digits; the check character makes the total a multiple of 36",
                      "references": [
                        {
                          "title": "GST portal: search taxpayer by GSTIN",
                          "url": "https://services.gst.gov.in/services/searchtp"
                        },
                        {
                          "title": "Central Board of Indirect Taxes and Customs: GST state codes",
                          "url": "https://cbic-gst.gov.in/"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Last character wrong",
                    "value": {
                      "calculator": "check/india-gstin@1",
                      "result": {
                        "valid": false,
                        "normalized": "27AAPFU0939F1ZX",
                        "problem": "CHECK_DIGIT",
                        "message": "The last character is X, but the first 14 characters give V.",
                        "state_code": "27",
                        "state": "Maharashtra",
                        "kind": "regular taxpayer",
                        "pan": "AAPFU0939F",
                        "pan_holder": "Firm or limited liability partnership",
                        "entity_number": "1",
                        "check_character": "X",
                        "expected_check_character": "V"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "27AAPFU0939F1ZX"
                      },
                      "formula": "value each character 0 to 35 (digits, then A to Z); from the right, double every second value and add its base-36 digits; the check character makes the total a multiple of 36",
                      "references": [
                        {
                          "title": "GST portal: search taxpayer by GSTIN",
                          "url": "https://services.gst.gov.in/services/searchtp"
                        },
                        {
                          "title": "Central Board of Indirect Taxes and Customs: GST state codes",
                          "url": "https://cbic-gst.gov.in/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "check/india-gstin@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/check/india-pan": {
      "post": {
        "operationId": "calc_check_india_pan",
        "summary": "PAN check (India)",
        "description": "Check the structure of an Indian Permanent Account Number and read the kind of holder from its fourth character.\n\nChecks a ten-character Permanent Account Number: five letters, four digits and a letter, where the fourth character says whether the holder is an individual, a company, a firm, a trust and so on. The rule for the last letter is not published, so it cannot be checked.",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "description": "The 10-character PAN. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.",
                    "type": "string",
                    "maxLength": 64,
                    "examples": [
                      "AAPFU0939F"
                    ]
                  }
                },
                "required": [
                  "number"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A firm's PAN",
                  "value": {
                    "number": "AAPFU0939F"
                  }
                },
                "example2": {
                  "summary": "Digits and letters in the wrong places",
                  "value": {
                    "number": "AAPF10939F"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "check/india-pan@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "description": "Whether the PAN passes every check.",
                          "type": "boolean"
                        },
                        "normalized": {
                          "description": "The number as it was checked: separators removed, letters in upper case.",
                          "type": "string"
                        },
                        "problem": {
                          "description": "What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.",
                          "type": "string"
                        },
                        "message": {
                          "description": "The result in a sentence, naming the rule that failed.",
                          "type": "string"
                        },
                        "holder_code": {
                          "description": "The fourth character.",
                          "type": "string"
                        },
                        "holder": {
                          "description": "The kind of holder it stands for.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "valid",
                        "normalized",
                        "message"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A firm's PAN",
                    "value": {
                      "calculator": "check/india-pan@1",
                      "result": {
                        "valid": true,
                        "normalized": "AAPFU0939F",
                        "message": "A well-formed PAN (firm or limited liability partnership).",
                        "holder_code": "F",
                        "holder": "Firm or limited liability partnership"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "AAPFU0939F"
                      },
                      "formula": "5 letters (the fourth is the holder type) + 4 digits + 1 letter",
                      "references": [
                        {
                          "title": "Income Tax Department: Permanent Account Number",
                          "url": "https://incometaxindia.gov.in/Pages/tax-services/apply-for-pan.aspx"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Digits and letters in the wrong places",
                    "value": {
                      "calculator": "check/india-pan@1",
                      "result": {
                        "valid": false,
                        "normalized": "AAPF10939F",
                        "problem": "FORMAT",
                        "message": "A PAN is five letters, four digits and a final letter."
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "AAPF10939F"
                      },
                      "formula": "5 letters (the fourth is the holder type) + 4 digits + 1 letter",
                      "references": [
                        {
                          "title": "Income Tax Department: Permanent Account Number",
                          "url": "https://incometaxindia.gov.in/Pages/tax-services/apply-for-pan.aspx"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "check/india-pan@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/check/isin": {
      "post": {
        "operationId": "calc_check_isin",
        "summary": "ISIN check",
        "description": "Check the structure and check digit of an ISIN (ISO 6166) and split it into prefix, national number and check digit.\n\nChecks an International Securities Identification Number as ISO 6166 defines it: a two-letter prefix, a nine-character national securities number and a check digit worked out with the Luhn rule after the letters are turned into numbers.",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "description": "The 12-character ISIN. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.",
                    "type": "string",
                    "maxLength": 64,
                    "examples": [
                      "US0378331005"
                    ]
                  }
                },
                "required": [
                  "number"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Apple Inc. common stock",
                  "value": {
                    "number": "US0378331005"
                  }
                },
                "example2": {
                  "summary": "Wrong check digit",
                  "value": {
                    "number": "US0378331004"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "check/isin@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "description": "Whether the ISIN passes every check.",
                          "type": "boolean"
                        },
                        "normalized": {
                          "description": "The number as it was checked: separators removed, letters in upper case.",
                          "type": "string"
                        },
                        "problem": {
                          "description": "What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.",
                          "type": "string"
                        },
                        "message": {
                          "description": "The result in a sentence, naming the rule that failed.",
                          "type": "string"
                        },
                        "prefix": {
                          "description": "The first two letters.",
                          "type": "string"
                        },
                        "prefix_country": {
                          "description": "The country the prefix stands for, when it is an ISO 3166 code. Prefixes such as XS (international securities) are not countries.",
                          "type": "string"
                        },
                        "nsin": {
                          "description": "The national securities number.",
                          "type": "string"
                        },
                        "check_digit": {
                          "description": "The last character.",
                          "type": "string"
                        },
                        "expected_check_digit": {
                          "description": "The check digit the first eleven characters give.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "valid",
                        "normalized",
                        "message"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Apple Inc. common stock",
                    "value": {
                      "calculator": "check/isin@1",
                      "result": {
                        "valid": true,
                        "normalized": "US0378331005",
                        "message": "A well-formed ISIN with the prefix of United States.",
                        "prefix": "US",
                        "prefix_country": "United States",
                        "nsin": "037833100",
                        "check_digit": "5",
                        "expected_check_digit": "5"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "US0378331005"
                      },
                      "formula": "turn each letter into two digits (A = 10 … Z = 35), then apply the Luhn rule: double every second digit from the right, add all digits, and the total must be a multiple of 10",
                      "references": [
                        {
                          "title": "ISO 6166:2021 International securities identification number (ISIN)",
                          "url": "https://www.iso.org/standard/78502.html"
                        },
                        {
                          "title": "ANNA: ISIN, structure and check digit",
                          "url": "https://www.anna-web.org/standards/isin-iso-6166/"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Wrong check digit",
                    "value": {
                      "calculator": "check/isin@1",
                      "result": {
                        "valid": false,
                        "normalized": "US0378331004",
                        "problem": "CHECK_DIGIT",
                        "message": "The check digit is 4, but the first eleven characters give 5.",
                        "prefix": "US",
                        "prefix_country": "United States",
                        "nsin": "037833100",
                        "check_digit": "4",
                        "expected_check_digit": "5"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "US0378331004"
                      },
                      "formula": "turn each letter into two digits (A = 10 … Z = 35), then apply the Luhn rule: double every second digit from the right, add all digits, and the total must be a multiple of 10",
                      "references": [
                        {
                          "title": "ISO 6166:2021 International securities identification number (ISIN)",
                          "url": "https://www.iso.org/standard/78502.html"
                        },
                        {
                          "title": "ANNA: ISIN, structure and check digit",
                          "url": "https://www.anna-web.org/standards/isin-iso-6166/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "check/isin@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/check/lei": {
      "post": {
        "operationId": "calc_check_lei",
        "summary": "LEI check",
        "description": "Check the length and check digits of a Legal Entity Identifier (ISO 17442).\n\nChecks a Legal Entity Identifier as ISO 17442 defines it: 20 letters and digits, the last two being check digits worked out with MOD 97-10. The first four characters identify the organisation that issued the LEI.",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "description": "The 20-character LEI. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.",
                    "type": "string",
                    "maxLength": 64,
                    "examples": [
                      "5493001KJTIIGC8Y1R12"
                    ]
                  }
                },
                "required": [
                  "number"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A well-formed LEI",
                  "value": {
                    "number": "5493001KJTIIGC8Y1R12"
                  }
                },
                "example2": {
                  "summary": "Two characters swapped",
                  "value": {
                    "number": "5493001KJTIIGC8Y1R21"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "check/lei@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "description": "Whether the LEI passes every check.",
                          "type": "boolean"
                        },
                        "normalized": {
                          "description": "The number as it was checked: separators removed, letters in upper case.",
                          "type": "string"
                        },
                        "problem": {
                          "description": "What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.",
                          "type": "string"
                        },
                        "message": {
                          "description": "The result in a sentence, naming the rule that failed.",
                          "type": "string"
                        },
                        "lou_prefix": {
                          "description": "The first four characters: the prefix of the issuing organisation (LOU).",
                          "type": "string"
                        },
                        "check_digits": {
                          "description": "The last two characters.",
                          "type": "string"
                        },
                        "expected_check_digits": {
                          "description": "The check digits the first 18 characters give.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "valid",
                        "normalized",
                        "message"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A well-formed LEI",
                    "value": {
                      "calculator": "check/lei@1",
                      "result": {
                        "valid": true,
                        "normalized": "5493001KJTIIGC8Y1R12",
                        "message": "A well-formed LEI.",
                        "lou_prefix": "5493",
                        "check_digits": "12",
                        "expected_check_digits": "12"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "5493001KJTIIGC8Y1R12"
                      },
                      "formula": "read A as 10 … Z as 35; the whole number must leave remainder 1 when divided by 97; check digits = 98 − (first 18 characters + 00) mod 97",
                      "references": [
                        {
                          "title": "GLEIF: ISO 17442, the LEI code structure",
                          "url": "https://www.gleif.org/en/about-lei/iso-17442-the-lei-code-structure"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Two characters swapped",
                    "value": {
                      "calculator": "check/lei@1",
                      "result": {
                        "valid": false,
                        "normalized": "5493001KJTIIGC8Y1R21",
                        "problem": "CHECK_DIGIT",
                        "message": "The check digits are 21, but the first 18 characters give 12 (ISO 17442, MOD 97-10).",
                        "lou_prefix": "5493",
                        "check_digits": "21",
                        "expected_check_digits": "12"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "5493001KJTIIGC8Y1R21"
                      },
                      "formula": "read A as 10 … Z as 35; the whole number must leave remainder 1 when divided by 97; check digits = 98 − (first 18 characters + 00) mod 97",
                      "references": [
                        {
                          "title": "GLEIF: ISO 17442, the LEI code structure",
                          "url": "https://www.gleif.org/en/about-lei/iso-17442-the-lei-code-structure"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "check/lei@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/check/us-routing-number": {
      "post": {
        "operationId": "calc_check_us_routing_number",
        "summary": "US bank routing number check",
        "description": "Check the check digit and the first two digits of a US ABA routing number.\n\nChecks a nine-digit ABA routing transit number: the first two digits must be in a range the American Bankers Association uses, and the ninth digit must be the check digit the first eight give with the weights 3, 7, 1.",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "description": "The nine-digit routing number. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.",
                    "type": "string",
                    "maxLength": 64,
                    "examples": [
                      "021000021"
                    ]
                  }
                },
                "required": [
                  "number"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A New York routing number",
                  "value": {
                    "number": "021000021"
                  }
                },
                "example2": {
                  "summary": "One digit wrong",
                  "value": {
                    "number": "021000022"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "check/us-routing-number@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "description": "Whether the routing number passes every check.",
                          "type": "boolean"
                        },
                        "normalized": {
                          "description": "The number as it was checked: separators removed, letters in upper case.",
                          "type": "string"
                        },
                        "problem": {
                          "description": "What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.",
                          "type": "string"
                        },
                        "message": {
                          "description": "The result in a sentence, naming the rule that failed.",
                          "type": "string"
                        },
                        "prefix_meaning": {
                          "description": "What the first two digits stand for.",
                          "type": "string"
                        },
                        "check_digit": {
                          "description": "The ninth digit.",
                          "type": "string"
                        },
                        "expected_check_digit": {
                          "description": "The check digit the first eight digits give.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "valid",
                        "normalized",
                        "message"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A New York routing number",
                    "value": {
                      "calculator": "check/us-routing-number@1",
                      "result": {
                        "valid": true,
                        "normalized": "021000021",
                        "message": "A well-formed routing number (Federal Reserve district 2).",
                        "prefix_meaning": "Federal Reserve district 2",
                        "check_digit": "1",
                        "expected_check_digit": "1"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "021000021"
                      },
                      "formula": "3·(d₁ + d₄ + d₇) + 7·(d₂ + d₅ + d₈) + (d₃ + d₆ + d₉) must be a multiple of 10",
                      "references": [
                        {
                          "title": "American Bankers Association: ABA routing number",
                          "url": "https://www.aba.com/about-us/routing-number"
                        },
                        {
                          "title": "ABA routing transit number: check digit and number ranges",
                          "url": "https://en.wikipedia.org/wiki/ABA_routing_transit_number"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "One digit wrong",
                    "value": {
                      "calculator": "check/us-routing-number@1",
                      "result": {
                        "valid": false,
                        "normalized": "021000022",
                        "problem": "CHECK_DIGIT",
                        "message": "The last digit is 2, but the first eight digits give 1.",
                        "prefix_meaning": "Federal Reserve district 2",
                        "check_digit": "2",
                        "expected_check_digit": "1"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "021000022"
                      },
                      "formula": "3·(d₁ + d₄ + d₇) + 7·(d₂ + d₅ + d₈) + (d₃ + d₆ + d₉) must be a multiple of 10",
                      "references": [
                        {
                          "title": "American Bankers Association: ABA routing number",
                          "url": "https://www.aba.com/about-us/routing-number"
                        },
                        {
                          "title": "ABA routing transit number: check digit and number ranges",
                          "url": "https://en.wikipedia.org/wiki/ABA_routing_transit_number"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "check/us-routing-number@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/check/vat-number": {
      "post": {
        "operationId": "calc_check_vat_number",
        "summary": "VAT number check",
        "description": "Check the structure and check digit of a VAT number from any EU member state, Northern Ireland, Great Britain, Switzerland or Norway.\n\nChecks a VAT identification number against its country's structure and check digit rule: all 27 EU member states, Northern Ireland (XI), Great Britain, Switzerland and Norway. This is the test to run before sending a number to VIES or putting it on an invoice: it catches typing mistakes at once and works when VIES is down. It does not say whether the number is registered.",
        "tags": [
          "Check"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "number": {
                    "description": "The VAT number, with or without its country prefix. Spaces, dots, hyphens and slashes are ignored, and lower-case letters are read as upper case. At most 64 characters.",
                    "type": "string",
                    "maxLength": 64,
                    "examples": [
                      "DE 136 695 976"
                    ]
                  },
                  "country": {
                    "description": "The country, when the number has no prefix. Greece uses EL on VAT numbers. Options: AT: Austria; BE: Belgium; BG: Bulgaria; CY: Cyprus; CZ: Czechia; DE: Germany; DK: Denmark; EE: Estonia; EL: Greece; ES: Spain; FI: Finland; FR: France; HR: Croatia; HU: Hungary; IE: Ireland; IT: Italy; LT: Lithuania; LU: Luxembourg; LV: Latvia; MT: Malta; NL: Netherlands; PL: Poland; PT: Portugal; RO: Romania; SE: Sweden; SI: Slovenia; SK: Slovakia; XI: Northern Ireland; GB: United Kingdom; CHE: Switzerland; NO: Norway; GR: Greece (same as EL); CH: Switzerland (same as CHE)",
                    "type": "string",
                    "enum": [
                      "AT",
                      "BE",
                      "BG",
                      "CY",
                      "CZ",
                      "DE",
                      "DK",
                      "EE",
                      "EL",
                      "ES",
                      "FI",
                      "FR",
                      "HR",
                      "HU",
                      "IE",
                      "IT",
                      "LT",
                      "LU",
                      "LV",
                      "MT",
                      "NL",
                      "PL",
                      "PT",
                      "RO",
                      "SE",
                      "SI",
                      "SK",
                      "XI",
                      "GB",
                      "CHE",
                      "NO",
                      "GR",
                      "CH"
                    ]
                  }
                },
                "required": [
                  "number"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A German number",
                  "value": {
                    "number": "DE 136 695 976"
                  }
                },
                "example2": {
                  "summary": "A French number with the wrong key",
                  "value": {
                    "number": "FR 41 954 506 077"
                  }
                },
                "example3": {
                  "summary": "No prefix, country given",
                  "value": {
                    "number": "0697449992",
                    "country": "BE"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "check/vat-number@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "description": "Whether the VAT number passes every check.",
                          "type": "boolean"
                        },
                        "normalized": {
                          "description": "The number as it was checked: separators removed, letters in upper case.",
                          "type": "string"
                        },
                        "problem": {
                          "description": "What is wrong, when valid is false: CHARACTERS: a character that cannot appear in this kind of number; LENGTH: the wrong number of characters; COUNTRY: an unknown or unsupported country code; FORMAT: the right length but the wrong structure; CHECK_DIGIT: the check digit or check characters do not match the rest of the number.",
                          "type": "string"
                        },
                        "message": {
                          "description": "The result in a sentence, naming the rule that failed.",
                          "type": "string"
                        },
                        "country": {
                          "description": "The prefix: the ISO 3166 code, except EL for Greece, XI for Northern Ireland and CHE for Switzerland.",
                          "type": "string"
                        },
                        "country_name": {
                          "description": "The country's name.",
                          "type": "string"
                        },
                        "national_number": {
                          "description": "The number after the prefix.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "valid",
                        "normalized",
                        "message"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A German number",
                    "value": {
                      "calculator": "check/vat-number@1",
                      "result": {
                        "valid": true,
                        "normalized": "DE136695976",
                        "message": "A well-formed VAT number from Germany.",
                        "country": "DE",
                        "country_name": "Germany",
                        "national_number": "136695976"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "DE 136 695 976"
                      },
                      "formula": "the country's structure, then its check digit rule (for example ISO 7064 MOD 11,10 for Germany, modulus 97 for Belgium, Luhn for Italy and Sweden)",
                      "references": [
                        {
                          "title": "European Commission: VIES, VAT identification number structure by member state",
                          "url": "https://ec.europa.eu/taxation_customs/vies/#/faq"
                        },
                        {
                          "title": "Swiss Federal Statistical Office: the business identification number (UID)",
                          "url": "https://www.bfs.admin.ch/bfs/en/home/registers/enterprise-register/enterprise-identification.html"
                        },
                        {
                          "title": "Brønnøysund Register Centre: the organisation number's check digit",
                          "url": "https://www.brreg.no/en/about-us-2/our-registers/about-the-central-coordinating-register-for-legal-entities-ccr/about-the-organisation-number/"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "A French number with the wrong key",
                    "value": {
                      "calculator": "check/vat-number@1",
                      "result": {
                        "valid": false,
                        "normalized": "FR41954506077",
                        "problem": "CHECK_DIGIT",
                        "message": "The two-digit key is 41, but the SIREN 954506077 gives 61.",
                        "country": "FR",
                        "country_name": "France",
                        "national_number": "41954506077"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "FR 41 954 506 077"
                      },
                      "formula": "the country's structure, then its check digit rule (for example ISO 7064 MOD 11,10 for Germany, modulus 97 for Belgium, Luhn for Italy and Sweden)",
                      "references": [
                        {
                          "title": "European Commission: VIES, VAT identification number structure by member state",
                          "url": "https://ec.europa.eu/taxation_customs/vies/#/faq"
                        },
                        {
                          "title": "Swiss Federal Statistical Office: the business identification number (UID)",
                          "url": "https://www.bfs.admin.ch/bfs/en/home/registers/enterprise-register/enterprise-identification.html"
                        },
                        {
                          "title": "Brønnøysund Register Centre: the organisation number's check digit",
                          "url": "https://www.brreg.no/en/about-us-2/our-registers/about-the-central-coordinating-register-for-legal-entities-ccr/about-the-organisation-number/"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "No prefix, country given",
                    "value": {
                      "calculator": "check/vat-number@1",
                      "result": {
                        "valid": true,
                        "normalized": "BE0697449992",
                        "message": "A well-formed VAT number from Belgium.",
                        "country": "BE",
                        "country_name": "Belgium",
                        "national_number": "0697449992"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "number": "0697449992",
                        "country": "BE"
                      },
                      "formula": "the country's structure, then its check digit rule (for example ISO 7064 MOD 11,10 for Germany, modulus 97 for Belgium, Luhn for Italy and Sweden)",
                      "references": [
                        {
                          "title": "European Commission: VIES, VAT identification number structure by member state",
                          "url": "https://ec.europa.eu/taxation_customs/vies/#/faq"
                        },
                        {
                          "title": "Swiss Federal Statistical Office: the business identification number (UID)",
                          "url": "https://www.bfs.admin.ch/bfs/en/home/registers/enterprise-register/enterprise-identification.html"
                        },
                        {
                          "title": "Brønnøysund Register Centre: the organisation number's check digit",
                          "url": "https://www.brreg.no/en/about-us-2/our-registers/about-the-central-coordinating-register-for-legal-entities-ccr/about-the-organisation-number/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "check/vat-number@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/date/add": {
      "post": {
        "operationId": "calc_date_add",
        "summary": "Add or subtract time from a date",
        "description": "Add or subtract years, months, weeks, days, business days or hours to a date or date-time, with month-end and daylight-saving rules spelled out.\n\nCalendar amounts (years, months, weeks, days) move the date on the calendar, keeping the clock time; hours, minutes and seconds are then added as elapsed time. So adding 1 day across a daylight saving change keeps 09:00 at 09:00, while adding 24 hours may not. Month additions that land on a day that does not exist use the month's last day, and the response says so.",
        "tags": [
          "Date"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start": {
                    "description": "Start date (YYYY-MM-DD) or date-time. At most 40 characters.",
                    "type": "string",
                    "maxLength": 40,
                    "examples": [
                      "2026-01-31"
                    ]
                  },
                  "operation": {
                    "description": "Add or subtract. Options: add: add; subtract: subtract",
                    "type": "string",
                    "enum": [
                      "add",
                      "subtract"
                    ],
                    "default": "add"
                  },
                  "years": {
                    "description": "Years to add. Allowed: >= 0 and <= 9999.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9999,
                    "default": 0
                  },
                  "months": {
                    "description": "Months to add. Allowed: >= 0 and <= 120000.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 120000,
                    "default": 0
                  },
                  "weeks": {
                    "description": "Weeks to add. Allowed: >= 0 and <= 600000.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 600000,
                    "default": 0
                  },
                  "days": {
                    "description": "Days to add. Allowed: >= 0 and <= 4000000.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4000000,
                    "default": 0
                  },
                  "business_days": {
                    "description": "Business days to add (alone, with a plain date). Allowed: >= 0 and <= 25000.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 25000
                  },
                  "hours": {
                    "description": "Hours of elapsed time to add (date-times). Allowed: >= 0 and <= 100000000.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100000000,
                    "default": 0
                  },
                  "minutes": {
                    "description": "Minutes of elapsed time to add (date-times). Allowed: >= 0 and <= 100000000.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100000000,
                    "default": 0
                  },
                  "seconds": {
                    "description": "Seconds of elapsed time to add (date-times). Allowed: >= 0 and <= 10000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "timezone": {
                    "description": "IANA time zone for a date-time start without an offset.",
                    "type": "string"
                  },
                  "weekend": {
                    "description": "Days that are not business days. Options: sat_sun: Saturday and Sunday; fri_sat: Friday and Saturday; sun: Sunday only; fri: Friday only; none: no weekend days",
                    "type": "string",
                    "enum": [
                      "sat_sun",
                      "fri_sat",
                      "sun",
                      "fri",
                      "none"
                    ],
                    "default": "sat_sun"
                  },
                  "holidays": {
                    "description": "Dates that are not business days. Up to 1000 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "date"
                    },
                    "minItems": 0,
                    "maxItems": 1000
                  }
                },
                "required": [
                  "start"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Month-end clamping",
                  "value": {
                    "start": "2026-01-31",
                    "months": 1
                  }
                },
                "example2": {
                  "summary": "Ten business days",
                  "value": {
                    "start": "2026-10-16",
                    "business_days": 10
                  }
                },
                "example3": {
                  "summary": "Subtract a year from a leap day",
                  "value": {
                    "start": "2028-02-29",
                    "years": 1,
                    "operation": "subtract"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "date/add@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "description": "The resulting date or date-time.",
                          "type": "string"
                        },
                        "weekday": {
                          "description": "Day of the week of the result.",
                          "type": "string"
                        },
                        "result_utc": {
                          "description": "The result in UTC (date-times).",
                          "type": "string",
                          "format": "date-time"
                        },
                        "tz_database": {
                          "description": "Time zone database version used.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "result",
                        "weekday"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Month-end clamping",
                    "value": {
                      "calculator": "date/add@1",
                      "result": {
                        "result": "2026-02-28",
                        "weekday": "Saturday"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "start": "2026-01-31",
                        "operation": "add",
                        "years": 0,
                        "months": 1,
                        "weeks": 0,
                        "days": 0,
                        "hours": 0,
                        "minutes": 0,
                        "seconds": "0",
                        "weekend": "sat_sun"
                      },
                      "formula": "months first (clamped to month end), then weeks and days, then elapsed time",
                      "references": [
                        {
                          "title": "ISO 8601 date and time format",
                          "url": "https://www.iso.org/iso-8601-date-and-time-format.html"
                        },
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        }
                      ],
                      "warnings": [
                        {
                          "code": "END_OF_MONTH_CLAMPED",
                          "message": "Day 31 does not exist in February 2026; the last day of the month, 2026-02-28, was used."
                        }
                      ]
                    }
                  },
                  "example2": {
                    "summary": "Ten business days",
                    "value": {
                      "calculator": "date/add@1",
                      "result": {
                        "result": "2026-10-30",
                        "weekday": "Friday"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "start": "2026-10-16",
                        "operation": "add",
                        "years": 0,
                        "months": 0,
                        "weeks": 0,
                        "days": 0,
                        "business_days": 10,
                        "hours": 0,
                        "minutes": 0,
                        "seconds": "0",
                        "weekend": "sat_sun"
                      },
                      "formula": "months first (clamped to month end), then weeks and days, then elapsed time",
                      "references": [
                        {
                          "title": "ISO 8601 date and time format",
                          "url": "https://www.iso.org/iso-8601-date-and-time-format.html"
                        },
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Subtract a year from a leap day",
                    "value": {
                      "calculator": "date/add@1",
                      "result": {
                        "result": "2027-02-28",
                        "weekday": "Sunday"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "start": "2028-02-29",
                        "operation": "subtract",
                        "years": 1,
                        "months": 0,
                        "weeks": 0,
                        "days": 0,
                        "hours": 0,
                        "minutes": 0,
                        "seconds": "0",
                        "weekend": "sat_sun"
                      },
                      "formula": "months first (clamped to month end), then weeks and days, then elapsed time",
                      "references": [
                        {
                          "title": "ISO 8601 date and time format",
                          "url": "https://www.iso.org/iso-8601-date-and-time-format.html"
                        },
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        }
                      ],
                      "warnings": [
                        {
                          "code": "END_OF_MONTH_CLAMPED",
                          "message": "Day 29 does not exist in February 2027; the last day of the month, 2027-02-28, was used."
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "date/add@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/date/age": {
      "post": {
        "operationId": "calc_date_age",
        "summary": "Age calculator",
        "description": "Exact age in years, months and days, plus the next birthday, with an explicit rule for 29 February birthdays.\n\nAge on a given date as completed years, months and days. People born on 29 February reach a new age on 28 February in common years by default (the rule in New Zealand and Taiwan, and the one consistent with date arithmetic); choose mar1 for the 1 March rule used in the UK and Hong Kong.",
        "tags": [
          "Date"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "birth_date": {
                    "description": "Date of birth (YYYY-MM-DD).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "1990-05-15"
                    ]
                  },
                  "on_date": {
                    "description": "Date to calculate the age on. Defaults to today in UTC.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-10-20"
                    ]
                  },
                  "leap_day_birthday": {
                    "description": "When someone born on 29 February has a birthday in a common year. Options: feb28: on 28 February; mar1: on 1 March",
                    "type": "string",
                    "enum": [
                      "feb28",
                      "mar1"
                    ],
                    "default": "feb28"
                  }
                },
                "required": [
                  "birth_date"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Age on a date",
                  "value": {
                    "birth_date": "1990-05-15",
                    "on_date": "2026-10-20"
                  }
                },
                "example2": {
                  "summary": "Leap-day birthday, 28 Feb rule",
                  "value": {
                    "birth_date": "2000-02-29",
                    "on_date": "2001-02-28"
                  }
                },
                "example3": {
                  "summary": "Leap-day birthday, 1 Mar rule",
                  "value": {
                    "birth_date": "2000-02-29",
                    "on_date": "2001-02-28",
                    "leap_day_birthday": "mar1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "date/age@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "years": {
                          "description": "Completed years.",
                          "type": "integer"
                        },
                        "months": {
                          "description": "Completed months since the last birthday.",
                          "type": "integer"
                        },
                        "days": {
                          "description": "Days since the last whole month.",
                          "type": "integer"
                        },
                        "total_months": {
                          "description": "Completed months since birth.",
                          "type": "integer"
                        },
                        "total_weeks": {
                          "description": "Completed weeks since birth.",
                          "type": "integer"
                        },
                        "total_days": {
                          "description": "Days since birth.",
                          "type": "integer"
                        },
                        "on_date": {
                          "description": "The date the age was calculated on.",
                          "type": "string",
                          "format": "date"
                        },
                        "next_birthday": {
                          "description": "Date of the next birthday.",
                          "type": "string",
                          "format": "date"
                        },
                        "days_until_next_birthday": {
                          "description": "Days until the next birthday.",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "years",
                        "months",
                        "days",
                        "total_months",
                        "total_weeks",
                        "total_days",
                        "on_date"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Age on a date",
                    "value": {
                      "calculator": "date/age@1",
                      "result": {
                        "years": 36,
                        "months": 5,
                        "days": 5,
                        "total_months": 437,
                        "total_weeks": 1901,
                        "total_days": 13307,
                        "on_date": "2026-10-20",
                        "next_birthday": "2027-05-15",
                        "days_until_next_birthday": 207
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "birth_date": "1990-05-15",
                        "on_date": "2026-10-20",
                        "leap_day_birthday": "feb28"
                      },
                      "formula": "years = completed anniversaries; then months and days as in date/difference",
                      "references": [
                        {
                          "title": "ISO 8601 date and time format",
                          "url": "https://www.iso.org/iso-8601-date-and-time-format.html"
                        },
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        },
                        {
                          "title": "UK Family Law Reform Act 1969, s.9 (time at which a person attains an age)",
                          "url": "https://www.legislation.gov.uk/ukpga/1969/46/section/9"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Leap-day birthday, 28 Feb rule",
                    "value": {
                      "calculator": "date/age@1",
                      "result": {
                        "years": 1,
                        "months": 0,
                        "days": 0,
                        "total_months": 12,
                        "total_weeks": 52,
                        "total_days": 365,
                        "on_date": "2001-02-28",
                        "next_birthday": "2002-02-28",
                        "days_until_next_birthday": 365
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "birth_date": "2000-02-29",
                        "on_date": "2001-02-28",
                        "leap_day_birthday": "feb28"
                      },
                      "formula": "years = completed anniversaries; then months and days as in date/difference",
                      "references": [
                        {
                          "title": "ISO 8601 date and time format",
                          "url": "https://www.iso.org/iso-8601-date-and-time-format.html"
                        },
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        },
                        {
                          "title": "UK Family Law Reform Act 1969, s.9 (time at which a person attains an age)",
                          "url": "https://www.legislation.gov.uk/ukpga/1969/46/section/9"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Leap-day birthday, 1 Mar rule",
                    "value": {
                      "calculator": "date/age@1",
                      "result": {
                        "years": 0,
                        "months": 0,
                        "days": 0,
                        "total_months": 0,
                        "total_weeks": 52,
                        "total_days": 365,
                        "on_date": "2001-02-28",
                        "next_birthday": "2001-03-01",
                        "days_until_next_birthday": 1
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "birth_date": "2000-02-29",
                        "on_date": "2001-02-28",
                        "leap_day_birthday": "mar1"
                      },
                      "formula": "years = completed anniversaries; then months and days as in date/difference",
                      "references": [
                        {
                          "title": "ISO 8601 date and time format",
                          "url": "https://www.iso.org/iso-8601-date-and-time-format.html"
                        },
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        },
                        {
                          "title": "UK Family Law Reform Act 1969, s.9 (time at which a person attains an age)",
                          "url": "https://www.legislation.gov.uk/ukpga/1969/46/section/9"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "date/age@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/date/difference": {
      "post": {
        "operationId": "calc_date_difference",
        "summary": "Date difference calculator",
        "description": "Days, weeks, months, years and business days between two dates, or the exact time between two date-times across time zones and daylight saving changes.\n\nFor two dates, returns the number of days (end minus start), the breakdown into years, months and days, and the number of business days. For two date-times, returns the exact elapsed time; each date-time needs a UTC offset or a time zone, and times that are skipped or repeated by daylight saving changes are reported instead of guessed.",
        "tags": [
          "Date"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start": {
                    "description": "Start date (YYYY-MM-DD) or date-time (2026-03-29T01:30:00+01:00). At most 40 characters.",
                    "type": "string",
                    "maxLength": 40,
                    "examples": [
                      "2026-01-01"
                    ]
                  },
                  "end": {
                    "description": "End date or date-time, same kind as start. At most 40 characters.",
                    "type": "string",
                    "maxLength": 40,
                    "examples": [
                      "2026-12-25"
                    ]
                  },
                  "timezone": {
                    "description": "IANA time zone for date-times without an offset, e.g. America/New_York.",
                    "type": "string"
                  },
                  "include_end_date": {
                    "description": "Count the end date too (so Monday to Friday is 5 days, like spreadsheet NETWORKDAYS).",
                    "type": "boolean",
                    "default": false
                  },
                  "weekend": {
                    "description": "Days that are not business days. Options: sat_sun: Saturday and Sunday; fri_sat: Friday and Saturday; sun: Sunday only; fri: Friday only; none: no weekend days",
                    "type": "string",
                    "enum": [
                      "sat_sun",
                      "fri_sat",
                      "sun",
                      "fri",
                      "none"
                    ],
                    "default": "sat_sun"
                  },
                  "holidays": {
                    "description": "Dates that are not business days. Up to 1000 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "date"
                    },
                    "minItems": 0,
                    "maxItems": 1000
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "start",
                  "end"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Days until Christmas 2026",
                  "value": {
                    "start": "2026-01-01",
                    "end": "2026-12-25"
                  }
                },
                "example2": {
                  "summary": "Working days in a week, inclusive",
                  "value": {
                    "start": "2026-10-19",
                    "end": "2026-10-23",
                    "include_end_date": true
                  }
                },
                "example3": {
                  "summary": "Across a daylight saving change",
                  "value": {
                    "start": "2026-03-28T12:00:00",
                    "end": "2026-03-29T12:00:00",
                    "timezone": "Europe/Berlin"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "date/difference@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "days": {
                          "description": "Days from start to end (negative if end is earlier); with include_end_date the end day is counted too.",
                          "type": "integer"
                        },
                        "weeks": {
                          "description": "Whole weeks in days.",
                          "type": "integer"
                        },
                        "remaining_days": {
                          "description": "Days left after the whole weeks.",
                          "type": "integer"
                        },
                        "years": {
                          "description": "Years in the years-months-days breakdown.",
                          "type": "integer"
                        },
                        "months": {
                          "description": "Months in the breakdown.",
                          "type": "integer"
                        },
                        "calendar_days": {
                          "description": "Days in the breakdown.",
                          "type": "integer"
                        },
                        "total_months": {
                          "description": "Whole months between the dates.",
                          "type": "integer"
                        },
                        "business_days": {
                          "description": "Business days from start up to (not including) end, or including end when include_end_date is true.",
                          "type": "integer"
                        },
                        "start_weekday": {
                          "description": "Day of the week of start.",
                          "type": "string"
                        },
                        "end_weekday": {
                          "description": "Day of the week of end.",
                          "type": "string"
                        },
                        "total_seconds": {
                          "description": "Exact elapsed seconds (date-times).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_minutes": {
                          "description": "Elapsed minutes (date-times).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_hours": {
                          "description": "Elapsed hours (date-times).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_days": {
                          "description": "Elapsed days of 24 hours (date-times).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "elapsed_days": {
                          "description": "Whole days in the elapsed time (date-times).",
                          "type": "integer"
                        },
                        "elapsed_hours": {
                          "description": "Hours after the whole days (date-times).",
                          "type": "integer"
                        },
                        "elapsed_minutes": {
                          "description": "Minutes after the whole hours (date-times).",
                          "type": "integer"
                        },
                        "elapsed_seconds": {
                          "description": "Seconds after the whole minutes, exactly (date-times).",
                          "type": "string"
                        },
                        "tz_database": {
                          "description": "Time zone database version used.",
                          "type": "string"
                        }
                      },
                      "required": []
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Days until Christmas 2026",
                    "value": {
                      "calculator": "date/difference@1",
                      "result": {
                        "days": 358,
                        "weeks": 51,
                        "remaining_days": 1,
                        "years": 0,
                        "months": 11,
                        "calendar_days": 24,
                        "total_months": 11,
                        "business_days": 256,
                        "start_weekday": "Thursday",
                        "end_weekday": "Friday"
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "start": "2026-01-01",
                        "end": "2026-12-25",
                        "include_end_date": false,
                        "weekend": "sat_sun"
                      },
                      "formula": "days = end − start; Y-M-D: largest whole months not passing end, then days",
                      "references": [
                        {
                          "title": "ISO 8601 date and time format",
                          "url": "https://www.iso.org/iso-8601-date-and-time-format.html"
                        },
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Working days in a week, inclusive",
                    "value": {
                      "calculator": "date/difference@1",
                      "result": {
                        "days": 5,
                        "weeks": 0,
                        "remaining_days": 5,
                        "years": 0,
                        "months": 0,
                        "calendar_days": 4,
                        "total_months": 0,
                        "business_days": 5,
                        "start_weekday": "Monday",
                        "end_weekday": "Friday"
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "start": "2026-10-19",
                        "end": "2026-10-23",
                        "include_end_date": true,
                        "weekend": "sat_sun"
                      },
                      "formula": "days = end − start; Y-M-D: largest whole months not passing end, then days",
                      "references": [
                        {
                          "title": "ISO 8601 date and time format",
                          "url": "https://www.iso.org/iso-8601-date-and-time-format.html"
                        },
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Across a daylight saving change",
                    "value": {
                      "calculator": "date/difference@1",
                      "result": {
                        "total_seconds": "82800",
                        "total_minutes": "1380",
                        "total_hours": "23",
                        "total_days": "0.958333333333333",
                        "elapsed_days": 0,
                        "elapsed_hours": 23,
                        "elapsed_minutes": 0,
                        "elapsed_seconds": "0",
                        "tz_database": "tzdata 2026.6 (IANA 2026f)"
                      },
                      "exactness": {
                        "total_seconds": "exact",
                        "total_minutes": "exact",
                        "total_hours": "exact",
                        "total_days": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "start": "2026-03-28T12:00:00",
                        "end": "2026-03-29T12:00:00",
                        "timezone": "Europe/Berlin",
                        "include_end_date": false,
                        "weekend": "sat_sun"
                      },
                      "formula": "days = end − start; Y-M-D: largest whole months not passing end, then days",
                      "references": [
                        {
                          "title": "ISO 8601 date and time format",
                          "url": "https://www.iso.org/iso-8601-date-and-time-format.html"
                        },
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "date/difference@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/date/holidays": {
      "post": {
        "operationId": "calc_date_holidays",
        "summary": "Public holidays by country and year",
        "description": "The public holidays of a country or region in a year, worked out from the rules in its law, with the official source.\n\nLists the public holidays of a year for the United States (federal), the United Kingdom (England and Wales, Scotland, Northern Ireland), Germany (nationwide and each of the 16 states), France, the Netherlands, Ireland, Belgium, Austria and Italy. Dates come from the rules themselves: fixed dates, weekday rules such as the last Monday in May, and days counted from Easter. UK substitute days and the day US federal offices close when a holiday falls at a weekend are included. Countries that set some holidays year by year, by decree or by the moon, are not covered, because those dates cannot be worked out ahead.",
        "tags": [
          "Date"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "calendar": {
                    "description": "The country or region. Options: US: United States (federal holidays); GB-ENG: United Kingdom: England and Wales; GB-SCT: United Kingdom: Scotland; GB-NIR: United Kingdom: Northern Ireland; DE: Germany (the nine nationwide holidays); DE-BW: Germany: Baden-Württemberg; DE-BY: Germany: Bavaria; DE-BE: Germany: Berlin; DE-BB: Germany: Brandenburg; DE-HB: Germany: Bremen; DE-HH: Germany: Hamburg; DE-HE: Germany: Hesse; DE-MV: Germany: Mecklenburg-Vorpommern; DE-NI: Germany: Lower Saxony; DE-NW: Germany: North Rhine-Westphalia; DE-RP: Germany: Rhineland-Palatinate; DE-SL: Germany: Saarland; DE-SN: Germany: Saxony; DE-ST: Germany: Saxony-Anhalt; DE-SH: Germany: Schleswig-Holstein; DE-TH: Germany: Thuringia; FR: France (mainland); NL: Netherlands; IE: Ireland; BE: Belgium; AT: Austria; IT: Italy",
                    "type": "string",
                    "enum": [
                      "US",
                      "GB-ENG",
                      "GB-SCT",
                      "GB-NIR",
                      "DE",
                      "DE-BW",
                      "DE-BY",
                      "DE-BE",
                      "DE-BB",
                      "DE-HB",
                      "DE-HH",
                      "DE-HE",
                      "DE-MV",
                      "DE-NI",
                      "DE-NW",
                      "DE-RP",
                      "DE-SL",
                      "DE-SN",
                      "DE-ST",
                      "DE-SH",
                      "DE-TH",
                      "FR",
                      "NL",
                      "IE",
                      "BE",
                      "AT",
                      "IT"
                    ],
                    "examples": [
                      "GB-ENG"
                    ]
                  },
                  "year": {
                    "description": "The year. Allowed: >= 2020 and <= 2030.",
                    "type": "integer",
                    "minimum": 2020,
                    "maximum": 2030,
                    "examples": [
                      2027
                    ]
                  }
                },
                "required": [
                  "calendar",
                  "year"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "England and Wales in 2027, when Christmas falls at a weekend",
                  "value": {
                    "calendar": "GB-ENG",
                    "year": 2027
                  }
                },
                "example2": {
                  "summary": "Bavaria in 2026",
                  "value": {
                    "calendar": "DE-BY",
                    "year": 2026
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "date/holidays@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "calendar_name": {
                          "description": "The country or region in words.",
                          "type": "string"
                        },
                        "count": {
                          "description": "How many holidays there are.",
                          "type": "integer"
                        },
                        "holidays": {
                          "description": "The holidays in date order.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "description": "The holiday's date.",
                                "type": "string",
                                "format": "date"
                              },
                              "weekday": {
                                "description": "Its day of the week.",
                                "type": "string"
                              },
                              "name": {
                                "description": "Its name in English.",
                                "type": "string"
                              },
                              "local_name": {
                                "description": "Its name in the country's language.",
                                "type": "string"
                              },
                              "observed_on": {
                                "description": "United States: the weekday federal offices close instead, when the date is a Saturday (the Friday before) or a Sunday (the Monday after).",
                                "type": "string",
                                "format": "date"
                              }
                            },
                            "required": [
                              "date",
                              "weekday",
                              "name"
                            ]
                          }
                        },
                        "days_off": {
                          "description": "The dates that are not worked, in order: each holiday, or the day it is observed on.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "source": {
                          "description": "The law or official list the rules come from.",
                          "type": "string"
                        },
                        "source_url": {
                          "description": "Its address.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "calendar_name",
                        "count",
                        "holidays",
                        "days_off",
                        "source",
                        "source_url"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "England and Wales in 2027, when Christmas falls at a weekend",
                    "value": {
                      "calculator": "date/holidays@1",
                      "result": {
                        "calendar_name": "United Kingdom: England and Wales",
                        "count": 8,
                        "holidays": [
                          {
                            "date": "2027-01-01",
                            "weekday": "Friday",
                            "name": "New Year's Day"
                          },
                          {
                            "date": "2027-03-26",
                            "weekday": "Friday",
                            "name": "Good Friday"
                          },
                          {
                            "date": "2027-03-29",
                            "weekday": "Monday",
                            "name": "Easter Monday"
                          },
                          {
                            "date": "2027-05-03",
                            "weekday": "Monday",
                            "name": "Early May bank holiday"
                          },
                          {
                            "date": "2027-05-31",
                            "weekday": "Monday",
                            "name": "Spring bank holiday"
                          },
                          {
                            "date": "2027-08-30",
                            "weekday": "Monday",
                            "name": "Summer bank holiday"
                          },
                          {
                            "date": "2027-12-27",
                            "weekday": "Monday",
                            "name": "Christmas Day (substitute day)"
                          },
                          {
                            "date": "2027-12-28",
                            "weekday": "Tuesday",
                            "name": "Boxing Day (substitute day)"
                          }
                        ],
                        "days_off": [
                          "2027-01-01",
                          "2027-03-26",
                          "2027-03-29",
                          "2027-05-03",
                          "2027-05-31",
                          "2027-08-30",
                          "2027-12-27",
                          "2027-12-28"
                        ],
                        "source": "GOV.UK: UK bank holidays",
                        "source_url": "https://www.gov.uk/bank-holidays"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "calendar": "GB-ENG",
                        "year": 2027
                      },
                      "formula": "fixed dates, n-th weekday of a month, and offsets from Easter Sunday (Gregorian computus); UK: a holiday at a weekend moves to the next working day",
                      "references": [
                        {
                          "title": "5 U.S.C. 6103, as listed by the US Office of Personnel Management",
                          "url": "https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/"
                        },
                        {
                          "title": "GOV.UK: UK bank holidays",
                          "url": "https://www.gov.uk/bank-holidays"
                        },
                        {
                          "title": "Germany: the Unification Treaty (3 October) and each state's public holiday act (Feiertagsgesetz), as summarised by the Federal Ministry of the Interior",
                          "url": "https://www.bmi.bund.de/DE/themen/verfassung/staatliche-symbole/nationale-feiertage/nationale-feiertage-node.html"
                        },
                        {
                          "title": "Code du travail, article L3133-1, as explained by Service-Public.fr",
                          "url": "https://www.service-public.gouv.fr/particuliers/vosdroits/F2405"
                        },
                        {
                          "title": "Government of the Netherlands: official public holidays",
                          "url": "https://www.rijksoverheid.nl/onderwerpen/arbeidsovereenkomst-en-cao/vraag-en-antwoord/officiele-feestdagen"
                        },
                        {
                          "title": "Organisation of Working Time Act 1997, as explained by Citizens Information",
                          "url": "https://www.citizensinformation.ie/en/employment/employment-rights-and-conditions/leave-and-holidays/public-holidays/"
                        },
                        {
                          "title": "Belgian Federal Public Service Employment: the ten statutory public holidays",
                          "url": "https://employment.belgium.be/en/themes/international/posting/working-conditions-be-respected-case-posting-belgium/public-holidays"
                        },
                        {
                          "title": "Feiertagsruhegesetz 1957, section 1 (Austrian legal information system)",
                          "url": "https://www.ris.bka.gv.at/GeltendeFassung.wxe?Abfrage=Bundesnormen&Gesetzesnummer=10008168"
                        },
                        {
                          "title": "Law 260 of 27 May 1949 and later amendments, as listed by the Italian government",
                          "url": "https://presidenza.governo.it/ufficio_cerimoniale/cerimoniale/giornate.html"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Bavaria in 2026",
                    "value": {
                      "calculator": "date/holidays@1",
                      "result": {
                        "calendar_name": "Germany: Bavaria",
                        "count": 12,
                        "holidays": [
                          {
                            "date": "2026-01-01",
                            "weekday": "Thursday",
                            "name": "New Year's Day",
                            "local_name": "Neujahr"
                          },
                          {
                            "date": "2026-01-06",
                            "weekday": "Tuesday",
                            "name": "Epiphany",
                            "local_name": "Heilige Drei Könige"
                          },
                          {
                            "date": "2026-04-03",
                            "weekday": "Friday",
                            "name": "Good Friday",
                            "local_name": "Karfreitag"
                          },
                          {
                            "date": "2026-04-06",
                            "weekday": "Monday",
                            "name": "Easter Monday",
                            "local_name": "Ostermontag"
                          },
                          {
                            "date": "2026-05-01",
                            "weekday": "Friday",
                            "name": "Labour Day",
                            "local_name": "Tag der Arbeit"
                          },
                          {
                            "date": "2026-05-14",
                            "weekday": "Thursday",
                            "name": "Ascension Day",
                            "local_name": "Christi Himmelfahrt"
                          },
                          {
                            "date": "2026-05-25",
                            "weekday": "Monday",
                            "name": "Whit Monday",
                            "local_name": "Pfingstmontag"
                          },
                          {
                            "date": "2026-06-04",
                            "weekday": "Thursday",
                            "name": "Corpus Christi",
                            "local_name": "Fronleichnam"
                          },
                          {
                            "date": "2026-10-03",
                            "weekday": "Saturday",
                            "name": "Day of German Unity",
                            "local_name": "Tag der Deutschen Einheit"
                          },
                          {
                            "date": "2026-11-01",
                            "weekday": "Sunday",
                            "name": "All Saints' Day",
                            "local_name": "Allerheiligen"
                          },
                          {
                            "date": "2026-12-25",
                            "weekday": "Friday",
                            "name": "Christmas Day",
                            "local_name": "1. Weihnachtstag"
                          },
                          {
                            "date": "2026-12-26",
                            "weekday": "Saturday",
                            "name": "Second day of Christmas",
                            "local_name": "2. Weihnachtstag"
                          }
                        ],
                        "days_off": [
                          "2026-01-01",
                          "2026-01-06",
                          "2026-04-03",
                          "2026-04-06",
                          "2026-05-01",
                          "2026-05-14",
                          "2026-05-25",
                          "2026-06-04",
                          "2026-10-03",
                          "2026-11-01",
                          "2026-12-25",
                          "2026-12-26"
                        ],
                        "source": "Germany: the Unification Treaty (3 October) and each state's public holiday act (Feiertagsgesetz), as summarised by the Federal Ministry of the Interior",
                        "source_url": "https://www.bmi.bund.de/DE/themen/verfassung/staatliche-symbole/nationale-feiertage/nationale-feiertage-node.html"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "calendar": "DE-BY",
                        "year": 2026
                      },
                      "formula": "fixed dates, n-th weekday of a month, and offsets from Easter Sunday (Gregorian computus); UK: a holiday at a weekend moves to the next working day",
                      "references": [
                        {
                          "title": "5 U.S.C. 6103, as listed by the US Office of Personnel Management",
                          "url": "https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/"
                        },
                        {
                          "title": "GOV.UK: UK bank holidays",
                          "url": "https://www.gov.uk/bank-holidays"
                        },
                        {
                          "title": "Germany: the Unification Treaty (3 October) and each state's public holiday act (Feiertagsgesetz), as summarised by the Federal Ministry of the Interior",
                          "url": "https://www.bmi.bund.de/DE/themen/verfassung/staatliche-symbole/nationale-feiertage/nationale-feiertage-node.html"
                        },
                        {
                          "title": "Code du travail, article L3133-1, as explained by Service-Public.fr",
                          "url": "https://www.service-public.gouv.fr/particuliers/vosdroits/F2405"
                        },
                        {
                          "title": "Government of the Netherlands: official public holidays",
                          "url": "https://www.rijksoverheid.nl/onderwerpen/arbeidsovereenkomst-en-cao/vraag-en-antwoord/officiele-feestdagen"
                        },
                        {
                          "title": "Organisation of Working Time Act 1997, as explained by Citizens Information",
                          "url": "https://www.citizensinformation.ie/en/employment/employment-rights-and-conditions/leave-and-holidays/public-holidays/"
                        },
                        {
                          "title": "Belgian Federal Public Service Employment: the ten statutory public holidays",
                          "url": "https://employment.belgium.be/en/themes/international/posting/working-conditions-be-respected-case-posting-belgium/public-holidays"
                        },
                        {
                          "title": "Feiertagsruhegesetz 1957, section 1 (Austrian legal information system)",
                          "url": "https://www.ris.bka.gv.at/GeltendeFassung.wxe?Abfrage=Bundesnormen&Gesetzesnummer=10008168"
                        },
                        {
                          "title": "Law 260 of 27 May 1949 and later amendments, as listed by the Italian government",
                          "url": "https://presidenza.governo.it/ufficio_cerimoniale/cerimoniale/giornate.html"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "date/holidays@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/date/timezone-convert": {
      "post": {
        "operationId": "calc_date_timezone_convert",
        "summary": "Time zone converter",
        "description": "A moment in up to 25 time zones at once, with each zone's UTC offset and whether daylight saving time applies, from the IANA time zone database.\n\nConverts a date and time to other time zones. Give the moment with a UTC offset, or as a local time with the zone it is in, and the zones you want. Each answer has the local date and time, the day of the week, the UTC offset in force at that moment and whether daylight saving time applies. A local time that does not exist (the clocks skip it) or happens twice (the clocks go back) is refused with an explanation instead of being guessed.",
        "tags": [
          "Date"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "datetime": {
                    "description": "The moment: an ISO 8601 date-time with a UTC offset, or a local time in from_timezone.",
                    "type": "string",
                    "format": "date-time",
                    "examples": [
                      "2026-03-29T09:00:00"
                    ]
                  },
                  "from_timezone": {
                    "description": "The IANA time zone of a datetime that has no UTC offset.",
                    "type": "string",
                    "examples": [
                      "Europe/Berlin"
                    ]
                  },
                  "to_timezones": {
                    "description": "The IANA time zones to convert to, such as America/New_York. 1 to 25 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 64
                    },
                    "minItems": 1,
                    "maxItems": 25,
                    "examples": [
                      [
                        "America/New_York",
                        "Asia/Kolkata",
                        "UTC"
                      ]
                    ]
                  }
                },
                "required": [
                  "datetime",
                  "to_timezones"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Nine in the morning in Berlin on the day the clocks go forward",
                  "value": {
                    "datetime": "2026-03-29T09:00:00",
                    "from_timezone": "Europe/Berlin",
                    "to_timezones": [
                      "America/New_York",
                      "Asia/Kolkata"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "date/timezone-convert@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "utc": {
                          "description": "The moment in UTC.",
                          "type": "string"
                        },
                        "conversions": {
                          "description": "The moment in each zone, in the order asked.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "timezone": {
                                "description": "The zone.",
                                "type": "string"
                              },
                              "local": {
                                "description": "The local date and time with its offset.",
                                "type": "string"
                              },
                              "weekday": {
                                "description": "The local day of the week.",
                                "type": "string"
                              },
                              "utc_offset": {
                                "description": "Offset from UTC at that moment.",
                                "type": "string"
                              },
                              "abbreviation": {
                                "description": "The zone's abbreviation then.",
                                "type": "string"
                              },
                              "daylight_saving": {
                                "description": "Whether daylight saving time applies.",
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "timezone",
                              "local",
                              "weekday",
                              "utc_offset",
                              "abbreviation",
                              "daylight_saving"
                            ]
                          }
                        },
                        "tz_database": {
                          "description": "The time zone data used.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "utc",
                        "conversions",
                        "tz_database"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Nine in the morning in Berlin on the day the clocks go forward",
                    "value": {
                      "calculator": "date/timezone-convert@1",
                      "result": {
                        "utc": "2026-03-29T07:00:00Z",
                        "conversions": [
                          {
                            "timezone": "America/New_York",
                            "local": "2026-03-29T03:00:00-04:00",
                            "weekday": "Sunday",
                            "utc_offset": "-04:00",
                            "abbreviation": "EDT",
                            "daylight_saving": true
                          },
                          {
                            "timezone": "Asia/Kolkata",
                            "local": "2026-03-29T12:30:00+05:30",
                            "weekday": "Sunday",
                            "utc_offset": "+05:30",
                            "abbreviation": "IST",
                            "daylight_saving": false
                          }
                        ],
                        "tz_database": "tzdata 2026.6 (IANA 2026f)"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "datetime": "2026-03-29T09:00:00",
                        "from_timezone": "Europe/Berlin",
                        "to_timezones": [
                          "America/New_York",
                          "Asia/Kolkata"
                        ]
                      },
                      "formula": "local time = UTC + the zone's offset at that instant, from the IANA rules",
                      "references": [
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        },
                        {
                          "title": "ISO 8601 date and time format",
                          "url": "https://www.iso.org/iso-8601-date-and-time-format.html"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "date/timezone-convert@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/date/working-days": {
      "post": {
        "operationId": "calc_date_working_days",
        "summary": "Working days calculator with public holidays",
        "description": "Working days between two dates, or the date a number of working days away, leaving out weekends and a country's public holidays.\n\nCounts the working days between two dates, or finds the date that lies a number of working days after (or before) a start date. Weekends and the public holidays of the chosen country or region are left out, and you can add your own closing days. The answer lists the holidays it skipped, so the count can be checked by hand.",
        "tags": [
          "Date"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start": {
                    "description": "The start date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-12-21"
                    ]
                  },
                  "end": {
                    "description": "The end date, to count working days.",
                    "type": "string",
                    "format": "date"
                  },
                  "add_days": {
                    "description": "Working days to move from start, to find a date; negative to go back. The start date itself is not counted. Allowed: >= -2500 and <= 2500.",
                    "type": "integer",
                    "minimum": -2500,
                    "maximum": 2500,
                    "examples": [
                      5
                    ]
                  },
                  "calendar": {
                    "description": "The public holidays to leave out (2020 to 2030). Omit it to count only weekends and extra_holidays. Options: US: United States (federal holidays); GB-ENG: United Kingdom: England and Wales; GB-SCT: United Kingdom: Scotland; GB-NIR: United Kingdom: Northern Ireland; DE: Germany (the nine nationwide holidays); DE-BW: Germany: Baden-Württemberg; DE-BY: Germany: Bavaria; DE-BE: Germany: Berlin; DE-BB: Germany: Brandenburg; DE-HB: Germany: Bremen; DE-HH: Germany: Hamburg; DE-HE: Germany: Hesse; DE-MV: Germany: Mecklenburg-Vorpommern; DE-NI: Germany: Lower Saxony; DE-NW: Germany: North Rhine-Westphalia; DE-RP: Germany: Rhineland-Palatinate; DE-SL: Germany: Saarland; DE-SN: Germany: Saxony; DE-ST: Germany: Saxony-Anhalt; DE-SH: Germany: Schleswig-Holstein; DE-TH: Germany: Thuringia; FR: France (mainland); NL: Netherlands; IE: Ireland; BE: Belgium; AT: Austria; IT: Italy",
                    "type": "string",
                    "enum": [
                      "US",
                      "GB-ENG",
                      "GB-SCT",
                      "GB-NIR",
                      "DE",
                      "DE-BW",
                      "DE-BY",
                      "DE-BE",
                      "DE-BB",
                      "DE-HB",
                      "DE-HH",
                      "DE-HE",
                      "DE-MV",
                      "DE-NI",
                      "DE-NW",
                      "DE-RP",
                      "DE-SL",
                      "DE-SN",
                      "DE-ST",
                      "DE-SH",
                      "DE-TH",
                      "FR",
                      "NL",
                      "IE",
                      "BE",
                      "AT",
                      "IT"
                    ]
                  },
                  "weekend": {
                    "description": "Days of the week that are not worked. Options: sat_sun: Saturday and Sunday; fri_sat: Friday and Saturday; sun: Sunday only; fri: Friday only; none: no weekend days",
                    "type": "string",
                    "enum": [
                      "sat_sun",
                      "fri_sat",
                      "sun",
                      "fri",
                      "none"
                    ],
                    "default": "sat_sun"
                  },
                  "extra_holidays": {
                    "description": "More days that are not worked, such as company closing days. Up to 1000 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "date"
                    },
                    "minItems": 0,
                    "maxItems": 1000
                  },
                  "include_end_date": {
                    "description": "When counting: whether the end date counts too. Without it the count runs from start up to the day before end.",
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "start"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Five working days after 21 December 2026 in England",
                  "value": {
                    "start": "2026-12-21",
                    "add_days": 5,
                    "calendar": "GB-ENG"
                  }
                },
                "example2": {
                  "summary": "US federal working days in July 2026",
                  "value": {
                    "start": "2026-07-01",
                    "end": "2026-07-31",
                    "calendar": "US",
                    "include_end_date": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "date/working-days@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "working_days": {
                          "description": "Working days from start to end; negative when end is before start.",
                          "type": "integer"
                        },
                        "result": {
                          "description": "The date add_days working days away.",
                          "type": "string",
                          "format": "date"
                        },
                        "weekday": {
                          "description": "The result's day of the week.",
                          "type": "string"
                        },
                        "holidays_skipped": {
                          "description": "The holidays on weekdays in the span, which were not counted.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "description": "The holiday.",
                                "type": "string",
                                "format": "date"
                              },
                              "weekday": {
                                "description": "Its day of the week.",
                                "type": "string"
                              },
                              "name": {
                                "description": "Its name.",
                                "type": "string"
                              }
                            },
                            "required": [
                              "date",
                              "weekday",
                              "name"
                            ]
                          }
                        }
                      },
                      "required": [
                        "holidays_skipped"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Five working days after 21 December 2026 in England",
                    "value": {
                      "calculator": "date/working-days@1",
                      "result": {
                        "result": "2026-12-30",
                        "weekday": "Wednesday",
                        "holidays_skipped": [
                          {
                            "date": "2026-12-25",
                            "weekday": "Friday",
                            "name": "Christmas Day"
                          },
                          {
                            "date": "2026-12-28",
                            "weekday": "Monday",
                            "name": "Boxing Day (substitute day)"
                          }
                        ]
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "start": "2026-12-21",
                        "add_days": 5,
                        "calendar": "GB-ENG",
                        "weekend": "sat_sun",
                        "include_end_date": false
                      },
                      "formula": "days in the span that are not a weekend day, a public holiday of the calendar or an extra holiday",
                      "references": [
                        {
                          "title": "5 U.S.C. 6103, as listed by the US Office of Personnel Management",
                          "url": "https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/"
                        },
                        {
                          "title": "GOV.UK: UK bank holidays",
                          "url": "https://www.gov.uk/bank-holidays"
                        },
                        {
                          "title": "Germany: the Unification Treaty (3 October) and each state's public holiday act (Feiertagsgesetz), as summarised by the Federal Ministry of the Interior",
                          "url": "https://www.bmi.bund.de/DE/themen/verfassung/staatliche-symbole/nationale-feiertage/nationale-feiertage-node.html"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "US federal working days in July 2026",
                    "value": {
                      "calculator": "date/working-days@1",
                      "result": {
                        "working_days": 22,
                        "holidays_skipped": [
                          {
                            "date": "2026-07-03",
                            "weekday": "Friday",
                            "name": "Independence Day (observed)"
                          }
                        ]
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "start": "2026-07-01",
                        "end": "2026-07-31",
                        "calendar": "US",
                        "weekend": "sat_sun",
                        "include_end_date": true
                      },
                      "formula": "days in the span that are not a weekend day, a public holiday of the calendar or an extra holiday",
                      "references": [
                        {
                          "title": "5 U.S.C. 6103, as listed by the US Office of Personnel Management",
                          "url": "https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/"
                        },
                        {
                          "title": "GOV.UK: UK bank holidays",
                          "url": "https://www.gov.uk/bank-holidays"
                        },
                        {
                          "title": "Germany: the Unification Treaty (3 October) and each state's public holiday act (Feiertagsgesetz), as summarised by the Federal Ministry of the Interior",
                          "url": "https://www.bmi.bund.de/DE/themen/verfassung/staatliche-symbole/nationale-feiertage/nationale-feiertage-node.html"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "date/working-days@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/date/working-hours": {
      "post": {
        "operationId": "calc_date_working_hours",
        "summary": "Working hours and SLA deadline calculator",
        "description": "The deadline a number of working hours after a start, or the working time between two moments, with office hours, weekends, public holidays and time zones.\n\nAnswers the two questions a service-level agreement asks. When is the deadline, if a ticket opened now must be answered within 8 working hours? And how much working time passed between the moment it opened and the moment it closed? Working time is the office hours you give, in the office's time zone, on days that are not a weekend day, a public holiday of the chosen calendar or one of your own closing days. Time outside office hours does not count: a ticket opened on Friday evening starts its clock on Monday morning.",
        "tags": [
          "Date"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start": {
                    "description": "When the clock starts: a date-time with a UTC offset, or a local time in timezone.",
                    "type": "string",
                    "format": "date-time",
                    "examples": [
                      "2026-12-24T15:30:00"
                    ]
                  },
                  "timezone": {
                    "description": "The IANA time zone the office hours are in.",
                    "type": "string",
                    "examples": [
                      "Europe/London"
                    ]
                  },
                  "add_hours": {
                    "description": "Working hours allowed, to find the deadline. Allowed: >= 0 and <= 20000. Unit: hours.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "8"
                    ]
                  },
                  "end": {
                    "description": "When the clock stops, to measure the working time.",
                    "type": "string",
                    "format": "date-time"
                  },
                  "day_start": {
                    "description": "When work starts each day, as HH:MM. At most 5 characters.",
                    "type": "string",
                    "maxLength": 5,
                    "default": "09:00"
                  },
                  "day_end": {
                    "description": "When work ends each day, as HH:MM; 24:00 for midnight. At most 5 characters.",
                    "type": "string",
                    "maxLength": 5,
                    "default": "17:00"
                  },
                  "calendar": {
                    "description": "The public holidays to leave out (2020 to 2030). Omit it to count only weekends and extra_holidays. Options: US: United States (federal holidays); GB-ENG: United Kingdom: England and Wales; GB-SCT: United Kingdom: Scotland; GB-NIR: United Kingdom: Northern Ireland; DE: Germany (the nine nationwide holidays); DE-BW: Germany: Baden-Württemberg; DE-BY: Germany: Bavaria; DE-BE: Germany: Berlin; DE-BB: Germany: Brandenburg; DE-HB: Germany: Bremen; DE-HH: Germany: Hamburg; DE-HE: Germany: Hesse; DE-MV: Germany: Mecklenburg-Vorpommern; DE-NI: Germany: Lower Saxony; DE-NW: Germany: North Rhine-Westphalia; DE-RP: Germany: Rhineland-Palatinate; DE-SL: Germany: Saarland; DE-SN: Germany: Saxony; DE-ST: Germany: Saxony-Anhalt; DE-SH: Germany: Schleswig-Holstein; DE-TH: Germany: Thuringia; FR: France (mainland); NL: Netherlands; IE: Ireland; BE: Belgium; AT: Austria; IT: Italy",
                    "type": "string",
                    "enum": [
                      "US",
                      "GB-ENG",
                      "GB-SCT",
                      "GB-NIR",
                      "DE",
                      "DE-BW",
                      "DE-BY",
                      "DE-BE",
                      "DE-BB",
                      "DE-HB",
                      "DE-HH",
                      "DE-HE",
                      "DE-MV",
                      "DE-NI",
                      "DE-NW",
                      "DE-RP",
                      "DE-SL",
                      "DE-SN",
                      "DE-ST",
                      "DE-SH",
                      "DE-TH",
                      "FR",
                      "NL",
                      "IE",
                      "BE",
                      "AT",
                      "IT"
                    ]
                  },
                  "weekend": {
                    "description": "Days of the week that are not worked. Options: sat_sun: Saturday and Sunday; fri_sat: Friday and Saturday; sun: Sunday only; fri: Friday only; none: no weekend days",
                    "type": "string",
                    "enum": [
                      "sat_sun",
                      "fri_sat",
                      "sun",
                      "fri",
                      "none"
                    ],
                    "default": "sat_sun"
                  },
                  "extra_holidays": {
                    "description": "More days that are not worked, such as company closing days. Up to 1000 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "date"
                    },
                    "minItems": 0,
                    "maxItems": 1000
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=4)."
                  }
                },
                "required": [
                  "start",
                  "timezone"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Eight working hours from the afternoon of Christmas Eve 2026 in London",
                  "value": {
                    "start": "2026-12-24T15:30:00",
                    "timezone": "Europe/London",
                    "add_hours": "8",
                    "calendar": "GB-ENG"
                  }
                },
                "example2": {
                  "summary": "Working time from Friday 16:00 to Monday 10:30 in New York",
                  "value": {
                    "start": "2026-03-06T16:00:00",
                    "end": "2026-03-09T10:30:00",
                    "timezone": "America/New_York"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "date/working-hours@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "deadline": {
                          "description": "The moment the working hours are used up, in the office's time zone.",
                          "type": "string"
                        },
                        "deadline_utc": {
                          "description": "The same moment in UTC.",
                          "type": "string"
                        },
                        "weekday": {
                          "description": "The deadline's day of the week.",
                          "type": "string"
                        },
                        "working_hours": {
                          "description": "Working time from start to end, in hours; negative when end is before start. Unit: hours.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "working_minutes": {
                          "description": "The same in minutes. Unit: minutes.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "days_with_working_time": {
                          "description": "How many days had some working time in the span.",
                          "type": "integer"
                        },
                        "tz_database": {
                          "description": "The time zone data used.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "tz_database"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Eight working hours from the afternoon of Christmas Eve 2026 in London",
                    "value": {
                      "calculator": "date/working-hours@1",
                      "result": {
                        "deadline": "2026-12-29T15:30:00+00:00",
                        "deadline_utc": "2026-12-29T15:30:00Z",
                        "weekday": "Tuesday",
                        "tz_database": "tzdata 2026.6 (IANA 2026f)"
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 4
                      },
                      "inputs": {
                        "start": "2026-12-24T15:30:00",
                        "timezone": "Europe/London",
                        "add_hours": "8",
                        "day_start": "09:00",
                        "day_end": "17:00",
                        "calendar": "GB-ENG",
                        "weekend": "sat_sun"
                      },
                      "formula": "working time = the part of [start, end] inside day_start to day_end on working days; the deadline is the earliest moment with add_hours of working time behind it",
                      "references": [
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        },
                        {
                          "title": "5 U.S.C. 6103, as listed by the US Office of Personnel Management",
                          "url": "https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/"
                        },
                        {
                          "title": "GOV.UK: UK bank holidays",
                          "url": "https://www.gov.uk/bank-holidays"
                        },
                        {
                          "title": "Germany: the Unification Treaty (3 October) and each state's public holiday act (Feiertagsgesetz), as summarised by the Federal Ministry of the Interior",
                          "url": "https://www.bmi.bund.de/DE/themen/verfassung/staatliche-symbole/nationale-feiertage/nationale-feiertage-node.html"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Working time from Friday 16:00 to Monday 10:30 in New York",
                    "value": {
                      "calculator": "date/working-hours@1",
                      "result": {
                        "working_hours": "2.5000",
                        "working_minutes": "150.0000",
                        "days_with_working_time": 2,
                        "tz_database": "tzdata 2026.6 (IANA 2026f)"
                      },
                      "exactness": {
                        "working_hours": "exact",
                        "working_minutes": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 4
                      },
                      "inputs": {
                        "start": "2026-03-06T16:00:00",
                        "timezone": "America/New_York",
                        "end": "2026-03-09T10:30:00",
                        "day_start": "09:00",
                        "day_end": "17:00",
                        "weekend": "sat_sun"
                      },
                      "formula": "working time = the part of [start, end] inside day_start to day_end on working days; the deadline is the earliest moment with add_hours of working time behind it",
                      "references": [
                        {
                          "title": "IANA Time Zone Database",
                          "url": "https://www.iana.org/time-zones"
                        },
                        {
                          "title": "5 U.S.C. 6103, as listed by the US Office of Personnel Management",
                          "url": "https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/"
                        },
                        {
                          "title": "GOV.UK: UK bank holidays",
                          "url": "https://www.gov.uk/bank-holidays"
                        },
                        {
                          "title": "Germany: the Unification Treaty (3 October) and each state's public holiday act (Feiertagsgesetz), as summarised by the Federal Ministry of the Interior",
                          "url": "https://www.bmi.bund.de/DE/themen/verfassung/staatliche-symbole/nationale-feiertage/nationale-feiertage-node.html"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "date/working-hours@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/everyday/discount": {
      "post": {
        "operationId": "calc_everyday_discount",
        "summary": "Discount calculator",
        "description": "Sale price after a percentage or fixed discount, an optional stacked second discount and sales tax.\n\nApplies a discount (percent or amount), then an optional second percentage discount on the reduced price (the way '20% off, then an extra 10%' works in shops), then sales tax. Each money amount is rounded to the cent and the totals are built from those rounded amounts, so the figures always add up.",
        "tags": [
          "Everyday"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "price": {
                    "description": "Original price. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "80"
                    ]
                  },
                  "discount_percent": {
                    "description": "Discount in percent. Give this or discount_amount. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "25"
                    ]
                  },
                  "discount_amount": {
                    "description": "Discount as an amount. Give this or discount_percent. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "additional_discount_percent": {
                    "description": "Second discount applied to the already reduced price. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "sales_tax_percent": {
                    "description": "Sales tax added after the discounts. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "price"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "25% off 80",
                  "value": {
                    "price": "80",
                    "discount_percent": "25"
                  }
                },
                "example2": {
                  "summary": "20% then an extra 10%",
                  "value": {
                    "price": "100",
                    "discount_percent": "20",
                    "additional_discount_percent": "10"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "everyday/discount@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "discount_amount": {
                          "description": "First discount. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "additional_discount_amount": {
                          "description": "Second discount. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "price_after_discount": {
                          "description": "Price after both discounts. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "tax_amount": {
                          "description": "Sales tax on the discounted price. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "final_price": {
                          "description": "Price after discounts plus tax. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_savings": {
                          "description": "Both discounts together. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "effective_discount_percent": {
                          "description": "Total savings as a percent of the price. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "discount_amount",
                        "additional_discount_amount",
                        "price_after_discount",
                        "tax_amount",
                        "final_price",
                        "total_savings",
                        "effective_discount_percent"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "25% off 80",
                    "value": {
                      "calculator": "everyday/discount@1",
                      "result": {
                        "discount_amount": "20.00",
                        "additional_discount_amount": "0.00",
                        "price_after_discount": "60.00",
                        "tax_amount": "0.00",
                        "final_price": "60.00",
                        "total_savings": "20.00",
                        "effective_discount_percent": "25.00"
                      },
                      "exactness": {
                        "discount_amount": "exact",
                        "additional_discount_amount": "exact",
                        "price_after_discount": "exact",
                        "tax_amount": "exact",
                        "final_price": "exact",
                        "total_savings": "exact",
                        "effective_discount_percent": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "price": "80",
                        "discount_percent": "25",
                        "additional_discount_percent": "0",
                        "sales_tax_percent": "0"
                      },
                      "formula": "after = price − d₁ − (price − d₁)·p₂; final = after + after·tax",
                      "references": [
                        {
                          "title": "Discounts and allowances",
                          "url": "https://en.wikipedia.org/wiki/Discounts_and_allowances"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "20% then an extra 10%",
                    "value": {
                      "calculator": "everyday/discount@1",
                      "result": {
                        "discount_amount": "20.00",
                        "additional_discount_amount": "8.00",
                        "price_after_discount": "72.00",
                        "tax_amount": "0.00",
                        "final_price": "72.00",
                        "total_savings": "28.00",
                        "effective_discount_percent": "28.00"
                      },
                      "exactness": {
                        "discount_amount": "exact",
                        "additional_discount_amount": "exact",
                        "price_after_discount": "exact",
                        "tax_amount": "exact",
                        "final_price": "exact",
                        "total_savings": "exact",
                        "effective_discount_percent": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "price": "100",
                        "discount_percent": "20",
                        "additional_discount_percent": "10",
                        "sales_tax_percent": "0"
                      },
                      "formula": "after = price − d₁ − (price − d₁)·p₂; final = after + after·tax",
                      "references": [
                        {
                          "title": "Discounts and allowances",
                          "url": "https://en.wikipedia.org/wiki/Discounts_and_allowances"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "everyday/discount@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/everyday/tip": {
      "post": {
        "operationId": "calc_everyday_tip",
        "summary": "Tip and bill split calculator",
        "description": "Tip amount, total and a fair split between people where the shares add up exactly to the bill.\n\nAdds a tip and splits the total. Splitting 100.00 three ways cannot give three equal amounts in cents, so the shares are 33.34, 33.33 and 33.33: they always add up to the total exactly, and the response says how many people pay one extra cent.",
        "tags": [
          "Everyday"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bill_amount": {
                    "description": "Bill before the tip. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "100"
                    ]
                  },
                  "tip_percent": {
                    "description": "Tip in percent of the bill. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "15"
                  },
                  "people": {
                    "description": "Number of people splitting the bill. Allowed: >= 1 and <= 1000.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "default": 1
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "bill_amount"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "100 split 3 ways, no tip",
                  "value": {
                    "bill_amount": "100",
                    "tip_percent": "0",
                    "people": 3
                  }
                },
                "example2": {
                  "summary": "18% tip on 64.50 for 2",
                  "value": {
                    "bill_amount": "64.50",
                    "tip_percent": "18",
                    "people": 2
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "everyday/tip@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "tip_amount": {
                          "description": "The tip. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total": {
                          "description": "Bill plus tip. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "per_person": {
                          "description": "Total ÷ people, rounded. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "shares": {
                          "description": "What each person pays; adds up exactly to total.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "people_paying_extra": {
                          "description": "How many shares carry one extra smallest unit.",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "tip_amount",
                        "total",
                        "per_person",
                        "shares",
                        "people_paying_extra"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "100 split 3 ways, no tip",
                    "value": {
                      "calculator": "everyday/tip@1",
                      "result": {
                        "tip_amount": "0.00",
                        "total": "100.00",
                        "per_person": "33.33",
                        "shares": [
                          "33.34",
                          "33.33",
                          "33.33"
                        ],
                        "people_paying_extra": 1
                      },
                      "exactness": {
                        "tip_amount": "exact",
                        "total": "exact",
                        "per_person": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "bill_amount": "100",
                        "tip_percent": "0",
                        "people": 3
                      },
                      "formula": "tip = bill × p; shares = total split into whole cents, remainder spread one cent at a time",
                      "references": [
                        {
                          "title": "Largest remainder method (fair rounding of shares)",
                          "url": "https://en.wikipedia.org/wiki/Largest_remainders_method"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "18% tip on 64.50 for 2",
                    "value": {
                      "calculator": "everyday/tip@1",
                      "result": {
                        "tip_amount": "11.61",
                        "total": "76.11",
                        "per_person": "38.06",
                        "shares": [
                          "38.06",
                          "38.05"
                        ],
                        "people_paying_extra": 1
                      },
                      "exactness": {
                        "tip_amount": "exact",
                        "total": "exact",
                        "per_person": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "bill_amount": "64.5",
                        "tip_percent": "18",
                        "people": 2
                      },
                      "formula": "tip = bill × p; shares = total split into whole cents, remainder spread one cent at a time",
                      "references": [
                        {
                          "title": "Largest remainder method (fair rounding of shares)",
                          "url": "https://en.wikipedia.org/wiki/Largest_remainders_method"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "everyday/tip@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/cumipmt": {
      "post": {
        "operationId": "calc_excel_cumipmt",
        "summary": "Excel CUMIPMT function: interest paid between two periods",
        "description": "Total interest paid on a loan from one period to another, as Excel's CUMIPMT.\n\nCUMIPMT(rate, nper, pv, start_period, end_period, type).",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rate": {
                    "description": "Interest rate per period, as a decimal (0.005 for 0.5%). Write a monthly rate from an annual one as \"0.06/12\". A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.08/12"
                    ]
                  },
                  "nper": {
                    "description": "Total number of payment periods. Allowed: >= 1 and <= 12000.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12000,
                    "examples": [
                      360
                    ]
                  },
                  "pv": {
                    "description": "Present value (the loan amount). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "125000"
                    ]
                  },
                  "start_period": {
                    "description": "First period to include (periods start at 1). Allowed: >= 1 and <= 12000.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12000,
                    "examples": [
                      13
                    ]
                  },
                  "end_period": {
                    "description": "Last period to include. Allowed: >= 1 and <= 12000.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12000,
                    "examples": [
                      24
                    ]
                  },
                  "type": {
                    "description": "0: payments at the end of each period; 1: at the beginning. Allowed: >= 0 and <= 1.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "rate",
                  "nper",
                  "pv",
                  "start_period",
                  "end_period",
                  "type"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: interest in the second year of a 30-year $125,000 loan at 9%",
                  "value": {
                    "rate": "0.09/12",
                    "nper": 360,
                    "pv": "125000",
                    "start_period": 13,
                    "end_period": 24,
                    "type": 0,
                    "options": {
                      "decimals": 5
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/cumipmt@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "cumipmt": {
                          "description": "Total interest over the periods (negative: paid).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "cumipmt"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: interest in the second year of a 30-year $125,000 loan at 9%",
                    "value": {
                      "calculator": "excel/cumipmt@1",
                      "result": {
                        "cumipmt": "-11135.23213"
                      },
                      "exactness": {
                        "cumipmt": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 5
                      },
                      "inputs": {
                        "rate": "0.0075",
                        "nper": 360,
                        "pv": "125000",
                        "start_period": 13,
                        "end_period": 24,
                        "type": 0
                      },
                      "formula": "Σ IPMT(rate, k, nper, pv, 0, type) for k = start_period … end_period",
                      "references": [
                        {
                          "title": "Microsoft Excel CUMIPMT function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/cumipmt-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/cumipmt@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/cumprinc": {
      "post": {
        "operationId": "calc_excel_cumprinc",
        "summary": "Excel CUMPRINC function: principal paid between two periods",
        "description": "Total principal repaid from one period to another, as Excel's CUMPRINC.\n\nCUMPRINC(rate, nper, pv, start_period, end_period, type).",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rate": {
                    "description": "Interest rate per period, as a decimal (0.005 for 0.5%). Write a monthly rate from an annual one as \"0.06/12\". A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.08/12"
                    ]
                  },
                  "nper": {
                    "description": "Total number of payment periods. Allowed: >= 1 and <= 12000.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12000,
                    "examples": [
                      360
                    ]
                  },
                  "pv": {
                    "description": "Present value (the loan amount). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "125000"
                    ]
                  },
                  "start_period": {
                    "description": "First period to include (periods start at 1). Allowed: >= 1 and <= 12000.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12000,
                    "examples": [
                      13
                    ]
                  },
                  "end_period": {
                    "description": "Last period to include. Allowed: >= 1 and <= 12000.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12000,
                    "examples": [
                      24
                    ]
                  },
                  "type": {
                    "description": "0: payments at the end of each period; 1: at the beginning. Allowed: >= 0 and <= 1.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "rate",
                  "nper",
                  "pv",
                  "start_period",
                  "end_period",
                  "type"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: principal in the second year of a 30-year $125,000 loan",
                  "value": {
                    "rate": "0.09/12",
                    "nper": 360,
                    "pv": "125000",
                    "start_period": 13,
                    "end_period": 24,
                    "type": 0,
                    "options": {
                      "decimals": 7
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/cumprinc@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "cumprinc": {
                          "description": "Total principal over the periods (negative: paid).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "cumprinc"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: principal in the second year of a 30-year $125,000 loan",
                    "value": {
                      "calculator": "excel/cumprinc@1",
                      "result": {
                        "cumprinc": "-934.1071234"
                      },
                      "exactness": {
                        "cumprinc": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 7
                      },
                      "inputs": {
                        "rate": "0.0075",
                        "nper": 360,
                        "pv": "125000",
                        "start_period": 13,
                        "end_period": 24,
                        "type": 0
                      },
                      "formula": "Σ PPMT(rate, k, nper, pv, 0, type) for k = start_period … end_period",
                      "references": [
                        {
                          "title": "Microsoft Excel CUMPRINC function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/cumprinc-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/cumprinc@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/days360": {
      "post": {
        "operationId": "calc_excel_days360",
        "summary": "Excel DAYS360 function: days on a 360-day year",
        "description": "Days between two dates on a 360-day year, by the US (NASD) or European method, as Excel's DAYS360.\n\nDAYS360(start_date, end_date, [method]). US method (false): a start date on the last day of a month becomes the 30th; an end date on the 31st becomes the 1st of the next month if the start day is before the 30th, otherwise the 30th. European method (true): every 31st becomes the 30th.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "description": "Start date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2011-01-01"
                    ]
                  },
                  "end_date": {
                    "description": "End date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2011-12-31"
                    ]
                  },
                  "method": {
                    "description": "false: US (NASD) method; true: European method.",
                    "type": "boolean",
                    "default": false
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=0)."
                  }
                },
                "required": [
                  "start_date",
                  "end_date"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: 30 January to 1 February 2011",
                  "value": {
                    "start_date": "2011-01-30",
                    "end_date": "2011-02-01"
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: the whole of 2011",
                  "value": {
                    "start_date": "2011-01-01",
                    "end_date": "2011-12-31"
                  }
                },
                "example3": {
                  "summary": "Microsoft's example: 1 January to 1 February 2011",
                  "value": {
                    "start_date": "2011-01-01",
                    "end_date": "2011-02-01"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/days360@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "days": {
                          "description": "Days on a 360-day year (negative if end is before start).",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "days"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: 30 January to 1 February 2011",
                    "value": {
                      "calculator": "excel/days360@1",
                      "result": {
                        "days": 1
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2011-01-30",
                        "end_date": "2011-02-01",
                        "method": false
                      },
                      "formula": "360·(y₂ − y₁) + 30·(m₂ − m₁) + (d₂ − d₁), after the method's adjustments",
                      "references": [
                        {
                          "title": "Microsoft Excel DAYS360 function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/days360-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: the whole of 2011",
                    "value": {
                      "calculator": "excel/days360@1",
                      "result": {
                        "days": 360
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2011-01-01",
                        "end_date": "2011-12-31",
                        "method": false
                      },
                      "formula": "360·(y₂ − y₁) + 30·(m₂ − m₁) + (d₂ − d₁), after the method's adjustments",
                      "references": [
                        {
                          "title": "Microsoft Excel DAYS360 function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/days360-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Microsoft's example: 1 January to 1 February 2011",
                    "value": {
                      "calculator": "excel/days360@1",
                      "result": {
                        "days": 30
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2011-01-01",
                        "end_date": "2011-02-01",
                        "method": false
                      },
                      "formula": "360·(y₂ − y₁) + 30·(m₂ − m₁) + (d₂ − d₁), after the method's adjustments",
                      "references": [
                        {
                          "title": "Microsoft Excel DAYS360 function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/days360-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/days360@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/db": {
      "post": {
        "operationId": "calc_excel_db",
        "summary": "Excel DB function: fixed-declining balance depreciation",
        "description": "Fixed-declining balance depreciation for one period, as Excel's DB, including its three-decimal rate and part-year first and last periods.\n\nDB(cost, salvage, life, period, [month]). The rate 1 − (salvage/cost)^(1/life) is rounded to three decimals, as Excel does. The first period covers month months; when month < 12 there is a final period life + 1 for the remainder.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cost": {
                    "description": "Initial cost of the asset. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "2400"
                    ]
                  },
                  "salvage": {
                    "description": "Value at the end of its life (can be 0). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "300"
                    ]
                  },
                  "life": {
                    "description": "Life in years (whole years). Allowed: >= 1 and <= 1200.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1200,
                    "examples": [
                      6
                    ]
                  },
                  "period": {
                    "description": "The period (year) to calculate, from 1. Allowed: >= 1 and <= 1201.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1201,
                    "examples": [
                      1
                    ]
                  },
                  "month": {
                    "description": "Months in the first year (default 12). Allowed: >= 1 and <= 12.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12,
                    "default": 12
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "cost",
                  "salvage",
                  "life",
                  "period"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: year 1, 7 months",
                  "value": {
                    "cost": "1000000",
                    "salvage": "100000",
                    "life": 6,
                    "period": 1,
                    "month": 7,
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: year 7, 5 months",
                  "value": {
                    "cost": "1000000",
                    "salvage": "100000",
                    "life": 6,
                    "period": 7,
                    "month": 7,
                    "options": {
                      "decimals": 2
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/db@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "db": {
                          "description": "Depreciation in that period.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "rate": {
                          "description": "The rounded rate Excel uses.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "db",
                        "rate"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: year 1, 7 months",
                    "value": {
                      "calculator": "excel/db@1",
                      "result": {
                        "db": "186083.33",
                        "rate": "0.32"
                      },
                      "exactness": {
                        "db": "rounded",
                        "rate": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "1000000",
                        "salvage": "100000",
                        "life": 6,
                        "period": 1,
                        "month": 7
                      },
                      "formula": "period 1: cost·rate·month/12; then (cost − prior depreciation)·rate; last: (cost − prior)·rate·(12 − month)/12",
                      "references": [
                        {
                          "title": "Microsoft Excel DB function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/db-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: year 7, 5 months",
                    "value": {
                      "calculator": "excel/db@1",
                      "result": {
                        "db": "15845.10",
                        "rate": "0.32"
                      },
                      "exactness": {
                        "db": "rounded",
                        "rate": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "1000000",
                        "salvage": "100000",
                        "life": 6,
                        "period": 7,
                        "month": 7
                      },
                      "formula": "period 1: cost·rate·month/12; then (cost − prior depreciation)·rate; last: (cost − prior)·rate·(12 − month)/12",
                      "references": [
                        {
                          "title": "Microsoft Excel DB function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/db-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/db@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/ddb": {
      "post": {
        "operationId": "calc_excel_ddb",
        "summary": "Excel DDB function: double-declining balance depreciation",
        "description": "Double-declining (or any factor) balance depreciation for one period, as Excel's DDB.\n\nDDB(cost, salvage, life, period, [factor]) = min((cost − prior depreciation)·factor/life, cost − salvage − prior depreciation).",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cost": {
                    "description": "Initial cost of the asset. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "2400"
                    ]
                  },
                  "salvage": {
                    "description": "Value at the end of its life (can be 0). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "300"
                    ]
                  },
                  "life": {
                    "description": "Number of periods over which the asset is depreciated. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 10000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "period": {
                    "description": "The period, in the same unit as life. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 10000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "1"
                    ]
                  },
                  "factor": {
                    "description": "Rate at which the balance declines (2 is double-declining). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "default": "2"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "cost",
                  "salvage",
                  "life",
                  "period"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: first day",
                  "value": {
                    "cost": "2400",
                    "salvage": "300",
                    "life": "3650",
                    "period": "1",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: first year",
                  "value": {
                    "cost": "2400",
                    "salvage": "300",
                    "life": "10",
                    "period": "1",
                    "factor": "2",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example3": {
                  "summary": "Microsoft's example: second year, factor 1.5",
                  "value": {
                    "cost": "2400",
                    "salvage": "300",
                    "life": "10",
                    "period": "2",
                    "factor": "1.5",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example4": {
                  "summary": "Microsoft's example: tenth year",
                  "value": {
                    "cost": "2400",
                    "salvage": "300",
                    "life": "10",
                    "period": "10",
                    "options": {
                      "decimals": 2
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/ddb@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "ddb": {
                          "description": "Depreciation in that period.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "ddb"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: first day",
                    "value": {
                      "calculator": "excel/ddb@1",
                      "result": {
                        "ddb": "1.32"
                      },
                      "exactness": {
                        "ddb": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "2400",
                        "salvage": "300",
                        "life": "3650",
                        "period": "1",
                        "factor": "2"
                      },
                      "formula": "min(book·factor/life, book − salvage)",
                      "references": [
                        {
                          "title": "Microsoft Excel DDB function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/ddb-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: first year",
                    "value": {
                      "calculator": "excel/ddb@1",
                      "result": {
                        "ddb": "480.00"
                      },
                      "exactness": {
                        "ddb": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "2400",
                        "salvage": "300",
                        "life": "10",
                        "period": "1",
                        "factor": "2"
                      },
                      "formula": "min(book·factor/life, book − salvage)",
                      "references": [
                        {
                          "title": "Microsoft Excel DDB function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/ddb-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Microsoft's example: second year, factor 1.5",
                    "value": {
                      "calculator": "excel/ddb@1",
                      "result": {
                        "ddb": "306.00"
                      },
                      "exactness": {
                        "ddb": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "2400",
                        "salvage": "300",
                        "life": "10",
                        "period": "2",
                        "factor": "1.5"
                      },
                      "formula": "min(book·factor/life, book − salvage)",
                      "references": [
                        {
                          "title": "Microsoft Excel DDB function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/ddb-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example4": {
                    "summary": "Microsoft's example: tenth year",
                    "value": {
                      "calculator": "excel/ddb@1",
                      "result": {
                        "ddb": "22.12"
                      },
                      "exactness": {
                        "ddb": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "2400",
                        "salvage": "300",
                        "life": "10",
                        "period": "10",
                        "factor": "2"
                      },
                      "formula": "min(book·factor/life, book − salvage)",
                      "references": [
                        {
                          "title": "Microsoft Excel DDB function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/ddb-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/ddb@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/duration": {
      "post": {
        "operationId": "calc_excel_duration",
        "summary": "Excel DURATION function: Macaulay duration of a bond",
        "description": "The Macaulay duration of a bond with periodic coupons, as Excel's DURATION: the average time to its payments, weighted by their present value.\n\nDURATION(settlement, maturity, coupon, yld, frequency, [basis]): the Macaulay duration in years for an assumed par value of 100. It is the weighted average of the times at which the bond pays, each weighted by the present value of that payment at the given yield, and measures how sensitive the price is to the yield.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settlement": {
                    "description": "Settlement date (when the buyer gets the bond).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2018-07-01"
                    ]
                  },
                  "maturity": {
                    "description": "Maturity date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2048-01-01"
                    ]
                  },
                  "coupon": {
                    "description": "Annual coupon rate as a decimal. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.08"
                    ]
                  },
                  "yld": {
                    "description": "Annual yield as a decimal. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.09"
                    ]
                  },
                  "frequency": {
                    "description": "Coupons per year: 1, 2 or 4. Allowed: >= 1 and <= 4.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4,
                    "examples": [
                      2
                    ]
                  },
                  "basis": {
                    "description": "Day count basis: 0 US (NASD) 30/360; 1 Actual/actual; 2 Actual/360; 3 Actual/365; 4 European 30/360. Allowed: >= 0 and <= 4.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4,
                    "default": 0
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "settlement",
                  "maturity",
                  "coupon",
                  "yld",
                  "frequency"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: 8% coupon, 9% yield, 2018 to 2048, actual/actual",
                  "value": {
                    "settlement": "2018-07-01",
                    "maturity": "2048-01-01",
                    "coupon": "0.08",
                    "yld": "0.09",
                    "frequency": 2,
                    "basis": 1,
                    "options": {
                      "decimals": 7
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/duration@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "duration": {
                          "description": "Macaulay duration in years.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "coupons_remaining": {
                          "description": "Coupons from settlement to maturity (N).",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "duration",
                        "coupons_remaining"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: 8% coupon, 9% yield, 2018 to 2048, actual/actual",
                    "value": {
                      "calculator": "excel/duration@1",
                      "result": {
                        "duration": "10.9191453",
                        "coupons_remaining": 59
                      },
                      "exactness": {
                        "duration": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 7
                      },
                      "inputs": {
                        "settlement": "2018-07-01",
                        "maturity": "2048-01-01",
                        "coupon": "0.08",
                        "yld": "0.09",
                        "frequency": 2,
                        "basis": 1
                      },
                      "formula": "Σ t_k·CF_k/(1 + yld/f)^t_k ÷ Σ CF_k/(1 + yld/f)^t_k ÷ f, t_k = k − 1 + DSC/E",
                      "references": [
                        {
                          "title": "Microsoft Excel DURATION function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/duration-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/duration@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/edate": {
      "post": {
        "operationId": "calc_excel_edate",
        "summary": "Excel EDATE function: same day, months later",
        "description": "The same day of the month a number of months before or after a date, as Excel's EDATE.\n\nEDATE(start_date, months). A day the target month lacks becomes its last day (31 January + 1 month = 28 or 29 February).",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "description": "Start date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2011-01-15"
                    ]
                  },
                  "months": {
                    "description": "Months to move: positive for later, negative for earlier. Allowed: >= -120000 and <= 120000.",
                    "type": "integer",
                    "minimum": -120000,
                    "maximum": 120000,
                    "examples": [
                      1
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=0)."
                  }
                },
                "required": [
                  "start_date",
                  "months"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: one month after 15 January 2011",
                  "value": {
                    "start_date": "2011-01-15",
                    "months": 1
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: one month before",
                  "value": {
                    "start_date": "2011-01-15",
                    "months": -1
                  }
                },
                "example3": {
                  "summary": "Microsoft's example: two months after",
                  "value": {
                    "start_date": "2011-01-15",
                    "months": 2
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/edate@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "date": {
                          "description": "The resulting date.",
                          "type": "string",
                          "format": "date"
                        },
                        "serial": {
                          "description": "Excel's serial number for the date.",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "date",
                        "serial"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: one month after 15 January 2011",
                    "value": {
                      "calculator": "excel/edate@1",
                      "result": {
                        "date": "2011-02-15",
                        "serial": 40589
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2011-01-15",
                        "months": 1
                      },
                      "formula": "start_date moved by months, clamped to the month's end",
                      "references": [
                        {
                          "title": "Microsoft Excel EDATE function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/edate-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: one month before",
                    "value": {
                      "calculator": "excel/edate@1",
                      "result": {
                        "date": "2010-12-15",
                        "serial": 40527
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2011-01-15",
                        "months": -1
                      },
                      "formula": "start_date moved by months, clamped to the month's end",
                      "references": [
                        {
                          "title": "Microsoft Excel EDATE function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/edate-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Microsoft's example: two months after",
                    "value": {
                      "calculator": "excel/edate@1",
                      "result": {
                        "date": "2011-03-15",
                        "serial": 40617
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2011-01-15",
                        "months": 2
                      },
                      "formula": "start_date moved by months, clamped to the month's end",
                      "references": [
                        {
                          "title": "Microsoft Excel EDATE function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/edate-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/edate@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/effect": {
      "post": {
        "operationId": "calc_excel_effect",
        "summary": "Excel EFFECT function: effective annual rate",
        "description": "The effective annual rate from a nominal rate and compounding periods, as Excel's EFFECT.\n\nEFFECT(nominal_rate, npery) = (1 + nominal_rate/npery)^npery − 1.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "nominal_rate": {
                    "description": "Nominal annual rate as a decimal. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.0525"
                    ]
                  },
                  "npery": {
                    "description": "Compounding periods per year (whole number). Allowed: >= 1 and <= 100000.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100000,
                    "examples": [
                      4
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "nominal_rate",
                  "npery"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: 5.25% compounded quarterly",
                  "value": {
                    "nominal_rate": "0.0525",
                    "npery": 4,
                    "options": {
                      "significant_digits": 6
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/effect@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "effect": {
                          "description": "Effective annual rate as a decimal.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "effect"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: 5.25% compounded quarterly",
                    "value": {
                      "calculator": "excel/effect@1",
                      "result": {
                        "effect": "0.0535427"
                      },
                      "exactness": {
                        "effect": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 6
                      },
                      "inputs": {
                        "nominal_rate": "0.0525",
                        "npery": 4
                      },
                      "formula": "(1 + nominal/npery)^npery − 1",
                      "references": [
                        {
                          "title": "Microsoft Excel EFFECT function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/effect-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/effect@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/eomonth": {
      "post": {
        "operationId": "calc_excel_eomonth",
        "summary": "Excel EOMONTH function: end of month",
        "description": "The last day of the month a number of months before or after a date, as Excel's EOMONTH.\n\nEOMONTH(start_date, months).",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "description": "Start date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2011-01-01"
                    ]
                  },
                  "months": {
                    "description": "Months to move: positive for later, negative for earlier. Allowed: >= -120000 and <= 120000.",
                    "type": "integer",
                    "minimum": -120000,
                    "maximum": 120000,
                    "examples": [
                      1
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=0)."
                  }
                },
                "required": [
                  "start_date",
                  "months"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: end of the next month",
                  "value": {
                    "start_date": "2011-01-01",
                    "months": 1
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: end of the month three months earlier",
                  "value": {
                    "start_date": "2011-01-01",
                    "months": -3
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/eomonth@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "date": {
                          "description": "The last day of the target month.",
                          "type": "string",
                          "format": "date"
                        },
                        "serial": {
                          "description": "Excel's serial number for the date.",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "date",
                        "serial"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: end of the next month",
                    "value": {
                      "calculator": "excel/eomonth@1",
                      "result": {
                        "date": "2011-02-28",
                        "serial": 40602
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2011-01-01",
                        "months": 1
                      },
                      "formula": "last day of (start_date's month + months)",
                      "references": [
                        {
                          "title": "Microsoft Excel EOMONTH function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/eomonth-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: end of the month three months earlier",
                    "value": {
                      "calculator": "excel/eomonth@1",
                      "result": {
                        "date": "2010-10-31",
                        "serial": 40482
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2011-01-01",
                        "months": -3
                      },
                      "formula": "last day of (start_date's month + months)",
                      "references": [
                        {
                          "title": "Microsoft Excel EOMONTH function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/eomonth-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/eomonth@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/fv": {
      "post": {
        "operationId": "calc_excel_fv",
        "summary": "Excel FV function: future value",
        "description": "The future value of an investment with equal payments, the same as Excel's FV.\n\nFV(rate, nper, pmt, [pv], [type]): the balance after nper periods.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rate": {
                    "description": "Interest rate per period, as a decimal (0.005 for 0.5%). Write a monthly rate from an annual one as \"0.06/12\". A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > -1 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.08/12"
                    ]
                  },
                  "nper": {
                    "description": "Total number of payment periods. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 12000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "pmt": {
                    "description": "Payment made each period (negative when you pay). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "-200"
                    ]
                  },
                  "pv": {
                    "description": "Present value: the amount now. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "default": "0"
                  },
                  "type": {
                    "description": "When payments are due: 0 at the end of each period, 1 at the beginning. Allowed: >= 0 and <= 1.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "rate",
                  "nper",
                  "pmt"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: $200 a month for 10 months at 6%, $500 now",
                  "value": {
                    "rate": "0.06/12",
                    "nper": "10",
                    "pmt": "-200",
                    "pv": "-500",
                    "type": 1,
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: $1,000 a month for 12 months at 12%",
                  "value": {
                    "rate": "0.12/12",
                    "nper": "12",
                    "pmt": "-1000",
                    "options": {
                      "decimals": 2
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/fv@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "fv": {
                          "description": "The future value.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "fv"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: $200 a month for 10 months at 6%, $500 now",
                    "value": {
                      "calculator": "excel/fv@1",
                      "result": {
                        "fv": "2581.40"
                      },
                      "exactness": {
                        "fv": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate": "0.005",
                        "nper": "10",
                        "pmt": "-200",
                        "pv": "-500",
                        "type": 1
                      },
                      "formula": "FV = −(pv·(1+rate)^nper + pmt·(1 + rate·type)·((1+rate)^nper − 1)/rate)",
                      "references": [
                        {
                          "title": "Microsoft Excel FV function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/fv-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: $1,000 a month for 12 months at 12%",
                    "value": {
                      "calculator": "excel/fv@1",
                      "result": {
                        "fv": "12682.50"
                      },
                      "exactness": {
                        "fv": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate": "0.01",
                        "nper": "12",
                        "pmt": "-1000",
                        "pv": "0",
                        "type": 0
                      },
                      "formula": "FV = −(pv·(1+rate)^nper + pmt·(1 + rate·type)·((1+rate)^nper − 1)/rate)",
                      "references": [
                        {
                          "title": "Microsoft Excel FV function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/fv-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/fv@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/ipmt": {
      "post": {
        "operationId": "calc_excel_ipmt",
        "summary": "Excel IPMT function: interest part of a payment",
        "description": "The interest paid in one period of a loan, the same as Excel's IPMT.\n\nIPMT(rate, per, nper, pv, [fv], [type]): the interest in payment number per: the rate times the balance after the previous payment. With type 1 the first payment has no interest, as in Excel.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rate": {
                    "description": "Interest rate per period, as a decimal (0.005 for 0.5%). Write a monthly rate from an annual one as \"0.06/12\". A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > -1 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.08/12"
                    ]
                  },
                  "per": {
                    "description": "The period you want, from 1 to nper. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 1 and <= 12000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "1"
                    ]
                  },
                  "nper": {
                    "description": "Total number of payment periods. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 12000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "pv": {
                    "description": "Present value: the amount now (a loan you receive is positive). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10000"
                    ]
                  },
                  "fv": {
                    "description": "Future value wanted after the last payment. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "default": "0"
                  },
                  "type": {
                    "description": "When payments are due: 0 at the end of each period, 1 at the beginning. Allowed: >= 0 and <= 1.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "rate",
                  "per",
                  "nper",
                  "pv"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: first month of a 3-year $8,000 loan at 10%",
                  "value": {
                    "rate": "0.10/12",
                    "per": "1",
                    "nper": "36",
                    "pv": "8000",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: last year of the same loan with yearly payments",
                  "value": {
                    "rate": "0.10",
                    "per": "3",
                    "nper": "3",
                    "pv": "8000",
                    "options": {
                      "decimals": 2
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/ipmt@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "ipmt": {
                          "description": "The interest in that period.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "ipmt"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: first month of a 3-year $8,000 loan at 10%",
                    "value": {
                      "calculator": "excel/ipmt@1",
                      "result": {
                        "ipmt": "-66.67"
                      },
                      "exactness": {
                        "ipmt": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate": "1/120",
                        "per": "1",
                        "nper": "36",
                        "pv": "8000",
                        "fv": "0",
                        "type": 0
                      },
                      "formula": "IPMT = rate · FV(rate, per − 1, PMT, pv, 0)  (type 0)",
                      "references": [
                        {
                          "title": "Microsoft Excel IPMT function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/ipmt-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: last year of the same loan with yearly payments",
                    "value": {
                      "calculator": "excel/ipmt@1",
                      "result": {
                        "ipmt": "-292.45"
                      },
                      "exactness": {
                        "ipmt": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate": "0.1",
                        "per": "3",
                        "nper": "3",
                        "pv": "8000",
                        "fv": "0",
                        "type": 0
                      },
                      "formula": "IPMT = rate · FV(rate, per − 1, PMT, pv, 0)  (type 0)",
                      "references": [
                        {
                          "title": "Microsoft Excel IPMT function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/ipmt-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/ipmt@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/mduration": {
      "post": {
        "operationId": "calc_excel_mduration",
        "summary": "Excel MDURATION function: modified duration of a bond",
        "description": "The modified Macaulay duration of a bond with periodic coupons, as Excel's MDURATION: the percentage change in price for a change in yield.\n\nMDURATION(settlement, maturity, coupon, yld, frequency, [basis]): the modified duration for an assumed par value of 100, which is DURATION divided by 1 + yld/frequency. A modified duration of 5.7 means the price falls by about 5.7% when the yield rises by one percentage point.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settlement": {
                    "description": "Settlement date (when the buyer gets the bond).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2018-07-01"
                    ]
                  },
                  "maturity": {
                    "description": "Maturity date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2048-01-01"
                    ]
                  },
                  "coupon": {
                    "description": "Annual coupon rate as a decimal. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.08"
                    ]
                  },
                  "yld": {
                    "description": "Annual yield as a decimal. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.09"
                    ]
                  },
                  "frequency": {
                    "description": "Coupons per year: 1, 2 or 4. Allowed: >= 1 and <= 4.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4,
                    "examples": [
                      2
                    ]
                  },
                  "basis": {
                    "description": "Day count basis: 0 US (NASD) 30/360; 1 Actual/actual; 2 Actual/360; 3 Actual/365; 4 European 30/360. Allowed: >= 0 and <= 4.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4,
                    "default": 0
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "settlement",
                  "maturity",
                  "coupon",
                  "yld",
                  "frequency"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: 8% coupon, 9% yield, 2008 to 2016, actual/actual",
                  "value": {
                    "settlement": "2008-01-01",
                    "maturity": "2016-01-01",
                    "coupon": "0.08",
                    "yld": "0.09",
                    "frequency": 2,
                    "basis": 1,
                    "options": {
                      "decimals": 3
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/mduration@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "mduration": {
                          "description": "Modified duration in years.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "coupons_remaining": {
                          "description": "Coupons from settlement to maturity (N).",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "mduration",
                        "coupons_remaining"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: 8% coupon, 9% yield, 2008 to 2016, actual/actual",
                    "value": {
                      "calculator": "excel/mduration@1",
                      "result": {
                        "mduration": "5.736",
                        "coupons_remaining": 16
                      },
                      "exactness": {
                        "mduration": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 3
                      },
                      "inputs": {
                        "settlement": "2008-01-01",
                        "maturity": "2016-01-01",
                        "coupon": "0.08",
                        "yld": "0.09",
                        "frequency": 2,
                        "basis": 1
                      },
                      "formula": "DURATION(settlement, maturity, coupon, yld, frequency, basis) ÷ (1 + yld/frequency)",
                      "references": [
                        {
                          "title": "Microsoft Excel MDURATION function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/mduration-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/mduration@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/mirr": {
      "post": {
        "operationId": "calc_excel_mirr",
        "summary": "Excel MIRR function: modified internal rate of return",
        "description": "The modified IRR of periodic cash flows with separate finance and reinvestment rates, as Excel's MIRR.\n\nMIRR(values, finance_rate, reinvest_rate): negative flows are discounted at finance_rate, positive flows compounded at reinvest_rate, and the rate linking the two over n − 1 periods is returned.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "values": {
                    "description": "Periodic cash flows, the first at the start. 2 to 1000 items. Each item: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 2,
                    "maxItems": 1000,
                    "examples": [
                      [
                        "-120000",
                        "39000",
                        "30000",
                        "21000",
                        "37000",
                        "46000"
                      ]
                    ]
                  },
                  "finance_rate": {
                    "description": "Rate paid on money borrowed (negative flows). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > -1 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.1"
                    ]
                  },
                  "reinvest_rate": {
                    "description": "Rate earned on money reinvested (positive flows). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > -1 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.12"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "values",
                  "finance_rate",
                  "reinvest_rate"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: five years",
                  "value": {
                    "values": [
                      "-120000",
                      "39000",
                      "30000",
                      "21000",
                      "37000",
                      "46000"
                    ],
                    "finance_rate": "0.1",
                    "reinvest_rate": "0.12",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: three years",
                  "value": {
                    "values": [
                      "-120000",
                      "39000",
                      "30000",
                      "21000"
                    ],
                    "finance_rate": "0.1",
                    "reinvest_rate": "0.12",
                    "options": {
                      "decimals": 2
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/mirr@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "mirr": {
                          "description": "Modified IRR per period, as a decimal.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "mirr"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: five years",
                    "value": {
                      "calculator": "excel/mirr@1",
                      "result": {
                        "mirr": "0.13"
                      },
                      "exactness": {
                        "mirr": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "values": [
                          "-120000",
                          "39000",
                          "30000",
                          "21000",
                          "37000",
                          "46000"
                        ],
                        "finance_rate": "0.1",
                        "reinvest_rate": "0.12"
                      },
                      "formula": "MIRR = (−NPV(rrate, positive)·(1+rrate)ⁿ / (NPV(frate, negative)·(1+frate)))^(1/(n−1)) − 1",
                      "references": [
                        {
                          "title": "Microsoft Excel MIRR function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/mirr-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: three years",
                    "value": {
                      "calculator": "excel/mirr@1",
                      "result": {
                        "mirr": "-0.05"
                      },
                      "exactness": {
                        "mirr": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "values": [
                          "-120000",
                          "39000",
                          "30000",
                          "21000"
                        ],
                        "finance_rate": "0.1",
                        "reinvest_rate": "0.12"
                      },
                      "formula": "MIRR = (−NPV(rrate, positive)·(1+rrate)ⁿ / (NPV(frate, negative)·(1+frate)))^(1/(n−1)) − 1",
                      "references": [
                        {
                          "title": "Microsoft Excel MIRR function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/mirr-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/mirr@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/networkdays": {
      "post": {
        "operationId": "calc_excel_networkdays",
        "summary": "Excel NETWORKDAYS function: working days between dates",
        "description": "Working days between two dates, both included, with holidays and any weekend, as Excel's NETWORKDAYS and NETWORKDAYS.INTL.\n\nNETWORKDAYS.INTL(start_date, end_date, [weekend], [holidays]); with the default weekend it is NETWORKDAYS. Both dates count. Negative when end is before start.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "description": "Start date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2012-10-01"
                    ]
                  },
                  "end_date": {
                    "description": "End date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2013-03-01"
                    ]
                  },
                  "holidays": {
                    "description": "Dates that are not working days. Up to 1000 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "date"
                    },
                    "minItems": 0,
                    "maxItems": 1000,
                    "default": [],
                    "examples": [
                      [
                        "2012-11-22"
                      ]
                    ]
                  },
                  "weekend": {
                    "description": "Weekend days, as in NETWORKDAYS.INTL: a weekend number (\"1\" Saturday and Sunday, \"2\" Sunday and Monday, ... \"7\" Friday and Saturday, \"11\" Sunday only, ... \"17\" Saturday only) or seven 0s and 1s starting on Monday, 1 for a weekend day (\"0000011\" is Saturday and Sunday). At most 7 characters.",
                    "type": "string",
                    "maxLength": 7,
                    "default": "1"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=0)."
                  }
                },
                "required": [
                  "start_date",
                  "end_date"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: 1 October 2012 to 1 March 2013",
                  "value": {
                    "start_date": "2012-10-01",
                    "end_date": "2013-03-01"
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: the same span less three holidays",
                  "value": {
                    "start_date": "2012-10-01",
                    "end_date": "2013-03-01",
                    "holidays": [
                      "2012-11-22",
                      "2012-12-04",
                      "2013-01-21"
                    ]
                  }
                },
                "example3": {
                  "summary": "Microsoft's example (NETWORKDAYS.INTL): Friday-Saturday weekend",
                  "value": {
                    "start_date": "2006-01-01",
                    "end_date": "2006-02-01",
                    "weekend": "7",
                    "holidays": [
                      "2006-01-02",
                      "2006-01-16"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/networkdays@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "days": {
                          "description": "Working days.",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "days"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: 1 October 2012 to 1 March 2013",
                    "value": {
                      "calculator": "excel/networkdays@1",
                      "result": {
                        "days": 110
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2012-10-01",
                        "end_date": "2013-03-01",
                        "holidays": [],
                        "weekend": "1"
                      },
                      "formula": "days from start to end inclusive, less weekend days and holidays",
                      "references": [
                        {
                          "title": "Microsoft Excel NETWORKDAYS function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/networkdays-function"
                        },
                        {
                          "title": "Microsoft Excel NETWORKDAYS.INTL function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/networkdays-intl-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: the same span less three holidays",
                    "value": {
                      "calculator": "excel/networkdays@1",
                      "result": {
                        "days": 107
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2012-10-01",
                        "end_date": "2013-03-01",
                        "holidays": [
                          "2012-11-22",
                          "2012-12-04",
                          "2013-01-21"
                        ],
                        "weekend": "1"
                      },
                      "formula": "days from start to end inclusive, less weekend days and holidays",
                      "references": [
                        {
                          "title": "Microsoft Excel NETWORKDAYS function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/networkdays-function"
                        },
                        {
                          "title": "Microsoft Excel NETWORKDAYS.INTL function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/networkdays-intl-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Microsoft's example (NETWORKDAYS.INTL): Friday-Saturday weekend",
                    "value": {
                      "calculator": "excel/networkdays@1",
                      "result": {
                        "days": 22
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2006-01-01",
                        "end_date": "2006-02-01",
                        "holidays": [
                          "2006-01-02",
                          "2006-01-16"
                        ],
                        "weekend": "7"
                      },
                      "formula": "days from start to end inclusive, less weekend days and holidays",
                      "references": [
                        {
                          "title": "Microsoft Excel NETWORKDAYS function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/networkdays-function"
                        },
                        {
                          "title": "Microsoft Excel NETWORKDAYS.INTL function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/networkdays-intl-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/networkdays@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/nominal": {
      "post": {
        "operationId": "calc_excel_nominal",
        "summary": "Excel NOMINAL function: nominal annual rate",
        "description": "The nominal annual rate from an effective rate, as Excel's NOMINAL.\n\nNOMINAL(effect_rate, npery) = npery·((1 + effect_rate)^(1/npery) − 1).",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "effect_rate": {
                    "description": "Effective annual rate as a decimal. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.053543"
                    ]
                  },
                  "npery": {
                    "description": "Compounding periods per year (whole number). Allowed: >= 1 and <= 100000.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100000,
                    "examples": [
                      4
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "effect_rate",
                  "npery"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: 5.3543% effective, quarterly",
                  "value": {
                    "effect_rate": "0.053543",
                    "npery": 4,
                    "options": {
                      "significant_digits": 7
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/nominal@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "nominal": {
                          "description": "Nominal annual rate as a decimal.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "nominal"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: 5.3543% effective, quarterly",
                    "value": {
                      "calculator": "excel/nominal@1",
                      "result": {
                        "nominal": "0.05250032"
                      },
                      "exactness": {
                        "nominal": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 7
                      },
                      "inputs": {
                        "effect_rate": "0.053543",
                        "npery": 4
                      },
                      "formula": "npery·((1 + effect)^(1/npery) − 1)",
                      "references": [
                        {
                          "title": "Microsoft Excel NOMINAL function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/nominal-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/nominal@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/nper": {
      "post": {
        "operationId": "calc_excel_nper",
        "summary": "Excel NPER function: number of periods",
        "description": "How many periods it takes to pay off a loan or reach a goal, as Excel's NPER.\n\nNPER(rate, pmt, pv, [fv], [type]).",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rate": {
                    "description": "Interest rate per period, as a decimal (0.005 for 0.5%). Write a monthly rate from an annual one as \"0.06/12\". A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > -1 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.08/12"
                    ]
                  },
                  "pmt": {
                    "description": "Payment made each period. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "-100"
                    ]
                  },
                  "pv": {
                    "description": "Present value. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "-1000"
                    ]
                  },
                  "fv": {
                    "description": "Future value wanted. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "default": "0"
                  },
                  "type": {
                    "description": "When payments are due: 0 at the end of each period, 1 at the beginning. Allowed: >= 0 and <= 1.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "rate",
                  "pmt",
                  "pv"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: payments at the start of each period",
                  "value": {
                    "rate": "0.12/12",
                    "pmt": "-100",
                    "pv": "-1000",
                    "fv": "10000",
                    "type": 1,
                    "options": {
                      "significant_digits": 9
                    }
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: payments at the end of each period",
                  "value": {
                    "rate": "0.12/12",
                    "pmt": "-100",
                    "pv": "-1000",
                    "fv": "10000",
                    "options": {
                      "significant_digits": 9
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/nper@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "nper": {
                          "description": "The number of periods (not rounded to whole periods).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "nper"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: payments at the start of each period",
                    "value": {
                      "calculator": "excel/nper@1",
                      "result": {
                        "nper": "59.6738657"
                      },
                      "exactness": {
                        "nper": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 9
                      },
                      "inputs": {
                        "rate": "0.01",
                        "pmt": "-100",
                        "pv": "-1000",
                        "fv": "10000",
                        "type": 1
                      },
                      "formula": "NPER = ln((pmt·(1+rate·type) − fv·rate) / (pmt·(1+rate·type) + pv·rate)) / ln(1+rate)",
                      "references": [
                        {
                          "title": "Microsoft Excel NPER function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/nper-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: payments at the end of each period",
                    "value": {
                      "calculator": "excel/nper@1",
                      "result": {
                        "nper": "60.0821229"
                      },
                      "exactness": {
                        "nper": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 9
                      },
                      "inputs": {
                        "rate": "0.01",
                        "pmt": "-100",
                        "pv": "-1000",
                        "fv": "10000",
                        "type": 0
                      },
                      "formula": "NPER = ln((pmt·(1+rate·type) − fv·rate) / (pmt·(1+rate·type) + pv·rate)) / ln(1+rate)",
                      "references": [
                        {
                          "title": "Microsoft Excel NPER function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/nper-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/nper@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/pmt": {
      "post": {
        "operationId": "calc_excel_pmt",
        "summary": "Excel PMT function: loan payment",
        "description": "The payment per period for a loan or an investment, the same as Excel's PMT.\n\nPMT(rate, nper, pv, [fv], [type]): the constant payment that brings pv to fv over nper periods at rate. Negative when you pay, as in Excel.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rate": {
                    "description": "Interest rate per period, as a decimal (0.005 for 0.5%). Write a monthly rate from an annual one as \"0.06/12\". A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > -1 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.08/12"
                    ]
                  },
                  "nper": {
                    "description": "Total number of payment periods. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 12000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "pv": {
                    "description": "Present value: the amount now (a loan you receive is positive). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10000"
                    ]
                  },
                  "fv": {
                    "description": "Future value wanted after the last payment. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "default": "0"
                  },
                  "type": {
                    "description": "When payments are due: 0 at the end of each period, 1 at the beginning. Allowed: >= 0 and <= 1.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "rate",
                  "nper",
                  "pv"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: $10,000 at 8% a year over 10 months",
                  "value": {
                    "rate": "0.08/12",
                    "nper": "10",
                    "pv": "10000",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example2": {
                  "summary": "Same loan, payments at the start of each month",
                  "value": {
                    "rate": "0.08/12",
                    "nper": "10",
                    "pv": "10000",
                    "type": 1,
                    "options": {
                      "decimals": 2
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/pmt@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "pmt": {
                          "description": "The payment per period.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "pmt"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: $10,000 at 8% a year over 10 months",
                    "value": {
                      "calculator": "excel/pmt@1",
                      "result": {
                        "pmt": "-1037.03"
                      },
                      "exactness": {
                        "pmt": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate": "1/150",
                        "nper": "10",
                        "pv": "10000",
                        "fv": "0",
                        "type": 0
                      },
                      "formula": "PMT = −rate·(fv + pv·(1+rate)^nper) / ((1 + rate·type)·((1+rate)^nper − 1))",
                      "references": [
                        {
                          "title": "Microsoft Excel PMT function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/pmt-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Same loan, payments at the start of each month",
                    "value": {
                      "calculator": "excel/pmt@1",
                      "result": {
                        "pmt": "-1030.16"
                      },
                      "exactness": {
                        "pmt": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate": "1/150",
                        "nper": "10",
                        "pv": "10000",
                        "fv": "0",
                        "type": 1
                      },
                      "formula": "PMT = −rate·(fv + pv·(1+rate)^nper) / ((1 + rate·type)·((1+rate)^nper − 1))",
                      "references": [
                        {
                          "title": "Microsoft Excel PMT function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/pmt-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/pmt@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/ppmt": {
      "post": {
        "operationId": "calc_excel_ppmt",
        "summary": "Excel PPMT function: principal part of a payment",
        "description": "The principal repaid in one period of a loan, the same as Excel's PPMT.\n\nPPMT(rate, per, nper, pv, [fv], [type]) = PMT − IPMT for that period.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rate": {
                    "description": "Interest rate per period, as a decimal (0.005 for 0.5%). Write a monthly rate from an annual one as \"0.06/12\". A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > -1 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.08/12"
                    ]
                  },
                  "per": {
                    "description": "The period you want, from 1 to nper. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 1 and <= 12000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "1"
                    ]
                  },
                  "nper": {
                    "description": "Total number of payment periods. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 12000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "pv": {
                    "description": "Present value: the amount now (a loan you receive is positive). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10000"
                    ]
                  },
                  "fv": {
                    "description": "Future value wanted after the last payment. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "default": "0"
                  },
                  "type": {
                    "description": "When payments are due: 0 at the end of each period, 1 at the beginning. Allowed: >= 0 and <= 1.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "rate",
                  "per",
                  "nper",
                  "pv"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: month 1 of a 2-year $2,000 loan at 10%",
                  "value": {
                    "rate": "0.10/12",
                    "per": "1",
                    "nper": "24",
                    "pv": "2000",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: year 10 of a 10-year $200,000 loan at 8%",
                  "value": {
                    "rate": "0.08",
                    "per": "10",
                    "nper": "10",
                    "pv": "200000",
                    "options": {
                      "decimals": 2
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/ppmt@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "ppmt": {
                          "description": "The principal repaid in that period.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "ppmt"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: month 1 of a 2-year $2,000 loan at 10%",
                    "value": {
                      "calculator": "excel/ppmt@1",
                      "result": {
                        "ppmt": "-75.62"
                      },
                      "exactness": {
                        "ppmt": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate": "1/120",
                        "per": "1",
                        "nper": "24",
                        "pv": "2000",
                        "fv": "0",
                        "type": 0
                      },
                      "formula": "PPMT = PMT − IPMT",
                      "references": [
                        {
                          "title": "Microsoft Excel PPMT function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/ppmt-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: year 10 of a 10-year $200,000 loan at 8%",
                    "value": {
                      "calculator": "excel/ppmt@1",
                      "result": {
                        "ppmt": "-27598.05"
                      },
                      "exactness": {
                        "ppmt": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate": "0.08",
                        "per": "10",
                        "nper": "10",
                        "pv": "200000",
                        "fv": "0",
                        "type": 0
                      },
                      "formula": "PPMT = PMT − IPMT",
                      "references": [
                        {
                          "title": "Microsoft Excel PPMT function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/ppmt-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/ppmt@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/price": {
      "post": {
        "operationId": "calc_excel_price",
        "summary": "Excel PRICE function: bond price per 100 face value",
        "description": "The clean price per 100 of a bond paying periodic coupons, from its yield, as Excel's PRICE.\n\nPRICE(settlement, maturity, rate, yld, redemption, frequency, [basis]). Coupon dates count back from maturity in steps of 12/frequency months (a month-end maturity keeps every coupon on a month end). The accrued interest is subtracted, so this is the clean price.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settlement": {
                    "description": "Settlement date (when the buyer gets the bond).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2008-02-15"
                    ]
                  },
                  "maturity": {
                    "description": "Maturity date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2017-11-15"
                    ]
                  },
                  "rate": {
                    "description": "Annual coupon rate as a decimal. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.0575"
                    ]
                  },
                  "yld": {
                    "description": "Annual yield as a decimal. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.065"
                    ]
                  },
                  "redemption": {
                    "description": "Redemption value per 100 of face value. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "100"
                    ]
                  },
                  "frequency": {
                    "description": "Coupons per year: 1, 2 or 4. Allowed: >= 1 and <= 4.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4,
                    "examples": [
                      2
                    ]
                  },
                  "basis": {
                    "description": "Day count basis: 0 US (NASD) 30/360; 1 Actual/actual; 2 Actual/360; 3 Actual/365; 4 European 30/360. Allowed: >= 0 and <= 4.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4,
                    "default": 0
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "settlement",
                  "maturity",
                  "rate",
                  "yld",
                  "redemption",
                  "frequency"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: 5.75% semiannual coupon at a 6.5% yield",
                  "value": {
                    "settlement": "2008-02-15",
                    "maturity": "2017-11-15",
                    "rate": "0.0575",
                    "yld": "0.065",
                    "redemption": "100",
                    "frequency": 2,
                    "basis": 0,
                    "options": {
                      "decimals": 4
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/price@2"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "price": {
                          "description": "Clean price per 100 of face value.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "coupons_remaining": {
                          "description": "Coupons from settlement to maturity (N).",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "price",
                        "coupons_remaining"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: 5.75% semiannual coupon at a 6.5% yield",
                    "value": {
                      "calculator": "excel/price@2",
                      "result": {
                        "price": "94.6344",
                        "coupons_remaining": 20
                      },
                      "exactness": {
                        "price": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 4
                      },
                      "inputs": {
                        "settlement": "2008-02-15",
                        "maturity": "2017-11-15",
                        "rate": "0.0575",
                        "yld": "0.065",
                        "redemption": "100",
                        "frequency": 2,
                        "basis": 0
                      },
                      "formula": "Σ discounted coupons + discounted redemption − accrued interest",
                      "references": [
                        {
                          "title": "Microsoft Excel PRICE function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/price-function"
                        },
                        {
                          "title": "Microsoft PRICE function formulas (DAX reference, same definition as Excel)",
                          "url": "https://learn.microsoft.com/en-us/dax/price-function-dax"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/price@2",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/pv": {
      "post": {
        "operationId": "calc_excel_pv",
        "summary": "Excel PV function: present value",
        "description": "The present value of a series of equal payments, the same as Excel's PV.\n\nPV(rate, nper, pmt, [fv], [type]): what the payments (and fv) are worth now.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rate": {
                    "description": "Interest rate per period, as a decimal (0.005 for 0.5%). Write a monthly rate from an annual one as \"0.06/12\". A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > -1 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.08/12"
                    ]
                  },
                  "nper": {
                    "description": "Total number of payment periods. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 12000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "pmt": {
                    "description": "Payment made each period (negative when you pay). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "-200"
                    ]
                  },
                  "fv": {
                    "description": "Future value wanted after the last payment. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "default": "0"
                  },
                  "type": {
                    "description": "When payments are due: 0 at the end of each period, 1 at the beginning. Allowed: >= 0 and <= 1.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "rate",
                  "nper",
                  "pmt"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: $500 a month for 20 years at 8%",
                  "value": {
                    "rate": "0.08/12",
                    "nper": "240",
                    "pmt": "500",
                    "options": {
                      "decimals": 2
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/pv@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "pv": {
                          "description": "The present value.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "pv"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: $500 a month for 20 years at 8%",
                    "value": {
                      "calculator": "excel/pv@1",
                      "result": {
                        "pv": "-59777.15"
                      },
                      "exactness": {
                        "pv": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate": "1/150",
                        "nper": "240",
                        "pmt": "500",
                        "fv": "0",
                        "type": 0
                      },
                      "formula": "PV = −(fv + pmt·(1 + rate·type)·((1+rate)^nper − 1)/rate) / (1+rate)^nper",
                      "references": [
                        {
                          "title": "Microsoft Excel PV function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/pv-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/pv@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/rate": {
      "post": {
        "operationId": "calc_excel_rate",
        "summary": "Excel RATE function: interest rate per period",
        "description": "The interest rate per period of a loan or annuity, as Excel's RATE, proven correct to the last digit.\n\nRATE(nper, pmt, pv, [fv], [type], [guess]): the rate that solves the annuity equation. Excel iterates up to 20 times and can fail with #NUM!; here every rate above −100% is found and the one closest to guess is returned.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "nper": {
                    "description": "Total number of payment periods. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 12000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "pmt": {
                    "description": "Payment made each period. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "-200"
                    ]
                  },
                  "pv": {
                    "description": "Present value. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "8000"
                    ]
                  },
                  "fv": {
                    "description": "Future value. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "default": "0"
                  },
                  "type": {
                    "description": "When payments are due: 0 at the end of each period, 1 at the beginning. Allowed: >= 0 and <= 1.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0
                  },
                  "guess": {
                    "description": "Your guess for the rate (Excel's default 0.1). Only used to choose between several solutions. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > -1 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "default": "0.1"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "nper",
                  "pmt",
                  "pv"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: 4-year $8,000 loan, $200 a month",
                  "value": {
                    "nper": "48",
                    "pmt": "-200",
                    "pv": "8000",
                    "options": {
                      "decimals": 4
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/rate@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "rate": {
                          "description": "Rate per period, as a decimal (0.0077 is 0.77%).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "all_rates": {
                          "description": "Every rate found, lowest first.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "rate",
                        "all_rates"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: 4-year $8,000 loan, $200 a month",
                    "value": {
                      "calculator": "excel/rate@1",
                      "result": {
                        "rate": "0.0077",
                        "all_rates": [
                          "0.0077"
                        ]
                      },
                      "exactness": {
                        "rate": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 4
                      },
                      "inputs": {
                        "nper": "48",
                        "pmt": "-200",
                        "pv": "8000",
                        "fv": "0",
                        "type": 0,
                        "guess": "0.1"
                      },
                      "formula": "pv·(1+r)^nper + pmt·(1 + r·type)·((1+r)^nper − 1)/r + fv = 0",
                      "references": [
                        {
                          "title": "Microsoft Excel RATE function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/rate-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/rate@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/sln": {
      "post": {
        "operationId": "calc_excel_sln",
        "summary": "Excel SLN function: straight-line depreciation",
        "description": "Straight-line depreciation for one period, as Excel's SLN.\n\nSLN(cost, salvage, life) = (cost − salvage) / life.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cost": {
                    "description": "Initial cost of the asset. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "2400"
                    ]
                  },
                  "salvage": {
                    "description": "Value at the end of its life (can be 0). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "300"
                    ]
                  },
                  "life": {
                    "description": "Number of periods over which the asset is depreciated. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 10000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "cost",
                  "salvage",
                  "life"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: $30,000 truck, $7,500 salvage, 10 years",
                  "value": {
                    "cost": "30000",
                    "salvage": "7500",
                    "life": "10"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/sln@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "sln": {
                          "description": "Depreciation per period.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "sln"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: $30,000 truck, $7,500 salvage, 10 years",
                    "value": {
                      "calculator": "excel/sln@1",
                      "result": {
                        "sln": "2250"
                      },
                      "exactness": {
                        "sln": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "cost": "30000",
                        "salvage": "7500",
                        "life": "10"
                      },
                      "formula": "(cost − salvage) / life",
                      "references": [
                        {
                          "title": "Microsoft Excel SLN function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/sln-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/sln@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/syd": {
      "post": {
        "operationId": "calc_excel_syd",
        "summary": "Excel SYD function: sum-of-years-digits depreciation",
        "description": "Sum-of-years' digits depreciation for one period, as Excel's SYD.\n\nSYD(cost, salvage, life, per) = (cost − salvage)·(life − per + 1)·2 / (life·(life + 1)).",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cost": {
                    "description": "Initial cost of the asset. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "2400"
                    ]
                  },
                  "salvage": {
                    "description": "Value at the end of its life (can be 0). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "300"
                    ]
                  },
                  "life": {
                    "description": "Number of periods over which the asset is depreciated. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 10000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "per": {
                    "description": "The period, from 1 to life. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 10000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "1"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "cost",
                  "salvage",
                  "life",
                  "per"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: year 1 of a $30,000 truck",
                  "value": {
                    "cost": "30000",
                    "salvage": "7500",
                    "life": "10",
                    "per": "1",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: year 10",
                  "value": {
                    "cost": "30000",
                    "salvage": "7500",
                    "life": "10",
                    "per": "10",
                    "options": {
                      "decimals": 2
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/syd@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "syd": {
                          "description": "Depreciation in that period.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "syd"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: year 1 of a $30,000 truck",
                    "value": {
                      "calculator": "excel/syd@1",
                      "result": {
                        "syd": "4090.91"
                      },
                      "exactness": {
                        "syd": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "30000",
                        "salvage": "7500",
                        "life": "10",
                        "per": "1"
                      },
                      "formula": "(cost − salvage)·(life − per + 1)·2 / (life·(life + 1))",
                      "references": [
                        {
                          "title": "Microsoft Excel SYD function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/syd-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: year 10",
                    "value": {
                      "calculator": "excel/syd@1",
                      "result": {
                        "syd": "409.09"
                      },
                      "exactness": {
                        "syd": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "30000",
                        "salvage": "7500",
                        "life": "10",
                        "per": "10"
                      },
                      "formula": "(cost − salvage)·(life − per + 1)·2 / (life·(life + 1))",
                      "references": [
                        {
                          "title": "Microsoft Excel SYD function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/syd-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/syd@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/vdb": {
      "post": {
        "operationId": "calc_excel_vdb",
        "summary": "Excel VDB function: variable declining balance depreciation",
        "description": "Declining-balance depreciation between any two points in an asset's life, switching to straight line, as Excel's VDB.\n\nVDB(cost, salvage, life, start_period, end_period, [factor], [no_switch]). Periods may be fractional. Unless no_switch is true, depreciation switches to straight line once that is larger than the declining balance.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cost": {
                    "description": "Initial cost of the asset. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "2400"
                    ]
                  },
                  "salvage": {
                    "description": "Value at the end of its life (can be 0). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "300"
                    ]
                  },
                  "life": {
                    "description": "Number of periods over which the asset is depreciated. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 10000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "start_period": {
                    "description": "Start of the span, in the unit of life (0 is the start of the asset's life). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 10000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0"
                    ]
                  },
                  "end_period": {
                    "description": "End of the span. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 10000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "1"
                    ]
                  },
                  "factor": {
                    "description": "Rate at which the balance declines (2 is double-declining). A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "default": "2"
                  },
                  "no_switch": {
                    "description": "true: never switch to straight line.",
                    "type": "boolean",
                    "default": false
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "cost",
                  "salvage",
                  "life",
                  "start_period",
                  "end_period"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: first day",
                  "value": {
                    "cost": "2400",
                    "salvage": "300",
                    "life": "3650",
                    "start_period": "0",
                    "end_period": "1",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: months 6 to 18",
                  "value": {
                    "cost": "2400",
                    "salvage": "300",
                    "life": "120",
                    "start_period": "6",
                    "end_period": "18",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example3": {
                  "summary": "Microsoft's example: months 6 to 18 at factor 1.5",
                  "value": {
                    "cost": "2400",
                    "salvage": "300",
                    "life": "120",
                    "start_period": "6",
                    "end_period": "18",
                    "factor": "1.5",
                    "options": {
                      "decimals": 2
                    }
                  }
                },
                "example4": {
                  "summary": "Microsoft's example: first fiscal year, 150% limit, bought mid-quarter",
                  "value": {
                    "cost": "2400",
                    "salvage": "300",
                    "life": "10",
                    "start_period": "0",
                    "end_period": "0.875",
                    "factor": "1.5",
                    "options": {
                      "decimals": 2
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/vdb@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "vdb": {
                          "description": "Depreciation between start_period and end_period.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "vdb"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: first day",
                    "value": {
                      "calculator": "excel/vdb@1",
                      "result": {
                        "vdb": "1.32"
                      },
                      "exactness": {
                        "vdb": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "2400",
                        "salvage": "300",
                        "life": "3650",
                        "start_period": "0",
                        "end_period": "1",
                        "factor": "2",
                        "no_switch": false
                      },
                      "formula": "declining balance by period, switching to straight line on the remaining book value when larger; partial periods pro rata",
                      "references": [
                        {
                          "title": "Microsoft Excel VDB function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/vdb-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: months 6 to 18",
                    "value": {
                      "calculator": "excel/vdb@1",
                      "result": {
                        "vdb": "396.31"
                      },
                      "exactness": {
                        "vdb": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "2400",
                        "salvage": "300",
                        "life": "120",
                        "start_period": "6",
                        "end_period": "18",
                        "factor": "2",
                        "no_switch": false
                      },
                      "formula": "declining balance by period, switching to straight line on the remaining book value when larger; partial periods pro rata",
                      "references": [
                        {
                          "title": "Microsoft Excel VDB function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/vdb-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Microsoft's example: months 6 to 18 at factor 1.5",
                    "value": {
                      "calculator": "excel/vdb@1",
                      "result": {
                        "vdb": "311.81"
                      },
                      "exactness": {
                        "vdb": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "2400",
                        "salvage": "300",
                        "life": "120",
                        "start_period": "6",
                        "end_period": "18",
                        "factor": "1.5",
                        "no_switch": false
                      },
                      "formula": "declining balance by period, switching to straight line on the remaining book value when larger; partial periods pro rata",
                      "references": [
                        {
                          "title": "Microsoft Excel VDB function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/vdb-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example4": {
                    "summary": "Microsoft's example: first fiscal year, 150% limit, bought mid-quarter",
                    "value": {
                      "calculator": "excel/vdb@1",
                      "result": {
                        "vdb": "315.00"
                      },
                      "exactness": {
                        "vdb": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "cost": "2400",
                        "salvage": "300",
                        "life": "10",
                        "start_period": "0",
                        "end_period": "0.875",
                        "factor": "1.5",
                        "no_switch": false
                      },
                      "formula": "declining balance by period, switching to straight line on the remaining book value when larger; partial periods pro rata",
                      "references": [
                        {
                          "title": "Microsoft Excel VDB function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/vdb-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/vdb@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/workday": {
      "post": {
        "operationId": "calc_excel_workday",
        "summary": "Excel WORKDAY function: date after working days",
        "description": "The date a number of working days before or after a date, with holidays and any weekend, as Excel's WORKDAY and WORKDAY.INTL.\n\nWORKDAY.INTL(start_date, days, [weekend], [holidays]). The start date itself is not counted; days = 0 returns start_date.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "description": "Start date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2008-10-01"
                    ]
                  },
                  "days": {
                    "description": "Working days to move (negative for earlier). Allowed: >= -35000 and <= 35000.",
                    "type": "integer",
                    "minimum": -35000,
                    "maximum": 35000,
                    "examples": [
                      151
                    ]
                  },
                  "holidays": {
                    "description": "Dates that are not working days. Up to 1000 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "date"
                    },
                    "minItems": 0,
                    "maxItems": 1000,
                    "default": [],
                    "examples": [
                      [
                        "2012-11-22"
                      ]
                    ]
                  },
                  "weekend": {
                    "description": "Weekend days, as in NETWORKDAYS.INTL: a weekend number (\"1\" Saturday and Sunday, \"2\" Sunday and Monday, ... \"7\" Friday and Saturday, \"11\" Sunday only, ... \"17\" Saturday only) or seven 0s and 1s starting on Monday, 1 for a weekend day (\"0000011\" is Saturday and Sunday). At most 7 characters.",
                    "type": "string",
                    "maxLength": 7,
                    "default": "1"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=0)."
                  }
                },
                "required": [
                  "start_date",
                  "days"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: 151 working days from 1 October 2008",
                  "value": {
                    "start_date": "2008-10-01",
                    "days": 151
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: the same, with three holidays",
                  "value": {
                    "start_date": "2008-10-01",
                    "days": 151,
                    "holidays": [
                      "2008-11-26",
                      "2008-12-04",
                      "2009-01-21"
                    ]
                  }
                },
                "example3": {
                  "summary": "Microsoft's example (WORKDAY.INTL): 90 days, Sunday-only weekend",
                  "value": {
                    "start_date": "2012-01-01",
                    "days": 90,
                    "weekend": "11"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/workday@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "date": {
                          "description": "The resulting date.",
                          "type": "string",
                          "format": "date"
                        },
                        "serial": {
                          "description": "Excel's serial number for the date.",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "date",
                        "serial"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: 151 working days from 1 October 2008",
                    "value": {
                      "calculator": "excel/workday@1",
                      "result": {
                        "date": "2009-04-30",
                        "serial": 39933
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2008-10-01",
                        "days": 151,
                        "holidays": [],
                        "weekend": "1"
                      },
                      "formula": "step day by day, counting only working days",
                      "references": [
                        {
                          "title": "Microsoft Excel WORKDAY function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/workday-function"
                        },
                        {
                          "title": "Microsoft Excel WORKDAY.INTL function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/workday-intl-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: the same, with three holidays",
                    "value": {
                      "calculator": "excel/workday@1",
                      "result": {
                        "date": "2009-05-05",
                        "serial": 39938
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2008-10-01",
                        "days": 151,
                        "holidays": [
                          "2008-11-26",
                          "2008-12-04",
                          "2009-01-21"
                        ],
                        "weekend": "1"
                      },
                      "formula": "step day by day, counting only working days",
                      "references": [
                        {
                          "title": "Microsoft Excel WORKDAY function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/workday-function"
                        },
                        {
                          "title": "Microsoft Excel WORKDAY.INTL function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/workday-intl-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Microsoft's example (WORKDAY.INTL): 90 days, Sunday-only weekend",
                    "value": {
                      "calculator": "excel/workday@1",
                      "result": {
                        "date": "2012-04-14",
                        "serial": 41013
                      },
                      "exactness": {},
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 0
                      },
                      "inputs": {
                        "start_date": "2012-01-01",
                        "days": 90,
                        "holidays": [],
                        "weekend": "11"
                      },
                      "formula": "step day by day, counting only working days",
                      "references": [
                        {
                          "title": "Microsoft Excel WORKDAY function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/workday-function"
                        },
                        {
                          "title": "Microsoft Excel WORKDAY.INTL function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/workday-intl-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/workday@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/xirr": {
      "post": {
        "operationId": "calc_excel_xirr",
        "summary": "Excel XIRR function: IRR of cash flows on any dates",
        "description": "The annual rate of return of cash flows on any dates, as Excel's XIRR, proven correct to the last digit.\n\nXIRR(values, dates, [guess]): the rate at which XNPV is zero. Excel iterates to within 0.000001% and gives up after 100 tries; here every rate above −100% is found and pinned down exactly.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "values": {
                    "description": "The cash flows. Money paid out is negative, money received positive. 2 to 1000 items. Each item: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 2,
                    "maxItems": 1000,
                    "examples": [
                      [
                        "-10000",
                        "2750",
                        "4250",
                        "3250",
                        "2750"
                      ]
                    ]
                  },
                  "dates": {
                    "description": "The date of each cash flow, in the same order. The first date is the start: no date may be before it. 2 to 1000 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "date"
                    },
                    "minItems": 2,
                    "maxItems": 1000,
                    "examples": [
                      [
                        "2008-01-01",
                        "2008-03-01",
                        "2008-10-30",
                        "2009-02-15",
                        "2009-04-01"
                      ]
                    ]
                  },
                  "guess": {
                    "description": "Your guess (Excel's default 0.1); chooses between several solutions. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > -1 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "default": "0.1"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "values",
                  "dates"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: five dated cash flows",
                  "value": {
                    "values": [
                      "-10000",
                      "2750",
                      "4250",
                      "3250",
                      "2750"
                    ],
                    "dates": [
                      "2008-01-01",
                      "2008-03-01",
                      "2008-10-30",
                      "2009-02-15",
                      "2009-04-01"
                    ],
                    "options": {
                      "significant_digits": 7
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/xirr@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "xirr": {
                          "description": "Annual rate as a decimal (0.3734 is 37.34%).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "all_rates": {
                          "description": "Every rate found, lowest first.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "xirr",
                        "all_rates"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: five dated cash flows",
                    "value": {
                      "calculator": "excel/xirr@1",
                      "result": {
                        "xirr": "0.3733625",
                        "all_rates": [
                          "0.3733625"
                        ]
                      },
                      "exactness": {
                        "xirr": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 7
                      },
                      "inputs": {
                        "values": [
                          "-10000",
                          "2750",
                          "4250",
                          "3250",
                          "2750"
                        ],
                        "dates": [
                          "2008-01-01",
                          "2008-03-01",
                          "2008-10-30",
                          "2009-02-15",
                          "2009-04-01"
                        ],
                        "guess": "0.1"
                      },
                      "formula": "Σ Pᵢ / (1 + xirr)^((dᵢ − d₁)/365) = 0",
                      "references": [
                        {
                          "title": "Microsoft Excel XIRR function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/xirr-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/xirr@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/xnpv": {
      "post": {
        "operationId": "calc_excel_xnpv",
        "summary": "Excel XNPV function: net present value of dated cash flows",
        "description": "Net present value of cash flows on any dates, the same as Excel's XNPV.\n\nXNPV(rate, values, dates) = Σ valueᵢ / (1 + rate)^((dateᵢ − date₁)/365). Each flow is discounted by its days from the first date over a 365-day year, as in Excel.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rate": {
                    "description": "Annual discount rate as a decimal. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > -1 and <= 1000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.09"
                    ]
                  },
                  "values": {
                    "description": "The cash flows. Money paid out is negative, money received positive. 2 to 1000 items. Each item: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 2,
                    "maxItems": 1000,
                    "examples": [
                      [
                        "-10000",
                        "2750",
                        "4250",
                        "3250",
                        "2750"
                      ]
                    ]
                  },
                  "dates": {
                    "description": "The date of each cash flow, in the same order. The first date is the start: no date may be before it. 2 to 1000 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "date"
                    },
                    "minItems": 2,
                    "maxItems": 1000,
                    "examples": [
                      [
                        "2008-01-01",
                        "2008-03-01",
                        "2008-10-30",
                        "2009-02-15",
                        "2009-04-01"
                      ]
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "rate",
                  "values",
                  "dates"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: five dated cash flows at 9%",
                  "value": {
                    "rate": "0.09",
                    "values": [
                      "-10000",
                      "2750",
                      "4250",
                      "3250",
                      "2750"
                    ],
                    "dates": [
                      "2008-01-01",
                      "2008-03-01",
                      "2008-10-30",
                      "2009-02-15",
                      "2009-04-01"
                    ],
                    "options": {
                      "decimals": 2
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/xnpv@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "xnpv": {
                          "description": "Net present value at the first date.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "xnpv"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: five dated cash flows at 9%",
                    "value": {
                      "calculator": "excel/xnpv@1",
                      "result": {
                        "xnpv": "2086.65"
                      },
                      "exactness": {
                        "xnpv": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "rate": "0.09",
                        "values": [
                          "-10000",
                          "2750",
                          "4250",
                          "3250",
                          "2750"
                        ],
                        "dates": [
                          "2008-01-01",
                          "2008-03-01",
                          "2008-10-30",
                          "2009-02-15",
                          "2009-04-01"
                        ]
                      },
                      "formula": "Σ Pᵢ / (1 + rate)^((dᵢ − d₁)/365)",
                      "references": [
                        {
                          "title": "Microsoft Excel XNPV function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/xnpv-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/xnpv@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/yearfrac": {
      "post": {
        "operationId": "calc_excel_yearfrac",
        "summary": "Excel YEARFRAC function: fraction of a year between dates",
        "description": "The fraction of a year between two dates under Excel's five day-count bases, including Excel's own actual/actual rule.\n\nYEARFRAC(start_date, end_date, [basis]). Basis 1 follows Excel exactly: within a year it divides by 365 or 366 (366 when the span includes 29 February); over longer spans it divides by the average length of the calendar years touched. Basis 0 treats the last day of February as the 30th. The order of the dates does not matter.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "description": "Start date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2012-01-01"
                    ]
                  },
                  "end_date": {
                    "description": "End date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2012-07-30"
                    ]
                  },
                  "basis": {
                    "description": "Day count basis: 0 US (NASD) 30/360; 1 Actual/actual; 2 Actual/360; 3 Actual/365; 4 European 30/360. Allowed: >= 0 and <= 4.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4,
                    "default": 0
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "start_date",
                  "end_date"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: 2012, US 30/360",
                  "value": {
                    "start_date": "2012-01-01",
                    "end_date": "2012-07-30",
                    "options": {
                      "decimals": 8
                    }
                  }
                },
                "example2": {
                  "summary": "Microsoft's example: 2012, actual/actual",
                  "value": {
                    "start_date": "2012-01-01",
                    "end_date": "2012-07-30",
                    "basis": 1,
                    "options": {
                      "decimals": 8
                    }
                  }
                },
                "example3": {
                  "summary": "Microsoft's example: 2012, actual/365",
                  "value": {
                    "start_date": "2012-01-01",
                    "end_date": "2012-07-30",
                    "basis": 3,
                    "options": {
                      "decimals": 8
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/yearfrac@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "yearfrac": {
                          "description": "Fraction of a year.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "yearfrac"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: 2012, US 30/360",
                    "value": {
                      "calculator": "excel/yearfrac@1",
                      "result": {
                        "yearfrac": "0.58055556"
                      },
                      "exactness": {
                        "yearfrac": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 8
                      },
                      "inputs": {
                        "start_date": "2012-01-01",
                        "end_date": "2012-07-30",
                        "basis": 0
                      },
                      "formula": "days (by basis) ÷ year length (by basis)",
                      "references": [
                        {
                          "title": "Microsoft Excel YEARFRAC function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/yearfrac-function"
                        },
                        {
                          "title": "OpenDocument formula specification (ODF 1.2 part 2), section 4.11.7, which documents Excel's day-count rules",
                          "url": "https://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Microsoft's example: 2012, actual/actual",
                    "value": {
                      "calculator": "excel/yearfrac@1",
                      "result": {
                        "yearfrac": "0.57650273"
                      },
                      "exactness": {
                        "yearfrac": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 8
                      },
                      "inputs": {
                        "start_date": "2012-01-01",
                        "end_date": "2012-07-30",
                        "basis": 1
                      },
                      "formula": "days (by basis) ÷ year length (by basis)",
                      "references": [
                        {
                          "title": "Microsoft Excel YEARFRAC function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/yearfrac-function"
                        },
                        {
                          "title": "OpenDocument formula specification (ODF 1.2 part 2), section 4.11.7, which documents Excel's day-count rules",
                          "url": "https://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Microsoft's example: 2012, actual/365",
                    "value": {
                      "calculator": "excel/yearfrac@1",
                      "result": {
                        "yearfrac": "0.57808219"
                      },
                      "exactness": {
                        "yearfrac": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 8
                      },
                      "inputs": {
                        "start_date": "2012-01-01",
                        "end_date": "2012-07-30",
                        "basis": 3
                      },
                      "formula": "days (by basis) ÷ year length (by basis)",
                      "references": [
                        {
                          "title": "Microsoft Excel YEARFRAC function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/yearfrac-function"
                        },
                        {
                          "title": "OpenDocument formula specification (ODF 1.2 part 2), section 4.11.7, which documents Excel's day-count rules",
                          "url": "https://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/yearfrac@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/excel/yield": {
      "post": {
        "operationId": "calc_excel_yield",
        "summary": "Excel YIELD function: bond yield from price",
        "description": "The yield of a bond paying periodic coupons, from its price, as Excel's YIELD, proven correct to the last digit.\n\nYIELD(settlement, maturity, rate, pr, redemption, frequency, [basis]): the yield at which PRICE gives pr. With one coupon or less left it is Microsoft's closed form; otherwise the root of the PRICE equation.",
        "tags": [
          "Excel"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settlement": {
                    "description": "Settlement date (when the buyer gets the bond).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2008-02-15"
                    ]
                  },
                  "maturity": {
                    "description": "Maturity date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2017-11-15"
                    ]
                  },
                  "rate": {
                    "description": "Annual coupon rate as a decimal. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: >= 0 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.0575"
                    ]
                  },
                  "pr": {
                    "description": "Clean price per 100 of face value. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "95.04287"
                    ]
                  },
                  "redemption": {
                    "description": "Redemption value per 100 of face value. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "100"
                    ]
                  },
                  "frequency": {
                    "description": "Coupons per year: 1, 2 or 4. Allowed: >= 1 and <= 4.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4,
                    "examples": [
                      2
                    ]
                  },
                  "basis": {
                    "description": "Day count basis: 0 US (NASD) 30/360; 1 Actual/actual; 2 Actual/360; 3 Actual/365; 4 European 30/360. Allowed: >= 0 and <= 4.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4,
                    "default": 0
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "settlement",
                  "maturity",
                  "rate",
                  "pr",
                  "redemption",
                  "frequency"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Microsoft's example: 5.75% semiannual coupon priced at 95.04287",
                  "value": {
                    "settlement": "2008-02-15",
                    "maturity": "2016-11-15",
                    "rate": "0.0575",
                    "pr": "95.04287",
                    "redemption": "100",
                    "frequency": 2,
                    "basis": 0,
                    "options": {
                      "decimals": 3
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "excel/yield@2"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "yield": {
                          "description": "Annual yield as a decimal.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "coupons_remaining": {
                          "description": "Coupons from settlement to maturity (N).",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "yield",
                        "coupons_remaining"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Microsoft's example: 5.75% semiannual coupon priced at 95.04287",
                    "value": {
                      "calculator": "excel/yield@2",
                      "result": {
                        "yield": "0.065",
                        "coupons_remaining": 18
                      },
                      "exactness": {
                        "yield": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 3
                      },
                      "inputs": {
                        "settlement": "2008-02-15",
                        "maturity": "2016-11-15",
                        "rate": "0.0575",
                        "pr": "95.04287",
                        "redemption": "100",
                        "frequency": 2,
                        "basis": 0
                      },
                      "formula": "PRICE(settlement, maturity, rate, yield, redemption, frequency, basis) = pr",
                      "references": [
                        {
                          "title": "Microsoft Excel YIELD function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/yield-function"
                        },
                        {
                          "title": "Microsoft YIELD function formulas (DAX reference, same definition as Excel)",
                          "url": "https://learn.microsoft.com/en-us/dax/yield-function-dax"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "excel/yield@2",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/apr/eu-aprc": {
      "post": {
        "operationId": "calc_finance_apr_eu_aprc",
        "summary": "EU and UK APRC calculator",
        "description": "Annual percentage rate of charge (APRC, the UK's APR) for consumer and mortgage credit, by the EU directives' equation and day count.\n\nComputes the annual percentage rate of charge defined in the EU Consumer Credit and Mortgage Credit Directives (Annex III and Annex I) and in the UK FCA rules (CONC App 1, MCOB 10A): the yearly rate X at which the payments, discounted with (1 + X) to the power of minus their time in years, equal the credit drawn down less the charges paid at the start. Times are 1/12 of a year per month and 1/52 per week; with dates, whole months (or weeks, or years) are counted back from each payment and the remaining days divided by 365 or 366, as the Mortgage Credit Directive and the European Commission's guidelines prescribe. The equation is solved with proven bounds and the APRC is rounded half up, to 1 decimal by default.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "credit_amount": {
                    "description": "The credit, drawn down in full at the start. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "200000"
                    ]
                  },
                  "upfront_charges": {
                    "description": "Charges the consumer pays at the start (arrangement or valuation fees, for example). Charges paid later go into the payments they are paid with. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0",
                    "examples": [
                      "4000"
                    ]
                  },
                  "payment_amounts": {
                    "description": "The payments in order. Give one amount per group of equal payments and the group sizes in payment_counts, e.g. [\"210.71\", \"220.25\"] with [24, 36]; without payment_counts each amount is one payment. 1 to 100 items. Each item: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 1,
                    "maxItems": 100,
                    "examples": [
                      [
                        "230"
                      ]
                    ]
                  },
                  "payment_counts": {
                    "description": "How many payments of each amount in payment_amounts (whole numbers, same order). Omit it when every amount is a single payment. Up to 100 items. Each item: >= 1 and <= 1200.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 0,
                    "maxItems": 100,
                    "examples": [
                      [
                        "24"
                      ]
                    ]
                  },
                  "payment_frequency": {
                    "description": "How often payments are made. Options: monthly: every month, 1/12 of a year; quarterly: every 3 months; semiannually: every 6 months; annually: every year; weekly: every week, 1/52 of a year; fortnightly: every 2 weeks",
                    "type": "string",
                    "enum": [
                      "monthly",
                      "quarterly",
                      "semiannually",
                      "annually",
                      "weekly",
                      "fortnightly"
                    ],
                    "default": "monthly"
                  },
                  "start_date": {
                    "description": "Date of the drawdown (the credit agreement). Give it with first_payment_date to count exact days; without both, the first payment is one period after the drawdown.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2012-01-12"
                    ]
                  },
                  "first_payment_date": {
                    "description": "Date of the first payment. Later payments fall on the same day of the month (or the same weekday) at the payment frequency.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2012-02-15"
                    ]
                  },
                  "include_schedule": {
                    "description": "Also return each payment with its time in years.",
                    "type": "boolean",
                    "default": false
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_up."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_up, decimals=1)."
                  }
                },
                "required": [
                  "credit_amount",
                  "payment_amounts"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Commission example 1: €200,000, €4,000 fee, 240 × €1,432.86 a month",
                  "value": {
                    "credit_amount": "200000",
                    "upfront_charges": "4000",
                    "payment_amounts": [
                      "1432.86"
                    ],
                    "payment_counts": [
                      "240"
                    ]
                  }
                },
                "example2": {
                  "summary": "The same loan signed 12 January 2012, paid on the 15th from February 2012",
                  "value": {
                    "credit_amount": "200000",
                    "upfront_charges": "4000",
                    "payment_amounts": [
                      "1433.57"
                    ],
                    "payment_counts": [
                      "240"
                    ],
                    "start_date": "2012-01-12",
                    "first_payment_date": "2012-02-15",
                    "options": {
                      "decimals": 6
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/apr/eu-aprc@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "aprc_percent": {
                          "description": "The annual percentage rate of charge, in percent, rounded half up. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_amount_payable": {
                          "description": "Upfront charges plus all payments. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_cost_of_credit": {
                          "description": "Total amount payable minus the credit amount. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "number_of_payments": {
                          "description": "Number of payments.",
                          "type": "integer"
                        },
                        "schedule": {
                          "description": "Each payment with its time from the drawdown (when include_schedule is true).",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "payment": {
                                "description": "Payment number, starting at 1.",
                                "type": "integer"
                              },
                              "date": {
                                "description": "Due date (when dates were given).",
                                "type": "string",
                                "format": "date"
                              },
                              "amount": {
                                "description": "The payment. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "years_from_start": {
                                "description": "Time from the drawdown in years, exact (e.g. 1/12 + 3/365 shows as a fraction).",
                                "type": "string"
                              }
                            },
                            "required": [
                              "payment",
                              "amount",
                              "years_from_start"
                            ]
                          }
                        }
                      },
                      "required": [
                        "aprc_percent",
                        "total_amount_payable",
                        "total_cost_of_credit",
                        "number_of_payments"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Commission example 1: €200,000, €4,000 fee, 240 × €1,432.86 a month",
                    "value": {
                      "calculator": "finance/apr/eu-aprc@1",
                      "result": {
                        "aprc_percent": "6.4",
                        "total_amount_payable": "347886.4",
                        "total_cost_of_credit": "147886.4",
                        "number_of_payments": 240
                      },
                      "exactness": {
                        "aprc_percent": "rounded",
                        "total_amount_payable": "exact",
                        "total_cost_of_credit": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 1
                      },
                      "inputs": {
                        "credit_amount": "200000",
                        "upfront_charges": "4000",
                        "payment_amounts": [
                          "1432.86"
                        ],
                        "payment_counts": [
                          "240"
                        ],
                        "payment_frequency": "monthly",
                        "include_schedule": false
                      },
                      "formula": "credit − upfront charges = Σ P_j (1 + X)^(−t_j), t_j in years; APRC = X × 100",
                      "references": [
                        {
                          "title": "Directive 2014/17/EU (Mortgage Credit Directive), Annex I: calculation of the APRC",
                          "url": "https://www.legislation.gov.uk/eudr/2014/17/annex/I"
                        },
                        {
                          "title": "Directive (EU) 2023/2225 (Consumer Credit Directive), Annex III, which replaces Directive 2008/48/EC from 20 November 2026 with the same equation and day count",
                          "url": "https://eur-lex.europa.eu/eli/dir/2023/2225/oj/eng"
                        },
                        {
                          "title": "Directive 2008/48/EC (Consumer Credit Directive), Annex I (until 19 November 2026)",
                          "url": "https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:02008L0048-20231230"
                        },
                        {
                          "title": "European Commission: examples for the calculation of the APRC (2015)",
                          "url": "https://commission.europa.eu/system/files/2016-11/aprc-examples-calculation_en.pdf"
                        },
                        {
                          "title": "FCA Handbook MCOB 10A: annual percentage rate of charge",
                          "url": "https://www.handbook.fca.org.uk/handbook/MCOB/10A/2.html"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "The same loan signed 12 January 2012, paid on the 15th from February 2012",
                    "value": {
                      "calculator": "finance/apr/eu-aprc@1",
                      "result": {
                        "aprc_percent": "6.434185",
                        "total_amount_payable": "348056.800000",
                        "total_cost_of_credit": "148056.800000",
                        "number_of_payments": 240
                      },
                      "exactness": {
                        "aprc_percent": "rounded",
                        "total_amount_payable": "exact",
                        "total_cost_of_credit": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 6
                      },
                      "inputs": {
                        "credit_amount": "200000",
                        "upfront_charges": "4000",
                        "payment_amounts": [
                          "1433.57"
                        ],
                        "payment_counts": [
                          "240"
                        ],
                        "payment_frequency": "monthly",
                        "start_date": "2012-01-12",
                        "first_payment_date": "2012-02-15",
                        "include_schedule": false
                      },
                      "formula": "credit − upfront charges = Σ P_j (1 + X)^(−t_j), t_j in years; APRC = X × 100",
                      "references": [
                        {
                          "title": "Directive 2014/17/EU (Mortgage Credit Directive), Annex I: calculation of the APRC",
                          "url": "https://www.legislation.gov.uk/eudr/2014/17/annex/I"
                        },
                        {
                          "title": "Directive (EU) 2023/2225 (Consumer Credit Directive), Annex III, which replaces Directive 2008/48/EC from 20 November 2026 with the same equation and day count",
                          "url": "https://eur-lex.europa.eu/eli/dir/2023/2225/oj/eng"
                        },
                        {
                          "title": "Directive 2008/48/EC (Consumer Credit Directive), Annex I (until 19 November 2026)",
                          "url": "https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:02008L0048-20231230"
                        },
                        {
                          "title": "European Commission: examples for the calculation of the APRC (2015)",
                          "url": "https://commission.europa.eu/system/files/2016-11/aprc-examples-calculation_en.pdf"
                        },
                        {
                          "title": "FCA Handbook MCOB 10A: annual percentage rate of charge",
                          "url": "https://www.handbook.fca.org.uk/handbook/MCOB/10A/2.html"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/apr/eu-aprc@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/apr/us-reg-z": {
      "post": {
        "operationId": "calc_finance_apr_us_reg_z",
        "summary": "US APR calculator (Truth in Lending, Regulation Z)",
        "description": "The annual percentage rate of a closed-end loan the way Regulation Z Appendix J defines it (actuarial method), with odd first periods and the accuracy tolerance.\n\nComputes the APR that US lenders must disclose under the Truth in Lending Act, using the actuarial method of Regulation Z, Appendix J: the rate per unit-period at which the payments, discounted back to consummation, equal the amount financed, times the number of unit-periods in a year. An odd first period is counted the way Appendix J counts it: full months back from the first payment date and the remaining days divided by 30, with simple interest for the fraction. Single-payment loans use the term as the unit-period. The equation is solved exactly and the APR is correctly rounded; the response also gives the finance charge and whether the 1/8 or 1/4 percentage point tolerance applies.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount_financed": {
                    "description": "The amount financed: the credit the borrower receives, after any prepaid finance charges. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "5000"
                    ]
                  },
                  "payment_amounts": {
                    "description": "The payments in order. Give one amount per group of equal payments and the group sizes in payment_counts, e.g. [\"210.71\", \"220.25\"] with [24, 36]; without payment_counts each amount is one payment. 1 to 100 items. Each item: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 1,
                    "maxItems": 100,
                    "examples": [
                      [
                        "230"
                      ]
                    ]
                  },
                  "payment_counts": {
                    "description": "How many payments of each amount in payment_amounts (whole numbers, same order). Omit it when every amount is a single payment. Up to 100 items. Each item: >= 1 and <= 1200.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 0,
                    "maxItems": 100,
                    "examples": [
                      [
                        "24"
                      ]
                    ]
                  },
                  "payment_frequency": {
                    "description": "How often payments are due; this is the unit-period. Options: monthly: 12 a year; semimonthly: 24 a year; biweekly: every 2 weeks, 26 a year; weekly: 52 a year; quarterly: 4 a year; semiannually: 2 a year; annually: once a year",
                    "type": "string",
                    "enum": [
                      "monthly",
                      "semimonthly",
                      "biweekly",
                      "weekly",
                      "quarterly",
                      "semiannually",
                      "annually"
                    ],
                    "default": "monthly"
                  },
                  "consummation_date": {
                    "description": "When the loan is made (the finance charge starts). Give it with first_payment_date to count an odd first period; without both, the first payment is one full period after consummation.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-01-12"
                    ]
                  },
                  "first_payment_date": {
                    "description": "When the first payment is due. Later payments follow at the payment frequency.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-02-15"
                    ]
                  },
                  "month_end_payments": {
                    "description": "Payments are due on the last day of each month, so months are counted from month end to month end (Appendix J (b)(3)(iv)).",
                    "type": "boolean",
                    "default": false
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_up."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_up, decimals=2)."
                  }
                },
                "required": [
                  "amount_financed",
                  "payment_amounts"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Regulation Z step-rate example: $10,000, 24 × $210.71, 24 × $220.25, 12 × $222.59",
                  "value": {
                    "amount_financed": "10000",
                    "payment_amounts": [
                      "210.71",
                      "220.25",
                      "222.59"
                    ],
                    "payment_counts": [
                      "24",
                      "24",
                      "12"
                    ]
                  }
                },
                "example2": {
                  "summary": "$5,000 in 24 monthly payments of $230, first payment 34 days after the loan",
                  "value": {
                    "amount_financed": "5000",
                    "payment_amounts": [
                      "230"
                    ],
                    "payment_counts": [
                      "24"
                    ],
                    "consummation_date": "2026-01-12",
                    "first_payment_date": "2026-02-15"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/apr/us-reg-z@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "apr_percent": {
                          "description": "The annual percentage rate, in percent. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "finance_charge": {
                          "description": "Total of payments minus the amount financed. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_of_payments": {
                          "description": "Sum of all payments. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "number_of_payments": {
                          "description": "Number of payments.",
                          "type": "integer"
                        },
                        "unit_period": {
                          "description": "The unit-period used.",
                          "type": "string"
                        },
                        "unit_periods_per_year": {
                          "description": "Unit-periods in a year; APR = rate per unit-period × this (exact).",
                          "type": "string"
                        },
                        "first_payment_unit_periods": {
                          "description": "Full unit-periods from consummation to the first payment.",
                          "type": "integer"
                        },
                        "first_period_fraction": {
                          "description": "The odd fraction of a unit-period before the first payment (0 for none).",
                          "type": "string"
                        },
                        "regular_transaction": {
                          "description": "True when the payments are equal (apart from the first and the last), so the 1/8 point tolerance applies; false for irregular payments (1/4 point).",
                          "type": "boolean"
                        },
                        "tolerance_percent": {
                          "description": "A disclosed APR within this many percentage points of the exact APR is accurate (Regulation Z § 1026.22(a)(2) and (3)).",
                          "type": "string"
                        }
                      },
                      "required": [
                        "apr_percent",
                        "finance_charge",
                        "total_of_payments",
                        "number_of_payments",
                        "unit_period",
                        "unit_periods_per_year",
                        "first_payment_unit_periods",
                        "first_period_fraction",
                        "regular_transaction",
                        "tolerance_percent"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Regulation Z step-rate example: $10,000, 24 × $210.71, 24 × $220.25, 12 × $222.59",
                    "value": {
                      "calculator": "finance/apr/us-reg-z@1",
                      "result": {
                        "apr_percent": "10.75",
                        "finance_charge": "3014.12",
                        "total_of_payments": "13014.12",
                        "number_of_payments": 60,
                        "unit_period": "month",
                        "unit_periods_per_year": "12",
                        "first_payment_unit_periods": 1,
                        "first_period_fraction": "0",
                        "regular_transaction": false,
                        "tolerance_percent": "0.25"
                      },
                      "exactness": {
                        "apr_percent": "rounded",
                        "finance_charge": "exact",
                        "total_of_payments": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "amount_financed": "10000",
                        "payment_amounts": [
                          "210.71",
                          "220.25",
                          "222.59"
                        ],
                        "payment_counts": [
                          "24",
                          "24",
                          "12"
                        ],
                        "payment_frequency": "monthly",
                        "month_end_payments": false
                      },
                      "formula": "A = Σ P_j / ((1 + f·i)(1 + i)^t_j); APR = i × unit-periods per year × 100",
                      "references": [
                        {
                          "title": "Regulation Z, Appendix J: Annual percentage rate computations for closed-end credit transactions",
                          "url": "https://www.consumerfinance.gov/rules-policy/regulations/1026/J/"
                        },
                        {
                          "title": "Regulation Z, official interpretation of § 1026.22 (step-rate and add-on rate examples, tolerances)",
                          "url": "https://www.consumerfinance.gov/rules-policy/regulations/1026/Interp-22"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "$5,000 in 24 monthly payments of $230, first payment 34 days after the loan",
                    "value": {
                      "calculator": "finance/apr/us-reg-z@1",
                      "result": {
                        "apr_percent": "9.61",
                        "finance_charge": "520.00",
                        "total_of_payments": "5520.00",
                        "number_of_payments": 24,
                        "unit_period": "month",
                        "unit_periods_per_year": "12",
                        "first_payment_unit_periods": 1,
                        "first_period_fraction": "0.1",
                        "regular_transaction": true,
                        "tolerance_percent": "0.125"
                      },
                      "exactness": {
                        "apr_percent": "rounded",
                        "finance_charge": "exact",
                        "total_of_payments": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "amount_financed": "5000",
                        "payment_amounts": [
                          "230"
                        ],
                        "payment_counts": [
                          "24"
                        ],
                        "payment_frequency": "monthly",
                        "consummation_date": "2026-01-12",
                        "first_payment_date": "2026-02-15",
                        "month_end_payments": false
                      },
                      "formula": "A = Σ P_j / ((1 + f·i)(1 + i)^t_j); APR = i × unit-periods per year × 100",
                      "references": [
                        {
                          "title": "Regulation Z, Appendix J: Annual percentage rate computations for closed-end credit transactions",
                          "url": "https://www.consumerfinance.gov/rules-policy/regulations/1026/J/"
                        },
                        {
                          "title": "Regulation Z, official interpretation of § 1026.22 (step-rate and add-on rate examples, tolerances)",
                          "url": "https://www.consumerfinance.gov/rules-policy/regulations/1026/Interp-22"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/apr/us-reg-z@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/black-76": {
      "post": {
        "operationId": "calc_finance_black_76",
        "summary": "Black-76 calculator for options on futures",
        "description": "The Black (1976) price and Greeks of a European option on a future or forward: commodity and bond futures options, caps, floors and swaptions.\n\nValues a European option on a futures or forward price with Black's 1976 model. It is the Black-Scholes formula with the forward price in place of the spot price and the whole payoff discounted, and is the market standard for options on commodity and interest-rate futures. The answer has the price, the Greeks with respect to the forward price, and d1 and d2.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "forward": {
                    "description": "The futures or forward price now. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "19"
                    ]
                  },
                  "strike": {
                    "description": "The option's strike price. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "19"
                    ]
                  },
                  "time_to_expiry_years": {
                    "description": "Time to expiry in years. Write days as a ratio, such as \"30/365\". A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.5"
                    ]
                  },
                  "volatility_percent": {
                    "description": "Volatility per year in percent (20 for 20%). Allowed: > 0 and <= 1000. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "20"
                    ]
                  },
                  "risk_free_rate_percent": {
                    "description": "Risk-free interest rate per year in percent, continuously compounded. Allowed: >= -50 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "option_type": {
                    "description": "Call or put. Options: call: the right to buy; put: the right to sell",
                    "type": "string",
                    "enum": [
                      "call",
                      "put"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=6)."
                  }
                },
                "required": [
                  "forward",
                  "strike",
                  "time_to_expiry_years",
                  "volatility_percent",
                  "risk_free_rate_percent",
                  "option_type"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A nine-month call at the money: future at 19, 28% volatility, 10% rate",
                  "value": {
                    "forward": "19",
                    "strike": "19",
                    "time_to_expiry_years": "0.75",
                    "volatility_percent": "28",
                    "risk_free_rate_percent": "10",
                    "option_type": "call"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/black-76@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "price": {
                          "description": "The option's value. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "delta": {
                          "description": "Change in the price for a change of 1 in the underlying price.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "gamma": {
                          "description": "Change in delta for a change of 1 in the underlying price.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "vega": {
                          "description": "Change in the price for one percentage point more volatility.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "theta": {
                          "description": "Change in the price over one calendar day, other things equal.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "rho": {
                          "description": "Change in the price for one percentage point more interest.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "d1": {
                          "description": "The model's d1.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "d2": {
                          "description": "The model's d2.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "price",
                        "delta",
                        "gamma",
                        "vega",
                        "theta",
                        "rho",
                        "d1",
                        "d2"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A nine-month call at the money: future at 19, 28% volatility, 10% rate",
                    "value": {
                      "calculator": "finance/black-76@1",
                      "result": {
                        "price": "1.701051",
                        "delta": "0.508636",
                        "gamma": "0.079745",
                        "vega": "0.060455",
                        "theta": "-0.002626",
                        "rho": "-0.012758",
                        "d1": "0.121244",
                        "d2": "-0.121244"
                      },
                      "exactness": {
                        "price": "rounded",
                        "delta": "rounded",
                        "gamma": "rounded",
                        "vega": "rounded",
                        "theta": "rounded",
                        "rho": "rounded",
                        "d1": "rounded",
                        "d2": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 6
                      },
                      "inputs": {
                        "forward": "19",
                        "strike": "19",
                        "time_to_expiry_years": "0.75",
                        "volatility_percent": "28",
                        "risk_free_rate_percent": "10",
                        "option_type": "call"
                      },
                      "formula": "call = e^(−rT)·(F·Φ(d1) − K·Φ(d2)); put = e^(−rT)·(K·Φ(−d2) − F·Φ(−d1)); d1 = (ln(F/K) + σ²·T/2) / (σ·√T), d2 = d1 − σ·√T",
                      "references": [
                        {
                          "title": "CME Group: Introduction to options theoretical pricing",
                          "url": "https://www.cmegroup.com/education/courses/introduction-to-options/options-theoretical-pricing-models.html"
                        },
                        {
                          "title": "The Nobel Prize in Economic Sciences 1997: Merton and Scholes, a new method to determine the value of derivatives",
                          "url": "https://www.nobelprize.org/prizes/economic-sciences/1997/press-release/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/black-76@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/black-scholes": {
      "post": {
        "operationId": "calc_finance_black_scholes",
        "summary": "Black-Scholes option price and Greeks calculator",
        "description": "The Black-Scholes-Merton price of a European call or put with delta, gamma, vega, theta and rho, correct to the last digit shown.\n\nValues a European option on a stock, index or currency with the Black-Scholes formula, with Merton's extension for a continuous dividend yield. The answer has the price and the five Greeks, and d1 and d2 for checking by hand. The normal distribution is evaluated with proven error bounds, so every digit returned is correct, including for options far in or out of the money where spreadsheet formulas lose digits.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "spot": {
                    "description": "The underlying's price now. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "42"
                    ]
                  },
                  "strike": {
                    "description": "The option's strike price. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "40"
                    ]
                  },
                  "time_to_expiry_years": {
                    "description": "Time to expiry in years. Write days as a ratio, such as \"30/365\". A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.5"
                    ]
                  },
                  "volatility_percent": {
                    "description": "Volatility per year in percent (20 for 20%). Allowed: > 0 and <= 1000. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "20"
                    ]
                  },
                  "risk_free_rate_percent": {
                    "description": "Risk-free interest rate per year in percent, continuously compounded. Allowed: >= -50 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "dividend_yield_percent": {
                    "description": "Dividend yield per year in percent, continuously compounded. Allowed: >= -50 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "option_type": {
                    "description": "Call or put. Options: call: the right to buy; put: the right to sell",
                    "type": "string",
                    "enum": [
                      "call",
                      "put"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=6)."
                  }
                },
                "required": [
                  "spot",
                  "strike",
                  "time_to_expiry_years",
                  "volatility_percent",
                  "risk_free_rate_percent",
                  "option_type"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A six-month call: stock at 42, strike 40, 10% rate, 20% volatility",
                  "value": {
                    "spot": "42",
                    "strike": "40",
                    "time_to_expiry_years": "0.5",
                    "volatility_percent": "20",
                    "risk_free_rate_percent": "10",
                    "option_type": "call"
                  }
                },
                "example2": {
                  "summary": "The put on the same terms",
                  "value": {
                    "spot": "42",
                    "strike": "40",
                    "time_to_expiry_years": "0.5",
                    "volatility_percent": "20",
                    "risk_free_rate_percent": "10",
                    "option_type": "put"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/black-scholes@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "price": {
                          "description": "The option's value. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "delta": {
                          "description": "Change in the price for a change of 1 in the underlying price.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "gamma": {
                          "description": "Change in delta for a change of 1 in the underlying price.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "vega": {
                          "description": "Change in the price for one percentage point more volatility.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "theta": {
                          "description": "Change in the price over one calendar day, other things equal.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "rho": {
                          "description": "Change in the price for one percentage point more interest.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "d1": {
                          "description": "The model's d1.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "d2": {
                          "description": "The model's d2.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "price",
                        "delta",
                        "gamma",
                        "vega",
                        "theta",
                        "rho",
                        "d1",
                        "d2"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A six-month call: stock at 42, strike 40, 10% rate, 20% volatility",
                    "value": {
                      "calculator": "finance/black-scholes@1",
                      "result": {
                        "price": "4.759422",
                        "delta": "0.779131",
                        "gamma": "0.049963",
                        "vega": "0.088134",
                        "theta": "-0.012491",
                        "rho": "0.139820",
                        "d1": "0.769263",
                        "d2": "0.627841"
                      },
                      "exactness": {
                        "price": "rounded",
                        "delta": "rounded",
                        "gamma": "rounded",
                        "vega": "rounded",
                        "theta": "rounded",
                        "rho": "rounded",
                        "d1": "rounded",
                        "d2": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 6
                      },
                      "inputs": {
                        "spot": "42",
                        "strike": "40",
                        "time_to_expiry_years": "0.5",
                        "volatility_percent": "20",
                        "risk_free_rate_percent": "10",
                        "dividend_yield_percent": "0",
                        "option_type": "call"
                      },
                      "formula": "call = S·e^(−qT)·Φ(d1) − K·e^(−rT)·Φ(d2); put = K·e^(−rT)·Φ(−d2) − S·e^(−qT)·Φ(−d1); d1 = (ln(S/K) + (r − q + σ²/2)·T) / (σ·√T), d2 = d1 − σ·√T",
                      "references": [
                        {
                          "title": "The Nobel Prize in Economic Sciences 1997: Merton and Scholes, a new method to determine the value of derivatives",
                          "url": "https://www.nobelprize.org/prizes/economic-sciences/1997/press-release/"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "The put on the same terms",
                    "value": {
                      "calculator": "finance/black-scholes@1",
                      "result": {
                        "price": "0.808599",
                        "delta": "-0.220869",
                        "gamma": "0.049963",
                        "vega": "0.088134",
                        "theta": "-0.002066",
                        "rho": "-0.050425",
                        "d1": "0.769263",
                        "d2": "0.627841"
                      },
                      "exactness": {
                        "price": "rounded",
                        "delta": "rounded",
                        "gamma": "rounded",
                        "vega": "rounded",
                        "theta": "rounded",
                        "rho": "rounded",
                        "d1": "rounded",
                        "d2": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 6
                      },
                      "inputs": {
                        "spot": "42",
                        "strike": "40",
                        "time_to_expiry_years": "0.5",
                        "volatility_percent": "20",
                        "risk_free_rate_percent": "10",
                        "dividend_yield_percent": "0",
                        "option_type": "put"
                      },
                      "formula": "call = S·e^(−qT)·Φ(d1) − K·e^(−rT)·Φ(d2); put = K·e^(−rT)·Φ(−d2) − S·e^(−qT)·Φ(−d1); d1 = (ln(S/K) + (r − q + σ²/2)·T) / (σ·√T), d2 = d1 − σ·√T",
                      "references": [
                        {
                          "title": "The Nobel Prize in Economic Sciences 1997: Merton and Scholes, a new method to determine the value of derivatives",
                          "url": "https://www.nobelprize.org/prizes/economic-sciences/1997/press-release/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/black-scholes@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/bond-duration-convexity": {
      "post": {
        "operationId": "calc_finance_bond_duration_convexity",
        "summary": "Bond duration and convexity calculator",
        "description": "The price of a coupon bond at a yield, with its Macaulay and modified duration, convexity and DV01, for any settlement date.\n\nPrices a bond that pays periodic coupons by discounting each payment at the yield, and measures how the price reacts when the yield moves. Modified duration is the percentage fall in price for a rise of one percentage point in yield; convexity is the correction for larger moves; DV01 is the change in price, per 100 of face value, for one basis point. Between coupon dates the price is split into the clean price and accrued interest.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settlement": {
                    "description": "Settlement date (when the buyer gets the bond).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-03-15"
                    ]
                  },
                  "maturity": {
                    "description": "Maturity date.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2036-03-15"
                    ]
                  },
                  "coupon_rate_percent": {
                    "description": "Annual coupon rate in percent of face value. Allowed: >= 0 and <= 1000. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "5"
                    ]
                  },
                  "yield_percent": {
                    "description": "Annual yield to maturity in percent, compounded at the coupon frequency. Allowed: > -50 and <= 1000. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "6"
                    ]
                  },
                  "redemption": {
                    "description": "Amount repaid at maturity per 100 of face value. Allowed: > 0 and <= 1000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "100"
                  },
                  "frequency": {
                    "description": "Coupons per year: 1, 2 or 4. Allowed: >= 1 and <= 4.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4,
                    "default": 2
                  },
                  "day_count": {
                    "description": "How days are counted for accrued interest. Options: 30/360: US (NASD) 30/360; actual/actual: actual days over the actual length of the coupon period; actual/360: actual days over a 360-day year; actual/365: actual days over a 365-day year; 30e/360: European 30/360",
                    "type": "string",
                    "enum": [
                      "30/360",
                      "actual/actual",
                      "actual/360",
                      "actual/365",
                      "30e/360"
                    ],
                    "default": "30/360"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=6)."
                  }
                },
                "required": [
                  "settlement",
                  "maturity",
                  "coupon_rate_percent",
                  "yield_percent"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A 10-year 5% semiannual bond at a 6% yield, on a coupon date",
                  "value": {
                    "settlement": "2026-03-15",
                    "maturity": "2036-03-15",
                    "coupon_rate_percent": "5",
                    "yield_percent": "6"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/bond-duration-convexity@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "clean_price": {
                          "description": "Price per 100 of face value without accrued interest.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "accrued_interest": {
                          "description": "Coupon earned since the last coupon date.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "dirty_price": {
                          "description": "What the buyer pays: clean price + accrued interest.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "macaulay_duration": {
                          "description": "Weighted average time to the payments, in years.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "modified_duration": {
                          "description": "Macaulay duration ÷ (1 + yield ÷ frequency).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "convexity": {
                          "description": "The second derivative of price to yield, divided by price.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "dv01": {
                          "description": "Fall in price per 100 of face value for a rise of 0.01% in yield.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "coupons_remaining": {
                          "description": "Coupons from settlement to maturity.",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "clean_price",
                        "accrued_interest",
                        "dirty_price",
                        "macaulay_duration",
                        "modified_duration",
                        "convexity",
                        "dv01",
                        "coupons_remaining"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A 10-year 5% semiannual bond at a 6% yield, on a coupon date",
                    "value": {
                      "calculator": "finance/bond-duration-convexity@1",
                      "result": {
                        "clean_price": "92.561263",
                        "accrued_interest": "0.000000",
                        "dirty_price": "92.561263",
                        "macaulay_duration": "7.894997",
                        "modified_duration": "7.665046",
                        "convexity": "71.785398",
                        "dv01": "0.070949",
                        "coupons_remaining": 20
                      },
                      "exactness": {
                        "clean_price": "rounded",
                        "accrued_interest": "exact",
                        "dirty_price": "rounded",
                        "macaulay_duration": "rounded",
                        "modified_duration": "rounded",
                        "convexity": "rounded",
                        "dv01": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 6
                      },
                      "inputs": {
                        "settlement": "2026-03-15",
                        "maturity": "2036-03-15",
                        "coupon_rate_percent": "5",
                        "yield_percent": "6",
                        "redemption": "100",
                        "frequency": 2,
                        "day_count": "30/360"
                      },
                      "formula": "P = Σ CF_k·v^t_k, v = 1/(1 + y/f), t_k = k − 1 + days to next coupon ÷ days in period; Macaulay = Σ t_k·CF_k·v^t_k ÷ P ÷ f; modified = Macaulay·v; convexity = Σ t_k·(t_k + 1)·CF_k·v^(t_k + 2) ÷ (P·f²); DV01 = modified × P ÷ 10000",
                      "references": [
                        {
                          "title": "Microsoft Excel DURATION function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/duration-function"
                        },
                        {
                          "title": "Microsoft Excel MDURATION function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/mduration-function"
                        },
                        {
                          "title": "FINRA: Bond yield and return (yield to maturity and yield to call)",
                          "url": "https://www.finra.org/investors/insights/bond-yield-return"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/bond-duration-convexity@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/compound-interest": {
      "post": {
        "operationId": "calc_finance_compound_interest",
        "summary": "Compound interest calculator",
        "description": "Future value of a lump sum with annual, monthly, daily or continuous compounding, plus the effective annual rate (APY).\n\nGrows a single deposit at a nominal annual rate compounded m times a year: A = P(1 + r/m)^(m·t), or A = P·e^(r·t) for continuous compounding. Whole numbers of periods are computed exactly; anything else is computed with certified high-precision arithmetic and rounded correctly.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "principal": {
                    "description": "Amount deposited at the start. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "1000"
                    ]
                  },
                  "annual_rate_percent": {
                    "description": "Nominal annual interest rate in percent (may be negative, above -100). Allowed: > -100 and <= 1000. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "5"
                    ]
                  },
                  "years": {
                    "description": "Time in years. Allowed: >= 0 and <= 200. Unit: years.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "compounding": {
                    "description": "How often interest is compounded. Options: annually: once a year; semiannually: twice a year; quarterly: 4 times a year; monthly: 12 times a year; weekly: 52 times a year; daily: 365 times a year; continuously: continuous compounding (e^rt)",
                    "type": "string",
                    "enum": [
                      "annually",
                      "semiannually",
                      "quarterly",
                      "monthly",
                      "weekly",
                      "daily",
                      "continuously"
                    ],
                    "default": "annually"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "principal",
                  "annual_rate_percent",
                  "years"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "1,000 at 5% for 10 years, yearly",
                  "value": {
                    "principal": "1000",
                    "annual_rate_percent": "5",
                    "years": "10"
                  }
                },
                "example2": {
                  "summary": "1,000 at 5% for 2 years, yearly",
                  "value": {
                    "principal": "1000",
                    "annual_rate_percent": "5",
                    "years": "2"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/compound-interest@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "final_amount": {
                          "description": "Balance at the end. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "interest_earned": {
                          "description": "Final amount minus principal. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "effective_annual_rate_percent": {
                          "description": "Effective annual rate (APY) for this compounding, in percent. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "periods": {
                          "description": "Number of compounding periods m·t used.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "final_amount",
                        "interest_earned",
                        "effective_annual_rate_percent",
                        "periods"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "1,000 at 5% for 10 years, yearly",
                    "value": {
                      "calculator": "finance/compound-interest@1",
                      "result": {
                        "final_amount": "1628.89",
                        "interest_earned": "628.89",
                        "effective_annual_rate_percent": "5.00",
                        "periods": "10"
                      },
                      "exactness": {
                        "final_amount": "rounded",
                        "interest_earned": "rounded",
                        "effective_annual_rate_percent": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "principal": "1000",
                        "annual_rate_percent": "5",
                        "years": "10",
                        "compounding": "annually"
                      },
                      "formula": "A = P·(1 + r/m)^(m·t); continuous: A = P·e^(r·t); APY = (1 + r/m)^m − 1",
                      "references": [
                        {
                          "title": "CFPB: What is compound interest? (worked example at 5% a year)",
                          "url": "https://www.consumerfinance.gov/ask-cfpb/how-does-compound-interest-work-en-1683/"
                        },
                        {
                          "title": "Compound interest (formula and continuous compounding)",
                          "url": "https://en.wikipedia.org/wiki/Compound_interest"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "1,000 at 5% for 2 years, yearly",
                    "value": {
                      "calculator": "finance/compound-interest@1",
                      "result": {
                        "final_amount": "1102.50",
                        "interest_earned": "102.50",
                        "effective_annual_rate_percent": "5.00",
                        "periods": "2"
                      },
                      "exactness": {
                        "final_amount": "exact",
                        "interest_earned": "exact",
                        "effective_annual_rate_percent": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "principal": "1000",
                        "annual_rate_percent": "5",
                        "years": "2",
                        "compounding": "annually"
                      },
                      "formula": "A = P·(1 + r/m)^(m·t); continuous: A = P·e^(r·t); APY = (1 + r/m)^m − 1",
                      "references": [
                        {
                          "title": "CFPB: What is compound interest? (worked example at 5% a year)",
                          "url": "https://www.consumerfinance.gov/ask-cfpb/how-does-compound-interest-work-en-1683/"
                        },
                        {
                          "title": "Compound interest (formula and continuous compounding)",
                          "url": "https://en.wikipedia.org/wiki/Compound_interest"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/compound-interest@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/extra-payments": {
      "post": {
        "operationId": "calc_finance_extra_payments",
        "summary": "Extra mortgage payment calculator",
        "description": "How much sooner a loan is paid off, and how much interest is saved, by paying extra each month or making one lump-sum payment.\n\nRuns a loan's schedule twice: once as agreed, and once with an extra amount on top of every payment, a single lump sum in a month you choose, or both. Extra money goes straight to the balance, so less interest builds up afterwards. The answer gives the new pay-off time and the interest saved.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "principal": {
                    "description": "The loan amount. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "300000"
                    ]
                  },
                  "annual_rate_percent": {
                    "description": "The annual interest rate. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "6.5"
                    ]
                  },
                  "term_months": {
                    "description": "The loan term in months. Allowed: >= 1 and <= 600.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 600,
                    "examples": [
                      360
                    ]
                  },
                  "extra_monthly_payment": {
                    "description": "Extra paid with every monthly payment. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0",
                    "examples": [
                      "200"
                    ]
                  },
                  "lump_sum": {
                    "description": "A single extra payment. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "lump_sum_month": {
                    "description": "The payment number the lump sum is made with (1 is the first payment). Allowed: >= 1 and <= 600.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 600,
                    "default": 1
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "principal",
                  "annual_rate_percent",
                  "term_months"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "300,000 at 6.5% over 30 years with 200 extra a month",
                  "value": {
                    "principal": "300000",
                    "annual_rate_percent": "6.5",
                    "term_months": 360,
                    "extra_monthly_payment": "200"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/extra-payments@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "regular_payment": {
                          "description": "The agreed monthly payment. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "months_to_pay_off": {
                          "description": "Months until the loan is repaid with the extra payments.",
                          "type": "integer"
                        },
                        "months_saved": {
                          "description": "How many months sooner that is.",
                          "type": "integer"
                        },
                        "interest_without_extra": {
                          "description": "Total interest on the agreed schedule. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "interest_with_extra": {
                          "description": "Total interest with the extras. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "interest_saved": {
                          "description": "The difference. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_paid": {
                          "description": "Everything paid with the extras: principal and interest. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "regular_payment",
                        "months_to_pay_off",
                        "months_saved",
                        "interest_without_extra",
                        "interest_with_extra",
                        "interest_saved",
                        "total_paid"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "300,000 at 6.5% over 30 years with 200 extra a month",
                    "value": {
                      "calculator": "finance/extra-payments@1",
                      "result": {
                        "regular_payment": "1896.20",
                        "months_to_pay_off": 277,
                        "months_saved": 83,
                        "interest_without_extra": "382636.71",
                        "interest_with_extra": "279186.52",
                        "interest_saved": "103450.19",
                        "total_paid": "579186.52"
                      },
                      "exactness": {
                        "regular_payment": "exact",
                        "interest_without_extra": "exact",
                        "interest_with_extra": "exact",
                        "interest_saved": "exact",
                        "total_paid": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "principal": "300000",
                        "annual_rate_percent": "6.5",
                        "term_months": 360,
                        "extra_monthly_payment": "200",
                        "lump_sum": "0",
                        "lump_sum_month": 1
                      },
                      "formula": "each month: interest = balance × r, rounded; balance = balance + interest − (payment + extra); the last payment clears what is left",
                      "references": [
                        {
                          "title": "Consumer Financial Protection Bureau: How does paying down a mortgage work?",
                          "url": "https://www.consumerfinance.gov/ask-cfpb/how-does-paying-down-a-mortgage-work-en-1943/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/extra-payments@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/fha-mip": {
      "post": {
        "operationId": "calc_finance_fha_mip",
        "summary": "FHA mortgage insurance (MIP) calculator",
        "description": "The upfront and annual mortgage insurance premium on an FHA loan, from HUD's current rate tables, and how long the annual premium is charged.\n\nAn FHA-insured mortgage carries two insurance premiums. The upfront premium is 1.75% of the base loan amount and is usually added to the loan. The annual premium depends on the loan term, the base loan amount and the loan-to-value ratio, and is charged monthly for 11 years or for the whole mortgage term. This calculator reads both from the tables in HUD Mortgagee Letter 2023-05, which apply to loans endorsed on or after 20 March 2023.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "base_loan_amount": {
                    "description": "The loan before the upfront premium is added. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "300000"
                    ]
                  },
                  "property_value": {
                    "description": "The value the loan-to-value ratio is measured against: the lower of the price and the appraised value. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "310000"
                    ]
                  },
                  "term_years": {
                    "description": "The mortgage term in years. Allowed: >= 1 and <= 30.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "30"
                    ]
                  },
                  "finance_upfront_mip": {
                    "description": "Whether the upfront premium is added to the loan instead of paid in cash.",
                    "type": "boolean",
                    "default": true
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "base_loan_amount",
                  "property_value",
                  "term_years"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A 30-year loan of 300,000 on a 310,000 home (LTV above 95%)",
                  "value": {
                    "base_loan_amount": "300000",
                    "property_value": "310000",
                    "term_years": "30",
                    "finance_upfront_mip": true
                  }
                },
                "example2": {
                  "summary": "A 15-year loan with 10% down",
                  "value": {
                    "base_loan_amount": "270000",
                    "property_value": "300000",
                    "term_years": "15",
                    "finance_upfront_mip": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/fha-mip@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "ltv_percent": {
                          "description": "Loan-to-value: base loan ÷ property value. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "upfront_mip": {
                          "description": "The upfront premium: 1.75% of the base loan. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "loan_amount_with_upfront_mip": {
                          "description": "The loan after the upfront premium is added, or the base loan when it is paid in cash. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "annual_mip_basis_points": {
                          "description": "The annual premium rate in basis points.",
                          "type": "integer"
                        },
                        "annual_mip_percent": {
                          "description": "The same rate in percent.",
                          "type": "string"
                        },
                        "monthly_mip_at_start": {
                          "description": "One twelfth of the annual rate on the starting base loan. The lender works the premium out again each year on the average balance, so it falls as the loan is repaid. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "mip_duration": {
                          "description": "How long the annual premium is charged.",
                          "type": "string"
                        },
                        "mip_months": {
                          "description": "The same in months.",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "ltv_percent",
                        "upfront_mip",
                        "loan_amount_with_upfront_mip",
                        "annual_mip_basis_points",
                        "annual_mip_percent",
                        "monthly_mip_at_start",
                        "mip_duration",
                        "mip_months"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A 30-year loan of 300,000 on a 310,000 home (LTV above 95%)",
                    "value": {
                      "calculator": "finance/fha-mip@1",
                      "result": {
                        "ltv_percent": "96.77",
                        "upfront_mip": "5250.00",
                        "loan_amount_with_upfront_mip": "305250.00",
                        "annual_mip_basis_points": 55,
                        "annual_mip_percent": "0.55",
                        "monthly_mip_at_start": "137.50",
                        "mip_duration": "mortgage term",
                        "mip_months": 360
                      },
                      "exactness": {
                        "ltv_percent": "rounded",
                        "upfront_mip": "exact",
                        "loan_amount_with_upfront_mip": "exact",
                        "monthly_mip_at_start": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "base_loan_amount": "300000",
                        "property_value": "310000",
                        "term_years": "30",
                        "finance_upfront_mip": true
                      },
                      "formula": "upfront = 1.75% × base loan; annual rate from the ML 2023-05 table for the term, base loan (up to or above $726,200) and LTV; monthly at start = base loan × rate ÷ 12",
                      "references": [
                        {
                          "title": "HUD Mortgagee Letter 2023-05: reduction of FHA annual mortgage insurance premium rates (case numbers endorsed on or after 20 March 2023)",
                          "url": "https://archives.hud.gov/news/2024/2023-05hsgml.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "A 15-year loan with 10% down",
                    "value": {
                      "calculator": "finance/fha-mip@1",
                      "result": {
                        "ltv_percent": "90.00",
                        "upfront_mip": "4725.00",
                        "loan_amount_with_upfront_mip": "274725.00",
                        "annual_mip_basis_points": 15,
                        "annual_mip_percent": "0.15",
                        "monthly_mip_at_start": "33.75",
                        "mip_duration": "11 years",
                        "mip_months": 132
                      },
                      "exactness": {
                        "ltv_percent": "exact",
                        "upfront_mip": "exact",
                        "loan_amount_with_upfront_mip": "exact",
                        "monthly_mip_at_start": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "base_loan_amount": "270000",
                        "property_value": "300000",
                        "term_years": "15",
                        "finance_upfront_mip": true
                      },
                      "formula": "upfront = 1.75% × base loan; annual rate from the ML 2023-05 table for the term, base loan (up to or above $726,200) and LTV; monthly at start = base loan × rate ÷ 12",
                      "references": [
                        {
                          "title": "HUD Mortgagee Letter 2023-05: reduction of FHA annual mortgage insurance premium rates (case numbers endorsed on or after 20 March 2023)",
                          "url": "https://archives.hud.gov/news/2024/2023-05hsgml.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/fha-mip@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/implied-volatility": {
      "post": {
        "operationId": "calc_finance_implied_volatility",
        "summary": "Implied volatility calculator",
        "description": "The volatility at which the Black-Scholes-Merton formula gives an option's market price, pinned between proven bounds.\n\nTurns an option's price back into the volatility that explains it. The Black-Scholes price rises with volatility, so a price inside the option's possible range matches exactly one volatility. It is found here by closing in on it and then proving that the price is too low just below and too high just above, so the digits returned are correct. A price outside the possible range is refused with the reason.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "option_price": {
                    "description": "The option's market price. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "4.759422"
                    ]
                  },
                  "spot": {
                    "description": "The underlying's price now. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "42"
                    ]
                  },
                  "strike": {
                    "description": "The option's strike price. A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 1000000000000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "40"
                    ]
                  },
                  "time_to_expiry_years": {
                    "description": "Time to expiry in years. Write days as a ratio, such as \"30/365\". A ratio of two decimals such as \"0.08/12\" is accepted. Allowed: > 0 and <= 100.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?(/[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?)?$",
                    "examples": [
                      "0.5"
                    ]
                  },
                  "risk_free_rate_percent": {
                    "description": "Risk-free interest rate per year in percent, continuously compounded. Allowed: >= -50 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "dividend_yield_percent": {
                    "description": "Dividend yield per year in percent, continuously compounded. Allowed: >= -50 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "option_type": {
                    "description": "Call or put. Options: call: the right to buy; put: the right to sell",
                    "type": "string",
                    "enum": [
                      "call",
                      "put"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=6)."
                  }
                },
                "required": [
                  "option_price",
                  "spot",
                  "strike",
                  "time_to_expiry_years",
                  "risk_free_rate_percent",
                  "option_type"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A six-month call on a stock at 42, strike 40, 10% rate, priced at 4.759422",
                  "value": {
                    "option_price": "4.759422",
                    "spot": "42",
                    "strike": "40",
                    "time_to_expiry_years": "0.5",
                    "risk_free_rate_percent": "10",
                    "option_type": "call"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/implied-volatility@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "implied_volatility_percent": {
                          "description": "Implied volatility per year. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "implied_volatility": {
                          "description": "The same as a decimal.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "implied_volatility_percent",
                        "implied_volatility"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A six-month call on a stock at 42, strike 40, 10% rate, priced at 4.759422",
                    "value": {
                      "calculator": "finance/implied-volatility@1",
                      "result": {
                        "implied_volatility_percent": "19.999996",
                        "implied_volatility": "0.200000"
                      },
                      "exactness": {
                        "implied_volatility_percent": "rounded",
                        "implied_volatility": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 6
                      },
                      "inputs": {
                        "option_price": "4.759422",
                        "spot": "42",
                        "strike": "40",
                        "time_to_expiry_years": "0.5",
                        "risk_free_rate_percent": "10",
                        "dividend_yield_percent": "0",
                        "option_type": "call"
                      },
                      "formula": "the σ with BlackScholes(S, K, T, r, q, σ) = option price",
                      "references": [
                        {
                          "title": "The Nobel Prize in Economic Sciences 1997: Merton and Scholes, a new method to determine the value of derivatives",
                          "url": "https://www.nobelprize.org/prizes/economic-sciences/1997/press-release/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/implied-volatility@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/irr": {
      "post": {
        "operationId": "calc_finance_irr",
        "summary": "Internal rate of return (IRR) calculator",
        "description": "Internal rate of return of periodic cash flows, with every IRR reported when there is more than one.\n\nFinds the discount rate at which the net present value of the cash flows is zero. Unlike spreadsheet IRR(), no starting guess is needed: all IRRs between −100% and the mathematical bound are searched, each one is pinned down with exact arithmetic, and the result is correctly rounded. When the cash flows change sign more than once there can be several IRRs; all are returned and a warning explains.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cash_flows": {
                    "description": "Cash flows in time order, one per period. Money paid out is negative, money received is positive. 2 to 600 items. Each item: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 2,
                    "maxItems": 600,
                    "examples": [
                      [
                        "-10000",
                        "3000",
                        "4200",
                        "6800"
                      ]
                    ]
                  },
                  "periods_per_year": {
                    "description": "Set to 12 for monthly flows, 4 for quarterly, ... to also get the effective annual IRR. Allowed: >= 1 and <= 365.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=4)."
                  }
                },
                "required": [
                  "cash_flows"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "ECMA-376 example",
                  "value": {
                    "cash_flows": [
                      "-70000",
                      "12000",
                      "15000",
                      "18000",
                      "21000",
                      "26000"
                    ]
                  }
                },
                "example2": {
                  "summary": "Exactly 10%",
                  "value": {
                    "cash_flows": [
                      "-100",
                      "110"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/irr@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "irr_percent": {
                          "description": "IRR per period, in percent. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "all_irr_percent": {
                          "description": "Every IRR found, lowest first, in percent.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "irr_is_unique": {
                          "description": "True when there is exactly one IRR.",
                          "type": "boolean"
                        },
                        "sign_changes": {
                          "description": "How many times the cash flows change sign.",
                          "type": "integer"
                        },
                        "annual_effective_irr_percent": {
                          "description": "(1 + IRR)^periods_per_year − 1, in percent. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "irr_percent",
                        "all_irr_percent",
                        "irr_is_unique",
                        "sign_changes"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "ECMA-376 example",
                    "value": {
                      "calculator": "finance/irr@1",
                      "result": {
                        "irr_percent": "8.6631",
                        "all_irr_percent": [
                          "8.6631"
                        ],
                        "irr_is_unique": true,
                        "sign_changes": 1
                      },
                      "exactness": {
                        "irr_percent": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 4
                      },
                      "inputs": {
                        "cash_flows": [
                          "-70000",
                          "12000",
                          "15000",
                          "18000",
                          "21000",
                          "26000"
                        ]
                      },
                      "formula": "Σ CFₜ / (1 + IRR)ᵗ = 0",
                      "references": [
                        {
                          "title": "ECMA-376 (Office Open XML) spreadsheet function IRR, with worked example",
                          "url": "https://webapp.docx4java.org/OnlineDemo/ecma376/SpreadsheetML/IRR.html"
                        },
                        {
                          "title": "Descartes' rule of signs",
                          "url": "https://en.wikipedia.org/wiki/Descartes%27_rule_of_signs"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Exactly 10%",
                    "value": {
                      "calculator": "finance/irr@1",
                      "result": {
                        "irr_percent": "10.0000",
                        "all_irr_percent": [
                          "10.0000"
                        ],
                        "irr_is_unique": true,
                        "sign_changes": 1
                      },
                      "exactness": {
                        "irr_percent": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 4
                      },
                      "inputs": {
                        "cash_flows": [
                          "-100",
                          "110"
                        ]
                      },
                      "formula": "Σ CFₜ / (1 + IRR)ᵗ = 0",
                      "references": [
                        {
                          "title": "ECMA-376 (Office Open XML) spreadsheet function IRR, with worked example",
                          "url": "https://webapp.docx4java.org/OnlineDemo/ecma376/SpreadsheetML/IRR.html"
                        },
                        {
                          "title": "Descartes' rule of signs",
                          "url": "https://en.wikipedia.org/wiki/Descartes%27_rule_of_signs"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/irr@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/loan/emi": {
      "post": {
        "operationId": "calc_finance_loan_emi",
        "summary": "Loan EMI calculator",
        "description": "Monthly instalment (EMI), total interest and an exact amortization schedule for a fixed-rate loan.\n\nComputes the equated monthly instalment for a fixed-rate loan repaid in equal monthly payments, the total paid and the total interest. The schedule is computed the way lenders do it: each month's interest is rounded to the cent, every payment is the rounded EMI, and the final payment is adjusted so the balance ends at exactly zero. Totals are the sums of that schedule, so they always add up to the cent.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "principal": {
                    "description": "Amount borrowed. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "250000"
                    ]
                  },
                  "annual_rate_percent": {
                    "description": "Nominal annual interest rate in percent (7.5 means 7.5%), compounded monthly. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "7.5"
                    ]
                  },
                  "term_months": {
                    "description": "Number of monthly payments. Allowed: >= 1 and <= 1200.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1200,
                    "examples": [
                      240
                    ]
                  },
                  "include_schedule": {
                    "description": "Also return the month-by-month schedule.",
                    "type": "boolean",
                    "default": false
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "principal",
                  "annual_rate_percent",
                  "term_months"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "250,000 at 7.5% over 20 years",
                  "value": {
                    "principal": "250000",
                    "annual_rate_percent": "7.5",
                    "term_months": 240
                  }
                },
                "example2": {
                  "summary": "CFPB sample: 162,000 at 3.875% over 30 years",
                  "value": {
                    "principal": "162000",
                    "annual_rate_percent": "3.875",
                    "term_months": 360
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/loan/emi@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "emi": {
                          "description": "The monthly payment, rounded to the precision. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_paid": {
                          "description": "Sum of all payments in the schedule. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_interest": {
                          "description": "Total paid minus the principal. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "last_payment": {
                          "description": "The final payment, which clears the balance exactly. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "number_of_payments": {
                          "description": "Number of payments in the schedule.",
                          "type": "integer"
                        },
                        "schedule": {
                          "description": "The amortization schedule (when include_schedule is true).",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "period": {
                                "description": "Payment number, starting at 1.",
                                "type": "integer"
                              },
                              "payment": {
                                "description": "Amount paid this period.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "principal": {
                                "description": "Part of the payment that reduces the balance.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "interest": {
                                "description": "Part of the payment that is interest.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "balance": {
                                "description": "Balance remaining after this payment.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "period",
                              "payment",
                              "principal",
                              "interest",
                              "balance"
                            ]
                          }
                        }
                      },
                      "required": [
                        "emi",
                        "total_paid",
                        "total_interest",
                        "last_payment",
                        "number_of_payments"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "250,000 at 7.5% over 20 years",
                    "value": {
                      "calculator": "finance/loan/emi@1",
                      "result": {
                        "emi": "2013.98",
                        "total_paid": "483356.89",
                        "total_interest": "233356.89",
                        "last_payment": "2015.67",
                        "number_of_payments": 240
                      },
                      "exactness": {
                        "emi": "exact",
                        "total_paid": "exact",
                        "total_interest": "exact",
                        "last_payment": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "principal": "250000",
                        "annual_rate_percent": "7.5",
                        "term_months": 240,
                        "include_schedule": false
                      },
                      "formula": "EMI = P·r·(1+r)^n / ((1+r)^n − 1), r = annual rate ÷ 12 ÷ 100 (EMI = P/n if r = 0)",
                      "references": [
                        {
                          "title": "CFPB Regulation Z Appendix H, form H-24(B) sample Loan Estimate: $162,000 at 3.875% for 30 years has a monthly principal and interest payment of $761.78",
                          "url": "https://www.consumerfinance.gov/rules-policy/regulations/1026/h/"
                        },
                        {
                          "title": "Amortization calculator (annuity payment formula)",
                          "url": "https://en.wikipedia.org/wiki/Amortization_calculator"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "CFPB sample: 162,000 at 3.875% over 30 years",
                    "value": {
                      "calculator": "finance/loan/emi@1",
                      "result": {
                        "emi": "761.78",
                        "total_paid": "274243.67",
                        "total_interest": "112243.67",
                        "last_payment": "764.65",
                        "number_of_payments": 360
                      },
                      "exactness": {
                        "emi": "exact",
                        "total_paid": "exact",
                        "total_interest": "exact",
                        "last_payment": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "principal": "162000",
                        "annual_rate_percent": "3.875",
                        "term_months": 360,
                        "include_schedule": false
                      },
                      "formula": "EMI = P·r·(1+r)^n / ((1+r)^n − 1), r = annual rate ÷ 12 ÷ 100 (EMI = P/n if r = 0)",
                      "references": [
                        {
                          "title": "CFPB Regulation Z Appendix H, form H-24(B) sample Loan Estimate: $162,000 at 3.875% for 30 years has a monthly principal and interest payment of $761.78",
                          "url": "https://www.consumerfinance.gov/rules-policy/regulations/1026/h/"
                        },
                        {
                          "title": "Amortization calculator (annuity payment formula)",
                          "url": "https://en.wikipedia.org/wiki/Amortization_calculator"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/loan/emi@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/mortgage": {
      "post": {
        "operationId": "calc_finance_mortgage",
        "summary": "Mortgage calculator",
        "description": "Monthly mortgage payment including property tax, insurance, HOA dues and PMI, with an exact amortization schedule.\n\nSplits the monthly housing payment into principal and interest, property tax, home insurance, HOA dues and private mortgage insurance (PMI). Principal and interest use the same exact, lender-style schedule as the loan EMI calculator. PMI applies when the loan is more than 80% of the price and stops once the scheduled balance reaches 78% of the original price, the automatic termination point in the US Homeowners Protection Act.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "home_price": {
                    "description": "Purchase price of the home. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "400000"
                    ]
                  },
                  "down_payment": {
                    "description": "Down payment as an amount. Give this or down_payment_percent. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "80000"
                    ]
                  },
                  "down_payment_percent": {
                    "description": "Down payment as a percent of the price. Give this or down_payment. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "annual_rate_percent": {
                    "description": "Nominal annual interest rate in percent. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "6.5"
                    ]
                  },
                  "term_years": {
                    "description": "Length of the mortgage in years. Allowed: >= 1 and <= 50.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50,
                    "examples": [
                      30
                    ]
                  },
                  "annual_property_tax": {
                    "description": "Property tax per year. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "annual_home_insurance": {
                    "description": "Home insurance premium per year. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "monthly_hoa": {
                    "description": "Homeowners association dues per month. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "pmi_annual_rate_percent": {
                    "description": "PMI premium per year as a percent of the original loan amount (often 0.3 to 1.5). Only applied when the loan is above 80% of the price. Allowed: >= 0 and <= 10. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "include_schedule": {
                    "description": "Also return the month-by-month schedule.",
                    "type": "boolean",
                    "default": false
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "home_price",
                  "annual_rate_percent",
                  "term_years"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "CFPB sample loan",
                  "value": {
                    "home_price": "180000",
                    "down_payment": "18000",
                    "annual_rate_percent": "3.875",
                    "term_years": 30
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/mortgage@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "loan_amount": {
                          "description": "Price minus down payment. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "down_payment": {
                          "description": "Down payment amount. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "loan_to_value_percent": {
                          "description": "Loan amount as a percent of the price. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "monthly_principal_and_interest": {
                          "description": "Monthly principal and interest payment. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "monthly_property_tax": {
                          "description": "Annual property tax ÷ 12. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "monthly_home_insurance": {
                          "description": "Annual insurance ÷ 12. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "monthly_hoa": {
                          "description": "Monthly HOA dues. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "monthly_pmi": {
                          "description": "Monthly PMI while it applies. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_monthly_payment": {
                          "description": "Total of the monthly items above (first month). Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "pmi_months": {
                          "description": "Number of months PMI is charged.",
                          "type": "integer"
                        },
                        "total_pmi": {
                          "description": "Total PMI paid. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_interest": {
                          "description": "Total interest over the life of the loan. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_principal_and_interest": {
                          "description": "Sum of all principal and interest payments. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "last_principal_and_interest_payment": {
                          "description": "The final payment, which clears the balance exactly. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "number_of_payments": {
                          "description": "Number of monthly payments.",
                          "type": "integer"
                        },
                        "schedule": {
                          "description": "The amortization schedule (when include_schedule is true).",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "period": {
                                "description": "Payment number.",
                                "type": "integer"
                              },
                              "payment": {
                                "description": "Principal and interest paid this month.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "principal": {
                                "description": "Principal part.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "interest": {
                                "description": "Interest part.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "pmi": {
                                "description": "PMI charged this month.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "balance": {
                                "description": "Balance after this payment.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "period",
                              "payment",
                              "principal",
                              "interest",
                              "pmi",
                              "balance"
                            ]
                          }
                        }
                      },
                      "required": [
                        "loan_amount",
                        "down_payment",
                        "loan_to_value_percent",
                        "monthly_principal_and_interest",
                        "monthly_property_tax",
                        "monthly_home_insurance",
                        "monthly_hoa",
                        "monthly_pmi",
                        "total_monthly_payment",
                        "pmi_months",
                        "total_pmi",
                        "total_interest",
                        "total_principal_and_interest",
                        "last_principal_and_interest_payment",
                        "number_of_payments"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "CFPB sample loan",
                    "value": {
                      "calculator": "finance/mortgage@1",
                      "result": {
                        "loan_amount": "162000.00",
                        "down_payment": "18000.00",
                        "loan_to_value_percent": "90.00",
                        "monthly_principal_and_interest": "761.78",
                        "monthly_property_tax": "0.00",
                        "monthly_home_insurance": "0.00",
                        "monthly_hoa": "0.00",
                        "monthly_pmi": "0.00",
                        "total_monthly_payment": "761.78",
                        "pmi_months": 0,
                        "total_pmi": "0.00",
                        "total_interest": "112243.67",
                        "total_principal_and_interest": "274243.67",
                        "last_principal_and_interest_payment": "764.65",
                        "number_of_payments": 360
                      },
                      "exactness": {
                        "loan_amount": "exact",
                        "down_payment": "exact",
                        "loan_to_value_percent": "exact",
                        "monthly_principal_and_interest": "exact",
                        "monthly_property_tax": "exact",
                        "monthly_home_insurance": "exact",
                        "monthly_hoa": "exact",
                        "monthly_pmi": "exact",
                        "total_monthly_payment": "exact",
                        "total_pmi": "exact",
                        "total_interest": "exact",
                        "total_principal_and_interest": "exact",
                        "last_principal_and_interest_payment": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "home_price": "180000",
                        "down_payment": "18000",
                        "annual_rate_percent": "3.875",
                        "term_years": 30,
                        "annual_property_tax": "0",
                        "annual_home_insurance": "0",
                        "monthly_hoa": "0",
                        "pmi_annual_rate_percent": "0",
                        "include_schedule": false
                      },
                      "formula": "P&I = L·r·(1+r)^n / ((1+r)^n − 1), L = price − down payment, r = rate ÷ 1200, n = years × 12; total = P&I + tax/12 + insurance/12 + HOA + PMI",
                      "references": [
                        {
                          "title": "CFPB Regulation Z Appendix H, form H-24(B) sample Loan Estimate: $162,000 at 3.875% for 30 years, principal and interest $761.78 per month",
                          "url": "https://www.consumerfinance.gov/rules-policy/regulations/1026/h/"
                        },
                        {
                          "title": "Homeowners Protection Act of 1998 (PMI cancellation and termination), 12 U.S.C. 4902",
                          "url": "https://www.law.cornell.edu/uscode/text/12/4902"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/mortgage@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/mortgage-affordability": {
      "post": {
        "operationId": "calc_finance_mortgage_affordability",
        "summary": "Mortgage affordability calculator",
        "description": "The largest loan and home price an income supports, from housing and debt-to-income ratios you set (28% and 36% by default).\n\nLenders compare monthly payments with gross monthly income. This calculator takes two limits: the share of income that may go to housing costs, and the share that may go to all debt payments together. It finds the largest housing payment that meets both, takes off property tax, insurance and fees, and turns what is left into the loan that a level monthly payment repays at the given rate and term. The ratios are inputs because lenders and loan programmes use different ones.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gross_monthly_income": {
                    "description": "Income per month before tax. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "6000"
                    ]
                  },
                  "monthly_debt_payments": {
                    "description": "Other debt payments per month: car loans, student loans, credit card minimums. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0",
                    "examples": [
                      "500"
                    ]
                  },
                  "annual_rate_percent": {
                    "description": "The mortgage's annual interest rate. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "6.5"
                    ]
                  },
                  "term_years": {
                    "description": "The mortgage term in years. Allowed: >= 1 and <= 50.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50,
                    "examples": [
                      30
                    ]
                  },
                  "down_payment": {
                    "description": "Cash paid towards the price. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0",
                    "examples": [
                      "40000"
                    ]
                  },
                  "monthly_taxes_insurance_and_fees": {
                    "description": "Property tax, home insurance, mortgage insurance and association fees per month. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0",
                    "examples": [
                      "450"
                    ]
                  },
                  "housing_ratio_percent": {
                    "description": "The most of gross income that may go to housing costs (the front-end ratio). Allowed: > 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "28"
                  },
                  "debt_ratio_percent": {
                    "description": "The most of gross income that may go to housing costs and other debts together (the back-end or debt-to-income ratio). Allowed: > 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "36"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "gross_monthly_income",
                  "annual_rate_percent",
                  "term_years"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "6,000 a month, 500 of other debts, 6.5% over 30 years",
                  "value": {
                    "gross_monthly_income": "6000",
                    "monthly_debt_payments": "500",
                    "annual_rate_percent": "6.5",
                    "term_years": 30,
                    "down_payment": "40000",
                    "monthly_taxes_insurance_and_fees": "450"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/mortgage-affordability@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "max_monthly_housing_payment": {
                          "description": "The largest monthly housing cost that meets both ratios. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "max_principal_and_interest": {
                          "description": "What is left for the loan payment after taxes, insurance and fees. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "max_loan_amount": {
                          "description": "The loan that payment repays. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "max_home_price": {
                          "description": "The loan plus the down payment. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "limited_by": {
                          "description": "Which ratio set the limit: housing_ratio or debt_ratio.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "max_monthly_housing_payment",
                        "max_principal_and_interest",
                        "max_loan_amount",
                        "max_home_price",
                        "limited_by"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "6,000 a month, 500 of other debts, 6.5% over 30 years",
                    "value": {
                      "calculator": "finance/mortgage-affordability@1",
                      "result": {
                        "max_monthly_housing_payment": "1660.00",
                        "max_principal_and_interest": "1210.00",
                        "max_loan_amount": "191435.09",
                        "max_home_price": "231435.09",
                        "limited_by": "debt_ratio"
                      },
                      "exactness": {
                        "max_monthly_housing_payment": "exact",
                        "max_principal_and_interest": "exact",
                        "max_loan_amount": "rounded",
                        "max_home_price": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "gross_monthly_income": "6000",
                        "monthly_debt_payments": "500",
                        "annual_rate_percent": "6.5",
                        "term_years": 30,
                        "down_payment": "40000",
                        "monthly_taxes_insurance_and_fees": "450",
                        "housing_ratio_percent": "28",
                        "debt_ratio_percent": "36"
                      },
                      "formula": "housing = min(income × housing ratio, income × debt ratio − debts); P&I = housing − taxes, insurance and fees; loan = P&I × ((1+r)^n − 1) ÷ (r × (1+r)^n), r = annual rate ÷ 12",
                      "references": [
                        {
                          "title": "Consumer Financial Protection Bureau: What is a debt-to-income ratio?",
                          "url": "https://www.consumerfinance.gov/ask-cfpb/what-is-a-debt-to-income-ratio-en-1791/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/mortgage-affordability@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/npv": {
      "post": {
        "operationId": "calc_finance_npv",
        "summary": "Net present value (NPV) calculator",
        "description": "Net present value of a series of periodic cash flows at a discount rate.\n\nDiscounts each cash flow to today and adds them up: NPV = Σ CFₜ / (1 + r)ᵗ. By default the first cash flow happens now (t = 0) and is not discounted, the usual finance-textbook convention. Choose first_cash_flow_at = t1 to match spreadsheet NPV() functions, which discount the first value by one period.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "discount_rate_percent": {
                    "description": "Discount rate per period, in percent. Allowed: > -100 and <= 1000. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10"
                    ]
                  },
                  "cash_flows": {
                    "description": "Cash flows in time order, one per period. Money paid out is negative, money received is positive. 1 to 600 items. Each item: >= -1000000000000000 and <= 1000000000000000.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 1,
                    "maxItems": 600,
                    "examples": [
                      [
                        "-10000",
                        "3000",
                        "4200",
                        "6800"
                      ]
                    ]
                  },
                  "first_cash_flow_at": {
                    "description": "When the first cash flow happens. Options: t0: now, not discounted (finance convention); t1: at the end of the first period (spreadsheet NPV convention)",
                    "type": "string",
                    "enum": [
                      "t0",
                      "t1"
                    ],
                    "default": "t0"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "discount_rate_percent",
                  "cash_flows"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Excel NPV example 1 (spreadsheet convention)",
                  "value": {
                    "discount_rate_percent": "10",
                    "cash_flows": [
                      "-10000",
                      "3000",
                      "4200",
                      "6800"
                    ],
                    "first_cash_flow_at": "t1"
                  }
                },
                "example2": {
                  "summary": "Excel NPV example 2 (initial outlay now)",
                  "value": {
                    "discount_rate_percent": "8",
                    "cash_flows": [
                      "-40000",
                      "8000",
                      "9200",
                      "10000",
                      "12000",
                      "14500"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/npv@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "npv": {
                          "description": "Net present value. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "present_values": {
                          "description": "Present value of each cash flow.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "npv",
                        "present_values"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Excel NPV example 1 (spreadsheet convention)",
                    "value": {
                      "calculator": "finance/npv@1",
                      "result": {
                        "npv": "1188.44",
                        "present_values": [
                          "-9090.91",
                          "2479.34",
                          "3155.52",
                          "4644.49"
                        ]
                      },
                      "exactness": {
                        "npv": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "discount_rate_percent": "10",
                        "cash_flows": [
                          "-10000",
                          "3000",
                          "4200",
                          "6800"
                        ],
                        "first_cash_flow_at": "t1"
                      },
                      "formula": "NPV = Σ CFₜ / (1 + r)^(t + s), s = 0 (t0) or 1 (t1)",
                      "references": [
                        {
                          "title": "Microsoft Excel NPV function documentation (examples 1 and 2)",
                          "url": "https://support.microsoft.com/en-us/excel/npv-function"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Excel NPV example 2 (initial outlay now)",
                    "value": {
                      "calculator": "finance/npv@1",
                      "result": {
                        "npv": "1922.06",
                        "present_values": [
                          "-40000.00",
                          "7407.41",
                          "7887.52",
                          "7938.32",
                          "8820.36",
                          "9868.46"
                        ]
                      },
                      "exactness": {
                        "npv": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "discount_rate_percent": "8",
                        "cash_flows": [
                          "-40000",
                          "8000",
                          "9200",
                          "10000",
                          "12000",
                          "14500"
                        ],
                        "first_cash_flow_at": "t0"
                      },
                      "formula": "NPV = Σ CFₜ / (1 + r)^(t + s), s = 0 (t0) or 1 (t1)",
                      "references": [
                        {
                          "title": "Microsoft Excel NPV function documentation (examples 1 and 2)",
                          "url": "https://support.microsoft.com/en-us/excel/npv-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/npv@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/refinance-break-even": {
      "post": {
        "operationId": "calc_finance_refinance_break_even",
        "summary": "Refinance break-even calculator",
        "description": "How many months of lower payments it takes to earn back the closing costs of a refinance, and the difference in total cost over the life of the loans.\n\nCompares keeping a loan with replacing it. It works out the payment on what is left of the current loan and on the new loan, the monthly saving, and the break-even point: the first month by which the savings add up to the closing costs. It also totals every remaining payment on each side, because a lower payment over a longer term can still cost more in the end.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "current_balance": {
                    "description": "What is still owed. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "250000"
                    ]
                  },
                  "current_rate_percent": {
                    "description": "The current loan's annual rate. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "7"
                    ]
                  },
                  "remaining_months": {
                    "description": "Months left on the current loan. Allowed: >= 1 and <= 600.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 600,
                    "examples": [
                      300
                    ]
                  },
                  "new_rate_percent": {
                    "description": "The new loan's annual rate. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "6"
                    ]
                  },
                  "new_term_months": {
                    "description": "The new loan's term in months. Allowed: >= 1 and <= 600.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 600,
                    "examples": [
                      300
                    ]
                  },
                  "closing_costs": {
                    "description": "Fees and costs of the refinance. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0",
                    "examples": [
                      "5000"
                    ]
                  },
                  "finance_closing_costs": {
                    "description": "true when the costs are added to the new loan instead of paid in cash.",
                    "type": "boolean",
                    "default": false
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "current_balance",
                  "current_rate_percent",
                  "remaining_months",
                  "new_rate_percent",
                  "new_term_months"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "250,000 with 25 years left at 7%, refinanced at 6% for 5,000",
                  "value": {
                    "current_balance": "250000",
                    "current_rate_percent": "7",
                    "remaining_months": 300,
                    "new_rate_percent": "6",
                    "new_term_months": 300,
                    "closing_costs": "5000"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/refinance-break-even@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "current_payment": {
                          "description": "Monthly payment on the current loan. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "new_payment": {
                          "description": "Monthly payment on the new loan. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "monthly_saving": {
                          "description": "current_payment − new_payment. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "break_even_months": {
                          "description": "The first month by which the monthly savings cover the closing costs. Absent when the new payment is not lower.",
                          "type": "integer"
                        },
                        "current_total_remaining": {
                          "description": "Every remaining payment on the current loan, added up. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "new_total_cost": {
                          "description": "Every payment on the new loan, plus the closing costs when paid in cash. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "lifetime_saving": {
                          "description": "current_total_remaining − new_total_cost; negative when the refinance costs more overall. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "current_interest_remaining": {
                          "description": "Interest still to pay on the current loan. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "new_interest": {
                          "description": "Interest on the new loan. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "current_payment",
                        "new_payment",
                        "monthly_saving",
                        "current_total_remaining",
                        "new_total_cost",
                        "lifetime_saving",
                        "current_interest_remaining",
                        "new_interest"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "250,000 with 25 years left at 7%, refinanced at 6% for 5,000",
                    "value": {
                      "calculator": "finance/refinance-break-even@1",
                      "result": {
                        "current_payment": "1766.95",
                        "new_payment": "1610.75",
                        "monthly_saving": "156.20",
                        "break_even_months": 33,
                        "current_total_remaining": "530083.43",
                        "new_total_cost": "488227.37",
                        "lifetime_saving": "41856.06",
                        "current_interest_remaining": "280083.43",
                        "new_interest": "233227.37"
                      },
                      "exactness": {
                        "current_payment": "exact",
                        "new_payment": "exact",
                        "monthly_saving": "exact",
                        "current_total_remaining": "exact",
                        "new_total_cost": "exact",
                        "lifetime_saving": "exact",
                        "current_interest_remaining": "exact",
                        "new_interest": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "current_balance": "250000",
                        "current_rate_percent": "7",
                        "remaining_months": 300,
                        "new_rate_percent": "6",
                        "new_term_months": 300,
                        "closing_costs": "5000",
                        "finance_closing_costs": false
                      },
                      "formula": "payment = P·r·(1+r)^n ÷ ((1+r)^n − 1); break-even = closing costs ÷ monthly saving, rounded up to a whole month",
                      "references": [
                        {
                          "title": "CFPB Regulation Z Appendix H: sample Loan Estimate, the level payment the schedules here are checked against",
                          "url": "https://www.consumerfinance.gov/rules-policy/regulations/1026/h/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/refinance-break-even@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/rent-vs-buy": {
      "post": {
        "operationId": "calc_finance_rent_vs_buy",
        "summary": "Rent or buy calculator",
        "description": "The net cost of renting against buying a home over a number of years, from assumptions you set, with the first year in which buying comes out ahead.\n\nAdds up what each choice costs over the years you plan to stay. Buying costs the down payment, the buying costs, the mortgage payments and the yearly costs of owning, less what is left after selling the home and repaying the loan. Renting costs the rent, less what the down payment and buying costs would have earned if invested instead. Every growth rate is an input, because the answer depends on them and nobody knows them in advance; change them to see how sure the result is.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "home_price": {
                    "description": "The price of the home. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "400000"
                    ]
                  },
                  "down_payment": {
                    "description": "Cash paid towards the price. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "80000"
                    ]
                  },
                  "annual_rate_percent": {
                    "description": "The mortgage's annual rate. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "6.5"
                    ]
                  },
                  "term_years": {
                    "description": "The mortgage term in years. Allowed: >= 1 and <= 50.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50,
                    "examples": [
                      30
                    ]
                  },
                  "years": {
                    "description": "How many years to compare. Allowed: >= 1 and <= 50.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50,
                    "examples": [
                      10
                    ]
                  },
                  "monthly_rent": {
                    "description": "Rent per month in the first year. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "2000"
                    ]
                  },
                  "rent_increase_percent": {
                    "description": "How much the rent rises each year. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "3"
                    ]
                  },
                  "home_appreciation_percent": {
                    "description": "How much the home's value changes each year; negative for a fall. Allowed: >= -50 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "3"
                    ]
                  },
                  "annual_ownership_cost_percent": {
                    "description": "Property tax, insurance and upkeep per year, as a percentage of the home's value. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "2"
                    ]
                  },
                  "buying_costs_percent": {
                    "description": "Costs of buying, as a percentage of the price. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "3"
                    ]
                  },
                  "selling_costs_percent": {
                    "description": "Costs of selling, as a percentage of the sale price. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "6"
                    ]
                  },
                  "investment_return_percent": {
                    "description": "The yearly return the down payment and buying costs would earn if invested instead. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "5"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "home_price",
                  "down_payment",
                  "annual_rate_percent",
                  "term_years",
                  "years",
                  "monthly_rent",
                  "rent_increase_percent",
                  "home_appreciation_percent",
                  "annual_ownership_cost_percent",
                  "buying_costs_percent",
                  "selling_costs_percent",
                  "investment_return_percent"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A 400,000 home with 20% down against renting at 2,000 a month, over 10 years",
                  "value": {
                    "home_price": "400000",
                    "down_payment": "80000",
                    "annual_rate_percent": "6.5",
                    "term_years": 30,
                    "years": 10,
                    "monthly_rent": "2000",
                    "rent_increase_percent": "3",
                    "home_appreciation_percent": "3",
                    "annual_ownership_cost_percent": "2",
                    "buying_costs_percent": "3",
                    "selling_costs_percent": "6",
                    "investment_return_percent": "5"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/rent-vs-buy@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "cost_of_renting": {
                          "description": "Net cost of renting over the years. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "cost_of_buying": {
                          "description": "Net cost of buying over the years. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "difference": {
                          "description": "cost_of_renting − cost_of_buying: positive when buying is cheaper. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "cheaper": {
                          "description": "buy or rent.",
                          "type": "string"
                        },
                        "break_even_year": {
                          "description": "The first year in which buying costs no more than renting. Absent when that does not happen within the years compared.",
                          "type": "integer"
                        },
                        "home_value_at_end": {
                          "description": "The home's value after the years. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "loan_balance_at_end": {
                          "description": "What is still owed then. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "years_table": {
                          "description": "Both net costs if you stopped after each year.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "year": {
                                "description": "Year number.",
                                "type": "integer"
                              },
                              "cost_of_renting": {
                                "description": "Net cost of renting so far. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "cost_of_buying": {
                                "description": "Net cost of buying so far. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "home_value": {
                                "description": "The home's value at the end of the year. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "loan_balance": {
                                "description": "The loan balance then. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "year",
                              "cost_of_renting",
                              "cost_of_buying",
                              "home_value",
                              "loan_balance"
                            ]
                          }
                        }
                      },
                      "required": [
                        "cost_of_renting",
                        "cost_of_buying",
                        "difference",
                        "cheaper",
                        "home_value_at_end",
                        "loan_balance_at_end",
                        "years_table"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A 400,000 home with 20% down against renting at 2,000 a month, over 10 years",
                    "value": {
                      "calculator": "finance/rent-vs-buy@1",
                      "result": {
                        "cost_of_renting": "217274.80",
                        "cost_of_buying": "192396.12",
                        "difference": "24878.68",
                        "cheaper": "buy",
                        "break_even_year": 8,
                        "home_value_at_end": "537566.55",
                        "loan_balance_at_end": "271283.24",
                        "years_table": [
                          {
                            "year": 1,
                            "cost_of_renting": "19400.00",
                            "cost_of_buying": "53414.68",
                            "home_value": "412000.00",
                            "loan_balance": "316423.24"
                          },
                          {
                            "year": 2,
                            "cost_of_renting": "39290.00",
                            "cost_of_buying": "70491.44",
                            "home_value": "424360.00",
                            "loan_balance": "312606.96"
                          },
                          {
                            "year": 3,
                            "cost_of_renting": "59680.10",
                            "cost_of_buying": "87211.25",
                            "home_value": "437090.80",
                            "loan_balance": "308535.08"
                          },
                          {
                            "year": 4,
                            "cost_of_renting": "80580.47",
                            "cost_of_buying": "103553.97",
                            "home_value": "450203.52",
                            "loan_balance": "304190.51"
                          },
                          {
                            "year": 5,
                            "cost_of_renting": "102001.36",
                            "cost_of_buying": "119498.20",
                            "home_value": "463709.63",
                            "loan_balance": "299554.97"
                          },
                          {
                            "year": 6,
                            "cost_of_renting": "123953.04",
                            "cost_of_buying": "135021.23",
                            "home_value": "477620.92",
                            "loan_balance": "294608.97"
                          },
                          {
                            "year": 7,
                            "cost_of_renting": "146445.85",
                            "cost_of_buying": "150098.95",
                            "home_value": "491949.55",
                            "loan_balance": "289331.75"
                          },
                          {
                            "year": 8,
                            "cost_of_renting": "169490.16",
                            "cost_of_buying": "164705.76",
                            "home_value": "506708.03",
                            "loan_balance": "283701.10"
                          },
                          {
                            "year": 9,
                            "cost_of_renting": "193096.35",
                            "cost_of_buying": "178814.44",
                            "home_value": "521909.27",
                            "loan_balance": "277693.35"
                          },
                          {
                            "year": 10,
                            "cost_of_renting": "217274.80",
                            "cost_of_buying": "192396.12",
                            "home_value": "537566.55",
                            "loan_balance": "271283.24"
                          }
                        ]
                      },
                      "exactness": {
                        "cost_of_renting": "rounded",
                        "cost_of_buying": "rounded",
                        "difference": "rounded",
                        "home_value_at_end": "rounded",
                        "loan_balance_at_end": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "home_price": "400000",
                        "down_payment": "80000",
                        "annual_rate_percent": "6.5",
                        "term_years": 30,
                        "years": 10,
                        "monthly_rent": "2000",
                        "rent_increase_percent": "3",
                        "home_appreciation_percent": "3",
                        "annual_ownership_cost_percent": "2",
                        "buying_costs_percent": "3",
                        "selling_costs_percent": "6",
                        "investment_return_percent": "5"
                      },
                      "formula": "buying = down payment + buying costs + mortgage payments + ownership costs − (home value × (1 − selling costs) − loan balance); renting = rent paid − (down payment + buying costs) × ((1 + return)^years − 1)",
                      "references": [
                        {
                          "title": "Consumer Financial Protection Bureau: Buying a house, tools and resources",
                          "url": "https://www.consumerfinance.gov/owning-a-home/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/rent-vs-buy@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/roi": {
      "post": {
        "operationId": "calc_finance_roi",
        "summary": "Return on investment (ROI) calculator",
        "description": "Gain, ROI percentage and annualized return (CAGR) of an investment.\n\nROI = (amount returned − amount invested) ÷ amount invested. With the holding period in years, also returns the annualized return (compound annual growth rate): (returned ÷ invested)^(1 ÷ years) − 1.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount_invested": {
                    "description": "Total amount put in. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10000"
                    ]
                  },
                  "amount_returned": {
                    "description": "Total amount received back (sale value plus income). Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "14500"
                    ]
                  },
                  "years": {
                    "description": "Holding period in years, for the annualized return. Allowed: > 0 and <= 1000. Unit: years.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "3"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "amount_invested",
                  "amount_returned"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "10,000 grows to 14,500 in 3 years",
                  "value": {
                    "amount_invested": "10000",
                    "amount_returned": "14500",
                    "years": "3"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/roi@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "gain": {
                          "description": "Amount returned minus amount invested. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "roi_percent": {
                          "description": "Return on investment in percent. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "annualized_roi_percent": {
                          "description": "Compound annual growth rate in percent. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "gain",
                        "roi_percent"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "10,000 grows to 14,500 in 3 years",
                    "value": {
                      "calculator": "finance/roi@1",
                      "result": {
                        "gain": "4500.00",
                        "roi_percent": "45.00",
                        "annualized_roi_percent": "13.19"
                      },
                      "exactness": {
                        "gain": "exact",
                        "roi_percent": "exact",
                        "annualized_roi_percent": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "amount_invested": "10000",
                        "amount_returned": "14500",
                        "years": "3"
                      },
                      "formula": "ROI = (R − I) ÷ I; annualized = (R ÷ I)^(1/years) − 1",
                      "references": [
                        {
                          "title": "Compound annual growth rate (CAGR)",
                          "url": "https://en.wikipedia.org/wiki/Compound_annual_growth_rate"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/roi@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/savings-goal": {
      "post": {
        "operationId": "calc_finance_savings_goal",
        "summary": "Savings goal calculator",
        "description": "How much to save each month (or week, or year) to reach a goal, or how long it takes with a given contribution.\n\nSolves the future-value-of-annuity equation either for the regular contribution or for the number of contributions. Interest compounds once per contribution period. The final balance is recomputed exactly with the rounded contribution, so you can see whether it lands on, above or below the goal.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "goal_amount": {
                    "description": "The amount you want to reach. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "20000"
                    ]
                  },
                  "current_savings": {
                    "description": "Amount already saved. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0"
                  },
                  "annual_rate_percent": {
                    "description": "Expected annual interest or return in percent. Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "4"
                    ]
                  },
                  "solve_for": {
                    "description": "What to calculate. Options: contribution: the contribution needed to reach the goal in a given time; time: how many contributions are needed with a given contribution",
                    "type": "string",
                    "enum": [
                      "contribution",
                      "time"
                    ],
                    "default": "contribution"
                  },
                  "years": {
                    "description": "Time to reach the goal, in years (solve_for = contribution). Allowed: > 0 and <= 100. Unit: years.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "3"
                    ]
                  },
                  "contribution": {
                    "description": "Contribution per period (solve_for = time). Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "contribution_frequency": {
                    "description": "How often you contribute. Options: monthly: 12 contributions a year; semimonthly: 24 contributions a year; biweekly: 26 contributions a year; weekly: 52 contributions a year; quarterly: 4 contributions a year; annually: 1 contribution a year",
                    "type": "string",
                    "enum": [
                      "monthly",
                      "semimonthly",
                      "biweekly",
                      "weekly",
                      "quarterly",
                      "annually"
                    ],
                    "default": "monthly"
                  },
                  "contribution_timing": {
                    "description": "When in each period you contribute. Options: end: at the end of each period (ordinary annuity); beginning: at the start of each period (annuity due)",
                    "type": "string",
                    "enum": [
                      "end",
                      "beginning"
                    ],
                    "default": "end"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "goal_amount",
                  "annual_rate_percent"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "20,000 in 3 years at 4%, monthly",
                  "value": {
                    "goal_amount": "20000",
                    "annual_rate_percent": "4",
                    "years": "3"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/savings-goal@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "contribution": {
                          "description": "Contribution per period. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "number_of_contributions": {
                          "description": "Number of contributions.",
                          "type": "integer"
                        },
                        "years": {
                          "description": "Number of contributions ÷ contributions per year.",
                          "type": "string"
                        },
                        "total_contributions": {
                          "description": "Contribution × number of contributions. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "interest_earned": {
                          "description": "Final balance minus savings and contributions. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "final_balance": {
                          "description": "Balance after the last contribution. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "contribution",
                        "number_of_contributions",
                        "years",
                        "total_contributions",
                        "interest_earned",
                        "final_balance"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "20,000 in 3 years at 4%, monthly",
                    "value": {
                      "calculator": "finance/savings-goal@1",
                      "result": {
                        "contribution": "523.81",
                        "number_of_contributions": 36,
                        "years": "3",
                        "total_contributions": "18857.16",
                        "interest_earned": "1142.72",
                        "final_balance": "19999.88"
                      },
                      "exactness": {
                        "contribution": "exact",
                        "total_contributions": "exact",
                        "interest_earned": "rounded",
                        "final_balance": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "goal_amount": "20000",
                        "current_savings": "0",
                        "annual_rate_percent": "4",
                        "solve_for": "contribution",
                        "years": "3",
                        "contribution_frequency": "monthly",
                        "contribution_timing": "end"
                      },
                      "formula": "FV = PV·(1+i)^n + PMT·((1+i)^n − 1)/i  [× (1+i) when paid at the start], i = annual rate ÷ periods per year",
                      "references": [
                        {
                          "title": "Future value of an annuity (ordinary annuity and annuity due)",
                          "url": "https://en.wikipedia.org/wiki/Annuity#Valuation"
                        }
                      ],
                      "warnings": [
                        {
                          "code": "ROUNDED_SHORT",
                          "message": "With the contribution rounded to 523.81, the final balance is 0.12 short of the goal; use options.rounding = 'ceiling' to stay at or above it."
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/savings-goal@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/simple-interest": {
      "post": {
        "operationId": "calc_finance_simple_interest",
        "summary": "Simple interest calculator",
        "description": "Simple interest for a number of years or between two dates, with standard day-count conventions (Actual/365, Actual/360, Actual/Actual, 30/360, 30E/360).\n\nInterest that is not compounded: I = P × r × t. Give the time either as a number of years or as a start and end date. With dates, the year fraction t follows a day-count convention from the ISDA 2006 Definitions; the exact fraction used is returned so you can check it.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "principal": {
                    "description": "Amount the interest is charged on. Allowed: >= 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10000"
                    ]
                  },
                  "annual_rate_percent": {
                    "description": "Annual interest rate in percent. Allowed: >= 0 and <= 1000. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "5"
                    ]
                  },
                  "years": {
                    "description": "Time in years (for example 0.5). Use this or the two dates. Allowed: >= 0 and <= 1000. Unit: years.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "2"
                    ]
                  },
                  "start_date": {
                    "description": "First day of the interest period (YYYY-MM-DD).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-01-15"
                    ]
                  },
                  "end_date": {
                    "description": "Day the interest period ends (YYYY-MM-DD); interest accrues up to but not including this day.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-07-15"
                    ]
                  },
                  "day_count": {
                    "description": "Day-count convention used with dates. Options: actual/365: Actual/365 Fixed: actual days ÷ 365.; actual/360: Actual/360: actual days ÷ 360.; actual/actual: Actual/Actual (ISDA): days in each calendar year ÷ that year's length (365 or 366), summed.; 30/360: 30/360 Bond Basis: months of 30 days, years of 360; D1=31→30, and D2=31→30 when D1 is 30 or 31.; 30e/360: 30E/360 Eurobond Basis: months of 30 days, years of 360; any 31st becomes the 30th.",
                    "type": "string",
                    "enum": [
                      "actual/365",
                      "actual/360",
                      "actual/actual",
                      "30/360",
                      "30e/360"
                    ],
                    "default": "actual/365"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "principal",
                  "annual_rate_percent"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "10,000 at 5% for 2 years",
                  "value": {
                    "principal": "10000",
                    "annual_rate_percent": "5",
                    "years": "2"
                  }
                },
                "example2": {
                  "summary": "1,000,000 at 4% Actual/360 for a quarter",
                  "value": {
                    "principal": "1000000",
                    "annual_rate_percent": "4",
                    "start_date": "2026-01-01",
                    "end_date": "2026-04-01",
                    "day_count": "actual/360"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/simple-interest@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "interest": {
                          "description": "Interest for the period. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_amount": {
                          "description": "Principal plus interest. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "days": {
                          "description": "Days counted under the convention (dates only).",
                          "type": "integer"
                        },
                        "year_fraction": {
                          "description": "The exact year fraction t used, as a decimal or a fraction such as 181/365.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "interest",
                        "total_amount",
                        "year_fraction"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "10,000 at 5% for 2 years",
                    "value": {
                      "calculator": "finance/simple-interest@1",
                      "result": {
                        "interest": "1000.00",
                        "total_amount": "11000.00",
                        "year_fraction": "2"
                      },
                      "exactness": {
                        "interest": "exact",
                        "total_amount": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "principal": "10000",
                        "annual_rate_percent": "5",
                        "years": "2",
                        "day_count": "actual/365"
                      },
                      "formula": "I = P × r × t; total = P + I",
                      "references": [
                        {
                          "title": "2006 ISDA Definitions, Section 4.16: Day Count Fraction (ISDA blackline)",
                          "url": "https://www.isda.org/a/smMDE/Blackline-2000-v-2006-ISDA-Definitions.pdf"
                        },
                        {
                          "title": "OpenGamma Strata day count documentation (worked 30/360 examples)",
                          "url": "https://strata.opengamma.io/apidocs/com/opengamma/strata/basics/date/DayCounts.html"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "1,000,000 at 4% Actual/360 for a quarter",
                    "value": {
                      "calculator": "finance/simple-interest@1",
                      "result": {
                        "interest": "10000.00",
                        "total_amount": "1010000.00",
                        "days": 90,
                        "year_fraction": "0.25"
                      },
                      "exactness": {
                        "interest": "exact",
                        "total_amount": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "principal": "1000000",
                        "annual_rate_percent": "4",
                        "start_date": "2026-01-01",
                        "end_date": "2026-04-01",
                        "day_count": "actual/360"
                      },
                      "formula": "I = P × r × t; total = P + I",
                      "references": [
                        {
                          "title": "2006 ISDA Definitions, Section 4.16: Day Count Fraction (ISDA blackline)",
                          "url": "https://www.isda.org/a/smMDE/Blackline-2000-v-2006-ISDA-Definitions.pdf"
                        },
                        {
                          "title": "OpenGamma Strata day count documentation (worked 30/360 examples)",
                          "url": "https://strata.opengamma.io/apidocs/com/opengamma/strata/basics/date/DayCounts.html"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/simple-interest@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/usda-guarantee-fee": {
      "post": {
        "operationId": "calc_finance_usda_guarantee_fee",
        "summary": "USDA loan guarantee fee calculator",
        "description": "The upfront guarantee fee and the annual fee on a USDA guaranteed home loan, at the rates USDA Rural Development set for fiscal year 2027.\n\nA USDA Single Family Housing Guaranteed loan has an upfront guarantee fee of 1.00% and an annual fee of 0.35%, for purchases and refinances in fiscal year 2027 (1 October 2026 to 30 September 2027). The upfront fee can be added to the loan; it is then 1% of the loan including the fee. The annual fee is paid monthly.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "loan_amount": {
                    "description": "The loan before the upfront fee is added. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "200000"
                    ]
                  },
                  "finance_upfront_fee": {
                    "description": "Whether the upfront fee is added to the loan instead of paid in cash.",
                    "type": "boolean",
                    "default": true
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "loan_amount"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A loan of 200,000 with the fee financed",
                  "value": {
                    "loan_amount": "200000",
                    "finance_upfront_fee": true
                  }
                },
                "example2": {
                  "summary": "The same loan with the fee paid in cash",
                  "value": {
                    "loan_amount": "200000",
                    "finance_upfront_fee": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/usda-guarantee-fee@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "upfront_fee": {
                          "description": "The upfront guarantee fee. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "loan_amount_with_fee": {
                          "description": "The loan after the fee is added, or the loan as given when it is paid in cash. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "annual_fee_percent": {
                          "description": "The annual fee rate. Unit: percent.",
                          "type": "string"
                        },
                        "monthly_annual_fee_at_start": {
                          "description": "One twelfth of the annual fee on the starting loan. The fee is worked out again each year on the scheduled balance, so it falls as the loan is repaid. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "upfront_fee",
                        "loan_amount_with_fee",
                        "annual_fee_percent",
                        "monthly_annual_fee_at_start"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A loan of 200,000 with the fee financed",
                    "value": {
                      "calculator": "finance/usda-guarantee-fee@1",
                      "result": {
                        "upfront_fee": "2020.20",
                        "loan_amount_with_fee": "202020.20",
                        "annual_fee_percent": "0.35",
                        "monthly_annual_fee_at_start": "58.92"
                      },
                      "exactness": {
                        "upfront_fee": "exact",
                        "loan_amount_with_fee": "exact",
                        "monthly_annual_fee_at_start": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "loan_amount": "200000",
                        "finance_upfront_fee": true
                      },
                      "formula": "financed: loan with fee = loan ÷ 0.99, fee = the difference; paid in cash: fee = 1% × loan; monthly at start = loan × 0.35% ÷ 12",
                      "references": [
                        {
                          "title": "USDA Rural Development: Single Family Housing Guaranteed Loan Program fees for fiscal year 2027 (upfront 1.00%, annual 0.35%)",
                          "url": "https://content.govdelivery.com/accounts/USDARD/bulletins/42b1054"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "The same loan with the fee paid in cash",
                    "value": {
                      "calculator": "finance/usda-guarantee-fee@1",
                      "result": {
                        "upfront_fee": "2000.00",
                        "loan_amount_with_fee": "200000.00",
                        "annual_fee_percent": "0.35",
                        "monthly_annual_fee_at_start": "58.33"
                      },
                      "exactness": {
                        "upfront_fee": "exact",
                        "loan_amount_with_fee": "exact",
                        "monthly_annual_fee_at_start": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "loan_amount": "200000",
                        "finance_upfront_fee": false
                      },
                      "formula": "financed: loan with fee = loan ÷ 0.99, fee = the difference; paid in cash: fee = 1% × loan; monthly at start = loan × 0.35% ÷ 12",
                      "references": [
                        {
                          "title": "USDA Rural Development: Single Family Housing Guaranteed Loan Program fees for fiscal year 2027 (upfront 1.00%, annual 0.35%)",
                          "url": "https://content.govdelivery.com/accounts/USDARD/bulletins/42b1054"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/usda-guarantee-fee@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/va-funding-fee": {
      "post": {
        "operationId": "calc_finance_va_funding_fee",
        "summary": "VA funding fee calculator",
        "description": "The VA funding fee on a home loan, from the Department of Veterans Affairs' current rate chart, by loan type, down payment and first or later use.\n\nMost VA home loans carry a one-time funding fee, a percentage of the loan amount that depends on the kind of loan, on the down payment for a purchase, and on whether the borrower has used a VA loan before. This calculator applies the rate chart the VA publishes for loans closed on or after 7 April 2023 and shows the loan amount if the fee is financed.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "loan_amount": {
                    "description": "The loan amount, without the fee. The fee is a percentage of the loan, not of the purchase price. Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "190000"
                    ]
                  },
                  "loan_type": {
                    "description": "The kind of loan. Options: purchase: VA-backed purchase or construction loan; cash_out_refinance: VA-backed cash-out refinance; irrrl: interest rate reduction refinance loan (IRRRL); nadl_purchase: Native American Direct Loan, purchase; nadl_refinance: Native American Direct Loan, refinance; manufactured_home: manufactured home loan (not permanently affixed); assumption: loan assumption; vendee: vendee loan (buying a VA-acquired property)",
                    "type": "string",
                    "enum": [
                      "purchase",
                      "cash_out_refinance",
                      "irrrl",
                      "nadl_purchase",
                      "nadl_refinance",
                      "manufactured_home",
                      "assumption",
                      "vendee"
                    ],
                    "default": "purchase"
                  },
                  "down_payment_percent": {
                    "description": "Down payment as a percentage of the purchase price (purchase and construction loans only). Allowed: >= 0 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "0",
                    "examples": [
                      "5"
                    ]
                  },
                  "first_use": {
                    "description": "true for the first use of the VA home loan benefit, false after that.",
                    "type": "boolean",
                    "default": true
                  },
                  "exempt": {
                    "description": "true when no fee is due, for example for a veteran who receives VA compensation for a service-connected disability.",
                    "type": "boolean",
                    "default": false
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "loan_amount"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "The VA's example: a first-time buyer, 200,000 home, 10,000 down",
                  "value": {
                    "loan_amount": "190000",
                    "down_payment_percent": "5",
                    "first_use": true
                  }
                },
                "example2": {
                  "summary": "A later-use cash-out refinance of 250,000",
                  "value": {
                    "loan_amount": "250000",
                    "loan_type": "cash_out_refinance",
                    "first_use": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/va-funding-fee@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "funding_fee_percent": {
                          "description": "The fee rate. Unit: percent.",
                          "type": "string"
                        },
                        "funding_fee": {
                          "description": "The fee. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "loan_amount_with_fee": {
                          "description": "The loan when the fee is added to it. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "funding_fee_percent",
                        "funding_fee",
                        "loan_amount_with_fee"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "The VA's example: a first-time buyer, 200,000 home, 10,000 down",
                    "value": {
                      "calculator": "finance/va-funding-fee@1",
                      "result": {
                        "funding_fee_percent": "1.5",
                        "funding_fee": "2850.00",
                        "loan_amount_with_fee": "192850.00"
                      },
                      "exactness": {
                        "funding_fee": "exact",
                        "loan_amount_with_fee": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "loan_amount": "190000",
                        "loan_type": "purchase",
                        "down_payment_percent": "5",
                        "first_use": true,
                        "exempt": false
                      },
                      "formula": "fee = loan amount × rate from the VA chart",
                      "references": [
                        {
                          "title": "US Department of Veterans Affairs: VA funding fee and loan closing costs (rate charts effective 7 April 2023)",
                          "url": "https://www.va.gov/housing-assistance/home-loans/funding-fee-and-closing-costs/"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "A later-use cash-out refinance of 250,000",
                    "value": {
                      "calculator": "finance/va-funding-fee@1",
                      "result": {
                        "funding_fee_percent": "3.3",
                        "funding_fee": "8250.00",
                        "loan_amount_with_fee": "258250.00"
                      },
                      "exactness": {
                        "funding_fee": "exact",
                        "loan_amount_with_fee": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "loan_amount": "250000",
                        "loan_type": "cash_out_refinance",
                        "down_payment_percent": "0",
                        "first_use": false,
                        "exempt": false
                      },
                      "formula": "fee = loan amount × rate from the VA chart",
                      "references": [
                        {
                          "title": "US Department of Veterans Affairs: VA funding fee and loan closing costs (rate charts effective 7 April 2023)",
                          "url": "https://www.va.gov/housing-assistance/home-loans/funding-fee-and-closing-costs/"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/va-funding-fee@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/finance/yield-to-call": {
      "post": {
        "operationId": "calc_finance_yield_to_call",
        "summary": "Yield to call calculator",
        "description": "The yield of a callable bond if the issuer redeems it on the call date at the call price, found as a proven root of the price equation.\n\nA callable bond can be repaid early at a set price. Yield to call is the yield the buyer earns if that happens: the rate at which the coupons up to the call date and the call price are worth today's price. It is the same equation as yield to maturity (Excel's YIELD) with the call date in place of maturity and the call price in place of the redemption value. Compare it with the yield to maturity; the lower of the two is the yield to worst.",
        "tags": [
          "Finance"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settlement": {
                    "description": "Settlement date (when the buyer gets the bond).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-03-15"
                    ]
                  },
                  "call_date": {
                    "description": "The date the bond can be called.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2031-03-15"
                    ]
                  },
                  "coupon_rate_percent": {
                    "description": "Annual coupon rate in percent of face value. Allowed: >= 0 and <= 1000. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "5"
                    ]
                  },
                  "price": {
                    "description": "Clean price paid per 100 of face value. Allowed: > 0 and <= 1000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "104"
                    ]
                  },
                  "call_price": {
                    "description": "Amount paid per 100 of face value if the bond is called. Allowed: > 0 and <= 1000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "102"
                    ]
                  },
                  "frequency": {
                    "description": "Coupons per year: 1, 2 or 4. Allowed: >= 1 and <= 4.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4,
                    "default": 2
                  },
                  "day_count": {
                    "description": "How days are counted for accrued interest. Options: 30/360: US (NASD) 30/360; actual/actual: actual days over the actual length of the coupon period; actual/360: actual days over a 360-day year; actual/365: actual days over a 365-day year; 30e/360: European 30/360",
                    "type": "string",
                    "enum": [
                      "30/360",
                      "actual/actual",
                      "actual/360",
                      "actual/365",
                      "30e/360"
                    ],
                    "default": "30/360"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=6)."
                  }
                },
                "required": [
                  "settlement",
                  "call_date",
                  "coupon_rate_percent",
                  "price",
                  "call_price"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A 5% bond bought at 104, callable in five years at 102",
                  "value": {
                    "settlement": "2026-03-15",
                    "call_date": "2031-03-15",
                    "coupon_rate_percent": "5",
                    "price": "104",
                    "call_price": "102"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "finance/yield-to-call@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "yield_to_call_percent": {
                          "description": "Annual yield to the call date. Unit: percent.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "coupons_until_call": {
                          "description": "Coupons from settlement to the call date.",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "yield_to_call_percent",
                        "coupons_until_call"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A 5% bond bought at 104, callable in five years at 102",
                    "value": {
                      "calculator": "finance/yield-to-call@1",
                      "result": {
                        "yield_to_call_percent": "4.460115",
                        "coupons_until_call": 10
                      },
                      "exactness": {
                        "yield_to_call_percent": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 6
                      },
                      "inputs": {
                        "settlement": "2026-03-15",
                        "call_date": "2031-03-15",
                        "coupon_rate_percent": "5",
                        "price": "104",
                        "call_price": "102",
                        "frequency": 2,
                        "day_count": "30/360"
                      },
                      "formula": "the y with PRICE(settlement, call date, coupon, y, call price, frequency, basis) = price",
                      "references": [
                        {
                          "title": "FINRA: Bond yield and return (yield to maturity and yield to call)",
                          "url": "https://www.finra.org/investors/insights/bond-yield-return"
                        },
                        {
                          "title": "Microsoft Excel YIELD function",
                          "url": "https://support.microsoft.com/en-us/excel/functions/yield-function"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "finance/yield-to-call@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/health/bmi": {
      "post": {
        "operationId": "calc_health_bmi",
        "summary": "BMI calculator",
        "description": "Body mass index for adults from weight and height in metric or imperial units, with the WHO/CDC weight category and the healthy weight range for that height.\n\nComputes BMI = weight (kg) ÷ height (m)² from exact unit definitions, so imperial inputs need no 703 approximation. The category is decided on the exact BMI, so a BMI of 24.96 is 'Healthy weight' even though it displays as 25.0; the response warns when rounding crosses a band boundary like that.",
        "tags": [
          "Health"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "weight": {
                    "description": "Body weight in weight_unit. Allowed: > 0 and <= 2000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "70"
                    ]
                  },
                  "weight_unit": {
                    "description": "Unit of weight. Options: kg: kilograms; lb: pounds (0.45359237 kg); st: stone (14 lb)",
                    "type": "string",
                    "enum": [
                      "kg",
                      "lb",
                      "st"
                    ],
                    "default": "kg"
                  },
                  "height": {
                    "description": "Height in height_unit. Allowed: > 0 and <= 300.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "175"
                    ]
                  },
                  "height_unit": {
                    "description": "Unit of height. Options: cm: centimetres; m: metres; in: inches (2.54 cm); ft: feet (12 in); add the rest with height_inches",
                    "type": "string",
                    "enum": [
                      "cm",
                      "m",
                      "in",
                      "ft"
                    ],
                    "default": "cm"
                  },
                  "height_inches": {
                    "description": "Extra inches when height_unit is ft (5 ft 10 in is height 5, height_inches 10). Allowed: >= 0 and < 12.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=1)."
                  }
                },
                "required": [
                  "weight",
                  "height"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Metric",
                  "value": {
                    "weight": "70",
                    "height": "175"
                  }
                },
                "example2": {
                  "summary": "Imperial, 5 ft 10 in and 180 lb",
                  "value": {
                    "weight": "180",
                    "weight_unit": "lb",
                    "height": "5",
                    "height_unit": "ft",
                    "height_inches": "10"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "health/bmi@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "bmi": {
                          "description": "Body mass index in kg/m². Unit: kg/m².",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "category": {
                          "description": "Weight category code: underweight, healthy_weight, overweight, obesity_class_1, obesity_class_2 or obesity_class_3.",
                          "type": "string"
                        },
                        "category_label": {
                          "description": "Weight category in words.",
                          "type": "string"
                        },
                        "healthy_weight_min": {
                          "description": "Lowest weight in the healthy band (BMI 18.5) for this height, in weight_unit.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "healthy_weight_max": {
                          "description": "Weight at BMI 25 for this height, in weight_unit (the healthy band ends just below it).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "weight_kg": {
                          "description": "Weight in kilograms, exact (not rounded).",
                          "type": "string"
                        },
                        "height_m": {
                          "description": "Height in metres, exact (not rounded).",
                          "type": "string"
                        }
                      },
                      "required": [
                        "bmi",
                        "category",
                        "category_label",
                        "healthy_weight_min",
                        "healthy_weight_max",
                        "weight_kg",
                        "height_m"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Metric",
                    "value": {
                      "calculator": "health/bmi@1",
                      "result": {
                        "bmi": "22.9",
                        "category": "healthy_weight",
                        "category_label": "Healthy weight",
                        "healthy_weight_min": "56.7",
                        "healthy_weight_max": "76.6",
                        "weight_kg": "70",
                        "height_m": "1.75"
                      },
                      "exactness": {
                        "bmi": "rounded",
                        "healthy_weight_min": "rounded",
                        "healthy_weight_max": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 1
                      },
                      "inputs": {
                        "weight": "70",
                        "weight_unit": "kg",
                        "height": "175",
                        "height_unit": "cm"
                      },
                      "formula": "BMI = kg / m²; 1 lb = 0.45359237 kg, 1 in = 0.0254 m exactly",
                      "references": [
                        {
                          "title": "CDC: Adult BMI categories",
                          "url": "https://www.cdc.gov/bmi/adult-calculator/bmi-categories.html"
                        },
                        {
                          "title": "WHO: Body mass index (BMI) among adults",
                          "url": "https://www.who.int/data/gho/data/themes/topics/topic-details/GHO/body-mass-index"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Imperial, 5 ft 10 in and 180 lb",
                    "value": {
                      "calculator": "health/bmi@1",
                      "result": {
                        "bmi": "25.8",
                        "category": "overweight",
                        "category_label": "Overweight (pre-obesity)",
                        "healthy_weight_min": "128.9",
                        "healthy_weight_max": "174.2",
                        "weight_kg": "81.6466266",
                        "height_m": "1.778"
                      },
                      "exactness": {
                        "bmi": "rounded",
                        "healthy_weight_min": "rounded",
                        "healthy_weight_max": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 1
                      },
                      "inputs": {
                        "weight": "180",
                        "weight_unit": "lb",
                        "height": "5",
                        "height_unit": "ft",
                        "height_inches": "10"
                      },
                      "formula": "BMI = kg / m²; 1 lb = 0.45359237 kg, 1 in = 0.0254 m exactly",
                      "references": [
                        {
                          "title": "CDC: Adult BMI categories",
                          "url": "https://www.cdc.gov/bmi/adult-calculator/bmi-categories.html"
                        },
                        {
                          "title": "WHO: Body mass index (BMI) among adults",
                          "url": "https://www.who.int/data/gho/data/themes/topics/topic-details/GHO/body-mass-index"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "health/bmi@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/math/expression": {
      "post": {
        "operationId": "calc_math_expression",
        "summary": "Expression calculator",
        "description": "Evaluate an arithmetic expression exactly, with functions like sqrt, ln, sin and factorial.\n\nEvaluates expressions such as (1/3 + 1/6) * 2^10 or sqrt(2) * sin(45) with no floating-point error: rational arithmetic is exact, and irrational results (roots, logarithms, trig) are computed with certified interval arithmetic and rounded correctly. The interpretation output shows how the expression was read, with every implied parenthesis written out.",
        "tags": [
          "Math"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expression": {
                    "description": "The expression. Operators: + - * / ^ (or **) and ! (factorial); constants pi and e; functions: abs, acos, asin, atan, cbrt, ceil, cos, cosh, exp, factorial, floor, ln, log, log10, log2, max, min, mod, root, sin, sinh, sqrt, tan, tanh. At most 1000 characters.",
                    "type": "string",
                    "maxLength": 1000,
                    "examples": [
                      "(1/3 + 1/6) * 2^10"
                    ]
                  },
                  "angle_unit": {
                    "description": "Unit for trig function inputs and inverse-trig outputs. Options: radians: radians; degrees: degrees",
                    "type": "string",
                    "enum": [
                      "radians",
                      "degrees"
                    ],
                    "default": "radians"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=20)."
                  }
                },
                "required": [
                  "expression"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "No floating-point error",
                  "value": {
                    "expression": "0.1 + 0.2"
                  }
                },
                "example2": {
                  "summary": "Exact fractions",
                  "value": {
                    "expression": "(1/3 + 1/6) * 2^10"
                  }
                },
                "example3": {
                  "summary": "Unary minus and powers",
                  "value": {
                    "expression": "-2^2"
                  }
                },
                "example4": {
                  "summary": "Trig in degrees",
                  "value": {
                    "expression": "sin(30)",
                    "angle_unit": "degrees"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "math/expression@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "description": "The value of the expression.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "interpretation": {
                          "description": "The expression as parsed, with explicit parentheses.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "result",
                        "interpretation"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "No floating-point error",
                    "value": {
                      "calculator": "math/expression@1",
                      "result": {
                        "result": "0.3",
                        "interpretation": "0.1 + 0.2"
                      },
                      "exactness": {
                        "result": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 20
                      },
                      "inputs": {
                        "expression": "0.1 + 0.2",
                        "angle_unit": "radians"
                      },
                      "formula": "Standard operator precedence: ^ (right-associative) > unary minus > * / > + -",
                      "references": [
                        {
                          "title": "Order of operations",
                          "url": "https://en.wikipedia.org/wiki/Order_of_operations"
                        },
                        {
                          "title": "A. Ziv, Fast evaluation of elementary mathematical functions with correctly rounded last bit, ACM TOMS 17(3), 1991 (rounding with growing precision)",
                          "url": "https://dblp.org/pid/53/3586"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Exact fractions",
                    "value": {
                      "calculator": "math/expression@1",
                      "result": {
                        "result": "512",
                        "interpretation": "((1 / 3) + (1 / 6)) * (2 ^ 10)"
                      },
                      "exactness": {
                        "result": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 20
                      },
                      "inputs": {
                        "expression": "(1/3 + 1/6) * 2^10",
                        "angle_unit": "radians"
                      },
                      "formula": "Standard operator precedence: ^ (right-associative) > unary minus > * / > + -",
                      "references": [
                        {
                          "title": "Order of operations",
                          "url": "https://en.wikipedia.org/wiki/Order_of_operations"
                        },
                        {
                          "title": "A. Ziv, Fast evaluation of elementary mathematical functions with correctly rounded last bit, ACM TOMS 17(3), 1991 (rounding with growing precision)",
                          "url": "https://dblp.org/pid/53/3586"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Unary minus and powers",
                    "value": {
                      "calculator": "math/expression@1",
                      "result": {
                        "result": "-4",
                        "interpretation": "-(2 ^ 2)"
                      },
                      "exactness": {
                        "result": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 20
                      },
                      "inputs": {
                        "expression": "-2^2",
                        "angle_unit": "radians"
                      },
                      "formula": "Standard operator precedence: ^ (right-associative) > unary minus > * / > + -",
                      "references": [
                        {
                          "title": "Order of operations",
                          "url": "https://en.wikipedia.org/wiki/Order_of_operations"
                        },
                        {
                          "title": "A. Ziv, Fast evaluation of elementary mathematical functions with correctly rounded last bit, ACM TOMS 17(3), 1991 (rounding with growing precision)",
                          "url": "https://dblp.org/pid/53/3586"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example4": {
                    "summary": "Trig in degrees",
                    "value": {
                      "calculator": "math/expression@1",
                      "result": {
                        "result": "0.5",
                        "interpretation": "sin(30)"
                      },
                      "exactness": {
                        "result": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 20
                      },
                      "inputs": {
                        "expression": "sin(30)",
                        "angle_unit": "degrees"
                      },
                      "formula": "Standard operator precedence: ^ (right-associative) > unary minus > * / > + -",
                      "references": [
                        {
                          "title": "Order of operations",
                          "url": "https://en.wikipedia.org/wiki/Order_of_operations"
                        },
                        {
                          "title": "A. Ziv, Fast evaluation of elementary mathematical functions with correctly rounded last bit, ACM TOMS 17(3), 1991 (rounding with growing precision)",
                          "url": "https://dblp.org/pid/53/3586"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "math/expression@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/math/fraction": {
      "post": {
        "operationId": "calc_math_fraction",
        "summary": "Fraction calculator",
        "description": "Add, subtract, multiply, divide and simplify fractions and mixed numbers, with the exact repeating decimal.\n\nWorks with exact fractions such as 3/4, mixed numbers such as 1 1/2, and decimals. Results are always in lowest terms and include the mixed number, a rounded decimal and the exact decimal expansion with its repeating block in parentheses (1/6 = 0.1(6)).",
        "tags": [
          "Math"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "operation": {
                    "description": "What to do. Options: simplify: reduce a to lowest terms; add: a + b; subtract: a − b; multiply: a × b; divide: a ÷ b",
                    "type": "string",
                    "enum": [
                      "simplify",
                      "add",
                      "subtract",
                      "multiply",
                      "divide"
                    ],
                    "examples": [
                      "add"
                    ]
                  },
                  "a": {
                    "description": "First fraction, e.g. '3/4', '-1 1/2' or '0.75'. At most 200 characters.",
                    "type": "string",
                    "maxLength": 200,
                    "examples": [
                      "1/3"
                    ]
                  },
                  "b": {
                    "description": "Second fraction (not used by simplify). At most 200 characters.",
                    "type": "string",
                    "maxLength": 200,
                    "examples": [
                      "1/6"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=20)."
                  }
                },
                "required": [
                  "operation",
                  "a"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "1/3 + 1/6",
                  "value": {
                    "operation": "add",
                    "a": "1/3",
                    "b": "1/6"
                  }
                },
                "example2": {
                  "summary": "Mixed numbers",
                  "value": {
                    "operation": "multiply",
                    "a": "1 1/2",
                    "b": "2/3"
                  }
                },
                "example3": {
                  "summary": "Repeating decimal",
                  "value": {
                    "operation": "simplify",
                    "a": "22/7"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "math/fraction@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "fraction": {
                          "description": "Result in lowest terms, e.g. '1/2' or '3'.",
                          "type": "string"
                        },
                        "numerator": {
                          "description": "Numerator in lowest terms (a string, since it can exceed JavaScript's safe integer range).",
                          "type": "string"
                        },
                        "denominator": {
                          "description": "Denominator in lowest terms (always positive).",
                          "type": "string"
                        },
                        "mixed_number": {
                          "description": "Result as a mixed number, e.g. '1 1/2'.",
                          "type": "string"
                        },
                        "decimal": {
                          "description": "Result as a rounded decimal.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "repeating_decimal": {
                          "description": "Exact decimal with the repeating block in parentheses.",
                          "type": "string"
                        },
                        "is_terminating": {
                          "description": "True when the decimal expansion ends.",
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "fraction",
                        "numerator",
                        "denominator",
                        "mixed_number",
                        "decimal",
                        "repeating_decimal",
                        "is_terminating"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "1/3 + 1/6",
                    "value": {
                      "calculator": "math/fraction@1",
                      "result": {
                        "fraction": "1/2",
                        "numerator": "1",
                        "denominator": "2",
                        "mixed_number": "1/2",
                        "decimal": "0.5",
                        "repeating_decimal": "0.5",
                        "is_terminating": true
                      },
                      "exactness": {
                        "decimal": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 20
                      },
                      "inputs": {
                        "operation": "add",
                        "a": "1/3",
                        "b": "1/6"
                      },
                      "formula": "a/b + c/d = (ad + bc)/bd, then reduced by the greatest common divisor",
                      "references": [
                        {
                          "title": "Fraction (mathematics)",
                          "url": "https://en.wikipedia.org/wiki/Fraction"
                        },
                        {
                          "title": "Repeating decimal",
                          "url": "https://en.wikipedia.org/wiki/Repeating_decimal"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Mixed numbers",
                    "value": {
                      "calculator": "math/fraction@1",
                      "result": {
                        "fraction": "1",
                        "numerator": "1",
                        "denominator": "1",
                        "mixed_number": "1",
                        "decimal": "1",
                        "repeating_decimal": "1",
                        "is_terminating": true
                      },
                      "exactness": {
                        "decimal": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 20
                      },
                      "inputs": {
                        "operation": "multiply",
                        "a": "1 1/2",
                        "b": "2/3"
                      },
                      "formula": "a/b + c/d = (ad + bc)/bd, then reduced by the greatest common divisor",
                      "references": [
                        {
                          "title": "Fraction (mathematics)",
                          "url": "https://en.wikipedia.org/wiki/Fraction"
                        },
                        {
                          "title": "Repeating decimal",
                          "url": "https://en.wikipedia.org/wiki/Repeating_decimal"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Repeating decimal",
                    "value": {
                      "calculator": "math/fraction@1",
                      "result": {
                        "fraction": "22/7",
                        "numerator": "22",
                        "denominator": "7",
                        "mixed_number": "3 1/7",
                        "decimal": "3.1428571428571428571",
                        "repeating_decimal": "3.(142857)",
                        "is_terminating": false
                      },
                      "exactness": {
                        "decimal": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 20
                      },
                      "inputs": {
                        "operation": "simplify",
                        "a": "22/7"
                      },
                      "formula": "a/b + c/d = (ad + bc)/bd, then reduced by the greatest common divisor",
                      "references": [
                        {
                          "title": "Fraction (mathematics)",
                          "url": "https://en.wikipedia.org/wiki/Fraction"
                        },
                        {
                          "title": "Repeating decimal",
                          "url": "https://en.wikipedia.org/wiki/Repeating_decimal"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "math/fraction@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/math/percentage": {
      "post": {
        "operationId": "calc_math_percentage",
        "summary": "Percentage calculator",
        "description": "Percent of a number, what percent one number is of another, percent change, percent difference, and increase or decrease by a percent.\n\nSix everyday percentage questions in one calculator, each with its formula returned so the meaning of a and b is never in doubt. All arithmetic is exact.",
        "tags": [
          "Math"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "operation": {
                    "description": "Which percentage question to answer. Options: percent_of: a% of b; what_percent: a is what percent of b; change: percent change from a to b; difference: percent difference between a and b; increase: b increased by a%; decrease: b decreased by a%",
                    "type": "string",
                    "enum": [
                      "percent_of",
                      "what_percent",
                      "change",
                      "difference",
                      "increase",
                      "decrease"
                    ],
                    "examples": [
                      "percent_of"
                    ]
                  },
                  "a": {
                    "description": "First number (see operation for its meaning).",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "15"
                    ]
                  },
                  "b": {
                    "description": "Second number (see operation for its meaning).",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "80"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "operation",
                  "a",
                  "b"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "15% of 80",
                  "value": {
                    "operation": "percent_of",
                    "a": "15",
                    "b": "80"
                  }
                },
                "example2": {
                  "summary": "Change from 80 to 100",
                  "value": {
                    "operation": "change",
                    "a": "80",
                    "b": "100"
                  }
                },
                "example3": {
                  "summary": "1 is what percent of 3",
                  "value": {
                    "operation": "what_percent",
                    "a": "1",
                    "b": "3"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "math/percentage@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "description": "The answer (a percentage for what_percent, change and difference).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "formula_used": {
                          "description": "The formula applied.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "result",
                        "formula_used"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "15% of 80",
                    "value": {
                      "calculator": "math/percentage@1",
                      "result": {
                        "result": "12",
                        "formula_used": "a / 100 × b"
                      },
                      "exactness": {
                        "result": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "operation": "percent_of",
                        "a": "15",
                        "b": "80"
                      },
                      "formula": "see formula_used",
                      "references": [
                        {
                          "title": "Percentage",
                          "url": "https://en.wikipedia.org/wiki/Percentage"
                        },
                        {
                          "title": "Relative change and percent difference",
                          "url": "https://en.wikipedia.org/wiki/Relative_change"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Change from 80 to 100",
                    "value": {
                      "calculator": "math/percentage@1",
                      "result": {
                        "result": "25",
                        "formula_used": "(b − a) / |a| × 100"
                      },
                      "exactness": {
                        "result": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "operation": "change",
                        "a": "80",
                        "b": "100"
                      },
                      "formula": "see formula_used",
                      "references": [
                        {
                          "title": "Percentage",
                          "url": "https://en.wikipedia.org/wiki/Percentage"
                        },
                        {
                          "title": "Relative change and percent difference",
                          "url": "https://en.wikipedia.org/wiki/Relative_change"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "1 is what percent of 3",
                    "value": {
                      "calculator": "math/percentage@1",
                      "result": {
                        "result": "33.3333333333333",
                        "formula_used": "a / b × 100"
                      },
                      "exactness": {
                        "result": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "operation": "what_percent",
                        "a": "1",
                        "b": "3"
                      },
                      "formula": "see formula_used",
                      "references": [
                        {
                          "title": "Percentage",
                          "url": "https://en.wikipedia.org/wiki/Percentage"
                        },
                        {
                          "title": "Relative change and percent difference",
                          "url": "https://en.wikipedia.org/wiki/Relative_change"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "math/percentage@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/math/rounding": {
      "post": {
        "operationId": "calc_math_rounding",
        "summary": "Rounding calculator",
        "description": "Round a number to decimal places, significant digits or a multiple, with any of seven rounding rules.\n\nRounds exactly (no binary floating point), so 2.675 to two places with half-up gives 2.68, not the 2.67 many programs print. Choose the rule explicitly: half-up, banker's rounding (half-even), half-down, up, down (truncate), ceiling or floor.",
        "tags": [
          "Math"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "description": "The number to round.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "2.675"
                    ]
                  },
                  "method": {
                    "description": "What to round to. Options: decimals: to a number of decimal places (negative rounds to tens, hundreds, ...); significant: to a number of significant digits; multiple: to the nearest multiple of a step, e.g. 0.05 for cash rounding",
                    "type": "string",
                    "enum": [
                      "decimals",
                      "significant",
                      "multiple"
                    ],
                    "default": "decimals"
                  },
                  "places": {
                    "description": "Decimal places (method decimals) or significant digits (method significant). Allowed: >= -20 and <= 60.",
                    "type": "integer",
                    "minimum": -20,
                    "maximum": 60,
                    "examples": [
                      2
                    ]
                  },
                  "multiple": {
                    "description": "Step to round to (method multiple), e.g. 0.05. Allowed: > 0.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "mode": {
                    "description": "Rounding rule. Options: half_up: to nearest, ties away from zero (2.5 → 3, -2.5 → -3); half_even: to nearest, ties to even (2.5 → 2, 3.5 → 4): banker's rounding; half_down: to nearest, ties towards zero (2.5 → 2); up: away from zero (2.1 → 3, -2.1 → -3); down: towards zero, i.e. truncate (2.9 → 2); ceiling: towards +∞ (2.1 → 3, -2.1 → -2); floor: towards −∞ (2.9 → 2, -2.1 → -3)",
                    "type": "string",
                    "enum": [
                      "half_up",
                      "half_even",
                      "half_down",
                      "up",
                      "down",
                      "ceiling",
                      "floor"
                    ],
                    "default": "half_up"
                  }
                },
                "required": [
                  "value"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "2.675 to 2 places, half-up",
                  "value": {
                    "value": "2.675",
                    "places": 2
                  }
                },
                "example2": {
                  "summary": "Banker's rounding",
                  "value": {
                    "value": "2.5",
                    "places": 0,
                    "mode": "half_even"
                  }
                },
                "example3": {
                  "summary": "Cash rounding to 0.05",
                  "value": {
                    "value": "1.234",
                    "method": "multiple",
                    "multiple": "0.05"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "math/rounding@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "description": "The rounded number, with trailing zeros kept (2.10).",
                          "type": "string"
                        },
                        "changed": {
                          "description": "False when the value was already exact at this precision.",
                          "type": "boolean"
                        },
                        "difference": {
                          "description": "result − value, exactly.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "result",
                        "changed",
                        "difference"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "2.675 to 2 places, half-up",
                    "value": {
                      "calculator": "math/rounding@1",
                      "result": {
                        "result": "2.68",
                        "changed": true,
                        "difference": "0.005"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "value": "2.675",
                        "method": "decimals",
                        "places": 2,
                        "mode": "half_up"
                      },
                      "formula": "decimals: round(x·10ⁿ)/10ⁿ; multiple: round(x/m)·m; ties per the chosen mode",
                      "references": [
                        {
                          "title": "IEEE 754-2008 section 4.3: rounding-direction attributes",
                          "url": "https://doi.org/10.1109/IEEESTD.2008.4610935"
                        },
                        {
                          "title": "Rounding",
                          "url": "https://en.wikipedia.org/wiki/Rounding"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Banker's rounding",
                    "value": {
                      "calculator": "math/rounding@1",
                      "result": {
                        "result": "2",
                        "changed": true,
                        "difference": "-0.5"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "value": "2.5",
                        "method": "decimals",
                        "places": 0,
                        "mode": "half_even"
                      },
                      "formula": "decimals: round(x·10ⁿ)/10ⁿ; multiple: round(x/m)·m; ties per the chosen mode",
                      "references": [
                        {
                          "title": "IEEE 754-2008 section 4.3: rounding-direction attributes",
                          "url": "https://doi.org/10.1109/IEEESTD.2008.4610935"
                        },
                        {
                          "title": "Rounding",
                          "url": "https://en.wikipedia.org/wiki/Rounding"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Cash rounding to 0.05",
                    "value": {
                      "calculator": "math/rounding@1",
                      "result": {
                        "result": "1.25",
                        "changed": true,
                        "difference": "0.016"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "value": "1.234",
                        "method": "multiple",
                        "multiple": "0.05",
                        "mode": "half_up"
                      },
                      "formula": "decimals: round(x·10ⁿ)/10ⁿ; multiple: round(x/m)·m; ties per the chosen mode",
                      "references": [
                        {
                          "title": "IEEE 754-2008 section 4.3: rounding-direction attributes",
                          "url": "https://doi.org/10.1109/IEEESTD.2008.4610935"
                        },
                        {
                          "title": "Rounding",
                          "url": "https://en.wikipedia.org/wiki/Rounding"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "math/rounding@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/math/scientific": {
      "post": {
        "operationId": "calc_math_scientific",
        "summary": "Scientific calculator",
        "description": "Roots, powers, logarithms, exponentials, trig and hyperbolic functions, and factorials, correctly rounded to up to 50 significant digits.\n\nEach function is evaluated with certified interval arithmetic and rounded correctly, so every returned digit is right. Exact cases stay exact: sqrt(2.25) is 1.5, log10(1000) is 3, sin(30°) is 0.5 and the cube root of -8 is -2.",
        "tags": [
          "Math"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "function": {
                    "description": "Function to apply. Options: sqrt: √x; cbrt: ∛x (real cube root); nth_root: the real y-th root of x (y a whole number from 2 to 1000); power: x^y; reciprocal: 1/x; exp: e^x; ln: natural logarithm of x; log10: base-10 logarithm of x; log2: base-2 logarithm of x; log_base: logarithm of x to base y; sin: sine of x; cos: cosine of x; tan: tangent of x; asin: inverse sine of x; acos: inverse cosine of x; atan: inverse tangent of x; sinh: hyperbolic sine of x; cosh: hyperbolic cosine of x; tanh: hyperbolic tangent of x; factorial: x! (x a whole number from 0 to 1000)",
                    "type": "string",
                    "enum": [
                      "sqrt",
                      "cbrt",
                      "nth_root",
                      "power",
                      "reciprocal",
                      "exp",
                      "ln",
                      "log10",
                      "log2",
                      "log_base",
                      "sin",
                      "cos",
                      "tan",
                      "asin",
                      "acos",
                      "atan",
                      "sinh",
                      "cosh",
                      "tanh",
                      "factorial"
                    ],
                    "examples": [
                      "sqrt"
                    ]
                  },
                  "x": {
                    "description": "The argument.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "2"
                    ]
                  },
                  "y": {
                    "description": "Second argument for power, nth_root and log_base.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "angle_unit": {
                    "description": "Unit for trig inputs and inverse-trig outputs. Options: radians: radians; degrees: degrees",
                    "type": "string",
                    "enum": [
                      "radians",
                      "degrees"
                    ],
                    "default": "radians"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=20)."
                  }
                },
                "required": [
                  "function",
                  "x"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Square root of 2",
                  "value": {
                    "function": "sqrt",
                    "x": "2"
                  }
                },
                "example2": {
                  "summary": "Exact cube root",
                  "value": {
                    "function": "cbrt",
                    "x": "-8"
                  }
                },
                "example3": {
                  "summary": "sin(30°)",
                  "value": {
                    "function": "sin",
                    "x": "30",
                    "angle_unit": "degrees"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "math/scientific@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "description": "The function value.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "result"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Square root of 2",
                    "value": {
                      "calculator": "math/scientific@1",
                      "result": {
                        "result": "1.4142135623730950488"
                      },
                      "exactness": {
                        "result": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 20
                      },
                      "inputs": {
                        "function": "sqrt",
                        "x": "2",
                        "angle_unit": "radians"
                      },
                      "formula": "see function",
                      "references": [
                        {
                          "title": "NIST Digital Library of Mathematical Functions",
                          "url": "https://dlmf.nist.gov/"
                        },
                        {
                          "title": "mpmath interval arithmetic (iv)",
                          "url": "https://mpmath.org/doc/current/contexts.html#arbitrary-precision-interval-arithmetic-iv"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Exact cube root",
                    "value": {
                      "calculator": "math/scientific@1",
                      "result": {
                        "result": "-2"
                      },
                      "exactness": {
                        "result": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 20
                      },
                      "inputs": {
                        "function": "cbrt",
                        "x": "-8",
                        "angle_unit": "radians"
                      },
                      "formula": "see function",
                      "references": [
                        {
                          "title": "NIST Digital Library of Mathematical Functions",
                          "url": "https://dlmf.nist.gov/"
                        },
                        {
                          "title": "mpmath interval arithmetic (iv)",
                          "url": "https://mpmath.org/doc/current/contexts.html#arbitrary-precision-interval-arithmetic-iv"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "sin(30°)",
                    "value": {
                      "calculator": "math/scientific@1",
                      "result": {
                        "result": "0.5"
                      },
                      "exactness": {
                        "result": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 20
                      },
                      "inputs": {
                        "function": "sin",
                        "x": "30",
                        "angle_unit": "degrees"
                      },
                      "formula": "see function",
                      "references": [
                        {
                          "title": "NIST Digital Library of Mathematical Functions",
                          "url": "https://dlmf.nist.gov/"
                        },
                        {
                          "title": "mpmath interval arithmetic (iv)",
                          "url": "https://mpmath.org/doc/current/contexts.html#arbitrary-precision-interval-arithmetic-iv"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "math/scientific@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/math/statistics": {
      "post": {
        "operationId": "calc_math_statistics",
        "summary": "Statistics calculator",
        "description": "Mean, median, mode, range, variance and standard deviation (population and sample) of a list of numbers.\n\nComputes descriptive statistics exactly. Sums, means and variances are exact fractions; standard deviations are square roots computed with certified arithmetic, so even long lists of decimals give correctly rounded results with no accumulated floating-point error.",
        "tags": [
          "Math"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "values": {
                    "description": "The data, as a list of numbers. 1 to 10000 items.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 1,
                    "maxItems": 10000,
                    "examples": [
                      [
                        "2",
                        "4",
                        "4",
                        "4",
                        "5",
                        "5",
                        "7",
                        "9"
                      ]
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "values"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Classic example",
                  "value": {
                    "values": [
                      "2",
                      "4",
                      "4",
                      "4",
                      "5",
                      "5",
                      "7",
                      "9"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "math/statistics@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "description": "Number of values.",
                          "type": "integer"
                        },
                        "sum": {
                          "description": "Sum of the values.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "mean": {
                          "description": "Arithmetic mean.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "median": {
                          "description": "Middle value (mean of the two middle values for an even count).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "mode": {
                          "description": "Most frequent value(s), exact; empty when no value repeats.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "minimum": {
                          "description": "Smallest value.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "maximum": {
                          "description": "Largest value.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "range": {
                          "description": "Maximum minus minimum.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "population_variance": {
                          "description": "Σ(x − mean)² / n.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "population_std_dev": {
                          "description": "Square root of the population variance.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "sample_variance": {
                          "description": "Σ(x − mean)² / (n − 1) (needs n ≥ 2).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "sample_std_dev": {
                          "description": "Square root of the sample variance (needs n ≥ 2).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      },
                      "required": [
                        "count",
                        "sum",
                        "mean",
                        "median",
                        "mode",
                        "minimum",
                        "maximum",
                        "range",
                        "population_variance",
                        "population_std_dev"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Classic example",
                    "value": {
                      "calculator": "math/statistics@1",
                      "result": {
                        "count": 8,
                        "sum": "40",
                        "mean": "5",
                        "median": "4.5",
                        "mode": [
                          "4"
                        ],
                        "minimum": "2",
                        "maximum": "9",
                        "range": "7",
                        "population_variance": "4",
                        "population_std_dev": "2",
                        "sample_variance": "4.57142857142857",
                        "sample_std_dev": "2.1380899352994"
                      },
                      "exactness": {
                        "sum": "exact",
                        "mean": "exact",
                        "median": "exact",
                        "minimum": "exact",
                        "maximum": "exact",
                        "range": "exact",
                        "population_variance": "exact",
                        "population_std_dev": "exact",
                        "sample_variance": "rounded",
                        "sample_std_dev": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "values": [
                          "2",
                          "4",
                          "4",
                          "4",
                          "5",
                          "5",
                          "7",
                          "9"
                        ]
                      },
                      "formula": "mean = Σx/n; population variance = Σ(x − mean)²/n; sample variance = Σ(x − mean)²/(n − 1); standard deviation = √variance",
                      "references": [
                        {
                          "title": "NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5: measures of location and scale",
                          "url": "https://www.itl.nist.gov/div898/handbook/eda/section3/eda35.htm"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "math/statistics@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/money/allocate": {
      "post": {
        "operationId": "calc_money_allocate",
        "summary": "Money splitter",
        "description": "Split an amount by ratios or into equal parts so the shares are whole cents and add up exactly to the amount.\n\nSplits an amount of money between several parts, by ratios (70/30, 1:2:3, percentages) or into equal parts, so that every share is a whole number of the currency's minor unit and the shares add up to the amount exactly: no cent is lost or invented. Rounding each share on its own does not work: 10.00 split three ways rounds to 3.33 three times, which is 9.99. Here each part first gets its exact share rounded down, and the few cents left over are handed out one at a time. Use it for splitting bills, revenue shares, commission, refunds across order lines, or a discount across invoice lines. The currency sets the minor unit: cents for USD and EUR, whole yen for JPY, fils (0.001) for KWD.",
        "tags": [
          "Money"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "description": "The amount to split. A negative amount (a refund) is split the same way and every share is negative. Allowed: >= -1000000000000000 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "100"
                    ]
                  },
                  "currency": {
                    "description": "ISO 4217 code of the currency, such as USD, EUR, JPY or KWD. It sets the number of decimals (the minor unit): 2 for most currencies, 0 for JPY, 3 for KWD. At most 3 characters.",
                    "type": "string",
                    "maxLength": 3,
                    "examples": [
                      "USD"
                    ]
                  },
                  "ratios": {
                    "description": "The parts' ratios, in order. Only their proportions matter: [70, 30], [7, 3] and [0.7, 0.3] split the same way. A ratio of 0 gets nothing. Give ratios or parts. 1 to 1000 items. Each item: >= 0 and <= 1000000000000000.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 1,
                    "maxItems": 1000,
                    "examples": [
                      [
                        "70",
                        "20",
                        "10"
                      ]
                    ]
                  },
                  "parts": {
                    "description": "Number of equal parts (instead of ratios). Allowed: >= 1 and <= 1000.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "examples": [
                      3
                    ]
                  },
                  "method": {
                    "description": "Who gets the minor units left over after every share is rounded down. Options: largest_remainder: the leftover minor units go to the parts whose exact shares were cut the most, earlier parts first on a tie (Hamilton's method); in_order: the leftover minor units go to the first parts, one each, skipping parts with a ratio of 0 (the rule of Dinero.js and Martin Fowler's Money pattern)",
                    "type": "string",
                    "enum": [
                      "largest_remainder",
                      "in_order"
                    ],
                    "default": "largest_remainder"
                  },
                  "rounding": {
                    "description": "How to round the amount to the currency's minor unit first, if it has more decimals (a warning says so). Options: half_up: to nearest, ties away from zero (2.5 → 3, -2.5 → -3); half_even: to nearest, ties to even (2.5 → 2, 3.5 → 4): banker's rounding; half_down: to nearest, ties towards zero (2.5 → 2); up: away from zero (2.1 → 3, -2.1 → -3); down: towards zero, i.e. truncate (2.9 → 2); ceiling: towards +∞ (2.1 → 3, -2.1 → -2); floor: towards −∞ (2.9 → 2, -2.1 → -3)",
                    "type": "string",
                    "enum": [
                      "half_up",
                      "half_even",
                      "half_down",
                      "up",
                      "down",
                      "ceiling",
                      "floor"
                    ],
                    "default": "half_up"
                  }
                },
                "required": [
                  "amount",
                  "currency"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "100 USD split 70/20/10",
                  "value": {
                    "amount": "100",
                    "currency": "USD",
                    "ratios": [
                      "70",
                      "20",
                      "10"
                    ]
                  }
                },
                "example2": {
                  "summary": "10 USD in 3 equal parts",
                  "value": {
                    "amount": "10",
                    "currency": "USD",
                    "parts": 3
                  }
                },
                "example3": {
                  "summary": "0.05 EUR split 70/30, largest remainder",
                  "value": {
                    "amount": "0.05",
                    "currency": "EUR",
                    "ratios": [
                      "70",
                      "30"
                    ]
                  }
                },
                "example4": {
                  "summary": "1000 JPY in 3 parts (yen have no decimals)",
                  "value": {
                    "amount": "1000",
                    "currency": "JPY",
                    "parts": 3
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "money/allocate@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "description": "The amount that was split, in the currency's minor unit; the shares add up to exactly this.",
                          "type": "string"
                        },
                        "shares": {
                          "description": "The shares, in the order of the parts.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "leftover_units": {
                          "description": "How many minor units were left after rounding every share down, and handed out one each.",
                          "type": "integer"
                        },
                        "decimals": {
                          "description": "The currency's number of decimals (ISO 4217 minor unit).",
                          "type": "integer"
                        },
                        "allocation": {
                          "description": "Each part: ratio, exact share and share.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "part": {
                                "description": "Part number, starting at 1, in the order given.",
                                "type": "integer"
                              },
                              "ratio": {
                                "description": "This part's ratio, as given (1 for equal parts).",
                                "type": "string"
                              },
                              "exact_share": {
                                "description": "total × ratio ÷ sum of ratios, exactly (a fraction p/q when it does not end), where total is the amount in whole minor units.",
                                "type": "string"
                              },
                              "share": {
                                "description": "This part's share in whole minor units.",
                                "type": "string"
                              },
                              "extra_unit": {
                                "description": "True when this part got one of the leftover minor units.",
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "part",
                              "ratio",
                              "exact_share",
                              "share",
                              "extra_unit"
                            ]
                          }
                        }
                      },
                      "required": [
                        "total",
                        "shares",
                        "leftover_units",
                        "decimals",
                        "allocation"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "100 USD split 70/20/10",
                    "value": {
                      "calculator": "money/allocate@1",
                      "result": {
                        "total": "100.00",
                        "shares": [
                          "70.00",
                          "20.00",
                          "10.00"
                        ],
                        "leftover_units": 0,
                        "decimals": 2,
                        "allocation": [
                          {
                            "part": 1,
                            "ratio": "70",
                            "exact_share": "70",
                            "share": "70.00",
                            "extra_unit": false
                          },
                          {
                            "part": 2,
                            "ratio": "20",
                            "exact_share": "20",
                            "share": "20.00",
                            "extra_unit": false
                          },
                          {
                            "part": 3,
                            "ratio": "10",
                            "exact_share": "10",
                            "share": "10.00",
                            "extra_unit": false
                          }
                        ]
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "amount": "100",
                        "currency": "USD",
                        "ratios": [
                          "70",
                          "20",
                          "10"
                        ],
                        "method": "largest_remainder",
                        "rounding": "half_up"
                      },
                      "formula": "units = amount × 10^decimals; share_i = ⌊units × r_i ÷ Σr⌋, then the units − Σshare_i leftover units go one each to the largest remainders (or the first parts)",
                      "references": [
                        {
                          "title": "Dinero.js: allocate (10.03 split 50/50 gives 5.02 and 5.01; a ratio of 0 gets nothing)",
                          "url": "https://www.dinerojs.com/api/mutations/allocate"
                        },
                        {
                          "title": "Largest remainder method (Hamilton's method), with a worked example",
                          "url": "https://en.wikipedia.org/wiki/Quota_method"
                        },
                        {
                          "title": "ISO 4217 List One, current currencies and funds (SIX, the maintenance agency)",
                          "url": "https://www.six-group.com/en/products-services/financial-information/market-reference-data/data-standards.html"
                        },
                        {
                          "title": "ISO 4217 amendment 180: Bulgaria adopts the euro (1 January 2026)",
                          "url": "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/amendments/dl-currency-iso-amendment-180.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "10 USD in 3 equal parts",
                    "value": {
                      "calculator": "money/allocate@1",
                      "result": {
                        "total": "10.00",
                        "shares": [
                          "3.34",
                          "3.33",
                          "3.33"
                        ],
                        "leftover_units": 1,
                        "decimals": 2,
                        "allocation": [
                          {
                            "part": 1,
                            "ratio": "1",
                            "exact_share": "10/3",
                            "share": "3.34",
                            "extra_unit": true
                          },
                          {
                            "part": 2,
                            "ratio": "1",
                            "exact_share": "10/3",
                            "share": "3.33",
                            "extra_unit": false
                          },
                          {
                            "part": 3,
                            "ratio": "1",
                            "exact_share": "10/3",
                            "share": "3.33",
                            "extra_unit": false
                          }
                        ]
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "amount": "10",
                        "currency": "USD",
                        "parts": 3,
                        "method": "largest_remainder",
                        "rounding": "half_up"
                      },
                      "formula": "units = amount × 10^decimals; share_i = ⌊units × r_i ÷ Σr⌋, then the units − Σshare_i leftover units go one each to the largest remainders (or the first parts)",
                      "references": [
                        {
                          "title": "Dinero.js: allocate (10.03 split 50/50 gives 5.02 and 5.01; a ratio of 0 gets nothing)",
                          "url": "https://www.dinerojs.com/api/mutations/allocate"
                        },
                        {
                          "title": "Largest remainder method (Hamilton's method), with a worked example",
                          "url": "https://en.wikipedia.org/wiki/Quota_method"
                        },
                        {
                          "title": "ISO 4217 List One, current currencies and funds (SIX, the maintenance agency)",
                          "url": "https://www.six-group.com/en/products-services/financial-information/market-reference-data/data-standards.html"
                        },
                        {
                          "title": "ISO 4217 amendment 180: Bulgaria adopts the euro (1 January 2026)",
                          "url": "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/amendments/dl-currency-iso-amendment-180.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "0.05 EUR split 70/30, largest remainder",
                    "value": {
                      "calculator": "money/allocate@1",
                      "result": {
                        "total": "0.05",
                        "shares": [
                          "0.04",
                          "0.01"
                        ],
                        "leftover_units": 1,
                        "decimals": 2,
                        "allocation": [
                          {
                            "part": 1,
                            "ratio": "70",
                            "exact_share": "0.035",
                            "share": "0.04",
                            "extra_unit": true
                          },
                          {
                            "part": 2,
                            "ratio": "30",
                            "exact_share": "0.015",
                            "share": "0.01",
                            "extra_unit": false
                          }
                        ]
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "amount": "0.05",
                        "currency": "EUR",
                        "ratios": [
                          "70",
                          "30"
                        ],
                        "method": "largest_remainder",
                        "rounding": "half_up"
                      },
                      "formula": "units = amount × 10^decimals; share_i = ⌊units × r_i ÷ Σr⌋, then the units − Σshare_i leftover units go one each to the largest remainders (or the first parts)",
                      "references": [
                        {
                          "title": "Dinero.js: allocate (10.03 split 50/50 gives 5.02 and 5.01; a ratio of 0 gets nothing)",
                          "url": "https://www.dinerojs.com/api/mutations/allocate"
                        },
                        {
                          "title": "Largest remainder method (Hamilton's method), with a worked example",
                          "url": "https://en.wikipedia.org/wiki/Quota_method"
                        },
                        {
                          "title": "ISO 4217 List One, current currencies and funds (SIX, the maintenance agency)",
                          "url": "https://www.six-group.com/en/products-services/financial-information/market-reference-data/data-standards.html"
                        },
                        {
                          "title": "ISO 4217 amendment 180: Bulgaria adopts the euro (1 January 2026)",
                          "url": "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/amendments/dl-currency-iso-amendment-180.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example4": {
                    "summary": "1000 JPY in 3 parts (yen have no decimals)",
                    "value": {
                      "calculator": "money/allocate@1",
                      "result": {
                        "total": "1000",
                        "shares": [
                          "334",
                          "333",
                          "333"
                        ],
                        "leftover_units": 1,
                        "decimals": 0,
                        "allocation": [
                          {
                            "part": 1,
                            "ratio": "1",
                            "exact_share": "1000/3",
                            "share": "334",
                            "extra_unit": true
                          },
                          {
                            "part": 2,
                            "ratio": "1",
                            "exact_share": "1000/3",
                            "share": "333",
                            "extra_unit": false
                          },
                          {
                            "part": 3,
                            "ratio": "1",
                            "exact_share": "1000/3",
                            "share": "333",
                            "extra_unit": false
                          }
                        ]
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "amount": "1000",
                        "currency": "JPY",
                        "parts": 3,
                        "method": "largest_remainder",
                        "rounding": "half_up"
                      },
                      "formula": "units = amount × 10^decimals; share_i = ⌊units × r_i ÷ Σr⌋, then the units − Σshare_i leftover units go one each to the largest remainders (or the first parts)",
                      "references": [
                        {
                          "title": "Dinero.js: allocate (10.03 split 50/50 gives 5.02 and 5.01; a ratio of 0 gets nothing)",
                          "url": "https://www.dinerojs.com/api/mutations/allocate"
                        },
                        {
                          "title": "Largest remainder method (Hamilton's method), with a worked example",
                          "url": "https://en.wikipedia.org/wiki/Quota_method"
                        },
                        {
                          "title": "ISO 4217 List One, current currencies and funds (SIX, the maintenance agency)",
                          "url": "https://www.six-group.com/en/products-services/financial-information/market-reference-data/data-standards.html"
                        },
                        {
                          "title": "ISO 4217 amendment 180: Bulgaria adopts the euro (1 January 2026)",
                          "url": "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/amendments/dl-currency-iso-amendment-180.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "money/allocate@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/money/round": {
      "post": {
        "operationId": "calc_money_round",
        "summary": "Currency rounding calculator",
        "description": "Round an amount to its currency's minor unit (ISO 4217: 2 decimals for EUR, 0 for JPY, 3 for KWD) and to a country's cash rounding rule, such as 0.05 in Canada.\n\nRounds an amount of money the way the currency and the country require. First it rounds to the currency's minor unit from ISO 4217, the international list of currency codes: cents for USD and EUR, whole yen for JPY, three decimals for the Kuwaiti dinar. Then, if you give a country, it applies that country's rule for rounding cash totals in countries that have withdrawn their smallest coins, such as 0.05 in Canada, Australia and several euro countries, 0.10 in Israel, a whole krona in Sweden or 10 pesos in Chile. There are 23 countries, and every rule follows the country's law, central bank or government guidance, cited in the references, including the special cases: Finland and Estonia never round a total of 0.01 or 0.02 to zero, Slovakia rounds it up to 0.05, and Chile rounds 5 pesos down. You can also give your own cash step.",
        "tags": [
          "Money"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "description": "The amount to round. Allowed: >= -1000000000000000 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "23.37"
                    ]
                  },
                  "currency": {
                    "description": "ISO 4217 code of the currency, such as USD, EUR, JPY or KWD. It sets the number of decimals (the minor unit): 2 for most currencies, 0 for JPY, 3 for KWD. At most 3 characters.",
                    "type": "string",
                    "maxLength": 3,
                    "examples": [
                      "EUR"
                    ]
                  },
                  "rounding": {
                    "description": "How to round to the currency's minor unit. half_up is the usual commercial rule (and the rule for euro conversions). Options: half_up: to nearest, ties away from zero (2.5 → 3, -2.5 → -3); half_even: to nearest, ties to even (2.5 → 2, 3.5 → 4): banker's rounding; half_down: to nearest, ties towards zero (2.5 → 2); up: away from zero (2.1 → 3, -2.1 → -3); down: towards zero, i.e. truncate (2.9 → 2); ceiling: towards +∞ (2.1 → 3, -2.1 → -2); floor: towards −∞ (2.9 → 2, -2.1 → -3)",
                    "type": "string",
                    "enum": [
                      "half_up",
                      "half_even",
                      "half_down",
                      "up",
                      "down",
                      "ceiling",
                      "floor"
                    ],
                    "default": "half_up"
                  },
                  "cash_country": {
                    "description": "Optional ISO 3166 two-letter country code, to also round the total for a cash payment by that country's rule. The currency must be the country's. Countries: AU (AUD), BE (EUR), BS (BSD), CA (CAD), CH (CHF), CL (CLP), CZ (CZK), DK (DKK), EE (EUR), FI (EUR), HU (HUF), IE (EUR), IL (ILS), IT (EUR), JM (JMD), LT (EUR), MY (MYR), NL (EUR), NO (NOK), NZ (NZD), SE (SEK), SK (EUR), TT (TTD). At most 2 characters.",
                    "type": "string",
                    "maxLength": 2,
                    "examples": [
                      "NL"
                    ]
                  },
                  "cash_step": {
                    "description": "Optional cash step of your own, such as 0.05 or 0.10, instead of cash_country. It must be a whole number of minor units. Allowed: > 0 and <= 1000000.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "cash_tie": {
                    "description": "Which way a cash total exactly halfway between two steps goes. The default is the country's rule; when the rule does not say (or with cash_step), up is used and a CASH_TIE_ASSUMED warning says so. Options: up: a total exactly halfway between two steps rounds away from zero; down: a total exactly halfway between two steps rounds towards zero",
                    "type": "string",
                    "enum": [
                      "up",
                      "down"
                    ]
                  }
                },
                "required": [
                  "amount",
                  "currency"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Japanese yen have no decimals",
                  "value": {
                    "amount": "1234.5",
                    "currency": "JPY"
                  }
                },
                "example2": {
                  "summary": "Kuwaiti dinar have 3 decimals",
                  "value": {
                    "amount": "1.2345",
                    "currency": "KWD"
                  }
                },
                "example3": {
                  "summary": "Dutch cash rounding: 23.37 EUR is paid as 23.35",
                  "value": {
                    "amount": "23.37",
                    "currency": "EUR",
                    "cash_country": "NL"
                  }
                },
                "example4": {
                  "summary": "Your own cash step of 0.10",
                  "value": {
                    "amount": "4.17",
                    "currency": "USD",
                    "cash_step": "0.10"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "money/round@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "rounded": {
                          "description": "The amount in the currency's minor unit, with every decimal shown (10.50, 1050 for JPY, 1.235 for KWD).",
                          "type": "string"
                        },
                        "minor_units": {
                          "description": "The rounded amount as a whole number of minor units (1050 for 10.50 EUR), as a string so it stays exact. Most payment APIs take amounts in this form, though a few use other minor units than ISO 4217 for some currencies, so check yours.",
                          "type": "string"
                        },
                        "decimals": {
                          "description": "The currency's ISO 4217 minor unit.",
                          "type": "integer"
                        },
                        "currency_name": {
                          "description": "The currency's English name.",
                          "type": "string"
                        },
                        "difference": {
                          "description": "rounded − amount, exactly.",
                          "type": "string"
                        },
                        "cash_amount": {
                          "description": "The total to pay in cash after the cash rounding rule.",
                          "type": "string"
                        },
                        "cash_difference": {
                          "description": "cash_amount − rounded, exactly.",
                          "type": "string"
                        },
                        "cash_step": {
                          "description": "The cash rounding step used.",
                          "type": "string"
                        },
                        "cash_rule": {
                          "description": "The cash rounding rule that was applied, in words.",
                          "type": "string"
                        },
                        "cash_source": {
                          "description": "Link to the law, central bank or government page the country's rule comes from.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "rounded",
                        "minor_units",
                        "decimals",
                        "currency_name",
                        "difference"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Japanese yen have no decimals",
                    "value": {
                      "calculator": "money/round@1",
                      "result": {
                        "rounded": "1235",
                        "minor_units": "1235",
                        "decimals": 0,
                        "currency_name": "Japanese yen",
                        "difference": "0.5"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "amount": "1234.5",
                        "currency": "JPY",
                        "rounding": "half_up"
                      },
                      "formula": "rounded = round(amount × 10^d) ÷ 10^d with d = ISO 4217 minor unit; cash = rounded to the nearest multiple of the step, ties and small totals per the country's rule",
                      "references": [
                        {
                          "title": "ISO 4217 List One, current currencies and funds (SIX, the maintenance agency)",
                          "url": "https://www.six-group.com/en/products-services/financial-information/market-reference-data/data-standards.html"
                        },
                        {
                          "title": "ISO 4217 amendment 180: Bulgaria adopts the euro (1 January 2026)",
                          "url": "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/amendments/dl-currency-iso-amendment-180.pdf"
                        },
                        {
                          "title": "ACCC: Rounding and EFTPOS transactions (11 December 2000), quoting the 1991 guideline",
                          "url": "https://www.accc.gov.au/media-release/rounding-and-eftpos-transactions"
                        },
                        {
                          "title": "SPF Economie: L'arrondi obligatoire souffle ses 4 bougies (30 November 2023)",
                          "url": "https://news.economie.fgov.be/232412-l-arrondi-obligatoire-souffle-ses-4-bougies/"
                        },
                        {
                          "title": "Central Bank of The Bahamas: Penny facts, FAQs on the elimination of the one cent coin",
                          "url": "https://www.centralbankbahamas.com/viewPDF/documents/2020-01-03-01-37-53-Penny-Facts.pdf"
                        },
                        {
                          "title": "Canada Revenue Agency: GST/HST Info Sheet GI-131, Phasing Out of the Penny (December 2012)",
                          "url": "https://www.canada.ca/en/revenue-agency/services/forms-publications/publications/gi-131/phasing-penny.html"
                        },
                        {
                          "title": "SECO: FAQ zur Preisbekanntgabe (prices ending in 9 centimes; rounding down cash totals)",
                          "url": "https://www.seco.admin.ch/de/faq-pbv"
                        },
                        {
                          "title": "SUSESO: Ley 20.956, artículo 13 (rounding of cash payments)",
                          "url": "https://www.suseso.gob.cl/612/w3-propertyvalue-633249.html"
                        },
                        {
                          "title": "Czech National Bank: Jak postupovat při zaokrouhlování po ukončení platnosti 50haléřových mincí (Act 634/1992, section 3)",
                          "url": "https://www.cnb.cz/cs/casto-kladene-dotazy/Jak-postupovat-pri-zaokrouhlovani-po-ukonceni-platnosti-50halerovych-minci"
                        },
                        {
                          "title": "Bekendtgørelse nr. 928 af 2008 om afskaffelse af 25-øren som gyldigt betalingsmiddel, section 2",
                          "url": "https://www.retsinformation.dk/eli/lta/2008/928/pdf"
                        },
                        {
                          "title": "Eesti Pank and Ministry of Finance: The rounding rule (booklet, 2024)",
                          "url": "https://haldus.eestipank.ee/sites/default/files/2024-10/ymardamisreegel_buklet_eng_011024.pdf"
                        },
                        {
                          "title": "Laki euromääräisten maksujen pyöristämisestä 890/2000, sections 1 and 2",
                          "url": "https://data.finlex.fi/api/assets/extra/statute-book-of-finland-pdf/fin/2000/20000124.pdf"
                        },
                        {
                          "title": "2008. évi III. törvény az 1 és 2 forintos címletű érmék bevonása következtében szükséges kerekítés szabályairól, sections 1 to 3",
                          "url": "https://njt.jog.gov.hu/jogszabaly/2008-3-00-00"
                        },
                        {
                          "title": "Central Bank of Ireland: Rounding",
                          "url": "https://www.centralbank.ie/consumer-hub/rounding"
                        },
                        {
                          "title": "Bank of Israel: Abolition of the 5 agorot coin (in Hebrew, updated 1 May 2024)",
                          "url": "https://boi.org.il/information/my-cash-banknotes/%D7%91%D7%99%D7%98%D7%95%D7%9C-%D7%9E%D7%98%D7%91%D7%A2-5-%D7%90%D7%92%D7%95%D7%A8%D7%95%D7%AA/"
                        },
                        {
                          "title": "Decreto-legge 24 aprile 2017, n. 50, article 13-quater (coordinated text)",
                          "url": "https://www.mefop.it/cms/doc/20300/dl-24-aprile-2017-50.pdf"
                        },
                        {
                          "title": "Bank of Jamaica: Guidance on the demonetization of coins",
                          "url": "https://boj.org.jm/uploads/news/guidance_demonetization_of_coins_ad_observer_copy.pdf"
                        },
                        {
                          "title": "Lietuvos bankas: Apvalinimas (rounding of cash payments)",
                          "url": "https://www.lb.lt/lt/apvalinimas"
                        },
                        {
                          "title": "Bank Negara Malaysia: Introduction of a rounding mechanism for over-the-counter payments",
                          "url": "https://www.bnm.gov.my/-/introduction-of-a-rounding-mechanism-for-over-the-counter-payments"
                        },
                        {
                          "title": "Rijksoverheid: Mogen winkeliers betalingen afronden op 0 eurocent of 5 eurocent?",
                          "url": "https://www.rijksoverheid.nl/vraag-en-antwoord/betalingsverkeer/mogen-winkeliers-betalingen-afronden-op-0-eurocent-of-5-eurocent"
                        },
                        {
                          "title": "Norges Bank: Rundskriv 1/2011, Forskrift om tilbaketrekking av 50-øremynt som gyldig betalingsmiddel, section 2",
                          "url": "https://www.norges-bank.no/aktuelt/nyheter/Rundskriv/2011/1-Forskrift-om-tilbaketrekking-av-50-oremynt-som-gyldig-betalingsmiddel/"
                        },
                        {
                          "title": "New Zealand Government Consumer Protection: Cash and EFTPOS",
                          "url": "https://www.consumerprotection.govt.nz/general-help/ways-to-buy-and-pay/cash-and-eftpos"
                        },
                        {
                          "title": "Lag (1970:1029) om avrundning av öresbelopp, sections 1 and 2",
                          "url": "https://data.riksdagen.se/dokument/sfs-1970-1029.html"
                        },
                        {
                          "title": "Zákon č. 18/1996 Z. z. o cenách, section 3(4), in force from 1 January 2026",
                          "url": "https://static.slov-lex.sk/pdf/SK/ZZ/1996/18/ZZ_1996_18_20260101.pdf"
                        },
                        {
                          "title": "Central Bank (Withdrawal, Redemption and Demonetisation of One Cent Coins) Regulations, 2018, Legal Notice No. 35",
                          "url": "https://www.central-bank.org.tt/wp-content/uploads/pdf/Legal-Notice-No.-35-of-2018.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Kuwaiti dinar have 3 decimals",
                    "value": {
                      "calculator": "money/round@1",
                      "result": {
                        "rounded": "1.235",
                        "minor_units": "1235",
                        "decimals": 3,
                        "currency_name": "Kuwaiti dinar",
                        "difference": "0.0005"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "amount": "1.2345",
                        "currency": "KWD",
                        "rounding": "half_up"
                      },
                      "formula": "rounded = round(amount × 10^d) ÷ 10^d with d = ISO 4217 minor unit; cash = rounded to the nearest multiple of the step, ties and small totals per the country's rule",
                      "references": [
                        {
                          "title": "ISO 4217 List One, current currencies and funds (SIX, the maintenance agency)",
                          "url": "https://www.six-group.com/en/products-services/financial-information/market-reference-data/data-standards.html"
                        },
                        {
                          "title": "ISO 4217 amendment 180: Bulgaria adopts the euro (1 January 2026)",
                          "url": "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/amendments/dl-currency-iso-amendment-180.pdf"
                        },
                        {
                          "title": "ACCC: Rounding and EFTPOS transactions (11 December 2000), quoting the 1991 guideline",
                          "url": "https://www.accc.gov.au/media-release/rounding-and-eftpos-transactions"
                        },
                        {
                          "title": "SPF Economie: L'arrondi obligatoire souffle ses 4 bougies (30 November 2023)",
                          "url": "https://news.economie.fgov.be/232412-l-arrondi-obligatoire-souffle-ses-4-bougies/"
                        },
                        {
                          "title": "Central Bank of The Bahamas: Penny facts, FAQs on the elimination of the one cent coin",
                          "url": "https://www.centralbankbahamas.com/viewPDF/documents/2020-01-03-01-37-53-Penny-Facts.pdf"
                        },
                        {
                          "title": "Canada Revenue Agency: GST/HST Info Sheet GI-131, Phasing Out of the Penny (December 2012)",
                          "url": "https://www.canada.ca/en/revenue-agency/services/forms-publications/publications/gi-131/phasing-penny.html"
                        },
                        {
                          "title": "SECO: FAQ zur Preisbekanntgabe (prices ending in 9 centimes; rounding down cash totals)",
                          "url": "https://www.seco.admin.ch/de/faq-pbv"
                        },
                        {
                          "title": "SUSESO: Ley 20.956, artículo 13 (rounding of cash payments)",
                          "url": "https://www.suseso.gob.cl/612/w3-propertyvalue-633249.html"
                        },
                        {
                          "title": "Czech National Bank: Jak postupovat při zaokrouhlování po ukončení platnosti 50haléřových mincí (Act 634/1992, section 3)",
                          "url": "https://www.cnb.cz/cs/casto-kladene-dotazy/Jak-postupovat-pri-zaokrouhlovani-po-ukonceni-platnosti-50halerovych-minci"
                        },
                        {
                          "title": "Bekendtgørelse nr. 928 af 2008 om afskaffelse af 25-øren som gyldigt betalingsmiddel, section 2",
                          "url": "https://www.retsinformation.dk/eli/lta/2008/928/pdf"
                        },
                        {
                          "title": "Eesti Pank and Ministry of Finance: The rounding rule (booklet, 2024)",
                          "url": "https://haldus.eestipank.ee/sites/default/files/2024-10/ymardamisreegel_buklet_eng_011024.pdf"
                        },
                        {
                          "title": "Laki euromääräisten maksujen pyöristämisestä 890/2000, sections 1 and 2",
                          "url": "https://data.finlex.fi/api/assets/extra/statute-book-of-finland-pdf/fin/2000/20000124.pdf"
                        },
                        {
                          "title": "2008. évi III. törvény az 1 és 2 forintos címletű érmék bevonása következtében szükséges kerekítés szabályairól, sections 1 to 3",
                          "url": "https://njt.jog.gov.hu/jogszabaly/2008-3-00-00"
                        },
                        {
                          "title": "Central Bank of Ireland: Rounding",
                          "url": "https://www.centralbank.ie/consumer-hub/rounding"
                        },
                        {
                          "title": "Bank of Israel: Abolition of the 5 agorot coin (in Hebrew, updated 1 May 2024)",
                          "url": "https://boi.org.il/information/my-cash-banknotes/%D7%91%D7%99%D7%98%D7%95%D7%9C-%D7%9E%D7%98%D7%91%D7%A2-5-%D7%90%D7%92%D7%95%D7%A8%D7%95%D7%AA/"
                        },
                        {
                          "title": "Decreto-legge 24 aprile 2017, n. 50, article 13-quater (coordinated text)",
                          "url": "https://www.mefop.it/cms/doc/20300/dl-24-aprile-2017-50.pdf"
                        },
                        {
                          "title": "Bank of Jamaica: Guidance on the demonetization of coins",
                          "url": "https://boj.org.jm/uploads/news/guidance_demonetization_of_coins_ad_observer_copy.pdf"
                        },
                        {
                          "title": "Lietuvos bankas: Apvalinimas (rounding of cash payments)",
                          "url": "https://www.lb.lt/lt/apvalinimas"
                        },
                        {
                          "title": "Bank Negara Malaysia: Introduction of a rounding mechanism for over-the-counter payments",
                          "url": "https://www.bnm.gov.my/-/introduction-of-a-rounding-mechanism-for-over-the-counter-payments"
                        },
                        {
                          "title": "Rijksoverheid: Mogen winkeliers betalingen afronden op 0 eurocent of 5 eurocent?",
                          "url": "https://www.rijksoverheid.nl/vraag-en-antwoord/betalingsverkeer/mogen-winkeliers-betalingen-afronden-op-0-eurocent-of-5-eurocent"
                        },
                        {
                          "title": "Norges Bank: Rundskriv 1/2011, Forskrift om tilbaketrekking av 50-øremynt som gyldig betalingsmiddel, section 2",
                          "url": "https://www.norges-bank.no/aktuelt/nyheter/Rundskriv/2011/1-Forskrift-om-tilbaketrekking-av-50-oremynt-som-gyldig-betalingsmiddel/"
                        },
                        {
                          "title": "New Zealand Government Consumer Protection: Cash and EFTPOS",
                          "url": "https://www.consumerprotection.govt.nz/general-help/ways-to-buy-and-pay/cash-and-eftpos"
                        },
                        {
                          "title": "Lag (1970:1029) om avrundning av öresbelopp, sections 1 and 2",
                          "url": "https://data.riksdagen.se/dokument/sfs-1970-1029.html"
                        },
                        {
                          "title": "Zákon č. 18/1996 Z. z. o cenách, section 3(4), in force from 1 January 2026",
                          "url": "https://static.slov-lex.sk/pdf/SK/ZZ/1996/18/ZZ_1996_18_20260101.pdf"
                        },
                        {
                          "title": "Central Bank (Withdrawal, Redemption and Demonetisation of One Cent Coins) Regulations, 2018, Legal Notice No. 35",
                          "url": "https://www.central-bank.org.tt/wp-content/uploads/pdf/Legal-Notice-No.-35-of-2018.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Dutch cash rounding: 23.37 EUR is paid as 23.35",
                    "value": {
                      "calculator": "money/round@1",
                      "result": {
                        "rounded": "23.37",
                        "minor_units": "2337",
                        "decimals": 2,
                        "currency_name": "Euro",
                        "difference": "0",
                        "cash_amount": "23.35",
                        "cash_difference": "-0.02",
                        "cash_step": "0.05",
                        "cash_rule": "Netherlands: shops may round cash totals to the nearest 0.05 EUR (23.37 to 23.35, 8.89 to 8.90) if a sticker says so; card payments are not rounded.",
                        "cash_source": "https://www.rijksoverheid.nl/vraag-en-antwoord/betalingsverkeer/mogen-winkeliers-betalingen-afronden-op-0-eurocent-of-5-eurocent"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "amount": "23.37",
                        "currency": "EUR",
                        "rounding": "half_up",
                        "cash_country": "NL"
                      },
                      "formula": "rounded = round(amount × 10^d) ÷ 10^d with d = ISO 4217 minor unit; cash = rounded to the nearest multiple of the step, ties and small totals per the country's rule",
                      "references": [
                        {
                          "title": "ISO 4217 List One, current currencies and funds (SIX, the maintenance agency)",
                          "url": "https://www.six-group.com/en/products-services/financial-information/market-reference-data/data-standards.html"
                        },
                        {
                          "title": "ISO 4217 amendment 180: Bulgaria adopts the euro (1 January 2026)",
                          "url": "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/amendments/dl-currency-iso-amendment-180.pdf"
                        },
                        {
                          "title": "ACCC: Rounding and EFTPOS transactions (11 December 2000), quoting the 1991 guideline",
                          "url": "https://www.accc.gov.au/media-release/rounding-and-eftpos-transactions"
                        },
                        {
                          "title": "SPF Economie: L'arrondi obligatoire souffle ses 4 bougies (30 November 2023)",
                          "url": "https://news.economie.fgov.be/232412-l-arrondi-obligatoire-souffle-ses-4-bougies/"
                        },
                        {
                          "title": "Central Bank of The Bahamas: Penny facts, FAQs on the elimination of the one cent coin",
                          "url": "https://www.centralbankbahamas.com/viewPDF/documents/2020-01-03-01-37-53-Penny-Facts.pdf"
                        },
                        {
                          "title": "Canada Revenue Agency: GST/HST Info Sheet GI-131, Phasing Out of the Penny (December 2012)",
                          "url": "https://www.canada.ca/en/revenue-agency/services/forms-publications/publications/gi-131/phasing-penny.html"
                        },
                        {
                          "title": "SECO: FAQ zur Preisbekanntgabe (prices ending in 9 centimes; rounding down cash totals)",
                          "url": "https://www.seco.admin.ch/de/faq-pbv"
                        },
                        {
                          "title": "SUSESO: Ley 20.956, artículo 13 (rounding of cash payments)",
                          "url": "https://www.suseso.gob.cl/612/w3-propertyvalue-633249.html"
                        },
                        {
                          "title": "Czech National Bank: Jak postupovat při zaokrouhlování po ukončení platnosti 50haléřových mincí (Act 634/1992, section 3)",
                          "url": "https://www.cnb.cz/cs/casto-kladene-dotazy/Jak-postupovat-pri-zaokrouhlovani-po-ukonceni-platnosti-50halerovych-minci"
                        },
                        {
                          "title": "Bekendtgørelse nr. 928 af 2008 om afskaffelse af 25-øren som gyldigt betalingsmiddel, section 2",
                          "url": "https://www.retsinformation.dk/eli/lta/2008/928/pdf"
                        },
                        {
                          "title": "Eesti Pank and Ministry of Finance: The rounding rule (booklet, 2024)",
                          "url": "https://haldus.eestipank.ee/sites/default/files/2024-10/ymardamisreegel_buklet_eng_011024.pdf"
                        },
                        {
                          "title": "Laki euromääräisten maksujen pyöristämisestä 890/2000, sections 1 and 2",
                          "url": "https://data.finlex.fi/api/assets/extra/statute-book-of-finland-pdf/fin/2000/20000124.pdf"
                        },
                        {
                          "title": "2008. évi III. törvény az 1 és 2 forintos címletű érmék bevonása következtében szükséges kerekítés szabályairól, sections 1 to 3",
                          "url": "https://njt.jog.gov.hu/jogszabaly/2008-3-00-00"
                        },
                        {
                          "title": "Central Bank of Ireland: Rounding",
                          "url": "https://www.centralbank.ie/consumer-hub/rounding"
                        },
                        {
                          "title": "Bank of Israel: Abolition of the 5 agorot coin (in Hebrew, updated 1 May 2024)",
                          "url": "https://boi.org.il/information/my-cash-banknotes/%D7%91%D7%99%D7%98%D7%95%D7%9C-%D7%9E%D7%98%D7%91%D7%A2-5-%D7%90%D7%92%D7%95%D7%A8%D7%95%D7%AA/"
                        },
                        {
                          "title": "Decreto-legge 24 aprile 2017, n. 50, article 13-quater (coordinated text)",
                          "url": "https://www.mefop.it/cms/doc/20300/dl-24-aprile-2017-50.pdf"
                        },
                        {
                          "title": "Bank of Jamaica: Guidance on the demonetization of coins",
                          "url": "https://boj.org.jm/uploads/news/guidance_demonetization_of_coins_ad_observer_copy.pdf"
                        },
                        {
                          "title": "Lietuvos bankas: Apvalinimas (rounding of cash payments)",
                          "url": "https://www.lb.lt/lt/apvalinimas"
                        },
                        {
                          "title": "Bank Negara Malaysia: Introduction of a rounding mechanism for over-the-counter payments",
                          "url": "https://www.bnm.gov.my/-/introduction-of-a-rounding-mechanism-for-over-the-counter-payments"
                        },
                        {
                          "title": "Rijksoverheid: Mogen winkeliers betalingen afronden op 0 eurocent of 5 eurocent?",
                          "url": "https://www.rijksoverheid.nl/vraag-en-antwoord/betalingsverkeer/mogen-winkeliers-betalingen-afronden-op-0-eurocent-of-5-eurocent"
                        },
                        {
                          "title": "Norges Bank: Rundskriv 1/2011, Forskrift om tilbaketrekking av 50-øremynt som gyldig betalingsmiddel, section 2",
                          "url": "https://www.norges-bank.no/aktuelt/nyheter/Rundskriv/2011/1-Forskrift-om-tilbaketrekking-av-50-oremynt-som-gyldig-betalingsmiddel/"
                        },
                        {
                          "title": "New Zealand Government Consumer Protection: Cash and EFTPOS",
                          "url": "https://www.consumerprotection.govt.nz/general-help/ways-to-buy-and-pay/cash-and-eftpos"
                        },
                        {
                          "title": "Lag (1970:1029) om avrundning av öresbelopp, sections 1 and 2",
                          "url": "https://data.riksdagen.se/dokument/sfs-1970-1029.html"
                        },
                        {
                          "title": "Zákon č. 18/1996 Z. z. o cenách, section 3(4), in force from 1 January 2026",
                          "url": "https://static.slov-lex.sk/pdf/SK/ZZ/1996/18/ZZ_1996_18_20260101.pdf"
                        },
                        {
                          "title": "Central Bank (Withdrawal, Redemption and Demonetisation of One Cent Coins) Regulations, 2018, Legal Notice No. 35",
                          "url": "https://www.central-bank.org.tt/wp-content/uploads/pdf/Legal-Notice-No.-35-of-2018.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example4": {
                    "summary": "Your own cash step of 0.10",
                    "value": {
                      "calculator": "money/round@1",
                      "result": {
                        "rounded": "4.17",
                        "minor_units": "417",
                        "decimals": 2,
                        "currency_name": "United States dollar",
                        "difference": "0",
                        "cash_amount": "4.20",
                        "cash_difference": "0.03",
                        "cash_step": "0.10",
                        "cash_rule": "Nearest multiple of 0.10 USD."
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "amount": "4.17",
                        "currency": "USD",
                        "rounding": "half_up",
                        "cash_step": "0.1"
                      },
                      "formula": "rounded = round(amount × 10^d) ÷ 10^d with d = ISO 4217 minor unit; cash = rounded to the nearest multiple of the step, ties and small totals per the country's rule",
                      "references": [
                        {
                          "title": "ISO 4217 List One, current currencies and funds (SIX, the maintenance agency)",
                          "url": "https://www.six-group.com/en/products-services/financial-information/market-reference-data/data-standards.html"
                        },
                        {
                          "title": "ISO 4217 amendment 180: Bulgaria adopts the euro (1 January 2026)",
                          "url": "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/amendments/dl-currency-iso-amendment-180.pdf"
                        },
                        {
                          "title": "ACCC: Rounding and EFTPOS transactions (11 December 2000), quoting the 1991 guideline",
                          "url": "https://www.accc.gov.au/media-release/rounding-and-eftpos-transactions"
                        },
                        {
                          "title": "SPF Economie: L'arrondi obligatoire souffle ses 4 bougies (30 November 2023)",
                          "url": "https://news.economie.fgov.be/232412-l-arrondi-obligatoire-souffle-ses-4-bougies/"
                        },
                        {
                          "title": "Central Bank of The Bahamas: Penny facts, FAQs on the elimination of the one cent coin",
                          "url": "https://www.centralbankbahamas.com/viewPDF/documents/2020-01-03-01-37-53-Penny-Facts.pdf"
                        },
                        {
                          "title": "Canada Revenue Agency: GST/HST Info Sheet GI-131, Phasing Out of the Penny (December 2012)",
                          "url": "https://www.canada.ca/en/revenue-agency/services/forms-publications/publications/gi-131/phasing-penny.html"
                        },
                        {
                          "title": "SECO: FAQ zur Preisbekanntgabe (prices ending in 9 centimes; rounding down cash totals)",
                          "url": "https://www.seco.admin.ch/de/faq-pbv"
                        },
                        {
                          "title": "SUSESO: Ley 20.956, artículo 13 (rounding of cash payments)",
                          "url": "https://www.suseso.gob.cl/612/w3-propertyvalue-633249.html"
                        },
                        {
                          "title": "Czech National Bank: Jak postupovat při zaokrouhlování po ukončení platnosti 50haléřových mincí (Act 634/1992, section 3)",
                          "url": "https://www.cnb.cz/cs/casto-kladene-dotazy/Jak-postupovat-pri-zaokrouhlovani-po-ukonceni-platnosti-50halerovych-minci"
                        },
                        {
                          "title": "Bekendtgørelse nr. 928 af 2008 om afskaffelse af 25-øren som gyldigt betalingsmiddel, section 2",
                          "url": "https://www.retsinformation.dk/eli/lta/2008/928/pdf"
                        },
                        {
                          "title": "Eesti Pank and Ministry of Finance: The rounding rule (booklet, 2024)",
                          "url": "https://haldus.eestipank.ee/sites/default/files/2024-10/ymardamisreegel_buklet_eng_011024.pdf"
                        },
                        {
                          "title": "Laki euromääräisten maksujen pyöristämisestä 890/2000, sections 1 and 2",
                          "url": "https://data.finlex.fi/api/assets/extra/statute-book-of-finland-pdf/fin/2000/20000124.pdf"
                        },
                        {
                          "title": "2008. évi III. törvény az 1 és 2 forintos címletű érmék bevonása következtében szükséges kerekítés szabályairól, sections 1 to 3",
                          "url": "https://njt.jog.gov.hu/jogszabaly/2008-3-00-00"
                        },
                        {
                          "title": "Central Bank of Ireland: Rounding",
                          "url": "https://www.centralbank.ie/consumer-hub/rounding"
                        },
                        {
                          "title": "Bank of Israel: Abolition of the 5 agorot coin (in Hebrew, updated 1 May 2024)",
                          "url": "https://boi.org.il/information/my-cash-banknotes/%D7%91%D7%99%D7%98%D7%95%D7%9C-%D7%9E%D7%98%D7%91%D7%A2-5-%D7%90%D7%92%D7%95%D7%A8%D7%95%D7%AA/"
                        },
                        {
                          "title": "Decreto-legge 24 aprile 2017, n. 50, article 13-quater (coordinated text)",
                          "url": "https://www.mefop.it/cms/doc/20300/dl-24-aprile-2017-50.pdf"
                        },
                        {
                          "title": "Bank of Jamaica: Guidance on the demonetization of coins",
                          "url": "https://boj.org.jm/uploads/news/guidance_demonetization_of_coins_ad_observer_copy.pdf"
                        },
                        {
                          "title": "Lietuvos bankas: Apvalinimas (rounding of cash payments)",
                          "url": "https://www.lb.lt/lt/apvalinimas"
                        },
                        {
                          "title": "Bank Negara Malaysia: Introduction of a rounding mechanism for over-the-counter payments",
                          "url": "https://www.bnm.gov.my/-/introduction-of-a-rounding-mechanism-for-over-the-counter-payments"
                        },
                        {
                          "title": "Rijksoverheid: Mogen winkeliers betalingen afronden op 0 eurocent of 5 eurocent?",
                          "url": "https://www.rijksoverheid.nl/vraag-en-antwoord/betalingsverkeer/mogen-winkeliers-betalingen-afronden-op-0-eurocent-of-5-eurocent"
                        },
                        {
                          "title": "Norges Bank: Rundskriv 1/2011, Forskrift om tilbaketrekking av 50-øremynt som gyldig betalingsmiddel, section 2",
                          "url": "https://www.norges-bank.no/aktuelt/nyheter/Rundskriv/2011/1-Forskrift-om-tilbaketrekking-av-50-oremynt-som-gyldig-betalingsmiddel/"
                        },
                        {
                          "title": "New Zealand Government Consumer Protection: Cash and EFTPOS",
                          "url": "https://www.consumerprotection.govt.nz/general-help/ways-to-buy-and-pay/cash-and-eftpos"
                        },
                        {
                          "title": "Lag (1970:1029) om avrundning av öresbelopp, sections 1 and 2",
                          "url": "https://data.riksdagen.se/dokument/sfs-1970-1029.html"
                        },
                        {
                          "title": "Zákon č. 18/1996 Z. z. o cenách, section 3(4), in force from 1 January 2026",
                          "url": "https://static.slov-lex.sk/pdf/SK/ZZ/1996/18/ZZ_1996_18_20260101.pdf"
                        },
                        {
                          "title": "Central Bank (Withdrawal, Redemption and Demonetisation of One Cent Coins) Regulations, 2018, Legal Notice No. 35",
                          "url": "https://www.central-bank.org.tt/wp-content/uploads/pdf/Legal-Notice-No.-35-of-2018.pdf"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "money/round@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/payments/late-interest/eu": {
      "post": {
        "operationId": "calc_payments_late_interest_eu",
        "summary": "EU late payment interest calculator (Directive 2011/7)",
        "description": "Statutory interest on a late business invoice under the EU Late Payment Directive: the ECB rate plus at least 8 points, set each half-year, plus €40.\n\nSimple interest at the ECB main refinancing rate plus a margin (at least 8 percentage points). The ECB rate in force on 1 January applies to days from January to June and the rate on 1 July to days from July to December, so a long delay is split into half-years. Also returns the €40 minimum compensation.",
        "tags": [
          "Payments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "description": "The unpaid amount (the invoice or debt). Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10000"
                    ]
                  },
                  "due_date": {
                    "description": "The last day the payment was due (interest starts the day after).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-03-31"
                    ]
                  },
                  "payment_date": {
                    "description": "The day the payment was or will be made (counted as a day of interest).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-06-29"
                    ]
                  },
                  "margin_percent": {
                    "description": "Points added to the ECB rate: 8 in the directive; some countries add more (Germany 9). Allowed: >= 8 and <= 50. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "default": "8"
                  },
                  "day_count": {
                    "description": "How a day's share of the year is counted. Options: actual_365: each day is 1/365 of a year, leap years included (the usual practice); actual_actual: each day is 1/365 of a year, or 1/366 in a leap year; actual_360: each day is 1/360 of a year",
                    "type": "string",
                    "enum": [
                      "actual_365",
                      "actual_actual",
                      "actual_360"
                    ],
                    "default": "actual_365"
                  },
                  "reference_rate_percent": {
                    "description": "Use this ECB rate (in percent) for every day instead of the published one, for example for a date not yet covered. Allowed: >= -5 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "amount",
                  "due_date",
                  "payment_date"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "€10,000 due 31 May 2026, paid 31 July 2026 (rate rises on 1 July)",
                  "value": {
                    "amount": "10000",
                    "due_date": "2026-05-31",
                    "payment_date": "2026-07-31"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "payments/late-interest/eu@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "days_late": {
                          "description": "Days of interest.",
                          "type": "integer"
                        },
                        "interest": {
                          "description": "Statutory interest. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "compensation": {
                          "description": "Minimum fixed compensation (Article 6). Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_claim": {
                          "description": "Interest plus the compensation. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "periods": {
                          "description": "Interest for each half-year.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "start": {
                                "description": "First day of interest in this period.",
                                "type": "string",
                                "format": "date"
                              },
                              "end": {
                                "description": "Last day of interest in this period.",
                                "type": "string",
                                "format": "date"
                              },
                              "days": {
                                "description": "Days of interest in this period.",
                                "type": "integer"
                              },
                              "annual_rate_percent": {
                                "description": "Interest rate for the period, in percent a year.",
                                "type": "string"
                              },
                              "interest": {
                                "description": "Interest for the period. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "start",
                              "end",
                              "days",
                              "annual_rate_percent",
                              "interest"
                            ]
                          }
                        }
                      },
                      "required": [
                        "days_late",
                        "interest",
                        "compensation",
                        "total_claim",
                        "periods"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "€10,000 due 31 May 2026, paid 31 July 2026 (rate rises on 1 July)",
                    "value": {
                      "calculator": "payments/late-interest/eu@1",
                      "result": {
                        "days_late": 61,
                        "interest": "171.75",
                        "compensation": "40.00",
                        "total_claim": "211.75",
                        "periods": [
                          {
                            "start": "2026-06-01",
                            "end": "2026-06-30",
                            "days": 30,
                            "annual_rate_percent": "10.15",
                            "interest": "83.42"
                          },
                          {
                            "start": "2026-07-01",
                            "end": "2026-07-31",
                            "days": 31,
                            "annual_rate_percent": "10.4",
                            "interest": "88.33"
                          }
                        ]
                      },
                      "exactness": {
                        "interest": "rounded",
                        "compensation": "exact",
                        "total_claim": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "amount": "10000",
                        "due_date": "2026-05-31",
                        "payment_date": "2026-07-31",
                        "margin_percent": "8",
                        "day_count": "actual_365"
                      },
                      "formula": "interest = Σ amount × (ECB rate on 1 Jan or 1 Jul + margin) × days / 365",
                      "references": [
                        {
                          "title": "Directive 2011/7/EU on combating late payment in commercial transactions, Articles 2, 3, 4 and 6",
                          "url": "https://eur-lex.europa.eu/eli/dir/2011/7/oj/eng"
                        },
                        {
                          "title": "European Central Bank, key ECB interest rates",
                          "url": "https://www.ecb.europa.eu/stats/policy_and_exchange_rates/key_ecb_interest_rates/html/index.en.html"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "payments/late-interest/eu@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/payments/late-interest/germany": {
      "post": {
        "operationId": "calc_payments_late_interest_germany",
        "summary": "Verzugszinsen calculator (§ 288 BGB, Germany)",
        "description": "Verzugszinsen under § 288 BGB, half-year by half-year: the Basiszinssatz plus 9 points and the €40 fee between businesses, or plus 5 points with consumers.\n\nSimple interest at the Bundesbank Basiszinssatz (§ 247 BGB) plus 9 percentage points when no consumer is involved, or 5 points when the debtor is a consumer (8 points for business contracts made before 29 July 2014). The Basiszinssatz changes on 1 January and 1 July, so a long delay is split into half-years. Business debtors also owe the €40 Verzugspauschale (§ 288 (5) BGB).",
        "tags": [
          "Payments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "description": "The unpaid amount (the invoice or debt). Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10000"
                    ]
                  },
                  "due_date": {
                    "description": "The last day before default (Verzug begins the next day).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-03-31"
                    ]
                  },
                  "payment_date": {
                    "description": "The day the payment was or will be made (counted as a day of interest).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-06-29"
                    ]
                  },
                  "debtor": {
                    "description": "Who owes the money. Options: business: no consumer involved: Basiszinssatz + 9 points; consumer: the debtor is a consumer: Basiszinssatz + 5 points",
                    "type": "string",
                    "enum": [
                      "business",
                      "consumer"
                    ],
                    "default": "business"
                  },
                  "contract_before_29_july_2014": {
                    "description": "The business contract was made before 29 July 2014 (8 points, no €40 fee).",
                    "type": "boolean",
                    "default": false
                  },
                  "day_count": {
                    "description": "How a day's share of the year is counted. Options: actual_365: each day is 1/365 of a year, leap years included (the usual practice); actual_actual: each day is 1/365 of a year, or 1/366 in a leap year; actual_360: each day is 1/360 of a year",
                    "type": "string",
                    "enum": [
                      "actual_365",
                      "actual_actual",
                      "actual_360"
                    ],
                    "default": "actual_365"
                  },
                  "reference_rate_percent": {
                    "description": "Use this Basiszinssatz (in percent) for every day instead of the published one, for example for a date not yet covered. Allowed: >= -5 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "amount",
                  "due_date",
                  "payment_date"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "€10,000 between businesses, due 30 June 2026, paid 31 December 2026",
                  "value": {
                    "amount": "10000",
                    "due_date": "2026-06-30",
                    "payment_date": "2026-12-31"
                  }
                },
                "example2": {
                  "summary": "€2,000 owed by a consumer, due 31 January 2026, paid 2 March 2026",
                  "value": {
                    "amount": "2000",
                    "due_date": "2026-01-31",
                    "payment_date": "2026-03-02",
                    "debtor": "consumer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "payments/late-interest/germany@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "days_late": {
                          "description": "Days of interest.",
                          "type": "integer"
                        },
                        "margin_percent": {
                          "description": "Points over the Basiszinssatz.",
                          "type": "string"
                        },
                        "interest": {
                          "description": "Verzugszinsen. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "compensation": {
                          "description": "Verzugspauschale (€40 for business debtors). Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_claim": {
                          "description": "Interest plus the Verzugspauschale. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "periods": {
                          "description": "Interest for each half-year.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "start": {
                                "description": "First day of interest in this period.",
                                "type": "string",
                                "format": "date"
                              },
                              "end": {
                                "description": "Last day of interest in this period.",
                                "type": "string",
                                "format": "date"
                              },
                              "days": {
                                "description": "Days of interest in this period.",
                                "type": "integer"
                              },
                              "annual_rate_percent": {
                                "description": "Interest rate for the period, in percent a year.",
                                "type": "string"
                              },
                              "interest": {
                                "description": "Interest for the period. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "start",
                              "end",
                              "days",
                              "annual_rate_percent",
                              "interest"
                            ]
                          }
                        }
                      },
                      "required": [
                        "days_late",
                        "margin_percent",
                        "interest",
                        "compensation",
                        "total_claim",
                        "periods"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "€10,000 between businesses, due 30 June 2026, paid 31 December 2026",
                    "value": {
                      "calculator": "payments/late-interest/germany@1",
                      "result": {
                        "days_late": 184,
                        "margin_percent": "9",
                        "interest": "530.32",
                        "compensation": "40.00",
                        "total_claim": "570.32",
                        "periods": [
                          {
                            "start": "2026-07-01",
                            "end": "2026-12-31",
                            "days": 184,
                            "annual_rate_percent": "10.52",
                            "interest": "530.32"
                          }
                        ]
                      },
                      "exactness": {
                        "interest": "rounded",
                        "compensation": "exact",
                        "total_claim": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "amount": "10000",
                        "due_date": "2026-06-30",
                        "payment_date": "2026-12-31",
                        "debtor": "business",
                        "contract_before_29_july_2014": false,
                        "day_count": "actual_365"
                      },
                      "formula": "interest = Σ amount × (Basiszinssatz + 9 or 5) × days / 365",
                      "references": [
                        {
                          "title": "§ 288 BGB Verzugszinsen und sonstiger Verzugsschaden",
                          "url": "https://www.gesetze-im-internet.de/bgb/__288.html"
                        },
                        {
                          "title": "§ 247 BGB Basiszinssatz",
                          "url": "https://www.gesetze-im-internet.de/bgb/__247.html"
                        },
                        {
                          "title": "Deutsche Bundesbank, announcement of the Basiszinssatz from 1 July 2026",
                          "url": "https://www.bundesbank.de/de/presse/pressemitteilungen/bekanntgabe-des-basiszinssatzes-zum-1-juli-2026-anpassung-auf-1-52--941386"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "€2,000 owed by a consumer, due 31 January 2026, paid 2 March 2026",
                    "value": {
                      "calculator": "payments/late-interest/germany@1",
                      "result": {
                        "days_late": 30,
                        "margin_percent": "5",
                        "interest": "10.31",
                        "compensation": "0.00",
                        "total_claim": "10.31",
                        "periods": [
                          {
                            "start": "2026-02-01",
                            "end": "2026-03-02",
                            "days": 30,
                            "annual_rate_percent": "6.27",
                            "interest": "10.31"
                          }
                        ]
                      },
                      "exactness": {
                        "interest": "rounded",
                        "compensation": "exact",
                        "total_claim": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "amount": "2000",
                        "due_date": "2026-01-31",
                        "payment_date": "2026-03-02",
                        "debtor": "consumer",
                        "contract_before_29_july_2014": false,
                        "day_count": "actual_365"
                      },
                      "formula": "interest = Σ amount × (Basiszinssatz + 9 or 5) × days / 365",
                      "references": [
                        {
                          "title": "§ 288 BGB Verzugszinsen und sonstiger Verzugsschaden",
                          "url": "https://www.gesetze-im-internet.de/bgb/__288.html"
                        },
                        {
                          "title": "§ 247 BGB Basiszinssatz",
                          "url": "https://www.gesetze-im-internet.de/bgb/__247.html"
                        },
                        {
                          "title": "Deutsche Bundesbank, announcement of the Basiszinssatz from 1 July 2026",
                          "url": "https://www.bundesbank.de/de/presse/pressemitteilungen/bekanntgabe-des-basiszinssatzes-zum-1-juli-2026-anpassung-auf-1-52--941386"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "payments/late-interest/germany@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/payments/late-interest/india-msme": {
      "post": {
        "operationId": "calc_payments_late_interest_india_msme",
        "summary": "MSME delayed payment interest calculator (India)",
        "description": "Interest owed to a micro or small enterprise for late payment under sections 15 and 16 of India's MSMED Act 2006: three times the RBI Bank Rate, compounded monthly.\n\nA buyer must pay a micro or small supplier by the agreed date, which may be at most 45 days after accepting the goods or services, or within 15 days when nothing was agreed. After that, the buyer owes compound interest with monthly rests at three times the Bank Rate notified by the Reserve Bank of India.",
        "tags": [
          "Payments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "description": "The unpaid amount (the invoice or debt). Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10000"
                    ]
                  },
                  "acceptance_date": {
                    "description": "The day the buyer accepted (or is deemed to have accepted) the goods or services.",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-01-10"
                    ]
                  },
                  "agreed_payment_date": {
                    "description": "The payment date agreed in writing, if any.",
                    "type": "string",
                    "format": "date"
                  },
                  "payment_date": {
                    "description": "The day the payment was or will be made (counted as a day of interest).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-06-30"
                    ]
                  },
                  "reference_rate_percent": {
                    "description": "Use this RBI Bank Rate (in percent) for every day instead of the published one, for example for a date not yet covered. Allowed: >= -5 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "amount",
                  "acceptance_date",
                  "payment_date"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "₹1,00,000 accepted 10 January 2026, nothing agreed, paid 30 June 2026",
                  "value": {
                    "amount": "100000",
                    "acceptance_date": "2026-01-10",
                    "payment_date": "2026-06-30"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "payments/late-interest/india-msme@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "due_date": {
                          "description": "The last day to pay without interest.",
                          "type": "string",
                          "format": "date"
                        },
                        "days_late": {
                          "description": "Days of interest.",
                          "type": "integer"
                        },
                        "interest": {
                          "description": "Compound interest owed. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_due": {
                          "description": "Amount plus interest. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "periods": {
                          "description": "Interest for each monthly rest (split where the Bank Rate changes).",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "start": {
                                "description": "First day of interest in this period.",
                                "type": "string",
                                "format": "date"
                              },
                              "end": {
                                "description": "Last day of interest in this period.",
                                "type": "string",
                                "format": "date"
                              },
                              "days": {
                                "description": "Days of interest in this period.",
                                "type": "integer"
                              },
                              "annual_rate_percent": {
                                "description": "Interest rate for the period, in percent a year.",
                                "type": "string"
                              },
                              "interest": {
                                "description": "Interest for the period. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "compounded": {
                                "description": "Interest is added to the balance at the end of this period.",
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "start",
                              "end",
                              "days",
                              "annual_rate_percent",
                              "interest",
                              "compounded"
                            ]
                          }
                        }
                      },
                      "required": [
                        "due_date",
                        "days_late",
                        "interest",
                        "total_due",
                        "periods"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "₹1,00,000 accepted 10 January 2026, nothing agreed, paid 30 June 2026",
                    "value": {
                      "calculator": "payments/late-interest/india-msme@1",
                      "result": {
                        "due_date": "2026-01-25",
                        "days_late": 156,
                        "interest": "7308.68",
                        "total_due": "107308.68",
                        "periods": [
                          {
                            "start": "2026-01-26",
                            "end": "2026-02-25",
                            "days": 31,
                            "annual_rate_percent": "16.5",
                            "interest": "1375.00",
                            "compounded": true
                          },
                          {
                            "start": "2026-02-26",
                            "end": "2026-03-25",
                            "days": 28,
                            "annual_rate_percent": "16.5",
                            "interest": "1393.91",
                            "compounded": true
                          },
                          {
                            "start": "2026-03-26",
                            "end": "2026-04-25",
                            "days": 31,
                            "annual_rate_percent": "16.5",
                            "interest": "1413.07",
                            "compounded": true
                          },
                          {
                            "start": "2026-04-26",
                            "end": "2026-05-25",
                            "days": 30,
                            "annual_rate_percent": "16.5",
                            "interest": "1432.50",
                            "compounded": true
                          },
                          {
                            "start": "2026-05-26",
                            "end": "2026-06-25",
                            "days": 31,
                            "annual_rate_percent": "16.5",
                            "interest": "1452.20",
                            "compounded": true
                          },
                          {
                            "start": "2026-06-26",
                            "end": "2026-06-30",
                            "days": 5,
                            "annual_rate_percent": "16.5",
                            "interest": "242.00",
                            "compounded": false
                          }
                        ]
                      },
                      "exactness": {
                        "interest": "rounded",
                        "total_due": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "amount": "100000",
                        "acceptance_date": "2026-01-10",
                        "payment_date": "2026-06-30"
                      },
                      "formula": "balance × (1 + 3 × Bank Rate / 12) each whole month; balance × 3 × Bank Rate × days / 365 for the last part-month",
                      "references": [
                        {
                          "title": "Micro, Small and Medium Enterprises Development Act 2006, sections 2(b), 15 and 16",
                          "url": "https://www.indiacode.nic.in/handle/123456789/2013"
                        },
                        {
                          "title": "Reserve Bank of India, policy rate archive (Bank Rate = repo rate + 0.25)",
                          "url": "https://website.rbi.org.in/web/rbi/policy-rate-archive"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "payments/late-interest/india-msme@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/payments/late-interest/uk": {
      "post": {
        "operationId": "calc_payments_late_interest_uk",
        "summary": "UK late payment interest calculator (8% over base)",
        "description": "Statutory interest and fixed compensation on a late business invoice under the UK Late Payment of Commercial Debts (Interest) Act 1998.\n\nSimple interest at 8 percentage points over the Bank of England Bank Rate. The rate is fixed for the whole debt: it uses Bank Rate on 31 December for interest that starts between 1 January and 30 June, and on 30 June for interest that starts between 1 July and 31 December. Also returns the fixed sum for recovery costs: £40, £70 or £100 depending on the size of the debt.",
        "tags": [
          "Payments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "description": "The unpaid amount (the invoice or debt). Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10000"
                    ]
                  },
                  "due_date": {
                    "description": "The last day the payment was due (interest starts the day after).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-03-31"
                    ]
                  },
                  "payment_date": {
                    "description": "The day the payment was or will be made (counted as a day of interest).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-06-29"
                    ]
                  },
                  "method": {
                    "description": "exact: amount × rate × days / 365. daily_pence: first round the daily interest to the penny, as the worked example on GOV.UK does. Options: exact: the exact interest, rounded once; daily_pence: daily interest rounded to the penny, then times the days",
                    "type": "string",
                    "enum": [
                      "exact",
                      "daily_pence"
                    ],
                    "default": "exact"
                  },
                  "reference_rate_percent": {
                    "description": "Use this Bank Rate (in percent) for every day instead of the published one, for example for a date not yet covered. Allowed: >= -5 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "amount",
                  "due_date",
                  "payment_date"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "£10,000 invoice due 31 March 2026, paid 29 June 2026",
                  "value": {
                    "amount": "10000",
                    "due_date": "2026-03-31",
                    "payment_date": "2026-06-29"
                  }
                },
                "example2": {
                  "summary": "GOV.UK's worked example: £1,000 for 50 days at 8.5%, daily interest in pence",
                  "value": {
                    "amount": "1000",
                    "due_date": "2026-01-31",
                    "payment_date": "2026-03-22",
                    "reference_rate_percent": "0.5",
                    "method": "daily_pence"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "payments/late-interest/uk@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "days_late": {
                          "description": "Days of interest.",
                          "type": "integer"
                        },
                        "annual_rate_percent": {
                          "description": "Statutory rate: reference rate + 8.",
                          "type": "string"
                        },
                        "reference_rate_percent": {
                          "description": "Bank Rate used.",
                          "type": "string"
                        },
                        "reference_date": {
                          "description": "The day whose Bank Rate was used.",
                          "type": "string",
                          "format": "date"
                        },
                        "daily_interest": {
                          "description": "Interest per day. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "interest": {
                          "description": "Statutory interest. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "compensation": {
                          "description": "Fixed sum for recovery costs (s.5A). Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "total_claim": {
                          "description": "Interest plus the fixed sum. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "periods": {
                          "description": "The interest period.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "start": {
                                "description": "First day of interest in this period.",
                                "type": "string",
                                "format": "date"
                              },
                              "end": {
                                "description": "Last day of interest in this period.",
                                "type": "string",
                                "format": "date"
                              },
                              "days": {
                                "description": "Days of interest in this period.",
                                "type": "integer"
                              },
                              "annual_rate_percent": {
                                "description": "Interest rate for the period, in percent a year.",
                                "type": "string"
                              },
                              "interest": {
                                "description": "Interest for the period. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "start",
                              "end",
                              "days",
                              "annual_rate_percent",
                              "interest"
                            ]
                          }
                        }
                      },
                      "required": [
                        "days_late",
                        "annual_rate_percent",
                        "reference_rate_percent",
                        "reference_date",
                        "daily_interest",
                        "interest",
                        "compensation",
                        "total_claim",
                        "periods"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "£10,000 invoice due 31 March 2026, paid 29 June 2026",
                    "value": {
                      "calculator": "payments/late-interest/uk@1",
                      "result": {
                        "days_late": 90,
                        "annual_rate_percent": "11.75",
                        "reference_rate_percent": "3.75",
                        "reference_date": "2025-12-31",
                        "daily_interest": "3.22",
                        "interest": "289.73",
                        "compensation": "100.00",
                        "total_claim": "389.73",
                        "periods": [
                          {
                            "start": "2026-04-01",
                            "end": "2026-06-29",
                            "days": 90,
                            "annual_rate_percent": "11.75",
                            "interest": "289.73"
                          }
                        ]
                      },
                      "exactness": {
                        "daily_interest": "rounded",
                        "interest": "rounded",
                        "compensation": "exact",
                        "total_claim": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "amount": "10000",
                        "due_date": "2026-03-31",
                        "payment_date": "2026-06-29",
                        "method": "exact"
                      },
                      "formula": "interest = amount × (Bank Rate + 8%) × days / 365",
                      "references": [
                        {
                          "title": "Late Payment of Commercial Debts (Interest) Act 1998, sections 4 and 5A",
                          "url": "https://www.legislation.gov.uk/ukpga/1998/20"
                        },
                        {
                          "title": "The Late Payment of Commercial Debts (Rate of Interest) (No. 3) Order 2002 (SI 2002/1675), article 4",
                          "url": "https://www.legislation.gov.uk/uksi/2002/1675/article/4"
                        },
                        {
                          "title": "GOV.UK: Late commercial payments, charging interest and debt recovery",
                          "url": "https://www.gov.uk/late-commercial-payments-interest-debt-recovery/charging-interest-commercial-debt"
                        },
                        {
                          "title": "Bank of England, Bank Rate history and data",
                          "url": "https://www.bankofengland.co.uk/boeapps/database/Bank-Rate.asp"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "GOV.UK's worked example: £1,000 for 50 days at 8.5%, daily interest in pence",
                    "value": {
                      "calculator": "payments/late-interest/uk@1",
                      "result": {
                        "days_late": 50,
                        "annual_rate_percent": "8.5",
                        "reference_rate_percent": "0.5",
                        "reference_date": "2025-12-31",
                        "daily_interest": "0.23",
                        "interest": "11.50",
                        "compensation": "70.00",
                        "total_claim": "81.50",
                        "periods": [
                          {
                            "start": "2026-02-01",
                            "end": "2026-03-22",
                            "days": 50,
                            "annual_rate_percent": "8.5",
                            "interest": "11.50"
                          }
                        ]
                      },
                      "exactness": {
                        "daily_interest": "exact",
                        "interest": "exact",
                        "compensation": "exact",
                        "total_claim": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "amount": "1000",
                        "due_date": "2026-01-31",
                        "payment_date": "2026-03-22",
                        "method": "daily_pence",
                        "reference_rate_percent": "0.5"
                      },
                      "formula": "interest = amount × (Bank Rate + 8%) × days / 365",
                      "references": [
                        {
                          "title": "Late Payment of Commercial Debts (Interest) Act 1998, sections 4 and 5A",
                          "url": "https://www.legislation.gov.uk/ukpga/1998/20"
                        },
                        {
                          "title": "The Late Payment of Commercial Debts (Rate of Interest) (No. 3) Order 2002 (SI 2002/1675), article 4",
                          "url": "https://www.legislation.gov.uk/uksi/2002/1675/article/4"
                        },
                        {
                          "title": "GOV.UK: Late commercial payments, charging interest and debt recovery",
                          "url": "https://www.gov.uk/late-commercial-payments-interest-debt-recovery/charging-interest-commercial-debt"
                        },
                        {
                          "title": "Bank of England, Bank Rate history and data",
                          "url": "https://www.bankofengland.co.uk/boeapps/database/Bank-Rate.asp"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "payments/late-interest/uk@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/payments/late-interest/us-prompt-payment": {
      "post": {
        "operationId": "calc_payments_late_interest_us_prompt_payment",
        "summary": "Prompt Payment Act interest calculator",
        "description": "The interest penalty a US federal agency owes on a late invoice under the Prompt Payment Act: the Treasury rate, compounded every 30 days on a 360-day year.\n\nUses the Prompt Payment rate in effect on the day after the due date for the whole delay. Unpaid interest is added to the principal at the end of each 30-day period, the leftover days earn simple interest on a 360-day year, and interest stops after one year. This is the Treasury formula P(1 + r/12)ⁿ(1 + r·d/360) − P.",
        "tags": [
          "Payments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "description": "The unpaid amount (the invoice or debt). Allowed: > 0 and <= 1000000000000000. Unit: currency.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "10000"
                    ]
                  },
                  "due_date": {
                    "description": "The last day the payment was due (interest starts the day after).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-03-31"
                    ]
                  },
                  "payment_date": {
                    "description": "The day the payment was or will be made (counted as a day of interest).",
                    "type": "string",
                    "format": "date",
                    "examples": [
                      "2026-06-29"
                    ]
                  },
                  "reference_rate_percent": {
                    "description": "Use this Prompt Payment rate (in percent) for every day instead of the published one, for example for a date not yet covered. Allowed: >= -5 and <= 100. Unit: percent.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, decimals=2)."
                  }
                },
                "required": [
                  "amount",
                  "due_date",
                  "payment_date"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Treasury's worked example: $1,500 due April 1, paid June 15, at 6%",
                  "value": {
                    "amount": "1500",
                    "due_date": "2026-04-01",
                    "payment_date": "2026-06-15",
                    "reference_rate_percent": "6"
                  }
                },
                "example2": {
                  "summary": "$25,000 due 30 June 2026, paid 15 September 2026",
                  "value": {
                    "amount": "25000",
                    "due_date": "2026-06-30",
                    "payment_date": "2026-09-15"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "payments/late-interest/us-prompt-payment@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "days_late": {
                          "description": "Days of interest.",
                          "type": "integer"
                        },
                        "annual_rate_percent": {
                          "description": "Prompt Payment rate used.",
                          "type": "string"
                        },
                        "periods_compounded": {
                          "description": "Whole 30-day periods (n).",
                          "type": "integer"
                        },
                        "interest": {
                          "description": "Interest penalty. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "periods": {
                          "description": "The interest period.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "start": {
                                "description": "First day of interest in this period.",
                                "type": "string",
                                "format": "date"
                              },
                              "end": {
                                "description": "Last day of interest in this period.",
                                "type": "string",
                                "format": "date"
                              },
                              "days": {
                                "description": "Days of interest in this period.",
                                "type": "integer"
                              },
                              "annual_rate_percent": {
                                "description": "Interest rate for the period, in percent a year.",
                                "type": "string"
                              },
                              "interest": {
                                "description": "Interest for the period. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "start",
                              "end",
                              "days",
                              "annual_rate_percent",
                              "interest"
                            ]
                          }
                        }
                      },
                      "required": [
                        "days_late",
                        "annual_rate_percent",
                        "periods_compounded",
                        "interest",
                        "periods"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Treasury's worked example: $1,500 due April 1, paid June 15, at 6%",
                    "value": {
                      "calculator": "payments/late-interest/us-prompt-payment@1",
                      "result": {
                        "days_late": 75,
                        "annual_rate_percent": "6",
                        "periods_compounded": 2,
                        "interest": "18.83",
                        "periods": [
                          {
                            "start": "2026-04-02",
                            "end": "2026-06-15",
                            "days": 75,
                            "annual_rate_percent": "6",
                            "interest": "18.83"
                          }
                        ]
                      },
                      "exactness": {
                        "interest": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "amount": "1500",
                        "due_date": "2026-04-01",
                        "payment_date": "2026-06-15",
                        "reference_rate_percent": "6"
                      },
                      "formula": "P(1 + r/12)ⁿ × (1 + r × d/360) − P, n = days ÷ 30, d = the remainder",
                      "references": [
                        {
                          "title": "5 CFR 1315.10, late payment interest penalties",
                          "url": "https://www.ecfr.gov/current/title-5/chapter-III/subchapter-B/part-1315/section-1315.10"
                        },
                        {
                          "title": "Bureau of the Fiscal Service, Prompt Payment monthly interest calculation and worked example",
                          "url": "https://fiscal.treasury.gov/payments-from-government/prompt-payment/monthly-interest"
                        },
                        {
                          "title": "Bureau of the Fiscal Service, Prompt Payment interest rates",
                          "url": "https://fiscal.treasury.gov/payments-from-government/prompt-payment/rates"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "$25,000 due 30 June 2026, paid 15 September 2026",
                    "value": {
                      "calculator": "payments/late-interest/us-prompt-payment@1",
                      "result": {
                        "days_late": 77,
                        "annual_rate_percent": "4.75",
                        "periods_compounded": 2,
                        "interest": "254.83",
                        "periods": [
                          {
                            "start": "2026-07-01",
                            "end": "2026-09-15",
                            "days": 77,
                            "annual_rate_percent": "4.75",
                            "interest": "254.83"
                          }
                        ]
                      },
                      "exactness": {
                        "interest": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "decimals": 2
                      },
                      "inputs": {
                        "amount": "25000",
                        "due_date": "2026-06-30",
                        "payment_date": "2026-09-15"
                      },
                      "formula": "P(1 + r/12)ⁿ × (1 + r × d/360) − P, n = days ÷ 30, d = the remainder",
                      "references": [
                        {
                          "title": "5 CFR 1315.10, late payment interest penalties",
                          "url": "https://www.ecfr.gov/current/title-5/chapter-III/subchapter-B/part-1315/section-1315.10"
                        },
                        {
                          "title": "Bureau of the Fiscal Service, Prompt Payment monthly interest calculation and worked example",
                          "url": "https://fiscal.treasury.gov/payments-from-government/prompt-payment/monthly-interest"
                        },
                        {
                          "title": "Bureau of the Fiscal Service, Prompt Payment interest rates",
                          "url": "https://fiscal.treasury.gov/payments-from-government/prompt-payment/rates"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "payments/late-interest/us-prompt-payment@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/tax/vat": {
      "post": {
        "operationId": "calc_tax_vat",
        "summary": "VAT and GST calculator",
        "description": "VAT or GST on one amount or a whole invoice, added or taken out of tax-inclusive prices, with the per-rate rounding EN 16931 e-invoices require.\n\nWorks out net, tax and gross for one amount or for every line of an invoice. Give amounts without tax to add it, or set amounts_include_tax to take the tax out of prices that already include it. Lines can have different rates. By default the tax is worked out once for each rate on the sum of that rate's lines and rounded to the cent, which is how the European e-invoice standard EN 16931 (and so XRechnung, Peppol and Factur-X) defines the VAT breakdown. The other choice rounds the tax on each line and adds those up, as a till receipt does; the two can differ by a few cents on a long invoice. The rate can be given, or looked up as a country's standard rate, in which case the answer names the official page it came from.",
        "tags": [
          "Tax"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amounts": {
                    "description": "The amount of each line: one item for a single price. Without tax, or with tax when amounts_include_tax is true. Negative amounts are credits. 1 to 1000 items. Each item: >= -1000000000000000 and <= 1000000000000000. Unit: currency.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 1,
                    "maxItems": 1000,
                    "examples": [
                      [
                        "4000",
                        "900",
                        "2000"
                      ]
                    ]
                  },
                  "rate_percent": {
                    "description": "One tax rate for every line, in percent (20 for 20%). Allowed: >= 0 and <= 100. Unit: %.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                  },
                  "rates_percent": {
                    "description": "The tax rate of each line in percent, one per amount and in the same order. Up to 1000 items. Each item: >= 0 and <= 100. Unit: %.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$"
                    },
                    "minItems": 0,
                    "maxItems": 1000,
                    "examples": [
                      [
                        "25",
                        "25",
                        "0"
                      ]
                    ]
                  },
                  "country": {
                    "description": "Use this country's standard rate for every line (see tax/vat-rates for the table). Reduced rates depend on what is sold, so give those as rate_percent. Options: AT: Austria: VAT 20%; BE: Belgium: VAT 21%; BG: Bulgaria: VAT 20%; CY: Cyprus: VAT 19%; CZ: Czechia: VAT 21%; DE: Germany: VAT 19%; DK: Denmark: VAT 25%; EE: Estonia: VAT 24%; EL: Greece: VAT 24%; ES: Spain: VAT 21%; FI: Finland: VAT 25.5%; FR: France: VAT 20%; HR: Croatia: VAT 25%; HU: Hungary: VAT 27%; IE: Ireland: VAT 23%; IT: Italy: VAT 22%; LT: Lithuania: VAT 21%; LU: Luxembourg: VAT 17%; LV: Latvia: VAT 21%; MT: Malta: VAT 18%; NL: Netherlands: VAT 21%; PL: Poland: VAT 23%; PT: Portugal: VAT 23%; RO: Romania: VAT 21%; SE: Sweden: VAT 25%; SI: Slovenia: VAT 22%; SK: Slovakia: VAT 23%; GB: United Kingdom: VAT 20%; CH: Switzerland: VAT (MWST) 8.1%; NO: Norway: VAT (MVA) 25%; AU: Australia: GST 10%; NZ: New Zealand: GST 15%; SG: Singapore: GST 9%; IN: India: GST 18%; CA: Canada (GST only): GST 5%; CA-NB: Canada: New Brunswick: HST 15%; CA-NL: Canada: Newfoundland and Labrador: HST 15%; CA-NS: Canada: Nova Scotia: HST 14%; CA-ON: Canada: Ontario: HST 13%; CA-PE: Canada: Prince Edward Island: HST 15%; GR: the same as EL; UK: the same as GB",
                    "type": "string",
                    "enum": [
                      "AT",
                      "BE",
                      "BG",
                      "CY",
                      "CZ",
                      "DE",
                      "DK",
                      "EE",
                      "EL",
                      "ES",
                      "FI",
                      "FR",
                      "HR",
                      "HU",
                      "IE",
                      "IT",
                      "LT",
                      "LU",
                      "LV",
                      "MT",
                      "NL",
                      "PL",
                      "PT",
                      "RO",
                      "SE",
                      "SI",
                      "SK",
                      "GB",
                      "CH",
                      "NO",
                      "AU",
                      "NZ",
                      "SG",
                      "IN",
                      "CA",
                      "CA-NB",
                      "CA-NL",
                      "CA-NS",
                      "CA-ON",
                      "CA-PE",
                      "GR",
                      "UK"
                    ]
                  },
                  "amounts_include_tax": {
                    "description": "true when the amounts already include the tax, to take it out.",
                    "type": "boolean",
                    "default": false
                  },
                  "rounding": {
                    "description": "Where the tax is rounded. Options: per_rate: once for each rate, on the sum of that rate's lines (EN 16931, the usual rule for invoices); per_line: on each line, then added up (till receipts, and invoices that print tax per line)",
                    "type": "string",
                    "enum": [
                      "per_rate",
                      "per_line"
                    ],
                    "default": "per_rate"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_up."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10,
                        "description": "Round results to this many digits after the decimal point."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_up, decimals=2)."
                  }
                },
                "required": [
                  "amounts"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "An invoice with two rates (the Peppol example's lines)",
                  "value": {
                    "amounts": [
                      "4000",
                      "900",
                      "100",
                      "2000"
                    ],
                    "rates_percent": [
                      "25",
                      "25",
                      "25",
                      "0"
                    ]
                  }
                },
                "example2": {
                  "summary": "Take 20% VAT out of a price of 180",
                  "value": {
                    "amounts": [
                      "180"
                    ],
                    "rate_percent": "20",
                    "amounts_include_tax": true
                  }
                },
                "example3": {
                  "summary": "Three lines of 0.99 at 19%, rounded on each line",
                  "value": {
                    "amounts": [
                      "0.99",
                      "0.99",
                      "0.99"
                    ],
                    "rate_percent": "19",
                    "rounding": "per_line"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "tax/vat@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "net_total": {
                          "description": "Total without tax. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "tax_total": {
                          "description": "Total tax: the sum of the tax of each rate. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "gross_total": {
                          "description": "Total with tax: net_total + tax_total. Unit: currency.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "breakdown": {
                          "description": "One row per tax rate, highest rate first.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "rate_percent": {
                                "description": "The tax rate, as given. Unit: %.",
                                "type": "string"
                              },
                              "net": {
                                "description": "Amount without tax. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "tax": {
                                "description": "The tax. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "gross": {
                                "description": "Amount with tax: net + tax. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "rate_percent",
                              "net",
                              "tax",
                              "gross"
                            ]
                          }
                        },
                        "lines": {
                          "description": "One row per line, when rounding is per_line.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "line": {
                                "description": "Line number, starting at 1.",
                                "type": "integer"
                              },
                              "rate_percent": {
                                "description": "The tax rate, as given. Unit: %.",
                                "type": "string"
                              },
                              "net": {
                                "description": "Amount without tax. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "tax": {
                                "description": "The tax. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              },
                              "gross": {
                                "description": "Amount with tax: net + tax. Unit: currency.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "line",
                              "rate_percent",
                              "net",
                              "tax",
                              "gross"
                            ]
                          }
                        },
                        "rate_source": {
                          "description": "Where the rate comes from, when country was given.",
                          "type": "string"
                        },
                        "rate_source_url": {
                          "description": "The source's address.",
                          "type": "string"
                        },
                        "rate_checked_on": {
                          "description": "The day the rate was last compared with that source.",
                          "type": "string",
                          "format": "date"
                        }
                      },
                      "required": [
                        "net_total",
                        "tax_total",
                        "gross_total",
                        "breakdown"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "An invoice with two rates (the Peppol example's lines)",
                    "value": {
                      "calculator": "tax/vat@1",
                      "result": {
                        "net_total": "7000.00",
                        "tax_total": "1250.00",
                        "gross_total": "8250.00",
                        "breakdown": [
                          {
                            "rate_percent": "25",
                            "net": "5000.00",
                            "tax": "1250.00",
                            "gross": "6250.00"
                          },
                          {
                            "rate_percent": "0",
                            "net": "2000.00",
                            "tax": "0.00",
                            "gross": "2000.00"
                          }
                        ]
                      },
                      "exactness": {
                        "net_total": "exact",
                        "tax_total": "exact",
                        "gross_total": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "amounts": [
                          "4000",
                          "900",
                          "100",
                          "2000"
                        ],
                        "rates_percent": [
                          "25",
                          "25",
                          "25",
                          "0"
                        ],
                        "amounts_include_tax": false,
                        "rounding": "per_rate"
                      },
                      "formula": "tax = round(net × rate / 100); from a price with tax: net = round(gross / (1 + rate / 100)), tax = gross − net; per_rate applies this to each rate's sum of lines, per_line to each line",
                      "references": [
                        {
                          "title": "Peppol BIS Billing 3.0 (EN 16931): calculation of VAT, BT-116 and BT-117",
                          "url": "https://docs.peppol.eu/poacc/billing/3.0/bis/#_calculation_of_vat"
                        },
                        {
                          "title": "GOV.UK: VAT rates, working out VAT-inclusive and VAT-exclusive prices",
                          "url": "https://www.gov.uk/vat-businesses/vat-rates"
                        },
                        {
                          "title": "Australian Taxation Office: GST is one eleventh of the price",
                          "url": "https://www.ato.gov.au/other-languages/information-in-other-languages/gst/goods-and-services-tax-gst-when-you-sell-to-australia"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Take 20% VAT out of a price of 180",
                    "value": {
                      "calculator": "tax/vat@1",
                      "result": {
                        "net_total": "150.00",
                        "tax_total": "30.00",
                        "gross_total": "180.00",
                        "breakdown": [
                          {
                            "rate_percent": "20",
                            "net": "150.00",
                            "tax": "30.00",
                            "gross": "180.00"
                          }
                        ]
                      },
                      "exactness": {
                        "net_total": "exact",
                        "tax_total": "exact",
                        "gross_total": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "amounts": [
                          "180"
                        ],
                        "rate_percent": "20",
                        "amounts_include_tax": true,
                        "rounding": "per_rate"
                      },
                      "formula": "tax = round(net × rate / 100); from a price with tax: net = round(gross / (1 + rate / 100)), tax = gross − net; per_rate applies this to each rate's sum of lines, per_line to each line",
                      "references": [
                        {
                          "title": "Peppol BIS Billing 3.0 (EN 16931): calculation of VAT, BT-116 and BT-117",
                          "url": "https://docs.peppol.eu/poacc/billing/3.0/bis/#_calculation_of_vat"
                        },
                        {
                          "title": "GOV.UK: VAT rates, working out VAT-inclusive and VAT-exclusive prices",
                          "url": "https://www.gov.uk/vat-businesses/vat-rates"
                        },
                        {
                          "title": "Australian Taxation Office: GST is one eleventh of the price",
                          "url": "https://www.ato.gov.au/other-languages/information-in-other-languages/gst/goods-and-services-tax-gst-when-you-sell-to-australia"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "Three lines of 0.99 at 19%, rounded on each line",
                    "value": {
                      "calculator": "tax/vat@1",
                      "result": {
                        "net_total": "2.97",
                        "tax_total": "0.57",
                        "gross_total": "3.54",
                        "breakdown": [
                          {
                            "rate_percent": "19",
                            "net": "2.97",
                            "tax": "0.57",
                            "gross": "3.54"
                          }
                        ],
                        "lines": [
                          {
                            "line": 1,
                            "rate_percent": "19",
                            "net": "0.99",
                            "tax": "0.19",
                            "gross": "1.18"
                          },
                          {
                            "line": 2,
                            "rate_percent": "19",
                            "net": "0.99",
                            "tax": "0.19",
                            "gross": "1.18"
                          },
                          {
                            "line": 3,
                            "rate_percent": "19",
                            "net": "0.99",
                            "tax": "0.19",
                            "gross": "1.18"
                          }
                        ]
                      },
                      "exactness": {
                        "net_total": "exact",
                        "tax_total": "exact",
                        "gross_total": "exact"
                      },
                      "precision": {
                        "rounding": "half_up",
                        "decimals": 2
                      },
                      "inputs": {
                        "amounts": [
                          "0.99",
                          "0.99",
                          "0.99"
                        ],
                        "rate_percent": "19",
                        "amounts_include_tax": false,
                        "rounding": "per_line"
                      },
                      "formula": "tax = round(net × rate / 100); from a price with tax: net = round(gross / (1 + rate / 100)), tax = gross − net; per_rate applies this to each rate's sum of lines, per_line to each line",
                      "references": [
                        {
                          "title": "Peppol BIS Billing 3.0 (EN 16931): calculation of VAT, BT-116 and BT-117",
                          "url": "https://docs.peppol.eu/poacc/billing/3.0/bis/#_calculation_of_vat"
                        },
                        {
                          "title": "GOV.UK: VAT rates, working out VAT-inclusive and VAT-exclusive prices",
                          "url": "https://www.gov.uk/vat-businesses/vat-rates"
                        },
                        {
                          "title": "Australian Taxation Office: GST is one eleventh of the price",
                          "url": "https://www.ato.gov.au/other-languages/information-in-other-languages/gst/goods-and-services-tax-gst-when-you-sell-to-australia"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "tax/vat@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/tax/vat-rates": {
      "post": {
        "operationId": "calc_tax_vat_rates",
        "summary": "VAT and GST rates by country",
        "description": "The standard and reduced VAT or GST rates of a country, with the official page they were read from and the day they were last checked.\n\nThe VAT or GST rates of 40 countries and provinces: the 27 EU member states from the European Commission's table, and the United Kingdom, Switzerland, Norway, Australia, New Zealand, Singapore, India and Canada (the federal GST and each province's HST) from the tax authority's own page. Every answer names its source and the day the rate was last compared with it, so you can see how fresh it is. Zero rates, exemptions and regional rates are not listed.",
        "tags": [
          "Tax"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "country": {
                    "description": "The country: its two-letter code (EL or GR for Greece, GB or UK for the United Kingdom), or CA- and the province for a Canadian province with HST. Options: AT: Austria: VAT 20%; BE: Belgium: VAT 21%; BG: Bulgaria: VAT 20%; CY: Cyprus: VAT 19%; CZ: Czechia: VAT 21%; DE: Germany: VAT 19%; DK: Denmark: VAT 25%; EE: Estonia: VAT 24%; EL: Greece: VAT 24%; ES: Spain: VAT 21%; FI: Finland: VAT 25.5%; FR: France: VAT 20%; HR: Croatia: VAT 25%; HU: Hungary: VAT 27%; IE: Ireland: VAT 23%; IT: Italy: VAT 22%; LT: Lithuania: VAT 21%; LU: Luxembourg: VAT 17%; LV: Latvia: VAT 21%; MT: Malta: VAT 18%; NL: Netherlands: VAT 21%; PL: Poland: VAT 23%; PT: Portugal: VAT 23%; RO: Romania: VAT 21%; SE: Sweden: VAT 25%; SI: Slovenia: VAT 22%; SK: Slovakia: VAT 23%; GB: United Kingdom: VAT 20%; CH: Switzerland: VAT (MWST) 8.1%; NO: Norway: VAT (MVA) 25%; AU: Australia: GST 10%; NZ: New Zealand: GST 15%; SG: Singapore: GST 9%; IN: India: GST 18%; CA: Canada (GST only): GST 5%; CA-NB: Canada: New Brunswick: HST 15%; CA-NL: Canada: Newfoundland and Labrador: HST 15%; CA-NS: Canada: Nova Scotia: HST 14%; CA-ON: Canada: Ontario: HST 13%; CA-PE: Canada: Prince Edward Island: HST 15%; GR: the same as EL; UK: the same as GB",
                    "type": "string",
                    "enum": [
                      "AT",
                      "BE",
                      "BG",
                      "CY",
                      "CZ",
                      "DE",
                      "DK",
                      "EE",
                      "EL",
                      "ES",
                      "FI",
                      "FR",
                      "HR",
                      "HU",
                      "IE",
                      "IT",
                      "LT",
                      "LU",
                      "LV",
                      "MT",
                      "NL",
                      "PL",
                      "PT",
                      "RO",
                      "SE",
                      "SI",
                      "SK",
                      "GB",
                      "CH",
                      "NO",
                      "AU",
                      "NZ",
                      "SG",
                      "IN",
                      "CA",
                      "CA-NB",
                      "CA-NL",
                      "CA-NS",
                      "CA-ON",
                      "CA-PE",
                      "GR",
                      "UK"
                    ],
                    "examples": [
                      "DE"
                    ]
                  }
                },
                "required": [
                  "country"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Germany",
                  "value": {
                    "country": "DE"
                  }
                },
                "example2": {
                  "summary": "Ontario's harmonized sales tax",
                  "value": {
                    "country": "CA-ON"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "tax/vat-rates@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "country": {
                          "description": "The code the rates are listed under.",
                          "type": "string"
                        },
                        "name": {
                          "description": "The country's name.",
                          "type": "string"
                        },
                        "tax": {
                          "description": "What the tax is called there.",
                          "type": "string"
                        },
                        "standard_rate_percent": {
                          "description": "The standard rate. Unit: %.",
                          "type": "string"
                        },
                        "other_rates_percent": {
                          "description": "The other rates above zero, lowest first: reduced and super-reduced rates, and for India the 40% rate. Unit: %.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "source": {
                          "description": "The official page the rates were read from.",
                          "type": "string"
                        },
                        "source_url": {
                          "description": "Its address.",
                          "type": "string"
                        },
                        "checked_on": {
                          "description": "The day the rates were last compared with the source.",
                          "type": "string",
                          "format": "date"
                        }
                      },
                      "required": [
                        "country",
                        "name",
                        "tax",
                        "standard_rate_percent",
                        "other_rates_percent",
                        "source",
                        "source_url",
                        "checked_on"
                      ]
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Germany",
                    "value": {
                      "calculator": "tax/vat-rates@1",
                      "result": {
                        "country": "DE",
                        "name": "Germany",
                        "tax": "VAT",
                        "standard_rate_percent": "19",
                        "other_rates_percent": [
                          "7"
                        ],
                        "source": "European Commission, Your Europe: VAT rules and rates (table of 13 July 2026)",
                        "source_url": "https://europa.eu/youreurope/business/finance-and-tax/vat/vat-rules-rates/index_en.htm",
                        "checked_on": "2026-11-12"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "country": "DE"
                      },
                      "formula": "a table lookup; nothing is calculated",
                      "references": [
                        {
                          "title": "European Commission, Your Europe: VAT rules and rates (table of 13 July 2026)",
                          "url": "https://europa.eu/youreurope/business/finance-and-tax/vat/vat-rules-rates/index_en.htm"
                        },
                        {
                          "title": "GOV.UK: VAT rates",
                          "url": "https://www.gov.uk/vat-rates"
                        },
                        {
                          "title": "Canada Revenue Agency: GST/HST calculator (and rates)",
                          "url": "https://www.canada.ca/en/revenue-agency/services/tax/businesses/topics/gst-hst-businesses/charge-collect-which-rate/calculator.html"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Ontario's harmonized sales tax",
                    "value": {
                      "calculator": "tax/vat-rates@1",
                      "result": {
                        "country": "CA-ON",
                        "name": "Canada: Ontario",
                        "tax": "HST",
                        "standard_rate_percent": "13",
                        "other_rates_percent": [],
                        "source": "Canada Revenue Agency: GST/HST calculator (and rates)",
                        "source_url": "https://www.canada.ca/en/revenue-agency/services/tax/businesses/topics/gst-hst-businesses/charge-collect-which-rate/calculator.html",
                        "checked_on": "2026-11-12"
                      },
                      "exactness": {},
                      "precision": null,
                      "inputs": {
                        "country": "CA-ON"
                      },
                      "formula": "a table lookup; nothing is calculated",
                      "references": [
                        {
                          "title": "European Commission, Your Europe: VAT rules and rates (table of 13 July 2026)",
                          "url": "https://europa.eu/youreurope/business/finance-and-tax/vat/vat-rules-rates/index_en.htm"
                        },
                        {
                          "title": "GOV.UK: VAT rates",
                          "url": "https://www.gov.uk/vat-rates"
                        },
                        {
                          "title": "Canada Revenue Agency: GST/HST calculator (and rates)",
                          "url": "https://www.canada.ca/en/revenue-agency/services/tax/businesses/topics/gst-hst-businesses/charge-collect-which-rate/calculator.html"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "tax/vat-rates@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/units/data-size": {
      "post": {
        "operationId": "calc_units_data_size",
        "summary": "Data size converter",
        "description": "Convert between bits, bytes and their decimal (kB, MB) and binary (KiB, MiB) multiples.\n\nConvert between bits, bytes and their decimal (kB, MB) and binary (KiB, MiB) multiples. Conversion factors are exact values from the official unit definitions, so the result is exact before the single final rounding. Leave out to_unit to get the value in every supported unit.",
        "tags": [
          "Units"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "description": "The amount to convert. Allowed: >= 0.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "1"
                    ]
                  },
                  "from_unit": {
                    "description": "Unit of the value. Options: bit: bit; B: byte; kB: kilobyte; MB: megabyte; GB: gigabyte; TB: terabyte; PB: petabyte; EB: exabyte; ZB: zettabyte; KiB: kibibyte; MiB: mebibyte; GiB: gibibyte; TiB: tebibyte; PiB: pebibyte; EiB: exbibyte; ZiB: zebibyte; kbit: kilobit; Mbit: megabit; Gbit: gigabit; Tbit: terabit; Kibit: kibibit; Mibit: mebibit; Gibit: gibibit",
                    "type": "string",
                    "enum": [
                      "bit",
                      "B",
                      "kB",
                      "MB",
                      "GB",
                      "TB",
                      "PB",
                      "EB",
                      "ZB",
                      "KiB",
                      "MiB",
                      "GiB",
                      "TiB",
                      "PiB",
                      "EiB",
                      "ZiB",
                      "kbit",
                      "Mbit",
                      "Gbit",
                      "Tbit",
                      "Kibit",
                      "Mibit",
                      "Gibit"
                    ],
                    "examples": [
                      "bit"
                    ]
                  },
                  "to_unit": {
                    "description": "Unit to convert to. Omit to convert to every unit. Options: bit: bit; B: byte; kB: kilobyte; MB: megabyte; GB: gigabyte; TB: terabyte; PB: petabyte; EB: exabyte; ZB: zettabyte; KiB: kibibyte; MiB: mebibyte; GiB: gibibyte; TiB: tebibyte; PiB: pebibyte; EiB: exbibyte; ZiB: zebibyte; kbit: kilobit; Mbit: megabit; Gbit: gigabit; Tbit: terabit; Kibit: kibibit; Mibit: mebibit; Gibit: gibibit",
                    "type": "string",
                    "enum": [
                      "bit",
                      "B",
                      "kB",
                      "MB",
                      "GB",
                      "TB",
                      "PB",
                      "EB",
                      "ZB",
                      "KiB",
                      "MiB",
                      "GiB",
                      "TiB",
                      "PiB",
                      "EiB",
                      "ZiB",
                      "kbit",
                      "Mbit",
                      "Gbit",
                      "Tbit",
                      "Kibit",
                      "Mibit",
                      "Gibit"
                    ],
                    "examples": [
                      "B"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "value",
                  "from_unit"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "A '1 TB' drive in GiB",
                  "value": {
                    "value": "1",
                    "from_unit": "TB",
                    "to_unit": "GiB"
                  }
                },
                "example2": {
                  "summary": "One GiB in bytes",
                  "value": {
                    "value": "1",
                    "from_unit": "GiB",
                    "to_unit": "B"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "units/data-size@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "description": "The converted value.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "factor": {
                          "description": "How many to_unit make one from_unit (multiply by this to convert).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "all_units": {
                          "description": "The value expressed in every supported unit.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "unit": {
                                "description": "Unit code.",
                                "type": "string"
                              },
                              "name": {
                                "description": "Unit name.",
                                "type": "string"
                              },
                              "value": {
                                "description": "The value in this unit.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "unit",
                              "name",
                              "value"
                            ]
                          }
                        }
                      },
                      "required": []
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "A '1 TB' drive in GiB",
                    "value": {
                      "calculator": "units/data-size@1",
                      "result": {
                        "result": "931.322574615479",
                        "factor": "931.322574615479"
                      },
                      "exactness": {
                        "result": "rounded",
                        "factor": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "1",
                        "from_unit": "TB",
                        "to_unit": "GiB"
                      },
                      "formula": "result = value × factor(from_unit) ÷ factor(to_unit), factors in bits",
                      "references": [
                        {
                          "title": "NIST: Prefixes for binary multiples (IEC kibi, mebi, gibi, ...)",
                          "url": "https://physics.nist.gov/cuu/Units/binary.html"
                        },
                        {
                          "title": "BIPM SI Brochure, 9th edition: SI prefixes",
                          "url": "https://www.bipm.org/en/publications/si-brochure"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "One GiB in bytes",
                    "value": {
                      "calculator": "units/data-size@1",
                      "result": {
                        "result": "1073741824",
                        "factor": "1073741824"
                      },
                      "exactness": {
                        "result": "exact",
                        "factor": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "1",
                        "from_unit": "GiB",
                        "to_unit": "B"
                      },
                      "formula": "result = value × factor(from_unit) ÷ factor(to_unit), factors in bits",
                      "references": [
                        {
                          "title": "NIST: Prefixes for binary multiples (IEC kibi, mebi, gibi, ...)",
                          "url": "https://physics.nist.gov/cuu/Units/binary.html"
                        },
                        {
                          "title": "BIPM SI Brochure, 9th edition: SI prefixes",
                          "url": "https://www.bipm.org/en/publications/si-brochure"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "units/data-size@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/units/length": {
      "post": {
        "operationId": "calc_units_length",
        "summary": "Length converter",
        "description": "Convert between metric, imperial/US, nautical and astronomical lengths.\n\nConvert between metric, imperial/US, nautical and astronomical lengths. Conversion factors are exact values from the official unit definitions, so the result is exact before the single final rounding. Leave out to_unit to get the value in every supported unit.",
        "tags": [
          "Units"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "description": "The amount to convert.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "1"
                    ]
                  },
                  "from_unit": {
                    "description": "Unit of the value. Options: m: metre; km: kilometre; cm: centimetre; mm: millimetre; um: micrometre; nm: nanometre; in: inch; ft: foot; yd: yard; mi: mile; nmi: nautical mile; mil: mil (thou); fathom: fathom; chain: chain; furlong: furlong; ft_us: US survey foot; au: astronomical unit; ly: light-year; pc: parsec",
                    "type": "string",
                    "enum": [
                      "m",
                      "km",
                      "cm",
                      "mm",
                      "um",
                      "nm",
                      "in",
                      "ft",
                      "yd",
                      "mi",
                      "nmi",
                      "mil",
                      "fathom",
                      "chain",
                      "furlong",
                      "ft_us",
                      "au",
                      "ly",
                      "pc"
                    ],
                    "examples": [
                      "m"
                    ]
                  },
                  "to_unit": {
                    "description": "Unit to convert to. Omit to convert to every unit. Options: m: metre; km: kilometre; cm: centimetre; mm: millimetre; um: micrometre; nm: nanometre; in: inch; ft: foot; yd: yard; mi: mile; nmi: nautical mile; mil: mil (thou); fathom: fathom; chain: chain; furlong: furlong; ft_us: US survey foot; au: astronomical unit; ly: light-year; pc: parsec",
                    "type": "string",
                    "enum": [
                      "m",
                      "km",
                      "cm",
                      "mm",
                      "um",
                      "nm",
                      "in",
                      "ft",
                      "yd",
                      "mi",
                      "nmi",
                      "mil",
                      "fathom",
                      "chain",
                      "furlong",
                      "ft_us",
                      "au",
                      "ly",
                      "pc"
                    ],
                    "examples": [
                      "km"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "value",
                  "from_unit"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "One mile in kilometres",
                  "value": {
                    "value": "1",
                    "from_unit": "mi",
                    "to_unit": "km"
                  }
                },
                "example2": {
                  "summary": "Six feet in metres",
                  "value": {
                    "value": "6",
                    "from_unit": "ft",
                    "to_unit": "m"
                  }
                },
                "example3": {
                  "summary": "One parsec in light-years",
                  "value": {
                    "value": "1",
                    "from_unit": "pc",
                    "to_unit": "ly"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "units/length@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "description": "The converted value.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "factor": {
                          "description": "How many to_unit make one from_unit (multiply by this to convert).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "all_units": {
                          "description": "The value expressed in every supported unit.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "unit": {
                                "description": "Unit code.",
                                "type": "string"
                              },
                              "name": {
                                "description": "Unit name.",
                                "type": "string"
                              },
                              "value": {
                                "description": "The value in this unit.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "unit",
                              "name",
                              "value"
                            ]
                          }
                        }
                      },
                      "required": []
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "One mile in kilometres",
                    "value": {
                      "calculator": "units/length@1",
                      "result": {
                        "result": "1.609344",
                        "factor": "1.609344"
                      },
                      "exactness": {
                        "result": "exact",
                        "factor": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "1",
                        "from_unit": "mi",
                        "to_unit": "km"
                      },
                      "formula": "result = value × factor(from_unit) ÷ factor(to_unit), factors in m",
                      "references": [
                        {
                          "title": "NIST Special Publication 811 (2008), Appendix B: conversion factors",
                          "url": "https://www.nist.gov/pml/special-publication-811"
                        },
                        {
                          "title": "IAU 2012 Resolution B2 (astronomical unit)",
                          "url": "https://iauarchive.eso.org/static/resolutions/IAU2012_English.pdf"
                        },
                        {
                          "title": "IAU 2015 Resolution B2 (parsec)",
                          "url": "https://www.iau.org/static/resolutions/IAU2015_English.pdf"
                        },
                        {
                          "title": "NIST: The U.S. survey foot (deprecation notice)",
                          "url": "https://www.nist.gov/pml/us-surveyfoot"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Six feet in metres",
                    "value": {
                      "calculator": "units/length@1",
                      "result": {
                        "result": "1.8288",
                        "factor": "0.3048"
                      },
                      "exactness": {
                        "result": "exact",
                        "factor": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "6",
                        "from_unit": "ft",
                        "to_unit": "m"
                      },
                      "formula": "result = value × factor(from_unit) ÷ factor(to_unit), factors in m",
                      "references": [
                        {
                          "title": "NIST Special Publication 811 (2008), Appendix B: conversion factors",
                          "url": "https://www.nist.gov/pml/special-publication-811"
                        },
                        {
                          "title": "IAU 2012 Resolution B2 (astronomical unit)",
                          "url": "https://iauarchive.eso.org/static/resolutions/IAU2012_English.pdf"
                        },
                        {
                          "title": "IAU 2015 Resolution B2 (parsec)",
                          "url": "https://www.iau.org/static/resolutions/IAU2015_English.pdf"
                        },
                        {
                          "title": "NIST: The U.S. survey foot (deprecation notice)",
                          "url": "https://www.nist.gov/pml/us-surveyfoot"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "One parsec in light-years",
                    "value": {
                      "calculator": "units/length@1",
                      "result": {
                        "result": "3.26156377716743",
                        "factor": "3.26156377716743"
                      },
                      "exactness": {
                        "result": "rounded",
                        "factor": "rounded"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "1",
                        "from_unit": "pc",
                        "to_unit": "ly"
                      },
                      "formula": "result = value × factor(from_unit) ÷ factor(to_unit), factors in m",
                      "references": [
                        {
                          "title": "NIST Special Publication 811 (2008), Appendix B: conversion factors",
                          "url": "https://www.nist.gov/pml/special-publication-811"
                        },
                        {
                          "title": "IAU 2012 Resolution B2 (astronomical unit)",
                          "url": "https://iauarchive.eso.org/static/resolutions/IAU2012_English.pdf"
                        },
                        {
                          "title": "IAU 2015 Resolution B2 (parsec)",
                          "url": "https://www.iau.org/static/resolutions/IAU2015_English.pdf"
                        },
                        {
                          "title": "NIST: The U.S. survey foot (deprecation notice)",
                          "url": "https://www.nist.gov/pml/us-surveyfoot"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "units/length@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/units/mass": {
      "post": {
        "operationId": "calc_units_mass",
        "summary": "Mass and weight converter",
        "description": "Convert between metric, avoirdupois (pounds and ounces), troy and carat units.\n\nConvert between metric, avoirdupois (pounds and ounces), troy and carat units. Conversion factors are exact values from the official unit definitions, so the result is exact before the single final rounding. Leave out to_unit to get the value in every supported unit.",
        "tags": [
          "Units"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "description": "The amount to convert. Allowed: >= 0.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "1"
                    ]
                  },
                  "from_unit": {
                    "description": "Unit of the value. Options: kg: kilogram; g: gram; mg: milligram; ug: microgram; t: tonne (metric ton); lb: pound (avoirdupois); oz: ounce (avoirdupois); st: stone; short_ton: short ton (US); long_ton: long ton (UK); gr: grain; ozt: troy ounce; lbt: troy pound; ct: carat (metric)",
                    "type": "string",
                    "enum": [
                      "kg",
                      "g",
                      "mg",
                      "ug",
                      "t",
                      "lb",
                      "oz",
                      "st",
                      "short_ton",
                      "long_ton",
                      "gr",
                      "ozt",
                      "lbt",
                      "ct"
                    ],
                    "examples": [
                      "kg"
                    ]
                  },
                  "to_unit": {
                    "description": "Unit to convert to. Omit to convert to every unit. Options: kg: kilogram; g: gram; mg: milligram; ug: microgram; t: tonne (metric ton); lb: pound (avoirdupois); oz: ounce (avoirdupois); st: stone; short_ton: short ton (US); long_ton: long ton (UK); gr: grain; ozt: troy ounce; lbt: troy pound; ct: carat (metric)",
                    "type": "string",
                    "enum": [
                      "kg",
                      "g",
                      "mg",
                      "ug",
                      "t",
                      "lb",
                      "oz",
                      "st",
                      "short_ton",
                      "long_ton",
                      "gr",
                      "ozt",
                      "lbt",
                      "ct"
                    ],
                    "examples": [
                      "g"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "value",
                  "from_unit"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "One pound in kilograms",
                  "value": {
                    "value": "1",
                    "from_unit": "lb",
                    "to_unit": "kg"
                  }
                },
                "example2": {
                  "summary": "One troy ounce in grams",
                  "value": {
                    "value": "1",
                    "from_unit": "ozt",
                    "to_unit": "g"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "units/mass@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "description": "The converted value.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "factor": {
                          "description": "How many to_unit make one from_unit (multiply by this to convert).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "all_units": {
                          "description": "The value expressed in every supported unit.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "unit": {
                                "description": "Unit code.",
                                "type": "string"
                              },
                              "name": {
                                "description": "Unit name.",
                                "type": "string"
                              },
                              "value": {
                                "description": "The value in this unit.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "unit",
                              "name",
                              "value"
                            ]
                          }
                        }
                      },
                      "required": []
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "One pound in kilograms",
                    "value": {
                      "calculator": "units/mass@1",
                      "result": {
                        "result": "0.45359237",
                        "factor": "0.45359237"
                      },
                      "exactness": {
                        "result": "exact",
                        "factor": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "1",
                        "from_unit": "lb",
                        "to_unit": "kg"
                      },
                      "formula": "result = value × factor(from_unit) ÷ factor(to_unit), factors in kg",
                      "references": [
                        {
                          "title": "NIST Special Publication 811 (2008), Appendix B: conversion factors",
                          "url": "https://www.nist.gov/pml/special-publication-811"
                        },
                        {
                          "title": "NIST Handbook 44, Appendix C: General tables of units of measurement",
                          "url": "https://www.nist.gov/pml/owm/nist-handbook-44-current-edition"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "One troy ounce in grams",
                    "value": {
                      "calculator": "units/mass@1",
                      "result": {
                        "result": "31.1034768",
                        "factor": "31.1034768"
                      },
                      "exactness": {
                        "result": "exact",
                        "factor": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "1",
                        "from_unit": "ozt",
                        "to_unit": "g"
                      },
                      "formula": "result = value × factor(from_unit) ÷ factor(to_unit), factors in kg",
                      "references": [
                        {
                          "title": "NIST Special Publication 811 (2008), Appendix B: conversion factors",
                          "url": "https://www.nist.gov/pml/special-publication-811"
                        },
                        {
                          "title": "NIST Handbook 44, Appendix C: General tables of units of measurement",
                          "url": "https://www.nist.gov/pml/owm/nist-handbook-44-current-edition"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "units/mass@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/units/temperature": {
      "post": {
        "operationId": "calc_units_temperature",
        "summary": "Temperature converter",
        "description": "Convert temperatures between Celsius, Fahrenheit, kelvin and Rankine.\n\nConverts a temperature reading, or a temperature difference, between scales. A reading uses the scale offsets (0 °C = 32 °F); a difference does not (a rise of 10 °C is a rise of 18 °F). All factors are exact.",
        "tags": [
          "Units"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "description": "The temperature (or temperature difference) to convert.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "100"
                    ]
                  },
                  "from_unit": {
                    "description": "Scale of the value. Options: C: degree Celsius; K: kelvin; F: degree Fahrenheit; R: degree Rankine",
                    "type": "string",
                    "enum": [
                      "C",
                      "K",
                      "F",
                      "R"
                    ],
                    "examples": [
                      "C"
                    ]
                  },
                  "to_unit": {
                    "description": "Scale to convert to. Omit to convert to every scale. Options: C: degree Celsius; K: kelvin; F: degree Fahrenheit; R: degree Rankine",
                    "type": "string",
                    "enum": [
                      "C",
                      "K",
                      "F",
                      "R"
                    ],
                    "examples": [
                      "F"
                    ]
                  },
                  "quantity": {
                    "description": "Whether the value is a reading or a difference between two readings. Options: reading: a temperature reading, like 20 °C; difference: a change or interval, like a rise of 5 °C",
                    "type": "string",
                    "enum": [
                      "reading",
                      "difference"
                    ],
                    "default": "reading"
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "value",
                  "from_unit"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "Boiling water in Fahrenheit",
                  "value": {
                    "value": "100",
                    "from_unit": "C",
                    "to_unit": "F"
                  }
                },
                "example2": {
                  "summary": "Body temperature in Celsius",
                  "value": {
                    "value": "98.6",
                    "from_unit": "F",
                    "to_unit": "C"
                  }
                },
                "example3": {
                  "summary": "A rise of 10 °C in °F",
                  "value": {
                    "value": "10",
                    "from_unit": "C",
                    "to_unit": "F",
                    "quantity": "difference"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "units/temperature@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "description": "The converted temperature.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "all_units": {
                          "description": "The value on every scale.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "unit": {
                                "description": "Scale code.",
                                "type": "string"
                              },
                              "name": {
                                "description": "Scale name.",
                                "type": "string"
                              },
                              "value": {
                                "description": "The value on this scale.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "unit",
                              "name",
                              "value"
                            ]
                          }
                        }
                      },
                      "required": []
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "Boiling water in Fahrenheit",
                    "value": {
                      "calculator": "units/temperature@1",
                      "result": {
                        "result": "212"
                      },
                      "exactness": {
                        "result": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "100",
                        "from_unit": "C",
                        "to_unit": "F",
                        "quantity": "reading"
                      },
                      "formula": "K = °C + 273.15; °F = K × 9/5 − 459.67; °R = K × 9/5 (differences: no offsets)",
                      "references": [
                        {
                          "title": "BIPM SI Brochure, 9th edition (2019), section 2.3.1: kelvin and degree Celsius",
                          "url": "https://www.bipm.org/en/publications/si-brochure"
                        },
                        {
                          "title": "NIST Special Publication 811 (2008), section B.9: temperature conversion",
                          "url": "https://www.nist.gov/pml/special-publication-811"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "Body temperature in Celsius",
                    "value": {
                      "calculator": "units/temperature@1",
                      "result": {
                        "result": "37"
                      },
                      "exactness": {
                        "result": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "98.6",
                        "from_unit": "F",
                        "to_unit": "C",
                        "quantity": "reading"
                      },
                      "formula": "K = °C + 273.15; °F = K × 9/5 − 459.67; °R = K × 9/5 (differences: no offsets)",
                      "references": [
                        {
                          "title": "BIPM SI Brochure, 9th edition (2019), section 2.3.1: kelvin and degree Celsius",
                          "url": "https://www.bipm.org/en/publications/si-brochure"
                        },
                        {
                          "title": "NIST Special Publication 811 (2008), section B.9: temperature conversion",
                          "url": "https://www.nist.gov/pml/special-publication-811"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example3": {
                    "summary": "A rise of 10 °C in °F",
                    "value": {
                      "calculator": "units/temperature@1",
                      "result": {
                        "result": "18"
                      },
                      "exactness": {
                        "result": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "10",
                        "from_unit": "C",
                        "to_unit": "F",
                        "quantity": "difference"
                      },
                      "formula": "K = °C + 273.15; °F = K × 9/5 − 459.67; °R = K × 9/5 (differences: no offsets)",
                      "references": [
                        {
                          "title": "BIPM SI Brochure, 9th edition (2019), section 2.3.1: kelvin and degree Celsius",
                          "url": "https://www.bipm.org/en/publications/si-brochure"
                        },
                        {
                          "title": "NIST Special Publication 811 (2008), section B.9: temperature conversion",
                          "url": "https://www.nist.gov/pml/special-publication-811"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "units/temperature@1",
        "x-billing-units": 1
      }
    },
    "/v1/calc/units/volume": {
      "post": {
        "operationId": "calc_units_volume",
        "summary": "Volume converter",
        "description": "Convert between metric, US customary, imperial and cubic units of volume.\n\nConvert between metric, US customary, imperial and cubic units of volume. Conversion factors are exact values from the official unit definitions, so the result is exact before the single final rounding. Leave out to_unit to get the value in every supported unit.",
        "tags": [
          "Units"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "description": "The amount to convert. Allowed: >= 0.",
                    "type": "string",
                    "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
                    "examples": [
                      "1"
                    ]
                  },
                  "from_unit": {
                    "description": "Unit of the value. Options: m3: cubic metre; l: litre; ml: millilitre; cm3: cubic centimetre; in3: cubic inch; ft3: cubic foot; yd3: cubic yard; gal_us: US gallon; qt_us: US liquid quart; pt_us: US liquid pint; cup_us: US customary cup; cup_us_legal: US legal cup (nutrition labels); floz_us: US fluid ounce; tbsp_us: US tablespoon; tsp_us: US teaspoon; bbl_oil: oil barrel; gal_imp: imperial gallon; qt_imp: imperial quart; pt_imp: imperial pint; floz_imp: imperial fluid ounce",
                    "type": "string",
                    "enum": [
                      "m3",
                      "l",
                      "ml",
                      "cm3",
                      "in3",
                      "ft3",
                      "yd3",
                      "gal_us",
                      "qt_us",
                      "pt_us",
                      "cup_us",
                      "cup_us_legal",
                      "floz_us",
                      "tbsp_us",
                      "tsp_us",
                      "bbl_oil",
                      "gal_imp",
                      "qt_imp",
                      "pt_imp",
                      "floz_imp"
                    ],
                    "examples": [
                      "m3"
                    ]
                  },
                  "to_unit": {
                    "description": "Unit to convert to. Omit to convert to every unit. Options: m3: cubic metre; l: litre; ml: millilitre; cm3: cubic centimetre; in3: cubic inch; ft3: cubic foot; yd3: cubic yard; gal_us: US gallon; qt_us: US liquid quart; pt_us: US liquid pint; cup_us: US customary cup; cup_us_legal: US legal cup (nutrition labels); floz_us: US fluid ounce; tbsp_us: US tablespoon; tsp_us: US teaspoon; bbl_oil: oil barrel; gal_imp: imperial gallon; qt_imp: imperial quart; pt_imp: imperial pint; floz_imp: imperial fluid ounce",
                    "type": "string",
                    "enum": [
                      "m3",
                      "l",
                      "ml",
                      "cm3",
                      "in3",
                      "ft3",
                      "yd3",
                      "gal_us",
                      "qt_us",
                      "pt_us",
                      "cup_us",
                      "cup_us_legal",
                      "floz_us",
                      "tbsp_us",
                      "tsp_us",
                      "bbl_oil",
                      "gal_imp",
                      "qt_imp",
                      "pt_imp",
                      "floz_imp"
                    ],
                    "examples": [
                      "l"
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "rounding": {
                        "type": "string",
                        "enum": [
                          "half_even",
                          "half_up",
                          "half_down",
                          "up",
                          "down",
                          "ceiling",
                          "floor"
                        ],
                        "description": "Rounding mode applied once to each result. Default half_even."
                      },
                      "decimals": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 20,
                        "description": "Round results to this many digits after the decimal point."
                      },
                      "significant_digits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "description": "Round results to this many significant digits."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Precision and rounding of the results (default: rounding=half_even, significant_digits=15)."
                  }
                },
                "required": [
                  "value",
                  "from_unit"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "One US gallon in litres",
                  "value": {
                    "value": "1",
                    "from_unit": "gal_us",
                    "to_unit": "l"
                  }
                },
                "example2": {
                  "summary": "One imperial pint in millilitres",
                  "value": {
                    "value": "1",
                    "from_unit": "pt_imp",
                    "to_unit": "ml"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 1 unit).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculator": {
                      "type": "string",
                      "description": "The calculator and version that ran.",
                      "examples": [
                        "units/volume@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "description": "The converted value.",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "factor": {
                          "description": "How many to_unit make one from_unit (multiply by this to convert).",
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        },
                        "all_units": {
                          "description": "The value expressed in every supported unit.",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "unit": {
                                "description": "Unit code.",
                                "type": "string"
                              },
                              "name": {
                                "description": "Unit name.",
                                "type": "string"
                              },
                              "value": {
                                "description": "The value in this unit.",
                                "type": "string",
                                "pattern": "^-?\\d+(\\.\\d+)?$"
                              }
                            },
                            "required": [
                              "unit",
                              "name",
                              "value"
                            ]
                          }
                        }
                      },
                      "required": []
                    },
                    "exactness": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "exact",
                          "rounded",
                          "rounded_uncertified",
                          "underflow"
                        ]
                      },
                      "description": "For each decimal output: exact; rounded (correctly, to the precision); rounded_uncertified (the last digit could not be proven); or underflow (below 1e-100, reported as 0)."
                    },
                    "precision": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The precision and rounding that were applied."
                    },
                    "inputs": {
                      "type": "object",
                      "description": "The inputs as understood."
                    },
                    "formula": {
                      "type": "string"
                    },
                    "references": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ]
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "calculator",
                    "result",
                    "exactness",
                    "inputs",
                    "warnings"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "One US gallon in litres",
                    "value": {
                      "calculator": "units/volume@1",
                      "result": {
                        "result": "3.785411784",
                        "factor": "3.785411784"
                      },
                      "exactness": {
                        "result": "exact",
                        "factor": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "1",
                        "from_unit": "gal_us",
                        "to_unit": "l"
                      },
                      "formula": "result = value × factor(from_unit) ÷ factor(to_unit), factors in m³",
                      "references": [
                        {
                          "title": "NIST Special Publication 811 (2008), Appendix B: conversion factors",
                          "url": "https://www.nist.gov/pml/special-publication-811"
                        },
                        {
                          "title": "UK Weights and Measures Act 1985, Schedule 1 (imperial gallon)",
                          "url": "https://www.legislation.gov.uk/ukpga/1985/72/schedule/1"
                        },
                        {
                          "title": "21 CFR 101.9(b)(5)(viii): the 240 mL cup used on US nutrition labels",
                          "url": "https://www.law.cornell.edu/cfr/text/21/101.9"
                        }
                      ],
                      "warnings": []
                    }
                  },
                  "example2": {
                    "summary": "One imperial pint in millilitres",
                    "value": {
                      "calculator": "units/volume@1",
                      "result": {
                        "result": "568.26125",
                        "factor": "568.26125"
                      },
                      "exactness": {
                        "result": "exact",
                        "factor": "exact"
                      },
                      "precision": {
                        "rounding": "half_even",
                        "significant_digits": 15
                      },
                      "inputs": {
                        "value": "1",
                        "from_unit": "pt_imp",
                        "to_unit": "ml"
                      },
                      "formula": "result = value × factor(from_unit) ÷ factor(to_unit), factors in m³",
                      "references": [
                        {
                          "title": "NIST Special Publication 811 (2008), Appendix B: conversion factors",
                          "url": "https://www.nist.gov/pml/special-publication-811"
                        },
                        {
                          "title": "UK Weights and Measures Act 1985, Schedule 1 (imperial gallon)",
                          "url": "https://www.legislation.gov.uk/ukpga/1985/72/schedule/1"
                        },
                        {
                          "title": "21 CFR 101.9(b)(5)(viii): the 240 mL cup used on US nutrition labels",
                          "url": "https://www.law.cornell.edu/cfr/text/21/101.9"
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "units/volume@1",
        "x-billing-units": 1
      }
    },
    "/v1/validate/einvoice/en16931": {
      "post": {
        "operationId": "validate_einvoice_en16931",
        "summary": "EN 16931 validator (UBL and CII)",
        "description": "Check a UBL or CII invoice against the European e-invoicing standard EN 16931 with CEN's official rules.\n\nRuns the UBL 2.1 or UN/CEFACT CII D16B schema and then CEN/TC 434's own validation artefacts: the business rules (BR-…), calculation rules (BR-CO-…), VAT rules and code lists of EN 16931-1. The syntax is detected from the document. Country rules (CIUS) such as XRechnung or Peppol BIS are separate endpoints.",
        "tags": [
          "Einvoice"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "The invoice XML, as text.",
                    "maxLength": 4194304
                  }
                },
                "required": [
                  "xml"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "An official sample (cen-ubl-tc434-creditnote1.xml)",
                  "value": {
                    "xml": "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n<!--\n\n    Licensed under European Union Public Licence (EUPL) version 1.2.\n\n-->\n<CreditNote xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2\"\n\txmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\"\n\txmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">\n\t<cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID>\n\t<cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>\n\t<cbc:ID>018304 / 28865</cbc:ID>\n\t<cbc:IssueDate>2019-09-23</cbc:IssueDate>\n\t<cbc:CreditNoteTypeCode>381</cbc:CreditNoteTypeCode>\n\t<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>\n\t<cbc:BuyerReference>018304 / 28865</cbc:BuyerReference>\n\t<cac:InvoicePeriod>\n\t\t<cbc:StartDate>2019-02-01</cbc:StartDate>\n\t\t<cbc:EndDate>2019-02-28</cbc:EndDate>\n\t</cac:InvoicePeriod>\n\t<cac:AccountingSupplierParty>\n\t\t<cac:Party>\n\t\t\t<cbc:EndpointID schemeID=\"0201\">0000000196</cbc:EndpointID>\n\t\t\t<cac:PartyName>\n\t\t\t\t<cbc:Name>My Supplier Company N.V.</cbc:Name>\n\t\t\t</cac:PartyName>\n\t\t\t<cac:PostalAddress>\n\t\t\t\t<cbc:StreetName>De Grote Meir 22</cbc:StreetName>\n\t\t\t\t<cbc:CityName>ANTWERPEN</cbc:CityName>\n\t\t\t\t<cbc:PostalZone>2000</cbc:PostalZone>\n\t\t\t\t<cac:Country>\n\t\t\t\t\t<cbc:IdentificationCode>BE</cbc:IdentificationCode>\n\t\t\t\t</cac:Country>\n\t\t\t</cac:PostalAddress>\n\t\t\t<cac:PartyTaxScheme>\n\t\t\t\t<cbc:CompanyID>BE0000000196</cbc:CompanyID>\n\t\t\t\t<cac:TaxScheme>\n\t\t\t\t\t<cbc:ID>VAT</cbc:ID>\n\t\t\t\t</cac:TaxScheme>\n\t\t\t</cac:PartyTaxScheme>\n\t\t\t<cac:PartyLegalEntity>\n\t\t\t\t<cbc:RegistrationName>My Supplier Company</cbc:RegistrationName>\n\t\t\t\t<cbc:CompanyID>0000000196</cbc:CompanyID>\n\t\t\t</cac:PartyLegalEntity>\n\t\t\t<cac:Contact>\n\t\t\t\t<cbc:ElectronicMail>john.doole@mysuppliercompany.be</cbc:ElectronicMail>\n\t\t\t</cac:Contact>\n\t\t</cac:Party>\n\t</cac:AccountingSupplierParty>\n\t<cac:AccountingCustomerParty>\n\t\t<cac:Party>\n\t\t\t<cbc:EndpointID schemeID=\"0201\">0000000295</cbc:EndpointID>\n\t\t\t<cac:PartyName>\n\t\t\t\t<cbc:Name>My Customer Company S.A.</cbc:Name>\n\t\t\t</cac:PartyName>\n\t\t\t<cac:PostalAddress>\n\t\t\t\t<cbc:StreetName>Boulevard Sint Michel 53</cbc:StreetName>\n\t\t\t\t<cbc:CityName>BRUXELLES</cbc:CityName>\n\t\t\t\t<cbc:PostalZone>1000</cbc:PostalZone>\n\t\t\t\t<cac:Country>\n\t\t\t\t\t<cbc:IdentificationCode>BE</cbc:IdentificationCode>\n\t\t\t\t</cac:Country>\n\t\t\t</cac:PostalAddress>\n\t\t\t<cac:PartyTaxScheme>\n\t\t\t\t<cbc:CompanyID>BE0000000295</cbc:CompanyID>\n\t\t\t\t<cac:TaxScheme>\n\t\t\t\t\t<cbc:ID>VAT</cbc:ID>\n\t\t\t\t</cac:TaxScheme>\n\t\t\t</cac:PartyTaxScheme>\n\t\t\t<cac:PartyLegalEntity>\n\t\t\t\t<cbc:RegistrationName>My Customer Company</cbc:RegistrationName>\n\t\t\t\t<cbc:CompanyID>0000000295</cbc:CompanyID>\n\t\t\t</cac:PartyLegalEntity>\n\t\t\t<cac:Contact>\n\t\t\t\t<cbc:ElectronicMail>pete.smith@mycustomercompany.be</cbc:ElectronicMail>\n\t\t\t</cac:Contact>\n\t\t</cac:Party>\n\t</cac:AccountingCustomerParty>\n\t<cac:PaymentMeans>\n\t\t<cbc:PaymentMeansCode>1</cbc:PaymentMeansCode>\n\t\t<cbc:PaymentID>010676609538</cbc:PaymentID>\n\t\t<cac:PayeeFinancialAccount>\n\t\t\t<cbc:ID>BE91000000143476</cbc:ID>\n\t\t\t<cac:FinancialInstitutionBranch>\n\t\t\t\t<cbc:ID>BPOTBEB1</cbc:ID>\n\t\t\t</cac:FinancialInstitutionBranch>\n\t\t</cac:PayeeFinancialAccount>\n\t</cac:PaymentMeans>\n\t<cac:TaxTotal>\n\t\t<cbc:TaxAmount currencyID=\"EUR\">0.00</cbc:TaxAmount>\n\t\t<cac:TaxSubtotal>\n\t\t\t<cbc:TaxableAmount currencyID=\"EUR\">100.11</cbc:TaxableAmount>\n\t\t\t<cbc:TaxAmount currencyID=\"EUR\">0.00</cbc:TaxAmount>\n\t\t\t<cac:TaxCategory>\n\t\t\t\t<cbc:ID>E</cbc:ID>\n\t\t\t\t<cbc:Percent>0.00</cbc:Percent>\n\t\t\t\t<cbc:TaxExemptionReason>Taxes are not applicable</cbc:TaxExemptionReason>\n\t\t\t\t<cac:TaxScheme>\n\t\t\t\t\t<cbc:ID>VAT</cbc:ID>\n\t\t\t\t</cac:TaxScheme>\n\t\t\t</cac:TaxCategory>\n\t\t</cac:TaxSubtotal>\n\t</cac:TaxTotal>\n\t<cac:LegalMonetaryTotal>\n\t\t<cbc:LineExtensionAmount currencyID=\"EUR\">100.11</cbc:LineExtensionAmount>\n\t\t<cbc:TaxExclusiveAmount currencyID=\"EUR\">100.11</cbc:TaxExclusiveAmount>\n\t\t<cbc:TaxInclusiveAmount currencyID=\"EUR\">100.11</cbc:TaxInclusiveAmount>\n\t\t<cbc:PayableAmount currencyID=\"EUR\">100.11</cbc:PayableAmount>\n\t</cac:LegalMonetaryTotal>\n\t<cac:CreditNoteLine>\n\t\t<cbc:ID>1</cbc:ID>\n\t\t<cbc:CreditedQuantity unitCode=\"C62\">1.00</cbc:CreditedQuantity>\n\t\t<cbc:LineExtensionAmount currencyID=\"EUR\">100.11</cbc:LineExtensionAmount>\n\t\t<cac:Item>\n\t\t\t<cbc:Description>Exonération du versement du PP</cbc:Description>\n\t\t\t<cbc:Name>Exonération du versement du PP</cbc:Name>\n\t\t\t<cac:SellersItemIdentification>\n\t\t\t\t<cbc:ID>V55</cbc:ID>\n\t\t\t</cac:SellersItemIdentification>\n\t\t\t<cac:ClassifiedTaxCategory>\n\t\t\t\t<cbc:ID>E</cbc:ID>\n\t\t\t\t<cbc:Percent>0.00</cbc:Percent>\n\t\t\t\t<cac:TaxScheme>\n\t\t\t\t\t<cbc:ID>VAT</cbc:ID>\n\t\t\t\t</cac:TaxScheme>\n\t\t\t</cac:ClassifiedTaxCategory>\n\t\t\t<cac:AdditionalItemProperty>\n\t\t\t\t<cbc:Name>2</cbc:Name>\n\t\t\t\t<cbc:Value>Contributions - précompte professionnel</cbc:Value>\n\t\t\t</cac:AdditionalItemProperty>\n\t\t</cac:Item>\n\t\t<cac:Price>\n\t\t\t<cbc:PriceAmount currencyID=\"EUR\">100.11</cbc:PriceAmount>\n\t\t</cac:Price>\n\t</cac:CreditNoteLine>\n</CreditNote>\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 5 units).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "validator": {
                      "type": "string",
                      "description": "The validator and version that ran.",
                      "examples": [
                        "einvoice/en16931@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "type": "boolean",
                          "description": "true when the document matched a scenario and no check reported an error."
                        },
                        "scenario": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Which set of rules applied, chosen from the document's own type and specification ID; null when none applies."
                        },
                        "document_type": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UBL Invoice, UBL CreditNote or UN/CEFACT CII."
                        },
                        "specification_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The CustomizationID (UBL) or guideline ID (CII), BT-24, as found."
                        },
                        "errors": {
                          "type": "integer",
                          "description": "Messages at level error."
                        },
                        "warnings": {
                          "type": "integer",
                          "description": "Messages at level warning."
                        },
                        "notices": {
                          "type": "integer",
                          "description": "Messages at level information."
                        },
                        "error_rules": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "The distinct rules that reported an error, sorted."
                        },
                        "checks": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          },
                          "description": "Each check in the order it ran, and whether it passed (a schema failure skips the rules, as in KoSIT's validator)."
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "description": "The rule's ID, e.g. BR-CO-10, or XSD for a schema error."
                              },
                              "level": {
                                "type": "string",
                                "enum": [
                                  "error",
                                  "warning",
                                  "information"
                                ]
                              },
                              "message": {
                                "type": "string",
                                "description": "The rule owner's own wording."
                              },
                              "check": {
                                "type": "string",
                                "description": "The check (schema or rule set) that reported it."
                              },
                              "location": {
                                "type": "string",
                                "description": "XPath of the element concerned, when given."
                              },
                              "line": {
                                "type": "integer",
                                "description": "Line in the document, for syntax and schema errors."
                              }
                            },
                            "required": [
                              "rule",
                              "level",
                              "message",
                              "check"
                            ]
                          },
                          "description": "Up to 500 findings."
                        },
                        "messages_truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "valid",
                        "scenario",
                        "errors",
                        "warnings",
                        "notices",
                        "error_rules",
                        "checks",
                        "messages",
                        "messages_truncated"
                      ]
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "The official artefacts used: name, version and source."
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "validator",
                    "result",
                    "rules"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "An official sample (cen-ubl-tc434-creditnote1.xml)",
                    "value": {
                      "validator": "einvoice/en16931@1",
                      "result": {
                        "valid": true,
                        "scenario": "EN 16931 (UBL CreditNote)",
                        "document_type": "UBL CreditNote",
                        "specification_id": "urn:cen.eu:en16931:2017",
                        "errors": 0,
                        "warnings": 0,
                        "notices": 0,
                        "error_rules": [],
                        "checks": [
                          {
                            "check": "XML syntax",
                            "passed": true
                          },
                          {
                            "check": "UBL 2.1 CreditNote schema",
                            "passed": true
                          },
                          {
                            "check": "EN 16931 rules 1.3.17",
                            "passed": true
                          }
                        ],
                        "messages": [],
                        "messages_truncated": false
                      },
                      "rules": [
                        {
                          "name": "CEN/TC 434 EN 16931 validation artefacts",
                          "version": "1.3.17",
                          "url": "https://github.com/ConnectingEurope/eInvoicing-EN16931/releases/tag/validation-1.3.17"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "einvoice/en16931@1",
        "x-billing-units": 5
      }
    },
    "/v1/validate/einvoice/peppol-bis": {
      "post": {
        "operationId": "validate_einvoice_peppol_bis",
        "summary": "Peppol BIS 3.0 invoice validator",
        "description": "Check a UBL invoice or credit note against Peppol BIS Billing 3.0 with OpenPeppol's official rules.\n\nRuns the UBL 2.1 schema, the EN 16931 rules in the copy Peppol ships, and the Peppol BIS Billing 3.0 rules (PEPPOL-EN16931-R…, country rules for Norway, Denmark, Italy, Sweden, Greece, Iceland, the Netherlands and Germany). Peppol BIS 3.0 documents are UBL only.",
        "tags": [
          "Einvoice"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "The invoice XML, as text.",
                    "maxLength": 4194304
                  }
                },
                "required": [
                  "xml"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "An official sample (peppol-base-creditnote-correction.xml)",
                  "value": {
                    "xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<CreditNote xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\"\n    xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\"\n    xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2\">\n    <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID>\n    <cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>\n    <cbc:ID>Snippet1</cbc:ID>\n    <cbc:IssueDate>2017-11-13</cbc:IssueDate>\n    <cbc:CreditNoteTypeCode>381</cbc:CreditNoteTypeCode>\n    <cbc:Note>Please note we have a new phone number: 22 22 22 22</cbc:Note>\n    <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>\n    <cbc:AccountingCost>4025:123:4343</cbc:AccountingCost>\n    <cbc:BuyerReference>0150abc</cbc:BuyerReference>\n    <cac:BillingReference>\n        <cac:InvoiceDocumentReference>\n            <cbc:ID>Snippet1</cbc:ID>\n        </cac:InvoiceDocumentReference>\n    </cac:BillingReference>\n    <cac:AccountingSupplierParty>\n        <cac:Party>\n            <cbc:EndpointID schemeID=\"0088\">9482348239847239874</cbc:EndpointID>\n            <cac:PartyIdentification>\n                <cbc:ID>99887766</cbc:ID>\n            </cac:PartyIdentification>\n            <cac:PartyName>\n                <cbc:Name>SupplierTradingName Ltd.</cbc:Name>\n            </cac:PartyName>\n            <cac:PostalAddress>\n                <cbc:StreetName>Main street 1</cbc:StreetName>\n                <cbc:AdditionalStreetName>Postbox 123</cbc:AdditionalStreetName>\n                <cbc:CityName>London</cbc:CityName>\n                <cbc:PostalZone>GB 123 EW</cbc:PostalZone>\n                <cac:Country>\n                    <cbc:IdentificationCode>GB</cbc:IdentificationCode>\n                </cac:Country>\n            </cac:PostalAddress>\n            <cac:PartyTaxScheme>\n                <cbc:CompanyID>GB1232434</cbc:CompanyID>\n                <cac:TaxScheme>\n                    <cbc:ID>VAT</cbc:ID>\n                </cac:TaxScheme>\n            </cac:PartyTaxScheme>\n            <cac:PartyLegalEntity>\n                <cbc:RegistrationName>SupplierOfficialName Ltd</cbc:RegistrationName>\n                <cbc:CompanyID>GB983294</cbc:CompanyID>\n            </cac:PartyLegalEntity>\n        </cac:Party>\n    </cac:AccountingSupplierParty>\n    <cac:AccountingCustomerParty>\n        <cac:Party>\n            <cbc:EndpointID schemeID=\"0002\">FR23342</cbc:EndpointID>\n            <cac:PartyIdentification>\n                <cbc:ID schemeID=\"0002\">FR23342</cbc:ID>\n            </cac:PartyIdentification>\n            <cac:PartyName>\n                <cbc:Name>BuyerTradingName AS</cbc:Name>\n            </cac:PartyName>\n            <cac:PostalAddress>\n                <cbc:StreetName>Hovedgatan 32</cbc:StreetName>\n                <cbc:AdditionalStreetName>Po box 878</cbc:AdditionalStreetName>\n                <cbc:CityName>Stockholm</cbc:CityName>\n                <cbc:PostalZone>456 34</cbc:PostalZone>\n                <cac:Country>\n                    <cbc:IdentificationCode>SE</cbc:IdentificationCode>\n                </cac:Country>\n            </cac:PostalAddress>\n            <cac:PartyTaxScheme>\n                <cbc:CompanyID>SE4598375937</cbc:CompanyID>\n                <cac:TaxScheme>\n                    <cbc:ID>VAT</cbc:ID>\n                </cac:TaxScheme>\n            </cac:PartyTaxScheme>\n            <cac:PartyLegalEntity>\n                <cbc:RegistrationName>Buyer Official Name</cbc:RegistrationName>\n                <cbc:CompanyID schemeID=\"0183\">39937423947</cbc:CompanyID>\n            </cac:PartyLegalEntity>\n            <cac:Contact>\n                <cbc:Name>Lisa Johnson</cbc:Name>\n                <cbc:Telephone>23434234</cbc:Telephone>\n                <cbc:ElectronicMail>lj@buyer.se</cbc:ElectronicMail>\n            </cac:Contact>\n        </cac:Party>\n    </cac:AccountingCustomerParty>\n    <cac:Delivery>\n        <cbc:ActualDeliveryDate>2017-11-01</cbc:ActualDeliveryDate>\n        <cac:DeliveryLocation>\n            <cbc:ID schemeID=\"0088\">9483759475923478</cbc:ID>\n            <cac:Address>\n                <cbc:StreetName>Delivery street 2</cbc:StreetName>\n                <cbc:AdditionalStreetName>Building 56</cbc:AdditionalStreetName>\n                <cbc:CityName>Stockholm</cbc:CityName>\n                <cbc:PostalZone>21234</cbc:PostalZone>\n                <cac:Country>\n                    <cbc:IdentificationCode>SE</cbc:IdentificationCode>\n                </cac:Country>\n            </cac:Address>\n        </cac:DeliveryLocation>\n        <cac:DeliveryParty>\n            <cac:PartyName>\n                <cbc:Name>Delivery party Name</cbc:Name>\n            </cac:PartyName>\n        </cac:DeliveryParty>\n    </cac:Delivery>\n    <cac:PaymentMeans>\n        <cbc:PaymentMeansCode name=\"Credit transfer\">30</cbc:PaymentMeansCode>\n        <cbc:PaymentID>Snippet1</cbc:PaymentID>\n        <cac:PayeeFinancialAccount>\n            <cbc:ID>IBAN32423940</cbc:ID>\n            <cbc:Name>AccountName</cbc:Name>\n            <cac:FinancialInstitutionBranch>\n                <cbc:ID>BIC324098</cbc:ID>\n            </cac:FinancialInstitutionBranch>\n        </cac:PayeeFinancialAccount>\n    </cac:PaymentMeans>\n    <cac:PaymentTerms>\n        <cbc:Note>Payment within 10 days, 2% discount</cbc:Note>\n    </cac:PaymentTerms>\n        <cac:AllowanceCharge>\n            <cbc:ChargeIndicator>true</cbc:ChargeIndicator>\n            <cbc:AllowanceChargeReason>Insurance</cbc:AllowanceChargeReason>\n            <cbc:Amount currencyID=\"EUR\">25</cbc:Amount>\n            <cac:TaxCategory>\n                <cbc:ID>S</cbc:ID>\n                <cbc:Percent>25.0</cbc:Percent>\n                <cac:TaxScheme>\n                    <cbc:ID>VAT</cbc:ID>\n                </cac:TaxScheme>\n            </cac:TaxCategory>\n        </cac:AllowanceCharge>\n    <cac:TaxTotal>\n        <cbc:TaxAmount currencyID=\"EUR\">331.25</cbc:TaxAmount>\n        <cac:TaxSubtotal>\n            <cbc:TaxableAmount currencyID=\"EUR\">1325</cbc:TaxableAmount>\n            <cbc:TaxAmount currencyID=\"EUR\">331.25</cbc:TaxAmount>\n            <cac:TaxCategory>\n                <cbc:ID>S</cbc:ID>\n                <cbc:Percent>25.0</cbc:Percent>\n                <cac:TaxScheme>\n                    <cbc:ID>VAT</cbc:ID>\n                </cac:TaxScheme>\n            </cac:TaxCategory>\n        </cac:TaxSubtotal>\n    </cac:TaxTotal>\n    <cac:LegalMonetaryTotal>\n        <cbc:LineExtensionAmount currencyID=\"EUR\">1300</cbc:LineExtensionAmount>\n        <cbc:TaxExclusiveAmount currencyID=\"EUR\">1325</cbc:TaxExclusiveAmount>\n        <cbc:TaxInclusiveAmount currencyID=\"EUR\">1656.25</cbc:TaxInclusiveAmount>\n        <cbc:ChargeTotalAmount currencyID=\"EUR\">25</cbc:ChargeTotalAmount>\n        <cbc:PayableAmount currencyID=\"EUR\">1656.25</cbc:PayableAmount>\n    </cac:LegalMonetaryTotal>\n    \n<cac:CreditNoteLine>\n        <cbc:ID>1</cbc:ID>\n    <cbc:CreditedQuantity unitCode=\"DAY\">7</cbc:CreditedQuantity>\n    <cbc:LineExtensionAmount currencyID= \"EUR\">2800</cbc:LineExtensionAmount>\n        <cbc:AccountingCost>Konteringsstreng</cbc:AccountingCost>\n       <cac:OrderLineReference>\n            <cbc:LineID>123</cbc:LineID>\n        </cac:OrderLineReference>\n    <cac:Item>\n            <cbc:Description>Description of item</cbc:Description>\n            <cbc:Name>item name</cbc:Name>\n            <cac:StandardItemIdentification>\n                <cbc:ID schemeID=\"0088\">21382183120983</cbc:ID>\n            </cac:StandardItemIdentification>\n            <cac:OriginCountry>\n                <cbc:IdentificationCode>NO</cbc:IdentificationCode>\n            </cac:OriginCountry>\n            <cac:CommodityClassification>\n                <cbc:ItemClassificationCode listID=\"SRV\">09348023</cbc:ItemClassificationCode>\n            </cac:CommodityClassification>\n            <cac:ClassifiedTaxCategory>\n                <cbc:ID>S</cbc:ID>\n                <cbc:Percent>25.0</cbc:Percent>\n                <cac:TaxScheme>\n                    <cbc:ID>VAT</cbc:ID>\n                </cac:TaxScheme>\n            </cac:ClassifiedTaxCategory>\n        </cac:Item>\n    <cac:Price>\n        <cbc:PriceAmount currencyID=\"EUR\">400</cbc:PriceAmount>\n    </cac:Price>\n    </cac:CreditNoteLine>\n<cac:CreditNoteLine>\n    <cbc:ID>2</cbc:ID>\n    <cbc:CreditedQuantity unitCode=\"DAY\">-3</cbc:CreditedQuantity>\n    <cbc:LineExtensionAmount currencyID=\"EUR\">-1500</cbc:LineExtensionAmount>\n    <cac:OrderLineReference>\n        <cbc:LineID>123</cbc:LineID>\n    </cac:OrderLineReference>\n    <cac:Item>\n        <cbc:Description>Description 2</cbc:Description>\n        <cbc:Name>item name 2</cbc:Name>\n        <cac:StandardItemIdentification>\n            <cbc:ID schemeID=\"0088\">21382183120983</cbc:ID>\n        </cac:StandardItemIdentification>\n        <cac:OriginCountry>\n            <cbc:IdentificationCode>NO</cbc:IdentificationCode>\n        </cac:OriginCountry>\n        <cac:CommodityClassification>\n            <cbc:ItemClassificationCode listID=\"SRV\">09348023</cbc:ItemClassificationCode>\n        </cac:CommodityClassification>\n        <cac:ClassifiedTaxCategory>\n            <cbc:ID>S</cbc:ID>\n            <cbc:Percent>25.0</cbc:Percent>\n            <cac:TaxScheme>\n                <cbc:ID>VAT</cbc:ID>\n            </cac:TaxScheme>\n        </cac:ClassifiedTaxCategory>\n    </cac:Item>\n    <cac:Price>\n        <cbc:PriceAmount currencyID=\"EUR\">500</cbc:PriceAmount>\n    </cac:Price>\n</cac:CreditNoteLine>\n</CreditNote>\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 5 units).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "validator": {
                      "type": "string",
                      "description": "The validator and version that ran.",
                      "examples": [
                        "einvoice/peppol-bis@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "type": "boolean",
                          "description": "true when the document matched a scenario and no check reported an error."
                        },
                        "scenario": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Which set of rules applied, chosen from the document's own type and specification ID; null when none applies."
                        },
                        "document_type": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UBL Invoice, UBL CreditNote or UN/CEFACT CII."
                        },
                        "specification_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The CustomizationID (UBL) or guideline ID (CII), BT-24, as found."
                        },
                        "errors": {
                          "type": "integer",
                          "description": "Messages at level error."
                        },
                        "warnings": {
                          "type": "integer",
                          "description": "Messages at level warning."
                        },
                        "notices": {
                          "type": "integer",
                          "description": "Messages at level information."
                        },
                        "error_rules": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "The distinct rules that reported an error, sorted."
                        },
                        "checks": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          },
                          "description": "Each check in the order it ran, and whether it passed (a schema failure skips the rules, as in KoSIT's validator)."
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "description": "The rule's ID, e.g. BR-CO-10, or XSD for a schema error."
                              },
                              "level": {
                                "type": "string",
                                "enum": [
                                  "error",
                                  "warning",
                                  "information"
                                ]
                              },
                              "message": {
                                "type": "string",
                                "description": "The rule owner's own wording."
                              },
                              "check": {
                                "type": "string",
                                "description": "The check (schema or rule set) that reported it."
                              },
                              "location": {
                                "type": "string",
                                "description": "XPath of the element concerned, when given."
                              },
                              "line": {
                                "type": "integer",
                                "description": "Line in the document, for syntax and schema errors."
                              }
                            },
                            "required": [
                              "rule",
                              "level",
                              "message",
                              "check"
                            ]
                          },
                          "description": "Up to 500 findings."
                        },
                        "messages_truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "valid",
                        "scenario",
                        "errors",
                        "warnings",
                        "notices",
                        "error_rules",
                        "checks",
                        "messages",
                        "messages_truncated"
                      ]
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "The official artefacts used: name, version and source."
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "validator",
                    "result",
                    "rules"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "An official sample (peppol-base-creditnote-correction.xml)",
                    "value": {
                      "validator": "einvoice/peppol-bis@1",
                      "result": {
                        "valid": true,
                        "scenario": "Peppol BIS Billing 3.0 (UBL CreditNote)",
                        "document_type": "UBL CreditNote",
                        "specification_id": "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0",
                        "errors": 0,
                        "warnings": 0,
                        "notices": 0,
                        "error_rules": [],
                        "checks": [
                          {
                            "check": "XML syntax",
                            "passed": true
                          },
                          {
                            "check": "UBL 2.1 CreditNote schema",
                            "passed": true
                          },
                          {
                            "check": "EN 16931 rules (Peppol BIS 3.0.22 copy)",
                            "passed": true
                          },
                          {
                            "check": "Peppol BIS Billing 3.0.22 rules",
                            "passed": true
                          }
                        ],
                        "messages": [],
                        "messages_truncated": false
                      },
                      "rules": [
                        {
                          "name": "OpenPeppol BIS Billing 3.0 Schematron (compiled with SchXslt 1.10.1)",
                          "version": "3.0.22",
                          "url": "https://github.com/OpenPEPPOL/peppol-bis-invoice-3/releases/tag/3.0.22"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "einvoice/peppol-bis@1",
        "x-billing-units": 5
      }
    },
    "/v1/validate/einvoice/xrechnung": {
      "post": {
        "operationId": "validate_einvoice_xrechnung",
        "summary": "XRechnung validator (KoSIT rules)",
        "description": "Check an XRechnung 3.0 invoice the way German public buyers do, with KoSIT's official validator configuration.\n\nUses KoSIT's validator configuration for XRechnung unchanged: its scenarios choose the rules from the document's type and specification ID, then the UBL or CII schema, the EN 16931 rules and the XRechnung rules (BR-DE-…) run, with KoSIT's custom levels. The decision is KoSIT's: valid means no error.",
        "tags": [
          "Einvoice"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "The invoice XML, as text.",
                    "maxLength": 4194304
                  }
                },
                "required": [
                  "xml"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "An official sample (xrechnung-01.01a-invoice-ubl.xml)",
                  "value": {
                    "xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ubl:Invoice xmlns:ubl=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"\n             xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\"\n             xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">\n    <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID>\n    <cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>\n    <cbc:ID>123456XX</cbc:ID>\n    <cbc:IssueDate>2016-04-04</cbc:IssueDate>\n    <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>\n    <cbc:Note>#ADU#Es gelten unsere Allgem. Geschäftsbedingungen, die Sie unter […] finden.</cbc:Note>\n    <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>\n    <cbc:BuyerReference>04011000-12345-03</cbc:BuyerReference>\n    <cac:AccountingSupplierParty>\n        <cac:Party>\n            <cbc:EndpointID schemeID=\"EM\">seller@email.de</cbc:EndpointID>\n            <cac:PartyName>\n                <cbc:Name>[Seller trading name]</cbc:Name>\n            </cac:PartyName>\n            <cac:PostalAddress>\n                <cbc:StreetName>[Seller address line 1]</cbc:StreetName>\n                <cbc:CityName>[Seller city]</cbc:CityName>\n                <cbc:PostalZone>12345</cbc:PostalZone>\n                <cac:Country>\n                    <cbc:IdentificationCode>DE</cbc:IdentificationCode>\n                </cac:Country>\n            </cac:PostalAddress>\n            <cac:PartyTaxScheme>\n                <cbc:CompanyID>DE 123456789</cbc:CompanyID>\n                <cac:TaxScheme>\n                    <cbc:ID>VAT</cbc:ID>\n                </cac:TaxScheme>\n            </cac:PartyTaxScheme>\n            <cac:PartyLegalEntity>\n                <cbc:RegistrationName>[Seller name]</cbc:RegistrationName>\n                <cbc:CompanyID>[HRA-Eintrag]</cbc:CompanyID>\n                <cbc:CompanyLegalForm>123/456/7890, HRA-Eintrag in […]</cbc:CompanyLegalForm>\n            </cac:PartyLegalEntity>\n            <cac:Contact>\n                <cbc:Name>nicht vorhanden</cbc:Name>\n                <cbc:Telephone>+49 1234-5678</cbc:Telephone>\n                <cbc:ElectronicMail>seller@email.de</cbc:ElectronicMail>\n            </cac:Contact>\n        </cac:Party>\n    </cac:AccountingSupplierParty>\n    <cac:AccountingCustomerParty>\n        <cac:Party>\n            <cbc:EndpointID schemeID=\"EM\">buyer@info.de</cbc:EndpointID>\n            <cac:PartyIdentification>\n                <cbc:ID>[Buyer identifier]</cbc:ID>\n            </cac:PartyIdentification>\n            <cac:PostalAddress>\n                <cbc:StreetName>[Buyer address line 1]</cbc:StreetName>\n                <cbc:CityName>[Buyer city]</cbc:CityName>\n                <cbc:PostalZone>12345</cbc:PostalZone>\n                <cac:Country>\n                    <cbc:IdentificationCode>DE</cbc:IdentificationCode>\n                </cac:Country>\n            </cac:PostalAddress>\n            <cac:PartyLegalEntity>\n                <cbc:RegistrationName>[Buyer name]</cbc:RegistrationName>\n            </cac:PartyLegalEntity>\n        </cac:Party>\n    </cac:AccountingCustomerParty>\n    <cac:PaymentMeans>\n        <cbc:PaymentMeansCode>58</cbc:PaymentMeansCode>\n        <cac:PayeeFinancialAccount>\n            <!-- dies ist eine nicht existerende aber valide IBAN als test dummy -->\n            <cbc:ID>DE79000000001234567890</cbc:ID>\n        </cac:PayeeFinancialAccount>\n    </cac:PaymentMeans>\n    <cac:PaymentTerms>\n        <cbc:Note>Zahlbar sofort ohne Abzug.</cbc:Note>\n    </cac:PaymentTerms>\n    <cac:TaxTotal>\n        <cbc:TaxAmount currencyID=\"EUR\">22.04</cbc:TaxAmount>\n        <cac:TaxSubtotal>\n            <cbc:TaxableAmount currencyID=\"EUR\">314.86</cbc:TaxableAmount>\n            <cbc:TaxAmount currencyID=\"EUR\">22.04</cbc:TaxAmount>\n            <cac:TaxCategory>\n                <cbc:ID>S</cbc:ID>\n                <cbc:Percent>7</cbc:Percent>\n                <cac:TaxScheme>\n                    <cbc:ID>VAT</cbc:ID>\n                </cac:TaxScheme>\n            </cac:TaxCategory>\n        </cac:TaxSubtotal>\n    </cac:TaxTotal>\n    <cac:LegalMonetaryTotal>\n        <cbc:LineExtensionAmount currencyID=\"EUR\">314.86</cbc:LineExtensionAmount>\n        <cbc:TaxExclusiveAmount currencyID=\"EUR\">314.86</cbc:TaxExclusiveAmount>\n        <cbc:TaxInclusiveAmount currencyID=\"EUR\">336.9</cbc:TaxInclusiveAmount>\n        <cbc:PayableAmount currencyID=\"EUR\">336.9</cbc:PayableAmount>\n    </cac:LegalMonetaryTotal>\n    <cac:InvoiceLine>\n        <cbc:ID>Zeitschrift [...]</cbc:ID>\n        <cbc:Note>Die letzte Lieferung im Rahmen des abgerechneten Abonnements erfolgt in 12/2016 Lieferung erfolgt / erfolgte direkt vom Verlag</cbc:Note>\n        <cbc:InvoicedQuantity unitCode=\"XPP\">1</cbc:InvoicedQuantity>\n        <cbc:LineExtensionAmount currencyID=\"EUR\">288.79</cbc:LineExtensionAmount>\n        <cac:InvoicePeriod>\n            <cbc:StartDate>2016-01-01</cbc:StartDate>\n            <cbc:EndDate>2016-12-31</cbc:EndDate>\n        </cac:InvoicePeriod>\n        <cac:OrderLineReference>\n            <cbc:LineID>6171175.1</cbc:LineID>\n        </cac:OrderLineReference>\n        <cac:Item>\n            <cbc:Description>Zeitschrift Inland</cbc:Description>\n            <cbc:Name>Zeitschrift [...]</cbc:Name>\n            <cac:SellersItemIdentification>\n                <cbc:ID>246</cbc:ID>\n            </cac:SellersItemIdentification>\n            <cac:CommodityClassification>\n                <cbc:ItemClassificationCode listID=\"IB\">0721-880X</cbc:ItemClassificationCode>\n            </cac:CommodityClassification>\n            <cac:ClassifiedTaxCategory>\n                <cbc:ID>S</cbc:ID>\n                <cbc:Percent>7</cbc:Percent>\n                <cac:TaxScheme>\n                    <cbc:ID>VAT</cbc:ID>\n                </cac:TaxScheme>\n            </cac:ClassifiedTaxCategory>\n        </cac:Item>\n        <cac:Price>\n            <cbc:PriceAmount currencyID=\"EUR\">288.79</cbc:PriceAmount>\n        </cac:Price>\n    </cac:InvoiceLine>\n    <cac:InvoiceLine>\n        <cbc:ID>Porto + Versandkosten</cbc:ID>\n        <cbc:InvoicedQuantity unitCode=\"XPP\">1</cbc:InvoicedQuantity>\n        <cbc:LineExtensionAmount currencyID=\"EUR\">26.07</cbc:LineExtensionAmount>\n        <cac:Item>\n            <cbc:Name>Porto + Versandkosten</cbc:Name>\n            <cac:ClassifiedTaxCategory>\n                <cbc:ID>S</cbc:ID>\n                <cbc:Percent>7</cbc:Percent>\n                <cac:TaxScheme>\n                    <cbc:ID>VAT</cbc:ID>\n                </cac:TaxScheme>\n            </cac:ClassifiedTaxCategory>\n        </cac:Item>\n        <cac:Price>\n            <cbc:PriceAmount currencyID=\"EUR\">26.07</cbc:PriceAmount>\n        </cac:Price>\n    </cac:InvoiceLine>\n</ubl:Invoice>\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 5 units).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "validator": {
                      "type": "string",
                      "description": "The validator and version that ran.",
                      "examples": [
                        "einvoice/xrechnung@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "type": "boolean",
                          "description": "true when the document matched a scenario and no check reported an error."
                        },
                        "scenario": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Which set of rules applied, chosen from the document's own type and specification ID; null when none applies."
                        },
                        "document_type": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UBL Invoice, UBL CreditNote or UN/CEFACT CII."
                        },
                        "specification_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The CustomizationID (UBL) or guideline ID (CII), BT-24, as found."
                        },
                        "errors": {
                          "type": "integer",
                          "description": "Messages at level error."
                        },
                        "warnings": {
                          "type": "integer",
                          "description": "Messages at level warning."
                        },
                        "notices": {
                          "type": "integer",
                          "description": "Messages at level information."
                        },
                        "error_rules": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "The distinct rules that reported an error, sorted."
                        },
                        "checks": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          },
                          "description": "Each check in the order it ran, and whether it passed (a schema failure skips the rules, as in KoSIT's validator)."
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "description": "The rule's ID, e.g. BR-CO-10, or XSD for a schema error."
                              },
                              "level": {
                                "type": "string",
                                "enum": [
                                  "error",
                                  "warning",
                                  "information"
                                ]
                              },
                              "message": {
                                "type": "string",
                                "description": "The rule owner's own wording."
                              },
                              "check": {
                                "type": "string",
                                "description": "The check (schema or rule set) that reported it."
                              },
                              "location": {
                                "type": "string",
                                "description": "XPath of the element concerned, when given."
                              },
                              "line": {
                                "type": "integer",
                                "description": "Line in the document, for syntax and schema errors."
                              }
                            },
                            "required": [
                              "rule",
                              "level",
                              "message",
                              "check"
                            ]
                          },
                          "description": "Up to 500 findings."
                        },
                        "messages_truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "valid",
                        "scenario",
                        "errors",
                        "warnings",
                        "notices",
                        "error_rules",
                        "checks",
                        "messages",
                        "messages_truncated"
                      ]
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "The official artefacts used: name, version and source."
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "validator",
                    "result",
                    "rules"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "An official sample (xrechnung-01.01a-invoice-ubl.xml)",
                    "value": {
                      "validator": "einvoice/xrechnung@1",
                      "result": {
                        "valid": true,
                        "scenario": "EN16931 XRechnung (UBL Invoice)",
                        "document_type": "UBL Invoice",
                        "specification_id": "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0",
                        "errors": 0,
                        "warnings": 0,
                        "notices": 1,
                        "error_rules": [],
                        "checks": [
                          {
                            "check": "XML syntax",
                            "passed": true
                          },
                          {
                            "check": "XML Schema for UBL 2.1 Invoice",
                            "passed": true
                          },
                          {
                            "check": "Schematron rules for EN16931 (UBL)",
                            "passed": true
                          },
                          {
                            "check": "Schematron rules for Invoice - CIUS XRechnung (UBL)",
                            "passed": true
                          }
                        ],
                        "messages": [
                          {
                            "rule": "BR-DE-TMP-32",
                            "level": "information",
                            "message": "[BR-DE-TMP-32] Eine Rechnung sollte zur Angabe des Liefer-/Leistungsdatums entweder BT-72 \"Actual delivery date\", BG-14 \"Invoicing period\" oder in jeder Rechnungsposition BG-26 \"Invoice line period\" enthalten.",
                            "check": "Schematron rules for Invoice - CIUS XRechnung (UBL)",
                            "location": "/Q{urn:oasis:names:specification:ubl:schema:xsd:Invoice-2}Invoice[1]"
                          }
                        ],
                        "messages_truncated": false
                      },
                      "rules": [
                        {
                          "name": "KoSIT validator configuration for XRechnung 3.0.2",
                          "version": "2026-08-31",
                          "url": "https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/v2026-08-31/xrechnung-3.0.2-validator-configuration-2026-08-31.zip"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "einvoice/xrechnung@1",
        "x-billing-units": 5
      }
    },
    "/v1/validate/einvoice/factur-x": {
      "post": {
        "operationId": "validate_einvoice_factur_x",
        "summary": "Factur-X / ZUGFeRD validator",
        "description": "Check a Factur-X or ZUGFeRD 2 invoice, as a PDF or its XML, against the rules for its profile.\n\nTakes the PDF (base64) or the CII XML. From a PDF the embedded factur-x.xml, zugferd-invoice.xml or xrechnung.xml is read, with the profile the PDF's XMP metadata names. The profile comes from the guideline ID (BT-24): MINIMUM, BASIC WL, BASIC, EN 16931 and EXTENDED use the Factur-X 1.09.2 / ZUGFeRD 2.5 schema and Schematron for that profile; XRECHNUNG uses KoSIT's rules.",
        "tags": [
          "Einvoice"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pdf": {
                    "type": "string",
                    "contentEncoding": "base64",
                    "description": "The Factur-X or ZUGFeRD PDF, base64-encoded (at most 6 MiB)."
                  },
                  "xml": {
                    "type": "string",
                    "description": "Or the CII invoice XML, as text.",
                    "maxLength": 4194304
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "example1": {
                  "summary": "An official sample (ferd-en16931-einfach.xml)",
                  "value": {
                    "xml": "<?xml version='1.0' encoding='UTF-8' ?>\n<!-- English disclaimer below.-->\n<!--Nutzungsrechte \nZUGFeRD Datenformat Version 2.2.0, 14.02.2022\nBeispiel Version 14.02.2022\n \nZweck des Forums elektronisch Rechnung Deutschland, welches am 31. März 2010 unter der Arbeitsgemeinschaft für \nwirtschaftliche Verwaltung e. V. gegründet wurde, ist u. a. die Schaffung und Spezifizierung eines offenen Datenformats \nfür strukturierten elektronischen Datenaustausch auf der Grundlage offener und nicht diskriminierender, standardisierter \nTechnologien („ZUGFeRD Datenformat“).\n \nDas ZUGFeRD Datenformat wird nach Maßgabe des FeRD sowohl Unternehmen als auch der öffentlichen Verwaltung \nfrei zugänglich gemacht. Hierfür bietet FeRD allen Unternehmen und Organisationen der öffentlichen Verwaltung eine \nLizenz für die Nutzung des urheberrechtlich geschützten ZUGFeRD-Datenformats zu fairen, sachgerechten und nicht \ndiskriminierenden Bedingungen an.\n \nDie Spezifikation des FeRD zur Implementierung des ZUGFeRD Datenformats ist in ihrer jeweils geltenden Fassung \nabrufbar unter www.ferd-net.de.\n \nIm Einzelnen schließt die Nutzungsgewährung ein: \n=====================================\n \nFeRD räumt eine Lizenz für die Nutzung des urheberrechtlich geschützten ZUGFeRD Datenformats in der jeweils \ngeltenden und akzeptierten Fassung (www.ferd-net.de) ein. \nDie Lizenz beinhaltet ein unwiderrufliches Nutzungsrecht einschließlich des Rechts der Weiterentwicklung, \nWeiterbearbeitung und Verbindung mit anderen Produkten.\nDie Lizenz gilt insbesondere für die Entwicklung, die Gestaltung, die Herstellung, den Verkauf, die Nutzung oder \nanderweitige Verwendung des ZUGFeRD Datenformats für Hardware- und/oder Softwareprodukte sowie sonstige \nAnwendungen und Dienste. \nDiese Lizenz schließt nicht die wesentlichen Patente der Mitglieder von FeRD ein. Als wesentliche Patente sind Patente \nund Patentanmeldungen weltweit zu verstehen, die einen oder mehrere Patentansprüche beinhalten, bei denen es sich um \nnotwendige Ansprüche handelt. Notwendige Ansprüche sind lediglich jene Ansprüche der Wesentlichen Patente, die durch \ndie Implementierung des ZUGFeRD Datenformats notwendigerweise verletzt würden. \nDer Lizenznehmer ist berechtigt, seinen jeweiligen Konzerngesellschaften ein unbefristetes, weltweites, nicht übertragbares, \nunwiderrufliches Nutzungsrecht einschließlich des Rechts der Weiterentwicklung, Weiterbearbeitung und Verbindung mit \nanderen Produkten einzuräumen. \n \nDie Lizenz wird kostenfrei zur Verfügung gestellt. \n \nAußer im Falle vorsätzlichen Verschuldens oder grober Fahrlässigkeit haftet FeRD weder für Nutzungsausfall, entgangenen \nGewinn, Datenverlust, Kommunikationsverlust, Einnahmeausfall, Vertragseinbußen, Geschäftsausfall oder für Kosten, \nSchäden, Verluste oder Haftpflichten im Zusammenhang mit einer Unterbrechung der Geschäftstätigkeit, noch für konkrete, \nbeiläufig entstandene, mittelbare Schäden, Straf- oder Folgeschäden und zwar auch dann nicht, wenn die Möglichkeit der \nKosten, Verluste bzw. Schäden hätte normalerweise vorhergesehen werden können.-->\n \n <!--Right of use \nZUGFeRD Data format version 2.2.0, February 14th, 2022\n \nThe purpose of the Forum elektronische Rechnung Deutschland (FeRD), which was founded on March 31, 2010 under the \numbrella of Arbeitsgemeinschaft für wirtschaftliche Verwaltung e. V., is, among other things, to create and specify an \nopen data format for structured electronic data exchange on the basis of open and non discriminatory, standardised \ntechnologies (\"ZUGFeRD data format\").\n \nThe ZUGFeRD data format is used by both companies and public administration according to the FeRD \nmade freely accessible. For this purpose FeRD offers all companies and organisations of the public administration a \nLicense to use the copyrighted ZUGFeRD data format in a fair, appropriate and non \ndiscriminatory conditions.\n \nThe specification of the FeRD for the implementation of the ZUGFeRD data format is, in its currently valid version \navailable at www.ferd-net.de.\n \nIn detail, the grant of use includes \n=====================================\n \nFeRD grants a license for the use of the copyrighted ZUGFeRD data format in the respective \nvalid and accepted version (www.ferd-net.de). \nThe license includes an irrevocable right of use including the right of further development, \nFurther processing and connection with other products.\nThe license applies in particular to the development, design, production, sale, use or \nother use of the ZUGFeRD data format for hardware and/or software products and other \napplications and services. \nThis license does not include the essential patents of the members of FeRD. The essential patents are patents \nand patent applications worldwide which contain one or more claims that are \nnecessary claims. Necessary claims are only those claims of the essential patents which are \nthe implementation of the ZUGFeRD data format would necessarily be violated. \nThe Licensee is entitled to provide its respective group companies with an unlimited, worldwide, non-transferable, \nirrevocable right of use including the right of further development, further processing and connection with \nother products. \n \nThe license is provided free of charge. \n \nExcept in the case of intentional fault or gross negligence, FeRD is not liable for loss of use, loss of \nProfit, loss of data, loss of communication, loss of revenue, loss of contracts, loss of business or for costs \ndamages, losses or liabilities in connection with an interruption of business, nor for concrete, \nincidental, indirect, punitive or consequential damages, even if the possibility of \ncosts, losses or damages could normally have been foreseen.-->\n\n<rsm:CrossIndustryInvoice xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\" xmlns:qdt=\"urn:un:unece:uncefact:data:standard:QualifiedDataType:100\" xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100\">\n  <rsm:ExchangedDocumentContext>\n    <ram:GuidelineSpecifiedDocumentContextParameter>\n      <ram:ID>urn:cen.eu:en16931:2017</ram:ID>\n    </ram:GuidelineSpecifiedDocumentContextParameter>\n  </rsm:ExchangedDocumentContext>\n  <rsm:ExchangedDocument>\n    <ram:ID>471102</ram:ID>\n    <ram:TypeCode>380</ram:TypeCode>\n    <ram:IssueDateTime>\n      <udt:DateTimeString format=\"102\">20180305</udt:DateTimeString>\n    </ram:IssueDateTime>\n    <ram:IncludedNote>\n      <ram:Content>Rechnung gemäß Bestellung vom 01.03.2018.</ram:Content>\n    </ram:IncludedNote>\n    <ram:IncludedNote>\n      <ram:Content>Lieferant GmbH\t\t\t\t\nLieferantenstraße 20\t\t\t\t\n80333 München\t\t\t\t\nDeutschland\t\t\t\t\nGeschäftsführer: Hans Muster\nHandelsregisternummer: H A 123\n      </ram:Content>\n      <ram:SubjectCode>REG</ram:SubjectCode>\n    </ram:IncludedNote>\n  </rsm:ExchangedDocument>\n  <rsm:SupplyChainTradeTransaction>\n    <ram:IncludedSupplyChainTradeLineItem>\n      <ram:AssociatedDocumentLineDocument>\n        <ram:LineID>1</ram:LineID>\n      </ram:AssociatedDocumentLineDocument>\n      <ram:SpecifiedTradeProduct>\n        <ram:GlobalID schemeID=\"0160\">4012345001235</ram:GlobalID>\n        <ram:SellerAssignedID>TB100A4</ram:SellerAssignedID>\n        <ram:Name>Trennblätter A4</ram:Name>\n      </ram:SpecifiedTradeProduct>\n      <ram:SpecifiedLineTradeAgreement>\n        <ram:GrossPriceProductTradePrice>\n          <ram:ChargeAmount>9.9000</ram:ChargeAmount>\n        </ram:GrossPriceProductTradePrice>\n        <ram:NetPriceProductTradePrice>\n          <ram:ChargeAmount>9.9000</ram:ChargeAmount>\n        </ram:NetPriceProductTradePrice>\n      </ram:SpecifiedLineTradeAgreement>\n      <ram:SpecifiedLineTradeDelivery>\n        <ram:BilledQuantity unitCode=\"H87\">20.0000</ram:BilledQuantity>\n      </ram:SpecifiedLineTradeDelivery>\n      <ram:SpecifiedLineTradeSettlement>\n        <ram:ApplicableTradeTax>\n          <ram:TypeCode>VAT</ram:TypeCode>\n          <ram:CategoryCode>S</ram:CategoryCode>\n          <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>\n        </ram:ApplicableTradeTax>\n        <ram:SpecifiedTradeSettlementLineMonetarySummation>\n          <ram:LineTotalAmount>198.00</ram:LineTotalAmount>\n        </ram:SpecifiedTradeSettlementLineMonetarySummation>\n      </ram:SpecifiedLineTradeSettlement>\n    </ram:IncludedSupplyChainTradeLineItem>\n    <ram:IncludedSupplyChainTradeLineItem>\n      <ram:AssociatedDocumentLineDocument>\n        <ram:LineID>2</ram:LineID>\n      </ram:AssociatedDocumentLineDocument>\n      <ram:SpecifiedTradeProduct>\n        <ram:GlobalID schemeID=\"0160\">4000050986428</ram:GlobalID>\n        <ram:SellerAssignedID>ARNR2</ram:SellerAssignedID>\n        <ram:Name>Joghurt Banane</ram:Name>\n      </ram:SpecifiedTradeProduct>\n      <ram:SpecifiedLineTradeAgreement>\n        <ram:GrossPriceProductTradePrice>\n          <ram:ChargeAmount>5.5000</ram:ChargeAmount>\n        </ram:GrossPriceProductTradePrice>\n        <ram:NetPriceProductTradePrice>\n          <ram:ChargeAmount>5.5000</ram:ChargeAmount>\n        </ram:NetPriceProductTradePrice>\n      </ram:SpecifiedLineTradeAgreement>\n      <ram:SpecifiedLineTradeDelivery>\n        <ram:BilledQuantity unitCode=\"H87\">50.0000</ram:BilledQuantity>\n      </ram:SpecifiedLineTradeDelivery>\n      <ram:SpecifiedLineTradeSettlement>\n        <ram:ApplicableTradeTax>\n          <ram:TypeCode>VAT</ram:TypeCode>\n          <ram:CategoryCode>S</ram:CategoryCode>\n          <ram:RateApplicablePercent>7.00</ram:RateApplicablePercent>\n        </ram:ApplicableTradeTax>\n        <ram:SpecifiedTradeSettlementLineMonetarySummation>\n          <ram:LineTotalAmount>275.00</ram:LineTotalAmount>\n        </ram:SpecifiedTradeSettlementLineMonetarySummation>\n      </ram:SpecifiedLineTradeSettlement>\n    </ram:IncludedSupplyChainTradeLineItem>\n    <ram:ApplicableHeaderTradeAgreement>\n      <ram:SellerTradeParty>\n\t\t<ram:ID>549910</ram:ID>\n        <ram:GlobalID schemeID=\"0088\">4000001123452</ram:GlobalID>\n        <ram:Name>Lieferant GmbH</ram:Name>\n        <ram:PostalTradeAddress>\n          <ram:PostcodeCode>80333</ram:PostcodeCode>\n          <ram:LineOne>Lieferantenstraße 20</ram:LineOne>\n          <ram:CityName>München</ram:CityName>\n          <ram:CountryID>DE</ram:CountryID>\n        </ram:PostalTradeAddress>\n        <ram:SpecifiedTaxRegistration>\n          <ram:ID schemeID=\"FC\">201/113/40209</ram:ID>\n        </ram:SpecifiedTaxRegistration>\n        <ram:SpecifiedTaxRegistration>\n          <ram:ID schemeID=\"VA\">DE123456789</ram:ID>\n        </ram:SpecifiedTaxRegistration>\n      </ram:SellerTradeParty>\n      <ram:BuyerTradeParty>\n        <ram:ID>GE2020211</ram:ID>\n        <ram:Name>Kunden AG Mitte</ram:Name>\n        <ram:PostalTradeAddress>\n          <ram:PostcodeCode>69876</ram:PostcodeCode>\n          <ram:LineOne>Kundenstraße 15</ram:LineOne>\n          <ram:CityName>Frankfurt</ram:CityName>\n          <ram:CountryID>DE</ram:CountryID>\n        </ram:PostalTradeAddress>\n      </ram:BuyerTradeParty>\n    </ram:ApplicableHeaderTradeAgreement>\n    <ram:ApplicableHeaderTradeDelivery>\n      <ram:ActualDeliverySupplyChainEvent>\n        <ram:OccurrenceDateTime>\n          <udt:DateTimeString format=\"102\">20180305</udt:DateTimeString>\n        </ram:OccurrenceDateTime>\n      </ram:ActualDeliverySupplyChainEvent>\n    </ram:ApplicableHeaderTradeDelivery>\n    <ram:ApplicableHeaderTradeSettlement>\n      <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>\n      <ram:ApplicableTradeTax>\n        <ram:CalculatedAmount>19.25</ram:CalculatedAmount>\n        <ram:TypeCode>VAT</ram:TypeCode>\n        <ram:BasisAmount>275.00</ram:BasisAmount>\n        <ram:CategoryCode>S</ram:CategoryCode>\n        <ram:RateApplicablePercent>7.00</ram:RateApplicablePercent>\n      </ram:ApplicableTradeTax>\n      <ram:ApplicableTradeTax>\n        <ram:CalculatedAmount>37.62</ram:CalculatedAmount>\n        <ram:TypeCode>VAT</ram:TypeCode>\n        <ram:BasisAmount>198.00</ram:BasisAmount>\n        <ram:CategoryCode>S</ram:CategoryCode>\n        <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>\n      </ram:ApplicableTradeTax>\n      <ram:SpecifiedTradePaymentTerms>\n        <ram:Description>Zahlbar innerhalb 30 Tagen netto bis 04.04.2018, 3% Skonto innerhalb 10 Tagen bis 15.03.2018</ram:Description>\n      </ram:SpecifiedTradePaymentTerms>\n      <ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n        <ram:LineTotalAmount>473.00</ram:LineTotalAmount>\n        <ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount>\n        <ram:AllowanceTotalAmount>0.00</ram:AllowanceTotalAmount>\n        <ram:TaxBasisTotalAmount>473.00</ram:TaxBasisTotalAmount>\n\t\t<ram:TaxTotalAmount currencyID=\"EUR\">56.87</ram:TaxTotalAmount>\n        <ram:GrandTotalAmount>529.87</ram:GrandTotalAmount>\n        <ram:TotalPrepaidAmount>0.00</ram:TotalPrepaidAmount>\n        <ram:DuePayableAmount>529.87</ram:DuePayableAmount>\n      </ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n    </ram:ApplicableHeaderTradeSettlement>\n  </rsm:SupplyChainTradeTransaction>\n</rsm:CrossIndustryInvoice>"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result (billed: 5 units).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Billable": {
                "$ref": "#/components/headers/X-Billable"
              },
              "X-Usage-Count": {
                "$ref": "#/components/headers/X-Usage-Count"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/X-Usage-Limit"
              },
              "X-Usage-Period": {
                "$ref": "#/components/headers/X-Usage-Period"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "validator": {
                      "type": "string",
                      "description": "The validator and version that ran.",
                      "examples": [
                        "einvoice/factur-x@1"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "type": "boolean",
                          "description": "true when the document matched a scenario and no check reported an error."
                        },
                        "scenario": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Which set of rules applied, chosen from the document's own type and specification ID; null when none applies."
                        },
                        "document_type": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UBL Invoice, UBL CreditNote or UN/CEFACT CII."
                        },
                        "specification_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The CustomizationID (UBL) or guideline ID (CII), BT-24, as found."
                        },
                        "errors": {
                          "type": "integer",
                          "description": "Messages at level error."
                        },
                        "warnings": {
                          "type": "integer",
                          "description": "Messages at level warning."
                        },
                        "notices": {
                          "type": "integer",
                          "description": "Messages at level information."
                        },
                        "error_rules": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "The distinct rules that reported an error, sorted."
                        },
                        "checks": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          },
                          "description": "Each check in the order it ran, and whether it passed (a schema failure skips the rules, as in KoSIT's validator)."
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "description": "The rule's ID, e.g. BR-CO-10, or XSD for a schema error."
                              },
                              "level": {
                                "type": "string",
                                "enum": [
                                  "error",
                                  "warning",
                                  "information"
                                ]
                              },
                              "message": {
                                "type": "string",
                                "description": "The rule owner's own wording."
                              },
                              "check": {
                                "type": "string",
                                "description": "The check (schema or rule set) that reported it."
                              },
                              "location": {
                                "type": "string",
                                "description": "XPath of the element concerned, when given."
                              },
                              "line": {
                                "type": "integer",
                                "description": "Line in the document, for syntax and schema errors."
                              }
                            },
                            "required": [
                              "rule",
                              "level",
                              "message",
                              "check"
                            ]
                          },
                          "description": "Up to 500 findings."
                        },
                        "messages_truncated": {
                          "type": "boolean"
                        },
                        "profile": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "MINIMUM, BASIC WL, BASIC, EN 16931, EXTENDED or XRECHNUNG."
                        },
                        "pdf": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "description": "For a PDF: the embedded file's name, the XMP ConformanceLevel and pdfa_checked (always false)."
                        }
                      },
                      "required": [
                        "valid",
                        "scenario",
                        "errors",
                        "warnings",
                        "notices",
                        "error_rules",
                        "checks",
                        "messages",
                        "messages_truncated"
                      ]
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "The official artefacts used: name, version and source."
                    },
                    "receipt": {
                      "type": "string",
                      "description": "Only with ?receipt=true: a signed receipt for this answer, a JSON Web Token signed with Ed25519 (alg EdDSA). Its claims are iss, iat, jti (the request id), endpoint, date and response (this response without the receipt). Check it with the keys at /.well-known/jwks.json or POST /v1/receipts/verify."
                    }
                  },
                  "required": [
                    "validator",
                    "result",
                    "rules"
                  ]
                },
                "examples": {
                  "example1": {
                    "summary": "An official sample (ferd-en16931-einfach.xml)",
                    "value": {
                      "validator": "einvoice/factur-x@1",
                      "result": {
                        "valid": true,
                        "scenario": "Factur-X EN 16931",
                        "document_type": "UN/CEFACT CII",
                        "specification_id": "urn:cen.eu:en16931:2017",
                        "errors": 0,
                        "warnings": 0,
                        "notices": 0,
                        "error_rules": [],
                        "checks": [
                          {
                            "check": "XML syntax",
                            "passed": true
                          },
                          {
                            "check": "Factur-X 1.09.2 EN 16931 schema",
                            "passed": true
                          },
                          {
                            "check": "Factur-X 1.09.2 EN 16931 rules",
                            "passed": true
                          }
                        ],
                        "messages": [],
                        "messages_truncated": false,
                        "profile": "EN 16931",
                        "pdf": null
                      },
                      "rules": [
                        {
                          "name": "Factur-X 1.09.2 / ZUGFeRD 2.5 schemas and Schematron (FNFE-MPE and FeRD), as distributed with Mustang",
                          "version": "1.09.2",
                          "url": "https://github.com/ZUGFeRD/mustangproject/tree/1d633ab612856527d536a709ed53bedd2a4ea98c/validator/src/main/resources"
                        },
                        {
                          "name": "KoSIT validator configuration for XRechnung 3.0.2",
                          "version": "2026-08-31",
                          "url": "https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/v2026-08-31/xrechnung-3.0.2-validator-configuration-2026-08-31.zip"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error: NOT_FOUND. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Error: METHOD_NOT_ALLOWED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "500": {
            "description": "Error: INTERNAL_ERROR. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "x-calculator": "einvoice/factur-x@1",
        "x-billing-units": 5
      }
    },
    "/v1/account": {
      "get": {
        "operationId": "account",
        "summary": "Your plan, this period's usage and statement",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "Account summary.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/spend-cap": {
      "put": {
        "operationId": "account_spend_cap",
        "summary": "Add or lower the monthly spend cap",
        "description": "The cap is the most a month may cost in total (the plan's price plus overage), in cents of the plan's currency (US dollars or euros). Requests that would take the month past it are refused with 429 SPEND_CAP_REACHED and never billed. Needs a live key. A key can add a cap or lower it but not raise or remove it, so a leaked key cannot lift its own limit; ask us to raise it.",
        "tags": [
          "Account"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "spend_cap_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100000000
                  }
                },
                "required": [
                  "spend_cap_cents"
                ],
                "additionalProperties": false
              },
              "examples": {
                "fifty_dollars": {
                  "value": {
                    "spend_cap_cents": 5000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new cap and the units it allows this month.",
            "content": {
              "application/json": {}
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/batch": {
      "post": {
        "operationId": "batch",
        "summary": "Run several calls in one request",
        "description": "Up to 25 calls (and no more than the plan's burst) in one request, with a live or test key. Each item is metered, limited by the quota and spend cap, and billed exactly like the same call on its own, and gets its own request id in the ledger. The account's rate limit is charged one request per item. With an Idempotency-Key header, item i uses the key `<key>:<i>`, so repeating the batch replays every item without billing it again. Items run in parallel on the calculation workers; any not started within 30 seconds get 503 and are not billed.",
        "tags": [
          "Discovery"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/Receipt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "requests": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 25,
                    "items": {
                      "type": "object",
                      "properties": {
                        "endpoint": {
                          "type": "string",
                          "description": "Product and endpoint, like calc/finance/loan/emi or calc/finance/loan/emi@1."
                        },
                        "input": {
                          "type": "object",
                          "description": "The endpoint's request body."
                        }
                      },
                      "required": [
                        "endpoint",
                        "input"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "requests"
                ],
                "additionalProperties": false
              },
              "examples": {
                "two_loans": {
                  "value": {
                    "requests": [
                      {
                        "endpoint": "calc/finance/loan/emi",
                        "input": {
                          "principal": "250000",
                          "annual_rate_percent": "7.5",
                          "term_months": 240
                        }
                      },
                      {
                        "endpoint": "calc/finance/loan/emi",
                        "input": {
                          "principal": "250000",
                          "annual_rate_percent": "7.5",
                          "term_months": 120
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per item, in order: index, status, request_id, billable and body (the endpoint's response or error).",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer"
                          },
                          "status": {
                            "type": "integer"
                          },
                          "request_id": {
                            "type": "string"
                          },
                          "billable": {
                            "type": "boolean"
                          },
                          "body": {
                            "type": [
                              "object",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "index",
                          "status",
                          "request_id",
                          "billable",
                          "body"
                        ]
                      }
                    }
                  },
                  "required": [
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "503": {
            "description": "Error: CALCULATION_TIMEOUT, SERVICE_UNAVAILABLE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        }
      }
    },
    "/v1/receipts/verify": {
      "post": {
        "operationId": "receipts_verify",
        "summary": "Check a signed receipt",
        "description": "Checks a receipt's signature against our current and earlier signing keys and returns its claims. Free, and needs no key. A receipt that does not verify gets 200 with valid false and the reason.",
        "tags": [
          "Receipts"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "receipt": {
                    "type": "string",
                    "description": "The receipt, as received."
                  }
                },
                "required": [
                  "receipt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "valid, and when true the key_id, header and claims; when false, the reason.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "valid": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "key_id": {
                      "type": "string"
                    },
                    "header": {
                      "type": "object"
                    },
                    "claims": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "valid"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error: INVALID_JSON. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Error: PAYLOAD_TOO_LARGE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Error: UNSUPPORTED_MEDIA_TYPE. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error: QUOTA_EXCEEDED, RATE_LIMITED, SPEND_CAP_REACHED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        }
      }
    },
    "/.well-known/jwks.json": {
      "get": {
        "operationId": "receipts_keys",
        "summary": "The public keys that sign receipts",
        "description": "A JSON Web Key Set (RFC 7517) of Ed25519 keys (RFC 8037). Each key's kid is its RFC 7638 thumbprint and matches the kid in a receipt's header. The current key is listed first; earlier keys stay listed so old receipts still verify.",
        "tags": [
          "Receipts"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The key set.",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/v1/account/usage": {
      "get": {
        "operationId": "account_usage",
        "summary": "Daily usage and the statement for a period",
        "tags": [
          "Account"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$"
            },
            "description": "Billing period: a calendar month (UTC) as 2026-10, or the first day of a billing month as 2026-10-17; default: the current one."
          }
        ],
        "responses": {
          "200": {
            "description": "Usage by day and endpoint.",
            "content": {
              "application/json": {}
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/usage/events.csv": {
      "get": {
        "operationId": "account_usage_events",
        "summary": "Every recorded request in a period, as CSV",
        "tags": [
          "Account"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$"
            },
            "description": "Billing period: a calendar month (UTC) as 2026-10, or the first day of a billing month as 2026-10-17; default: the current one."
          }
        ],
        "responses": {
          "200": {
            "description": "One row per request.",
            "content": {
              "text/csv": {}
            }
          },
          "401": {
            "description": "Error: UNAUTHENTICATED. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error: FORBIDDEN. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Error: IDEMPOTENCY_KEY_REUSED, INVALID_INPUT, MISSING_FIELD, OUT_OF_RANGE, UNDEFINED_RESULT, UNKNOWN_FIELD. Never billed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "CALCULATION_TIMEOUT",
                  "FORBIDDEN",
                  "IDEMPOTENCY_KEY_REUSED",
                  "INTERNAL_ERROR",
                  "INVALID_INPUT",
                  "INVALID_JSON",
                  "METHOD_NOT_ALLOWED",
                  "MISSING_FIELD",
                  "NOT_FOUND",
                  "OUT_OF_RANGE",
                  "PAYLOAD_TOO_LARGE",
                  "QUOTA_EXCEEDED",
                  "RATE_LIMITED",
                  "SERVICE_UNAVAILABLE",
                  "SPEND_CAP_REACHED",
                  "UNAUTHENTICATED",
                  "UNDEFINED_RESULT",
                  "UNKNOWN_FIELD",
                  "UNSUPPORTED_MEDIA_TYPE"
                ]
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              },
              "request_id": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "description": "Repeat a request safely: same key and body within 24 hours returns the same result without billing again."
      },
      "Receipt": {
        "name": "receipt",
        "in": "query",
        "required": false,
        "schema": {
          "type": "boolean",
          "default": false
        },
        "description": "true adds a signed receipt to a successful answer (no extra charge)."
      }
    },
    "headers": {
      "X-Request-Id": {
        "description": "Unique ID of this request, as recorded in the usage ledger.",
        "schema": {
          "type": "string"
        }
      },
      "X-Billable": {
        "description": "true if this request was billed.",
        "schema": {
          "type": "string"
        }
      },
      "X-Usage-Count": {
        "description": "Units used this period (the test allowance for test keys).",
        "schema": {
          "type": "string"
        }
      },
      "X-Usage-Limit": {
        "description": "Units included this period, or the units the account's spend cap allows (the test allowance for test keys).",
        "schema": {
          "type": "string"
        }
      },
      "X-Usage-Period": {
        "description": "The billing period: 2026-10 for a calendar month (UTC), or the first day of a billing month that starts on another day, e.g. 2026-10-17.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Limit": {
        "description": "Requests allowed in a burst.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Remaining": {
        "description": "Requests left in the current burst.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Reset": {
        "description": "Seconds until the burst allowance is full again.",
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before trying again. Sent with RATE_LIMITED and with SERVICE_UNAVAILABLE when a retry is likely to work.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}