# Create Refund

**Method:** `POST`

**Path:** `/api/pay/v1/refunds/{order_id}`

**Category:** Refunds

**Authentication:** Required

## Description

Creates a refund against a completed order.

**Important notes:**
- For a full refund, all IMEI numbers associated with products are automatically blocked.
- For a partial refund, you must specify the IMEI number that needs to be blocked.
- Refunds of less than ₹1 are not supported.
- For a given day, the total sale amount must be greater than or equal to the total refund amount.


## Path Parameters

- `order_id` (`string`) **required** — The unique order identifier to refund against.

## Request Body

Content-Type: `application/json`

- `merchant_order_reference` (`string`) **required** — **Idempotency Key.** Unique identifier for the refund request. Duplicate requests with the same `merchant_order_reference` will return the existing refund instead of creating a new one.
- `order_amount` (`object`) **required** — The refund amount details.
  - `value` (`integer`) **required** — Refund amount in the smallest currency unit (e.g., paisa for INR). Minimum ₹1 (100 paisa).
  - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

- `merchant_metadata` (`object`) — Arbitrary key-value pairs for merchant use. Maximum 10 pairs, 256 characters each.
- `products` (`object[]`) — Array of product objects for IMEI blocking (required for partial refunds with IMEI).
  - `product_code` (`string`) — Product code/SKU.
  - `imei_number` (`string`) — IMEI number to block for partial refunds.

- `split_info` (`object`) — Split settlement information for refunds involving split payments.
  - `split_type` (`string`) — Type of split.
  - `split_details` (`object[]`)
    - `split_merchant_id` (`string`) — Unique identifier of the partner merchant.
    - `merchant_settlement_reference` (`string`) — Merchant settlement reference for the split.
    - `amount` (`object`)
      - `value` (`integer`)
      - `currency` (`string`)




### Example Request

```json
{
  "merchant_order_reference": "e436fefa-f0e9-4b36-ac01-3d158c31726c",
  "order_amount": {
    "value": 400,
    "currency": "INR"
  },
  "merchant_metadata": {
    "clientId": "DD",
    "transactionReferenceNo": "pine-1223",
    "merchantId": "1234",
    "tid": "9000990",
    "acquirerName": "HDFC_FSS",
    "isOfferDisplayRequired": "true",
    "OfferData": "UHJvZHVjdF9Db2RlPSIgIiZQcm9kdWN0X05hbWU9IiImUGF5bWVudF9Nb2RlPUJhbmsgRU1JJkNhcmRfVHlwZT1EZWJpdCBDYXJkJkJhbmtfTmFtZT1IREZDIERlYml0JkVNSV9UZW51cmU9NiZJbnRlcmVzdF9SYXRlPTkuMCZJbnRlcmVzdF9BbW91bnQ9MTM4MTQwJk1vbnRobHlfSW5zdGFsbG1lbnQ9ODk0NjkwJkF1dGhvcml6YXRpb25fQW1vdW50PTEwMCZMb2FuX2Jvb2tpbmdfQW1vdW50PTUyMzAwMDAmSW50ZXJlc3RfQ2FzaGJhY2tfQW1vdW50PTAmSW50ZXJlc3RfQ2FzaGJhY2tfVHlwZT1EZWZlcnJlZCZBZGRpdGlvbmFsX0Nhc2hiYWNrPSIiJkFkZGl0aW9uYWxfQ2FzaGJhY2tfVHlwZT0iIiZEZXNjcmlwdGlvbj1CYW5rIEVNSSZQcm9kdWN0X1ZhbHVlPTUyMzAwMDA",
    "tenant_id": "PGATPOS",
    "is_offer_validation_required": "true"
  },
  "products": [],
  "split_info": {
    "split_type": "AMOUNT",
    "split_details": [
      {
        "split_merchant_id": "117230",
        "merchant_settlement_reference": "ref1",
        "amount": {
          "value": 21000,
          "currency": "INR"
        }
      }
    ]
  }
}
```

## Responses

- `200` — Refund created successfully.
- `400` — 
- `401` — 
- `404` — 
- `422` — Unprocessable Entity — amount limit exceeded or invalid refund.
- `500` — 

### Response Schema

