Making an AuthOnly transaction and Completing the Sale

Use Cases

  • Sometimes it is necessary to make an authorization and settle the funds later. An example of this process is when tips or completions are expected at the end of a business day.

👍

The Authorization and Tip Adjustment/Sale Completion process is ideal for businesses that expect to run Sale Completions or process Tips at the close of business. Examples of businesses that can take advantage of this flow are Food Service, Service Industry and Hair Salons.

This is a typical way to make an authorization (hold) an amount first and then make a final sale completion. Any AuthOnly transaction must be followed by a Sale Completion transaction, otherwise, the AuthOnly transaction will be removed after 7 days.

  • Setup a POST /payment either with a Keyed or Swiped transaction and add the AuthOnly=true field. This indicates to do an AuthOnly payment and a Sale Completion will be followed after.
  • Complete the sale with AuthOnly=false and adjust the total amount, if needed, using the previous card account token. Using the previous card account token lets the API know which AuthOnly transaction this sale is for. Otherwise, a new regular sale transaction is created.

Step 1

  • POST a payment with authOnly set to True
Request URL:https://sandbox.api.mxmerchant.com/checkout/v3/payment?echo=true
Request Method:POST
Authorization:Basic xxxxxxxxxxxxxxxxxxxxxxxx1NQ==
Content-Type:application/json
{
   merchantId :”xxx12345",
   tenderType :"Card",
   amount :"0.03",
   authOnly: true,
   cardAccount :{
       number : “xxxxxxxxxxxxxxxxxx4618",
       expiryMonth : "06",
       expiryyear : "2022",
       cvv : "019",
       avsZip : "30004",
       avsStreet: "2001 Westside"
       }
}
{
	"created": "2014-07-17T17:53:48.74Z",
	"paymentToken": "PZxxxxxxxxxxxxxxxxxxxxxFtYz",
	"id": 2125085,
	"creatorName": “Erick Nguyen",
	"merchantId": xxx12345,
	"tenderType": "Card",
	"currency": "USD",
	"amount": "0.03",
	"meta": "",
	"cardAccount": {
		"hash": "4hhexxxxxxxxxxxxxxxxxxxxxxxxxxxh1I=",
		"cardType": "MasterCard",
		"entryMode": "Keyed",
		"last4": "4618",
		"token": "PZxxxxxxxxxxxxxxxxlMDoPxFtYz",
		"expiryMonth": "06",
		"expiryYear": "22"
	},
	"authOnly": true,
	"authCode": "025349",
	"status": "Approved",
	"fraudScoreMeta": "{\"cvvResponse\":\"M\",\"avsResponse\":\"N\"}",
	"requireSignature": false,
	"customerMatches": [],
	"settledAmount": "0",
	"settledCurrency": "USD",
	"cardPresent": false,
	"referenceNumber": "00C9700APHIS",
	"purchases": [],
	"iccRequestData": "",
	"refundedAmount": "0"
}

Step 2

  • Complete the Sale
Request URL:https://sandbox.api.mxmerchant.com/checkout/v3/payment?echo=true
Request Method:POST
Authorization:Basic xxxxxxxxxxxxxxxxxxxxxxxx1NQ==
Content-Type:application/json
{
	merchantId: “xxx12345",
  paymentToken: "PZxxxxxxxxxxxxxxxxxxxxxFtYz",
	tenderType: "Card",
	amount: "0.03",
 	authCode: "025349",
	authOnly: false,
}
{
	"created": "2014-07-17T18:04:01.457Z",
	"paymentToken": "PvxxxxxxxxxxxxxxxxxxxGFWq",
	"id": 2125266,
	"creatorName": “Erick Nguyen",
	"merchantId": xxx12345,
	"tenderType": "Card",
	"currency": "USD",
	"amount": "0.03",
	"meta": "",
	"cardAccount": {
		"hash": “4hhe/xxxxxxxxxxxxxxxxxxxxx/49w3Poh1I=",
		"cardType": "MasterCard",
		"entryMode": "Keyed",
		"last4": "4618",
		"token": "PvKxxxxxxxxxxxxxxxxxxxH8GFWq",
		"expiryMonth": "06",
		"expiryYear": "22"
	},
	"authOnly": false,
	"authCode": "077922",
	"status": "Approved",
	"fraudScoreMeta": "{}",
	"requireSignature": false,
	"customerMatches": [],
	"settledAmount": "0",
	"settledCurrency": "USD",
	"cardPresent": false,
	"referenceNumber": "00C9L006RRQV",
	"purchases": [],
	"iccRequestData": "",
	"refundedAmount": "0"
}