# Verify VPA

**Method:** `POST`

**Path:** `/payment-option`

**Category:** Pay by Points

**Authentication:** Required

## Description

Verifies a customer's UPI VPA details or checks reward points balance.
Supports fetching UPI VPA details based on the payer's phone number, as well as checking reward points balance
and card eligibility.


## Request Body

Content-Type: `application/json`

- `payment_method` (`UPI | POINTS`) — Type of payment method to check eligibility for.
- `payment_option` (`object`) **required** — An object that contains the payment option details. Use `upi_details` for UPI or `points_card_details` for points. One is mandatory to process the request. 
  - `upi_details` (`object`) — UPI-specific payment option details.
    - `payer` (`object`) **required** — Payer details for fetching VPA.
      - `fetch_vpa` (`boolean`) **required** — Indicates whether VPA should be fetched for the payer.
      - `phone_number` (`string`) **required** — Payer phone number.


  - `points_card_details` (`object`) — **Mandatory when payment_method is `POINTS`**. An object that contains the point card details.
    - `card_last4` (`string`) — Last four digits of the card.
    - `card_number` (`string`) — Card number to check points balance.
    - `registered_mobile_number` (`string`) — Registered mobile number on the card.


- `order_details` (`object`) — Order details for the points balance check. Required when using points_card_details.
  - `order_amount` (`object`) **required** — Order amount for the points balance check.
    - `value` (`integer`) — Order amount in smallest currency unit (e.g., paisa).
    - `currency` (`string`) — Currency code.



### Example Request

```json
{
  "payment_method": "UPI",
  "payment_option": {
    "upi_details": {
      "payer": {
        "fetch_vpa": true,
        "phone_number": "9876543210"
      }
    },
    "points_card_details": {
      "card_last4": "1112",
      "card_number": "4012001037141112",
      "registered_mobile_number": "7827709063"
    }
  },
  "order_details": {
    "order_amount": {
      "value": 5000,
      "currency": "INR"
    }
  }
}
```

## Responses

- `200` — Payment option eligibility or points balance response.
- `400` — 
- `401` — 
- `422` — Unprocessable Entity — card not eligible or invalid request.
- `500` — 

### Response Schema

- `payment_method` (`UPI | POINTS`) — The payment method checked.
- `payment_option_metadata` (`object`) — Metadata returned for the payment option.
  - `upi_payment_option_data` (`object`) — UPI-specific metadata.
    - `fetched_vpa` (`string`) — VPA fetched for the payer phone number.


- `balance` (`object`) — Card balance details. Returned for points payment method.
  - `value` (`integer`) — Balance available on the card (in paisa).
  - `currency` (`string`)

- `redeemable_amount` (`object`) — Redeemable amount details. Returned for points payment method.
  - `value` (`integer`) — Redeemable amount on card (in paisa).
  - `currency` (`string`)

- `redeemable_points` (`integer`) — Total redeemable points available on the card.
- `is_eligible` (`boolean`) — Card eligibility status for pay by points.

### Example Response

```json
{
  "payment_method": "UPI",
  "payment_option_metadata": {
    "upi_payment_option_data": {
      "fetched_vpa": "customer@okaxis"
    }
  },
  "balance": {
    "value": 23718050,
    "currency": "INR"
  },
  "redeemable_amount": {
    "value": 3500,
    "currency": "INR"
  },
  "redeemable_points": 140,
  "is_eligible": true
}
```

---

Reference: https://localhost:3000/api/pay-by-points/get-payment-option
