# Calculate Convenience Fee

**Method:** `POST`

**Path:** `/api/v1/fees`

**Category:** Convenience Fee

**Authentication:** Required

## Description

Calculate the convenience fee for a payment against an order based on
the payment method and amount.


## Request Body

Content-Type: `application/json`

- `amount` (`object`) **required** — Monetary amount with currency.
  - `value` (`integer`) **required** — Amount in the smallest currency unit (e.g., paisa for INR).
  - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

- `payment_method` (`string`) **required** — Payment method for fee calculation.
- `network_type` (`string`) — Card network type for more specific fee calculation.

### Example Request

```json
{
  "amount": {
    "value": 50000,
    "currency": "INR"
  },
  "payment_method": "CARD",
  "network_type": "VISA"
}
```

## Responses

- `200` — Convenience fee calculated successfully.
- `400` — 
- `401` — 
- `422` — Unprocessable entity.
- `500` — 

### Response Schema

- `data` (`object[]`) — Array of convenience fee results per payment method/network combination.
  - `payment_method` (`string`) — Payment method.
  - `fee_type` (`string`) — Type of fee calculation.
  - `amount` (`object`) — Monetary amount with currency.
    - `value` (`integer`) **required** — Amount in the smallest currency unit (e.g., paisa for INR).
    - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

  - `convenience_fee_breakdown` (`object`) — Breakdown of the convenience fee.
    - `fee_amount` (`object`) — Monetary amount with currency.
      - `value` (`integer`) **required** — Amount in the smallest currency unit (e.g., paisa for INR).
      - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

    - `tax_amount` (`object`) — Monetary amount with currency.
      - `value` (`integer`) **required** — Amount in the smallest currency unit (e.g., paisa for INR).
      - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

    - `additional_fee_amount` (`object`) — Monetary amount with currency.
      - `value` (`integer`) **required** — Amount in the smallest currency unit (e.g., paisa for INR).
      - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

    - `maximum_fee_amount` (`object`) — Monetary amount with currency.
      - `value` (`integer`) **required** — Amount in the smallest currency unit (e.g., paisa for INR).
      - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

    - `applicable_fee_amount` (`object`) — Monetary amount with currency.
      - `value` (`integer`) **required** — Amount in the smallest currency unit (e.g., paisa for INR).
      - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.


  - `payable_amount` (`object`) — Monetary amount with currency.
    - `value` (`integer`) **required** — Amount in the smallest currency unit (e.g., paisa for INR).
    - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

  - `payment_method_metadata` (`object`) — Metadata about the payment method.
    - `network_type` (`string`) — Card network type.
    - `card_type` (`string`) — Type of card.



### Example Response

```json
{
  "data": [
    {
      "payment_method": "CARD",
      "fee_type": "PERCENTAGE",
      "amount": {
        "value": 50000,
        "currency": "INR"
      },
      "convenience_fee_breakdown": {
        "fee_amount": {
          "value": 50000,
          "currency": "INR"
        },
        "tax_amount": {
          "value": 50000,
          "currency": "INR"
        },
        "additional_fee_amount": {
          "value": 50000,
          "currency": "INR"
        },
        "maximum_fee_amount": {
          "value": 50000,
          "currency": "INR"
        },
        "applicable_fee_amount": {
          "value": 50000,
          "currency": "INR"
        }
      },
      "payable_amount": {
        "value": 50000,
        "currency": "INR"
      },
      "payment_method_metadata": {
        "network_type": "VISA",
        "card_type": "CREDIT"
      }
    }
  ]
}
```

---

Reference: https://localhost:3000/api/convenience-fee/calculate-convenience-fee
