---
title: Sale/Void cancel
description: 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.
---

# PUSH TO POS - Sale/Void cancel

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
```

## Parameter

| Field | Type | Description |
| --- | --- | --- |
| mercid | String | Merchant Id (length 1-12, required) |
| orderid | String | Order ID (length 4-12, required) |
| amount | Number | Amount (length 12,2, required) |
| uniqueid | String | (Unique ID is a unique identifier and have unique value,length 4-10, required) |
| postxntype | Number | Post Transaction Type (length 1, required)<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) |
| originalrrn | String | 12 digit unique number to verify the transaction whether it is success or failure (length 20, not required)<br>In case of void it is required.<br>In case of sale it is not required. |

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

| Field | Type | Description |
| --- | --- | --- |
| status | Number | Status Code |
| message | String | Status Message |

## Success-Response:

```
HTTP/1.1 200 OK
{
     "status": 200​, "message": []
}
```
## Error-Response: 

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