---
page_title: Create Refund for Split Settled Transactions
product: API Reference
page_source: https://juspay.io/in/docs/api-reference/docs/split-settlement/create-refund-for-split-settled-transactions
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fapi-reference%2Fdocs%2Fsplit-settlement%2Fcreate-refund-for-split-settled-transactions
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/api-reference/llms.txt
---

## API Version: default


# Create Refund for Split Settled Transactions



## Endpoints:
- Sandbox: https://sandbox.juspay.in/orders/{order_id}/refunds

- Production: https://api.juspay.in/orders/{order_id}/refunds

## Request Type: 
POST

## Headers:

#### Content-Type:
application/x-www-form-urlencoded
- Tags: string, Required

#### Authorization:
Basic of Base64 encoded API Key
- Tags: string, Required

#### x-routing-id:
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.

> **Warning**
> This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.


- Value: customer_1122
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location --request POST 'https://api.juspay.in/orders/splitsettlement_1619009418_test/refunds' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic <base64 of Merchant API Key>' \
--header 'x-routing-id: customer_1122'\
--data-urlencode 'unique_request_id=refund_1619010416' \
--data-urlencode 'amount=1' \
--data-urlencode 'metadata.split_settlement_details={"marketplace": {"refund_amount": 0}, "vendor": {"split": [{"sub_mid": "Vendor2", "refund_amount": 1}]}}'

