# Void

Cancel a POS transaction before settlement.

## Void a transaction

/v1/pos-transactions/{systemTransactionId}/modifications

### Request example

Use the following request to void a transaction before settlement.

```json
{
  "merchant": "MERCHANT-1",
  "site": "SITE-1",
  "merchantTransactionId": "POS_002",
  "merchantTransactionDate": "2025-01-27T08:51:02.826Z",
  "systemTransactionId": "fff4cf23-9c69-40cc-8a8b-b5c86b302b74",
  "amounts": {
    "transaction": 24.99,
    "currencyCode": "GBP",
    "gratuity": 0
  },
  "operation": "Void",
  "statusCallbackUrl": "http://192.168.204.43:5000/statuspacket"
}
```

| Parameter | Description |
|  --- | --- |
| `merchant`string (≤ 20 characters) | Your unique merchant identifier, as assigned by PXP. |
| `site`string (≤ 50 characters) | Your unique site identifier, as assigned by PXP. |
| `merchantTransactionId`string (≤ 50 characters) | The unique identifier for this transaction, as chosen by you. |
| `merchantTransactionDate`date-time | The date and time when the initial transaction happened, in ISO 8601 format. |
| `systemTransactionId`string | The system transaction ID of the original transaction you are modifying. This must match the ID in the request path. |
| `amounts`object | Details about the transaction amount. |
| `amounts.transaction`number | The value of the transaction. For `Void` operations, this should match the original transaction value. |
| `amounts.currencyCode`string | The currency code associated with the transaction, in ISO 4217 format. |
| `amounts.gratuity`number | The optional gratuity amount. |
| `operation`string | The type of modification that you want to make. Set this to `Void`. Possible values:`Capture``FinalCapture``Refund``Incremental``Void` |
| `offerDcc`boolean | Whether to offer Dynamic Currency Conversion to the customer during the transaction. Note: This is primarily used for Capture operations but is no longer actively supported. Defaults to `false`. |
| `merchantDeeplink`string (URI) | A custom URI scheme that allows your mobile app to handle payment callbacks. When provided, the payment terminal will use this deeplink to redirect users back to your app after the transaction is completed. |
| `statusCallbackUrl`string | The webhook URL that PXP should send status updates to, if the *Return status packets* feature is enabled for the device. This overrides the webhook URL configured in the Unity Portal. |


### Response example

If your request is successful, you'll receive a `200` response containing a new `systemTransactionId` and an updated `state`. You'll also receive a Transaction (Card Cancelled) webhook notification.

```json
{
  "state": "Cancelled",
  "stateData": {
    "code": "CRD000",
    "message": "Approved"
  },
  "approvalCode": "260643",
  "merchantTransactionId": "POS_002",
  "systemTransactionId": "c1651dba-da35-44f1-bf12-a169d46ced0b",
  "merchantTransactionDate": "2025-04-11T08:37:02.826445+01:00",
  "fundingData": {
    "maskedPrimaryAccountNumber": "222360******0011",
    "expiryMonth": "12",
    "expiryYear": "2049",
    "cardScheme": "MasterCard",
    "gatewayTokenId": "db2d6ff1-d67e-44d2-9e56-4bcdacad753f",
    "providerResponse": {
      "provider": "PXP Financial",
      "code": "00",
      "message": "",
      "merchantId": "",
      "terminalId": "",
      "paymentAccountReference": "",
      "schemeTransactionId": "",
      "merchantAdvice": {
        "code": "",
        "message": ""
      },
      "settlementDate": "2025-04-11T12:03:37.519413+01:00"
      }
   }
}
```