- `data` (`object`)
  - `order_id` (`string`) — Unique identifier of the refund order.
  - `parent_order_id` (`string`) — Unique identifier of the parent order being refunded.
  - `merchant_order_reference` (`string`) — Merchant reference for the refund.
  - `type` (`CHARGE | REFUND`) — Payment type.
  - `status` (`CREATED | PENDING | PROCESSED | FAILED`) — Refund status.
  - `merchant_id` (`string`) — Unique identifier of the merchant.
  - `order_amount` (`object`)
    - `value` (`integer`)
    - `currency` (`string`)

  - `purchase_details` (`object`)
    - `customer` (`object`)
      - `email_id` (`string`)
      - `first_name` (`string`)
      - `last_name` (`string`)
      - `customer_id` (`string`)
      - `mobile_number` (`string`)
      - `country_code` (`string`)
      - `billing_address` (`object`) — Physical address.
        - `address1` (`string`) — Address line 1.
        - `address2` (`string`) — Address line 2.
        - `address3` (`string`) — Address line 3.
        - `pincode` (`string`) — Postal/ZIP code.
        - `city` (`string`) — City name.
        - `state` (`string`) — State or province.
        - `country` (`string`) — Country name.
        - `full_name` (`string`) — Full name of the address holder.
        - `adddress_type` (`string`) — Type of address (e.g., Home, Office).
        - `address_category` (`billing | shipping`) — Category of the address.

      - `shipping_address` (`object`) — Physical address.
        - `address1` (`string`) — Address line 1.
        - `address2` (`string`) — Address line 2.
        - `address3` (`string`) — Address line 3.
        - `pincode` (`string`) — Postal/ZIP code.
        - `city` (`string`) — City name.
        - `state` (`string`) — State or province.
        - `country` (`string`) — Country name.
        - `full_name` (`string`) — Full name of the address holder.
        - `adddress_type` (`string`) — Type of address (e.g., Home, Office).
        - `address_category` (`billing | shipping`) — Category of the address.

      - `is_edit_customer_details_allowed` (`boolean`) — Whether the customer is allowed to edit their details.

    - `merchant_metadata` (`object`) — Arbitrary key-value pairs for merchant use. Maximum 10 pairs, 256 characters each.
    - `split_info` (`object`)
      - `split_type` (`string`)
      - `split_details` (`SplitDetailRefund[]`)
        - `parent_order_split_settlement_id` (`string`) — Unique identifier of the parent split settlement.
        - `split_merchant_id` (`string`) — Unique identifier of the partner merchant.
        - `split_settlement_id` (`string`) — Unique identifier of the refund split settlement.
        - `merchant_settlement_reference` (`string`) — Merchant settlement reference.
        - `amount` (`object`)
          - `value` (`integer`)
          - `currency` (`string`)

        - `status` (`DO_NOT_RECOVER | `) — Split settlement recovery status.
        - `updated_at` (`string`) — ISO 8601 UTC timestamp when the split was created.



  - `payments` (`PaymentObject[]`)
    - `id` (`string`) — Unique identifier of the payment.
    - `status` (`PENDING | AUTHORIZED | CANCELLED | PROCESSED | FAILED`) — Payment status.
    - `payment_amount` (`object`)
      - `value` (`integer`)
      - `currency` (`string`)

    - `payment_method` (`CARD | UPI | POINTS | NETBANKING | WALLET`) — Type of payment method.
    - `acquirer_data` (`object`)
      - `approval_code` (`string`)
      - `acquirer_reference` (`string`)
      - `rrn` (`string`)
      - `is_aggregator` (`boolean`)
      - `acquirer_name` (`string`)

    - `offer_data` (`object`) — Offer details associated with the payment.
    - `created_at` (`string`)
    - `updated_at` (`string`)

  - `created_at` (`string`) — ISO 8601 UTC timestamp when the refund was created.
  - `updated_at` (`string`) — ISO 8601 UTC timestamp when the refund was last updated.
  - `integration_mode` (`SEAMLESS | REDIRECT`) — Mode of implementation.
  - `payment_retries_remaining` (`integer`) — Remaining payment retry attempts.


### Example Response