```

### Sample Response:

#### Response:
```json
{
  "udf9": "",
  "udf8": "",
  "udf7": "",
  "udf6": "",
  "udf5": "",
  "udf4": "",
  "udf3": "",
  "udf2": "",
  "udf10": "",
  "udf1": "",
  "txn_uuid": "eul4bnuBAnnC7UivV8k",
  "txn_id": "splitsettlement_1619009418_test",
  "status_id": 21,
  "status": "CHARGED",
  "split_settlement_response": {
    "split_details": [
      {
        "sub_vendor_id": "Vendor1",
        "amount": 3
      },
      {
        "sub_vendor_id": "Vendor2",
        "refunded_amount": 1,
        "amount": 2
      }
    ],
    "split_applied": true
  },
  "return_url": "https://www.google.com",
  "refunds": [
    {
      "unique_request_id": "refund_1619010416",
      "status": "SUCCESS",
      "sent_to_gateway": true,
      "ref": null,
      "id": null,
      "error_message": "",
      "created": "2021-04-21T19:00:21Z",
      "amount": 1
    }
  ],
  "refunded": true,
  "product_id": "",
  "payment_method_type": "CARD",
  "payment_method": "VISA",
  "payment_links": {
    "web": "https://api.juspay.in/merchant/pay/ordeh_16c54f506c1143a88d2aca61533e8b56",
    "mobile": "https://api.juspay.in/merchant/pay/ordeh_16c54f506c1143a88d2aca61533e8b56?mobile=true",
    "iframe": "https://api.juspay.in/merchant/ipay/ordeh_16c54f506c1143a88d2aca61533e8b56"
  },
  "payment_gateway_response": {
    "txn_id": "splitsettlement_1619009418_test",
    "rrn": "768370",
    "resp_message": "Approved",
    "resp_code": "Success",
    "epg_txn_id": "110086948408",
    "created": "2021-04-21T06:28:49Z",
    "auth_id_code": "NA"
  },
  "order_id": "splitsettlement_1619009418_test",
  "merchant_id": "merchant identifier",
  "id": "ordeh_16c54f506c1143a88d2aca61533e8b56",
  "gateway_reference_id": null,
  "gateway_id": 16,
  "date_created": "2021-04-21T06:28:09Z",
  "customer_phone": "9987039379",
  "customer_id": "cst_1845074",
  "customer_email": "juspay@juspay.in",
  "currency": "INR",
  "card": {
    "using_saved_card": true,
    "saved_to_locker": false,
    "name_on_card": "XXXX",
    "last_four_digits": "",
    "expiry_year": "",
    "expiry_month": "",
    "card_type": "DEBIT",
    "card_reference": "",
    "card_issuer": "IDFC Bank",
    "card_isin": "",
    "card_fingerprint": "",
    "card_brand": "VISA"
  },
  "bank_error_message": "",
  "bank_error_code": "",
  "auth_type": "THREE_DS",
  "amount_refunded": 1,
  "amount": 5
}
```

## Path Parameters:

#### order_id:
Order Id
- Value: Example:- ord_3876784
- Tags: String, Mandatory
## Body Parameters:
### Parameters:

#### amount:
- Description: Amount that has to be refunded. Amount has to be less than or equal to the amount of the order that is not yet refunded.
- Tags: string, Required

#### unique_request_id:
- Description: Request ID that uniquely identifies this request. You cannot reuse the value for two different refund requests. This is to avoid processing duplicate refund requests.
- Tags: string, Required

#### metadata:
- Description: This field describes how much amount has to be refunded from the respective sub account ids.
- Value:
  - **Split_settlement_details**:
    - Description: This field describes how much amount has to be refunded from the respective sub account ids.
    - Value:
      - **Marketplace**:
        - Description: Marketplace (Parent merchant account ID) refund specific data to be passed
        - Value:
          - **Refund_amount**:
            - Description: Refund amount to be reversed from the parent merchant settlement accountNOTE: Refund Amount is to be passed with Decimal values and has to be less than or equal the split amount passed in the Order
            - Tags: Number, Mandatory
        - Tags: JSON, Conditional
      - **Vendor**:
        - Description: Vendor (Sub account IDs) specific data to be passed
        - Value:
          - **Split**:
            - Description: Split settlement refund information to be passed
            - Value:
              - **Sub_mid**:
                - Description: Sub Account ID (maintained at JusPay’s end) to be passed.
                - Tags: String, Mandatory
              - **Refund_amount**:
                - Description: Refund Amount to be reversed from the sub accountNOTE: Refund Amount is to be passed with Decimal values and has to be less than or equal the split amount passed in the Order
                - Tags: Number, Mandatory
            - Tags: Array, Conditional
        - Tags: JSON, Conditional
    - Tags: string, RequiredTag
- Tags: object, Required
## API Responses:
### 200:

#### udf1-10:
- Tags: string

#### txn_uuid:
- Description: eul4bnuBAnnC7UivV8k
- Tags: string

#### txn_id:
- Description: splitsettlement_1619009418_test
- Tags: string

#### status_id:
- Tags: integer

#### status:
- Description: CHARGED
- Tags: string

#### split_settlement_response:
- Value:
  - **Split_details. sub_vendor_id**:
    - Tags: String
  - **Split_details.amount**:
    - Tags: Integer
  - **Split_applied**:
    - Tags: Boolean
- Tags: object

#### return_url:
- Description: https://www.google.com
- Tags: string

#### refunds:
- Tags: array

#### refunded:
- Tags: boolean

#### product_id:
- Tags: string

#### payment_method_type:
- Description: CARD
- Tags: string

#### payment_method:
- Description: VISA
- Tags: string

#### payment_links:
- Value:
  - **Web**:
    - Description: https://api.juspay.in/merchant/pay/ordeh_16c54f506c1143a88d2aca61533e8b56
    - Tags: string
  - **Mobile**:
    - Description: https://api.juspay.in/merchant/pay/ordeh_16c54f506c1143a88d2aca61533e8b56?mobile=true
    - Tags: string
  - **Iframe**:
    - Description: https://api.juspay.in/merchant/ipay/ordeh_16c54f506c1143a88d2aca61533e8b56
    - Tags: string
- Tags: object

#### payment_gateway_response:
- Value:
  - **Txn_id**:
    - Description: splitsettlement_1619009418_test
    - Tags: string
  - **Rrn**:
    - Description: 768370
    - Tags: string
  - **Resp_message**:
    - Description: Approved
    - Tags: string
  - **Resp_code**:
    - Description: Success
    - Tags: string
  - **Epg_txn_id**:
    - Description: 110086948408
    - Tags: string
  - **Created**:
    - Description: 2021-04-21T06:28:49Z
    - Tags: string
  - **Auth_id_code**:
    - Description: NA
    - Tags: string
- Tags: object

#### order_id:
- Description: splitsettlement_1619009418_test
- Tags: string

#### merchant_id:
- Description: merchant identifier
- Tags: string

#### id:
- Description: ordeh_16c54f506c1143a88d2aca61533e8b56
- Tags: string

#### gateway_reference_id:

#### gateway_id:
- Tags: integer

#### date_created:
- Description: 2021-04-21T06:28:09Z
- Tags: string

#### customer_phone:
- Description: 9987039379
- Tags: string

#### customer_id:
- Description: cst_1845074
- Tags: string

#### customer_email:
- Description: juspay@juspay.in
- Tags: string

#### currency:
- Description: INR
- Tags: string

#### card:
- Value:
  - **Using_saved_card**:
    - Tags: boolean
  - **Saved_to_locker**:
    - Tags: boolean
  - **Name_on_card**:
    - Description: XXXX
    - Tags: string
  - **Last_four_digits**:
    - Tags: string
  - **Expiry_year**:
    - Tags: string
  - **Expiry_month**:
    - Tags: string
  - **Card_type**:
    - Description: DEBIT
    - Tags: string
  - **Card_reference**:
    - Tags: string
  - **Card_issuer**:
    - Description: IDFC Bank
    - Tags: string
  - **Card_isin**:
    - Tags: string
  - **Card_fingerprint**:
    - Tags: string
  - **Card_brand**:
    - Description: VISA
    - Tags: string
- Tags: object

#### bank_error_message:
- Tags: string

#### bank_error_code:
- Tags: string

#### auth_type:
- Description: THREE_DS
- Tags: string

#### amount_refunded:
- Tags: integer

#### amount:
- Tags: integer
### 400:

#### status_id:
- Tags: integer

#### status:
- Description: ERROR
- Tags: string

#### error_message:
- Description: Refund amount exceeds the refundable amount.
- Tags: string

#### error_code:
- Description: invalid.amount.exceeded
- Tags: string


---

## See Also

- [Order Status for Split Settlement](https://juspay.io/in/docs/api-reference/docs/split-settlement/order-status-for-split-settlement)
- [GooglePay Integration](https://juspay.io/in/docs/api-reference/docs/googlepay-integrations-and-flows/googlepay-integration)
