> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fincode.technology/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Investment Quote

> Retrieves a quote for purchasing a specific number of units of an investment product.

Calculates and returns a quote for purchasing a specified number of units of an investment product, including the total amount, fees, and investing amount.

## Request Headers

<ParamField header="X-Auth-Token" type="string" required>
  The **JWT Access Token** obtained from the `/login` or `/refresh-token` endpoint.
</ParamField>

<ParamField header="x-idempotency-key" type="string" required>
  Unique idempotency key for the request to prevent duplicate processing.
</ParamField>

<ParamField header="x-fapi-auth-date" type="string" required>
  The date and time at which the request was initiated (ISO 8601 format).
</ParamField>

<ParamField header="x-fapi-customer-ip-address" type="string" required>
  The IP address of the customer making the request.
</ParamField>

<ParamField header="x-fapi-interaction-id" type="string" required>
  Unique identifier for the interaction/session.
</ParamField>

## Path Parameters

<ParamField path="product-id" type="string" required>
  The unique identifier (UUID) of the investment product to get a quote for.
</ParamField>

<ParamField path="number-of-units-to-purchase" type="number" required>
  The number of units to purchase.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://test-investment-products-service.fincode.software/api/v1/user/quote/get-quote/123e4567-e89b-12d3-a456-426614174000/100' \
  --header 'X-Auth-Token: YOUR_JWT_ACCESS_TOKEN' \
  --header 'x-idempotency-key: unique-key-12345' \
  --header 'x-fapi-auth-date: 2024-01-15T10:30:00Z' \
  --header 'x-fapi-customer-ip-address: 192.168.1.1' \
  --header 'x-fapi-interaction-id: interaction-12345'
  ```

  ```javascript Node.js theme={null}
  const axios = require('axios');

  const BASE_URL = 'https://test-investment-products-service.fincode.software/api/v1/user/quote';

  async function getQuote(accessToken, productId, numberOfUnits) {
    try {
      const response = await axios.get(
        `${BASE_URL}/get-quote/${productId}/${numberOfUnits}`,
        {
          headers: {
            'X-Auth-Token': accessToken,
            'x-idempotency-key': `key-${Date.now()}`,
            'x-fapi-auth-date': new Date().toISOString(),
            'x-fapi-customer-ip-address': '192.168.1.1',
            'x-fapi-interaction-id': `interaction-${Date.now()}`,
          },
        }
      );

      const quote = response.data.data;
      console.log('Quote Details:');
      console.log(`Total Amount: ${quote.totalAmount}`);
      console.log(`Investing Amount: ${quote.investingAmount}`);
      console.log(`Fee Amount: ${quote.feeAmount}`);
      return quote;
    } catch (error) {
      console.error(
        'Failed to get quote:',
        error.response?.data || error.message
      );
      throw error;
    }
  }

  // Usage Example
  const accessToken = 'YOUR_JWT_ACCESS_TOKEN';
  const productId = '123e4567-e89b-12d3-a456-426614174000';
  getQuote(accessToken, productId, 100);
  ```
</CodeGroup>


## OpenAPI

````yaml GET /quote/get-quote/{product-id}/{number-of-units-to-purchase}
openapi: 3.0.0
info:
  title: FinCode API
  version: v6
servers:
  - url: https://{tenant}.fincode.software/api/v6/services
    description: API v6
    variables:
      tenant:
        default: remitjunction
        description: Enter your tenant subdomain
  - url: https://{tenant}.fincode.software/api/v1/services
    description: API v1
    variables:
      tenant:
        default: finlend
        description: Enter your tenant subdomain
  - url: https://api.stag.songhaiexchange.io
    description: Songhai Exchange API
security: []
paths:
  /quote/get-quote/{product-id}/{number-of-units-to-purchase}:
    get:
      summary: Get Investment Quote
      description: Retrieves a quote for purchasing units.
      operationId: getInvestmentQuote
      parameters:
        - $ref: '#/components/parameters/platformHeader'
        - $ref: '#/components/parameters/uuidHeader'
        - in: header
          name: X-Auth-Token
          schema:
            type: string
          required: true
        - in: header
          name: x-idempotency-key
          schema:
            type: string
          required: true
        - in: path
          name: product-id
          schema:
            type: string
          required: true
        - in: path
          name: number-of-units-to-purchase
          schema:
            type: number
          required: true
      responses:
        '200':
          description: Investment quote
      servers:
        - url: >-
            https://test-investment-products-service.fincode.software/api/v1/user
components:
  parameters:
    platformHeader:
      in: header
      name: platform
      schema:
        type: string
        default: fincode
      required: true
    uuidHeader:
      in: header
      name: uuid
      schema:
        type: string
        default: '200'
      required: true

````