```json
{
  "data": {
    "order_id": "v1-241010071949-aa-vcqtJY",
    "parent_order_id": "v1-241010055924-aa-AHbN0s",
    "merchant_order_reference": "e436fefa-f0e9-4b36-ac01-3d158c31726c",
    "type": "REFUND",
    "status": "PROCESSED",
    "merchant_id": "108272",
    "order_amount": {
      "value": 400,
      "currency": "INR"
    },
    "purchase_details": {
      "customer": {
        "email_id": "[email protected]",
        "first_name": "Kevin",
        "last_name": "Bob",
        "customer_id": "123456",
        "mobile_number": "9876543210",
        "country_code": "91",
        "billing_address": {
          "address1": "10 Downing Street Westminster London",
          "address2": "Oxford Street Westminster London",
          "address3": "Baker Street Westminster London",
          "pincode": "51524036",
          "city": "Westminster",
          "state": "Westminster",
          "country": "London",
          "full_name": "Kevin Bob",
          "adddress_type": "Home",
          "address_category": "billing"
        },
        "shipping_address": {
          "address1": "10 Downing Street Westminster London",
          "address2": "Oxford Street Westminster London",
          "address3": "Baker Street Westminster London",
          "pincode": "51524036",
          "city": "Westminster",
          "state": "Westminster",
          "country": "London",
          "full_name": "Kevin Bob",
          "adddress_type": "Home",
          "address_category": "billing"
        },
        "is_edit_customer_details_allowed": false
      },
      "merchant_metadata": {
        "clientId": "DD",
        "transactionReferenceNo": "pine-1223",
        "merchantId": "1234",
        "tid": "9000990",
        "acquirerName": "HDFC_FSS",
        "isOfferDisplayRequired": "true",
        "OfferData": "UHJvZHVjdF9Db2RlPSIgIiZQcm9kdWN0X05hbWU9IiImUGF5bWVudF9Nb2RlPUJhbmsgRU1JJkNhcmRfVHlwZT1EZWJpdCBDYXJkJkJhbmtfTmFtZT1IREZDIERlYml0JkVNSV9UZW51cmU9NiZJbnRlcmVzdF9SYXRlPTkuMCZJbnRlcmVzdF9BbW91bnQ9MTM4MTQwJk1vbnRobHlfSW5zdGFsbG1lbnQ9ODk0NjkwJkF1dGhvcml6YXRpb25fQW1vdW50PTEwMCZMb2FuX2Jvb2tpbmdfQW1vdW50PTUyMzAwMDAmSW50ZXJlc3RfQ2FzaGJhY2tfQW1vdW50PTAmSW50ZXJlc3RfQ2FzaGJhY2tfVHlwZT1EZWZlcnJlZCZBZGRpdGlvbmFsX0Nhc2hiYWNrPSIiJkFkZGl0aW9uYWxfQ2FzaGJhY2tfVHlwZT0iIiZEZXNjcmlwdGlvbj1CYW5rIEVNSSZQcm9kdWN0X1ZhbHVlPTUyMzAwMDA",
        "tenant_id": "PGATPOS",
        "is_offer_validation_required": "true"
      },
      "split_info": {
        "split_type": "AMOUNT",
        "split_details": [
          {
            "parent_order_split_settlement_id": "v1-250513063000-aa-UBAnaE-ss-g",
            "split_merchant_id": "117230",
            "split_settlement_id": "v1-5312042524-aa-0YO29z-ss-a",
            "merchant_settlement_reference": "ref1",
            "amount": {
              "value": 21000,
              "currency": "INR"
            },
            "status": "DO_NOT_RECOVER",
            "updated_at": "2025-05-13T06:34:38.036Z"
          }
        ]
      }
    },
    "payments": [
      {
        "id": "v1-241010071949-aa-vcqtJY-cc-b",
        "status": "PROCESSED",
        "payment_amount": {
          "value": 400,
          "currency": "INR"
        },
        "payment_method": "CARD",
        "acquirer_data": {
          "approval_code": "",
          "acquirer_reference": "7285447904236780703954",
          "rrn": "",
          "is_aggregator": true,
          "acquirer_name": "Cyber_Source_AXIS"
        },
        "created_at": "2024-10-10T07:19:49.423Z",
        "updated_at": "2024-10-10T07:19:51.205Z"
      }
    ],
    "created_at": "2024-10-10T07:19:49.424Z",
    "updated_at": "2024-10-10T07:19:51.205Z",
    "integration_mode": "SEAMLESS",
    "payment_retries_remaining": 10
  }
}
```

---

Reference: https://localhost:3000/api/refunds/create-refund
