> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paytring.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund Order

> This API can trigger refund for any order of any pg.

This API can trigger a refund for any order of any payment gateway.

### Request Body

```json theme={null}
{
  "key": "string", // Merchant API key
  "id": "string", // Order ID
  "hash": "string" // Calculated hash for request validation
}
```

### Responses

#### 200 OK

```json theme={null}
{
  "status": true,
  "message": "Refund has been initiated",
  "id": "string"
}
```

#### 400 Bad Request

```json theme={null}
{
  "status": false,
  "error": {
    "message": "Invalid request",
    "code": 400
  }
}
```


## OpenAPI

````yaml POST /api/v2/order/refund
openapi: 3.1.0
info:
  title: Orchestration
  version: '1'
servers:
  - url: https://api.paytring.com
security:
  - sec0: []
paths:
  /api/v2/order/refund:
    post:
      summary: Refund Order
      description: This API can trigger refund for any order of any pg.
      operationId: refund-order
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - key
                - id
                - hash
              properties:
                key:
                  type: string
                  description: Merchant api key, provided in paytring dashbord
                id:
                  type: string
                  description: Order id provided by paytring.
                hash:
                  type: string
                  description: to be calculated by hash logic.
                  default: 'null'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "status": true,
                        "message": "Refund has been initiated",
                        "id": "xxxxxx-xxxx"
                    }
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                    default: true
                  message:
                    type: string
                    example: Refund has been initiated
                  id:
                    type: string
                    example: xxxxxx-xxxx
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: |
                    {
                        "status": false,
                        "error": {
                            "message": "error message here",
                            "code": 204
                        }
                    }
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                    default: true
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        example: error message here
                      code:
                        type: integer
                        example: 204
                        default: 0
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````