Making a Partial Refund

When a transaction has been settled you can make a partial refund by making a new transaction on the same credit card with a Negative Amount.

  • Do a POST /payment with the amount being set to a negative number, which would be the refund amount.

👍

Tying the transaction to a previous transaction

If you want the refund to associate with a previous transaction, you can pass in the paymentToken returned in the original transaction. Using this method will not require the original credit card number to be entered again.

POST https://sandbox.api.mxmerchant.com/checkout/v3/payment?echo=true HTTP/1.1
Authorization: Basic c2FuZGJveHBvcxxxxxxxGVtcDE1NTE1NTE1NQ==
Content-Type: application/json

Payload:
{
    merchantId :"4xxx0",
    tenderType :"Card",
    amount :"-5.00",
    cardAccount :{
        number : "555xxxxxxxxxx618",
        expiryMonth : "xx",
        expiryyear : "20xx",
        cvv : "000",
        avsZip : "30004",
        avsStreet: "2001 Westside"
    }
}


RESPONSE:
Status: 201 Created
{
    "created": "2015-02-03T20:21:14.343Z",
    "id": 10000000310349,
    "paymentToken":"P4G1dbQGwfLiMX9BTIsco7GKJ8IzBg9I",
    "creatorName": "Tester SANDBOX",
    "merchantId": "4xxx0",
    "batch": "ZCHC0",
    "tenderType": "Card",
    "currency": "USD",
    "amount": "-5",
    "meta": "",
    "cardAccount": {
        "cardType": "MasterCard",
        "entryMode": "Keyed",
        "last4": "4618",
        "expiryMonth": "xx",
        "expiryYear": "xx"
    },
    "authOnly": false,
    "authCode": "PPSY8O",
    "status": "Approved",
    "risk": {
        "cvvResponseCode": "M",
        "cvvResponse": "Match",
        "avsResponseCode": "Y"
    },
    "requireSignature": false,
    "settledAmount": "0",
    "settledCurrency": "USD",
    "cardPresent": true,
    "authMessage": "AUTH/TKT PPSY8O",
    "availableAuthAmount": "0",
    "reference": "PV3560028FGF",
    "purchases": [ ],
    "refundedAmount": "0",
    "type": "Return",
    "reviewIndicator": 1
}
POST https://sandbox.api.mxmerchant.com/checkout/v3/payment?echo=true HTTP/1.1
Authorization: Basic c2FuZGJveHBvcxxxxxxxGVtcDE1NTE1NTE1NQ==
Content-Type: application/json

Payload:
{
    "merchantId" :"4xxx0",
    "tenderType" :"Card",
    "amount" :"-5.00",
    "paymentToken":"P4G1dbQGwfLiMX9BTIsco7GKJ8IzBg9I"
}

RESPONSE:
Status: 201 Created
{
    "created": "2015-02-03T20:21:14.343Z",
    "id": 10000000310349,
    "paymentToken":"P4G1dbQGwfLiMX9BTIsco7GKJ8IzBg9I",
    "creatorName": "Tester SANDBOX",
    "merchantId": "4xxx0",
    "batch": "ZCHC0",
    "tenderType": "Card",
    "currency": "USD",
    "amount": "-5",
    "meta": "",
    "cardAccount": {
        "cardType": "MasterCard",
        "entryMode": "Keyed",
        "last4": "4618",
        "expiryMonth": "xx",
        "expiryYear": "xx"
    },
    "authOnly": false,
    "authCode": "PPSY8O",
    "status": "Approved",
    "risk": {
        "cvvResponseCode": "M",
        "cvvResponse": "Match",
        "avsResponseCode": "Y"
    },
    "requireSignature": false,
    "settledAmount": "0",
    "settledCurrency": "USD",
    "cardPresent": true,
    "authMessage": "AUTH/TKT PPSY8O",
    "availableAuthAmount": "0",
    "reference": "PV3560028FGF",
    "purchases": [ ],
    "refundedAmount": "0",
    "type": "Return",
    "reviewIndicator": 1
}