> ## 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.

# Cancel Payment

> This API allows you to cancel the authorized payment of a previously authorized order.

This API is used to cancel a payment for a specific order.

### Request Body

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

### Responses

#### 200 OK

```json theme={null}
{
  "status": true,
  "message": "Payment cancelled successfully",
  "id": "string"
}
```

#### 400 Bad Request

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


## OpenAPI

````yaml POST /api/v2/order/cancel
openapi: 3.1.0
info:
  title: Orchestration
  version: '1'
servers:
  - url: https://api.paytring.com
security:
  - sec0: []
paths:
  /api/v2/order/cancel:
    post:
      summary: Cancel Order
      description: >-
        This API allows you to cancel the authorized payment of a previously
        authorized order.
      operationId: cancel-order
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - key
                - id
                - hash
              properties:
                key:
                  type: string
                  description: Merchant Key
                  default: test_123
                id:
                  type: string
                  description: pass order id of partying in this param.
                hash:
                  type: string
                  description: hash is calculated as provided in doc.
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "status": true,
                        "message": "Order canceled successfully."
                    }
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                    default: true
                  message:
                    type: string
                    example: Order canceled successfully.
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"status\": false,\n    \"error\": {\n    \t\"code\": 202,\n      \"message\":\"error message\"\n    }\n}\n\n\n\n\n\n\n\n\n\n"
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                    default: true
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 202
                        default: 0
                      message:
                        type: string
                        example: error message
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````