---
page_source: https://juspay.io/in/docs/upi-merchant-stack/docs/submerchants/sub-merchant-refund-360
page_title: Sub Merchant Refund 360
---

## API Version: default


## **Sub Merchant Refund 360** 



This api can be used to trigger a refund against a successful sub-merchant transaction.

> **Note**
> This is an idempotent api.



## Endpoints:
- Production: http://{{host}}/api/{uri}/merchants/transactions/refund360

## Request Type: 
POST

## Headers:

#### Content-Type:
`application/json`
- Value: application/json
- Tags: string

#### x-merchant-id:
Will be shared while onboarding.
- Value: TEST
- Tags: string

#### x-merchant-channel-id:
Will be shared while onboarding.
- Value: TESTAPP
- Tags: string

#### Accept:
`application/json`
- Value: application/json
- Tags: string

#### x-timestamp:
This is an epoch unix timestamp string. For example, `1496918882000`. It can be used by us to invalidate older requests.
- Value: 23456789012
- Tags: String

#### x-merchant-signature:
This is a signature over combination of headers, payload. Refer Signature Calculation section for more details.
- Value: janfajnskdfcxnkansdkcnakdnsckvnafkd
- Tags: string

#### x-sub-merchant-id:
Provided during on-boarding. To be passed in the apis if it needs to be invoked in sub merchant mode.
- Tags: String

#### x-sub-merchant-channel-id:
Provided during on-boarding. To be passed in the apis if it needs to be invoked in sub merchant mode.
- Tags: String
## Sample Code Snippets:
### Code Snippets:

#### Shell Code Snippet:

```shell
{"success":false,"message":"No Data found for the given path"}
```

### Sample Request and Response:

#### Request:
```json
{"success":false,"message":"No Data found for the given path"}
```

#### Response:
```json
{"success":false,"message":"No Data found for the given path"}
```

## Body Parameters:
### Parameters:

#### originalUpiRequestId:
- Description: UPI request id for the original transaction against which refund is being initiated**Constraints:** 35 character alphanumeric
- Tags: String, Mandatory

#### originalTransactionTimestamp:
- Description: Timestamp of the original transaction**Constraints:** As returned in the response of original transaction api, String (`YYYY-MM-DDTHH:MM:SS+05:30`)
- Tags: String, Optional

#### refundRequestId:
- Description: Merchant generated unique id for the refund**Constraints:** 35 characters alphanumeric
- Tags: String, Mandatory

#### refundAmount:
- Description: The amount to be refunded**Constraints:** String with mandatory two decimals
- Tags: String, Mandatory

#### refundType:
- Description: Type of refund being initiated**Constraints:** `OFFLINE`, `ONLINE`
- Tags: String, Mandatory

#### merchantRefundVpa:
- Description: Merchant refund vpa of parent merchant is to be used for online refund**Constraints:** mandatory for `refundType = ONLINE`, vpa@handle
- Tags: String, optional

#### remarks:
- Description: Remarks or reason for the refund**Constraint:** The transaction note must be alphanumeric, with a **minimum length of 1 character and a maximum length of 50**  characters.
- Tags: String, Mandatory

#### udfParameters:
- Description: Stringified JSON for udf parameters

**Example** : "{\"udf1\":\"value1\",\"udf2\":\"value2\",…}"**Note** : Few special characters are not allowed. Regex for the characters which are not allowed : **^[^/#-()*!%~`]+$** 
- Tags: JSON String, Optional

#### iat:
- Description: Timestamp to be used in JWS**Constraints:** As passed in the request body
- Tags: String, Mandatory
## API Responses:
### 200:

#### status:
- Description: PSP status of the APISUCCESS, FAILURE
- Tags: String, Mandatory

#### responseCode:
- Description: PSP response code for the APIRefer error code section
- Tags: String, Mandatory

#### responseMessage:
- Description: PSP response message for the APIRefer error code section
- Tags: String, Mandatory

#### payload:
- Value:
  - **MerchantId**:
    - Description: Unique id for the merchantAs passed in request headers
    - Tags: String, Mandatory
  - **MerchantChannelId**:
    - Description: Unique id for the merchant channelAs passed in request headers
    - Tags: String, Mandatory
  - **RefundRequestId**:
    - Description: Merchant generated unique id for the refundAs passed in the request body
    - Tags: String, Mandatory
  - **TransactionAmount**:
    - Description: The total amount for which original transaction was performedString with mandatory two decimals
    - Tags: String, Mandatory
  - **RefundAmount**:
    - Description: The amount to be refundedAs passed in the request body
    - Tags: String, Mandatory
  - **RefundType**:
    - Description: Type of refund being initiatedAs passed in the request body
    - Tags: String, Mandatory
  - **RefundTimestamp**:
    - Description: Timestamp of when refund request was initiatedString (`YYYY-MM-DDTHH:MM:SS+05:30`)
    - Tags: String, Mandatory
  - **GatewayTransactionId**:
    - Description: UPI request id returned by gateway for the transactionSame as `originalUpiRequestId` passed in request
    - Tags: String, Mandatory
  - **GatewayRefundReferenceId**:
    - Description: Reference id returned by the gateway for the refund
    - Tags: String, Mandatory
  - **GatewayResponseStatus**:
    - Description: Response status returned by gateway for the refundString (`SUCCESS`, `PENDING`, `DEEMED`, `FAILURE`)
    - Tags: String, Mandatory
  - **GatewayResponseCode**:
    - Description: Response code returned by gateway for the refund
    - Tags: String, Mandatory
  - **GatewayResponseMessage**:
    - Description: Response message for code returned by gateway for the refund
    - Tags: String, Mandatory
- Tags: JSON, Mandatory

#### udfParameters:
- Description: Udf parametersAs passed in the request body
- Tags: JSON String, Optional
