---
title: "Calculate Pricing"
method: POST
path: "/api/instrument/{instrument_id}/calculate"
tags: ["pricing"]
---

# Calculate Pricing

`POST /api/instrument/{instrument_id}/calculate`

## Request

- Base URL: `https://api.harmoney.in`
- URL: `https://api.harmoney.in/api/instrument/{instrument_id}/calculate`
- Auth: API key in header `x-api-key`

Calculate bond price from yield or yield from price.

Specify exactly ONE of 'price' or 'yield' in the request body.
The API will calculate the missing value.

## Path parameters

- `instrument_id` integer, required

## Request body

- PricingCalculationRequest: Request schema for pricing calculations.
  - `as_of_date` string, date, required: Settlement date for pricing calculation
  - `quantum` union: Face value/quantum for calculation. Defaults to instrument's par value if not specified. Cannot be used together with 'quantity'.
    - number
    - string
  - `quantity` union: Number of units traded. If provided, quantum is calculated as quantity * par_value. Cannot be used together with 'quantum'.
    - number
    - string
  - `yield` union: Yield as decimal (e.g., 0.09 for 9%). Specify one of price or yield.
    - number
    - string
  - `price` union: Unit clean price per 100 of par value. Specify one of price or yield.
    - number
    - string
  - `termination_type` 'maturity' | 'call' | 'put': Termination type exposed via datafeed APIs.
  - `calculation_type` 'eay' | 'bey' | 'mmy': Calculation type for yield.
  - `put_date` string, date, nullable: Optional put date to use for put termination calculations.
  - `call_date` string, date, nullable: Optional call date to use for call termination calculations.
  - `benchmark_rate` union: Current benchmark rate for floating/reset rate bonds. Used to calculate future coupon rates as (benchmark_rate + spread).
    - number
    - string

## Response `200`

Successful Response

- PricingResponse: Response schema for pricing calculations.
  - `as_of_date` string, date, required: Settlement date used for calculation
  - `yield` string, required: Yield as decimal
  - `termination_type` string, required: Termination type (maturity, call, put)
  - `unit_clean_price` string, required: Clean price per 100 of par value
  - `clean_price` string, required: Total clean price for quantum
  - `unit_accrued_interest` string, required: Accrued interest per 100 of par value
  - `accrued_interest` string, required: Accrued interest amount
  - `dirty_price` string, required: Total dirty price (clean price + accrued interest)
  - `accrued_interest_days` integer, nullable, required: Number of days of accrued interest
  - `quantum` string, required: Face value/quantum used
  - `quantity` string, required: Number of units of the security
  - `previous_coupon_date` string, date, nullable, required: Date of previous coupon payment
  - `calculation_type` string, required: Calculation type (EAY, BEY, MMY)
  - `call_date` string, date, nullable: Call date used in calculation (for YTC)
  - `put_date` string, date, nullable: Put date used in calculation (for YTP)
  - `stamp_duty` string, required: Stamp duty amount

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/inferedge/apis/india-fixed-income-data-feed.md) - [All operations](https://skmtc.dev/inferedge/apis/india-fixed-income-data-feed/llms.txt) - [OpenAPI document](https://skmtc.dev/inferedge/apis/india-fixed-income-data-feed/revisions/66687f780824?raw)
