---
title: Sale/Void cancel
description: Cancel or void a POS transaction to reverse the deducted amount.
---

A void transaction is a transaction that is cancelled by a merchant or vendor before it settles through a consumer's debit or credit card account. This API is used to make a transaction void -- it reverses the deducted amount based on original RRN. If the request has valid details, the sale will be cancelled.

#### POST

```
https://kraken.airpay.co.in/airpay/ms/pos/api/cancel-txn
```

## Request Body

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| mercid  required | String  <br>(1-12) | Merchant Id | `18999` |
| orderid  required | String  <br>(4-12) | Order Id | `180554` |
| amount  required | Number  <br>(12,2) | Amount | `1.00` |
| uniqueid  required | String  <br>(4-10) | Unique ID is a unique identifier and have unique value | `012686` |
| postxntype  required | Number  <br>(2) | Post Transaction Type<br>01 - Sale/Purchase (Transaction Type is either sale or purchase)<br>08 - Void (Cancel the transaction)<br>07 - Pre auth (Holds the amount for some period of time)<br>10 - Sale completion (Use the preauth amount.This amount will be deducted from the account)<br>11 - Auth Release (Cancel the auth) | `01` |
| originalrrn  required | String  <br>(12-20) | Unique number to verify the transaction whether it is success or failure<br>In case of void it is required.<br>In case of sale it is not required. | `12441412412` |

## Success 200

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| status  required | Number | Status Code | `200` |
| message  required | String | Status Message | `message[]` |

## Request Example

```
curl --location --request POST 'https://kraken.airpay.co.in/airpay/ms/pos/api/cancel-txn' \
 --header 'content-type: application/x-www-form-urlencoded' \
--data-urlencode 'amount=1.00' \
--data-urlencode 'orderid=180554' \
--data-urlencode 'mercid=18999' \
--data-urlencode 'uniqueid=012686' \
--data-urlencode 'postxntype=01' \
--data-urlencode 'originalrrn=003511588415'
```

### Success Response

```json
HTTP/1.1 200 OK
{
     "status": 200​, "message": []
}
```

### Error Response

```json
{
    "status": 502,
    "message": []
}
```