Making a Tip Adjustment on a Sale

You can adjust any sale if the transaction has not been settled by using a PUT /payment route. Only positive amount adjustments are allowed when using this route. Once the transaction has been settled you cannot make a change to it.

  • Create a POST /payment. Take note of the id and paymentToken
  • Adjust the payment to a different positive amount by using PUT /payment/{id}. On the payload use the paymentToken.
  • If you do a GET /payment/{id}, you will see the original amount and the updated amount. The last updated amount is the final sale to be settled.
POST https://sandbox.api.mxmerchant.com/checkout/v3/payment?echo=true HTTP/1.1
Authorization:Basic xxxxxxxxxxxxxxxxxxxxxxxx1NQ==
Content-Type: application/json

Payload:
{
   "merchantId" :"48200",
   "tenderType" :"Card",
   "amount" :"5.00",
   "cardAccount" : {
       "number" : "555xxxxxxxxxx618",
       "expiryMonth" : "xx",
       "expiryyear" : "20xx",
       "cvv" : "000",
       "avsZip" : "30004",
       "avsStreet": "2001 Westside"
       }
}
{
    "created": "2015-02-03T20:09:38.607Z",
    "paymentToken": "P1pOIyd3J0xxxxxxxxRWw6rj",
    "id": 10000000310346,
    "creatorName": "Postman SANDBOX",
    "merchantId": "4xxx0",
    "batch": "ZCHC0",
    "tenderType": "Card",
    "currency": "USD",
    "amount": "5",
    "meta": "",
    "cardAccount": {
        "cardType": "MasterCard",
        "entryMode": "Keyed",
        "last4": "4618",
        "token": "P1pOIyd3JxxxxxxxxxRWw6rj",
        "expiryMonth": "xx",
        "expiryYear": “xx"
    },
    "authOnly": false,
    "authCode": "PPSB3V",
    "status": "Approved",
    "risk": {
        "cvvResponseCode": "M",
        "cvvResponse": "Match",
        "avsResponseCode": "Y"
    },
    "requireSignature": false,
    "customerMatches": [ ],
    "settledAmount": "0",
    "settledCurrency": "USD",
    "cardPresent": true,
    "authMessage": "AUTH/TKT PPSB3V",
    "availableAuthAmount": "0",
    "reference": "PV356001TIMD",
    "purchases": [ ],
    "refundedAmount": "0",
    "type": "Sale",
    "reviewIndicator": 1
}
PUT https://sandbox.api.mxmerchant.com/checkout/v3/payment/10000000310346 HTTP/1.1
Authorization:Basic c2FuZGJveHBvc3RxxxxxVtcDE1NTE1NTE1NQ==
Content-Type: application/json

{
   merchantId :"4xxx0",
   tenderType :"Card",
   amount :"6.00",
   tip :"1:00",
   paymentToken:"P1pOIyd3J0xxxxxxxxRWw6rj"
}

 

Did this page help you?