# Refund

Return funds from a purchase POS transaction back to a customer.

## Refund a purchase transaction

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

### Request example

Use the following request to return funds from a purchase transaction back to the original payment method.

You can also perform a refund by [initiating a transaction](/guides/pos-plus/api/card-transaction) and setting the intent to `Refund`.

```json
{
  "merchant": "MERCHANT-1",
  "site": "SITE-1",
  "merchantTransactionId": "POS_002",
  "merchantTransactionDate": "2025-01-27T08:51:02.826Z",
  "amounts": {
    "transaction": 24.99,
    "currencyCode": "GBP",
    "gratuity": 0
  },
  "operation": "Refund",
  "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. |
| `amounts`object | Details about the transaction amount. |
| `amounts.transaction`string | The value of the transaction. For `Refund` operations, this can't be more than the original transaction value. |
| `amounts.currencyCode`string | The currency code associated with the transaction, in ISO 4217 format. |
| `amounts.gratuity`number | The gratuity or tip amount added by the customer to the transaction total. |
| `operation`string | The type of modification that you want to make. Set this to `Refund`.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`. You'll also receive a Transaction (Authorised) webhook notification.

```json
{
  "state": "Authorised",
  "stateData": {
    "code": "CRD000",
    "message": "Approved"
  },
  "approvalCode": "991721",
  "merchantTransactionId": "ngtest250411_m12",
  "systemTransactionId": "c2bacf16-c6f9-4709-b03a-6916504c730b",
  "merchantTransactionDate": "2025-04-11T09:51:02.826445+01:00",
  "fundingData": {
    "maskedPrimaryAccountNumber": "",
    "expiryMonth": "",
    "expiryYear": "",
    "cardScheme": "AmericanExpress",
    "gatewayTokenId": "31759b1c-9057-4306-900e-a944e189c79c",
    "providerResponse": {
      "provider": "American Express",
      "code": "000",
      "message": "",
      "merchantId": "0371518531",
      "terminalId": "12345678",
      "paymentAccountReference": "99999999999999999999999999999999999",
      "schemeTransactionId": "000003530991721",
      "merchantAdvice": {
        "code": "",
        "message": ""
      },
      "settlementDate": "2025-04-11T09:42:54.369310+01:00"
    }
  },
  "amounts": {
    "gratuity": 0
  },
  "dccData": {
    "dccSelectedIndicator": "Selected",
    "amounts": {
      "local": {
        "transaction": 100.00,
        "currencyCode": "USD"
      },
      "cardholder": {
        "transaction": 85.50,
        "currencyCode": "EUR"
      }
    },
    "exchangeRate": 0.855,
    "markupRate": 3.92,
    "disclaimer": "You are offered to pay in EUR. This includes a 3.5% commission above the base rate of 0.9245 provided by Elavon.",
    "providerData": {
      "provider": "Elavon",
      "referenceId": "REF123456789",
      "merchantId": "MERCH001",
      "terminalId": "TERM001",
      "markupTextIndicator": 1
    }
  }
}
```