cancel
Showing results for 
Search instead for 
Did you mean: 

where to add the retail element in json request for card present transactions

Here is my code:

 

{
    "createTransactionRequest": {
        "merchantAuthentication": {
            "name": "8Mfn3yN5r",
            "transactionKey": "8738EskJb4X83k36"
        },
        "refId": "123456",
        "transactionRequest": {
            "transactionType": "authCaptureTransaction",
            "amount": "5",
               "payment": {
                "trackData": {
                    "track2": "5301250070000191=08051010912345678901"
                }
              },

            "lineItems": {
                "lineItem": {
                    "itemId": "1",
                    "name": "vase",
                    "description": "Cannes logo",
                    "quantity": "18",
                    "unitPrice": "45.00"
                }
            },
            "tax": {
                "amount": "4.26",
                "name": "level2 tax name",
                "description": "level2 tax"
            },
            "duty": {
                "amount": "8.55",
                "name": "duty name",
                "description": "duty description"
            },
            "shipping": {
                "amount": "4.26",
                "name": "level2 tax name",
                "description": "level2 tax"
            },
            "poNumber": "456654",
            "customer": {
                "id": "99999456654"
            },
            "billTo": {
                "firstName": "Ellen",
                "lastName": "Johnson",
                "company": "Souveniropolis",
                "address": "14 Main Street",
                "city": "Pecan Springs",
                "state": "TX",
                "zip": "44628",
                "country": "USA"
            },
            "shipTo": {
                "firstName": "China",
                "lastName": "Bayles",
                "company": "Thyme for Tea",
                "address": "12 Main Street",
                "city": "Pecan Springs",
                "state": "TX",
                "zip": "44628",
                "country": "USA"
            },
            "customerIP": "192.168.1.1",
            "transactionSettings": {
                "setting": {
                    "settingName": "testRequest",
                    "settingValue": "false"
                }
            },





            "userFields": {
                "userField": [
                    {
                        "name": "MerchantDefinedFieldName1",
                        "value": "MerchantDefinedFieldValue1"
                    },
                    {
                        "name": "favorite_color",
                        "value": "blue"
                    }
                ]
            },



			"processingOptions": {
             "isSubsequentAuth": "true"
            },



            "subsequentAuthInformation": {
             "originalNetworkTransId": "123456789NNNH",
             "originalAuthAmount": "45.00",
             "reason": "resubmission"         
            },	
            


            "authorizationIndicatorType": {
            "authorizationIndicator": "final"
          }

        }

    }
}




 

Here is the error: 

 

													
{
    "transactionResponse": {
        "responseCode": "3",
        "authCode": "",
        "avsResultCode": "P",
        "cvvResultCode": "",
        "cavvResultCode": "",
        "transId": "0",
        "refTransID": "",
        "transHash": "",
        "testRequest": "0",
        "accountNumber": "",
        "accountType": "",
        "errors": [
            {
                "errorCode": "85",
                "errorText": "The market type is invalid"
            }
        ],
        "userFields": [
            {
                "name": "MerchantDefinedFieldName1",
                "value": "MerchantDefinedFieldValue1"
            },
            {
                "name": "favorite_color",
                "value": "blue"
            }
        ],
        "transHashSha2": "",
        "SupplementalDataQualificationIndicator": 3
    },
    "refId": "123456",
    "messages": {
        "resultCode": "Error",
        "message": [
            {
                "code": "E00027",
                "text": "The transaction was unsuccessful."
            }
        ]
    }
}

 

I have read in this forum that I need to add the retail element.  However, after trying I cannot understand where it goes.  Thank you for the help.

 

 

simplytrue
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Through trial and error I found the right place.  For others here is the code that works:

 

"createTransactionRequest": {
        "merchantAuthentication": {
            "name": "8Mfn3yN5r",
            "transactionKey": "8738EskJb4X83k36"
        },
        "refId": "123456",
        "transactionRequest": {
            "transactionType": "authCaptureTransaction",
            "amount": "5",
               "payment": {
                "trackData": {
                    "track2": "4497844492644078=2401123123400001230"
                }
              },

            "lineItems": {
                "lineItem": {
                    "itemId": "1",
                    "name": "vase",
                    "description": "Cannes logo",
                    "quantity": "18",
                    "unitPrice": "45.00"
                }
            },
            "tax": {
                "amount": "4.26",
                "name": "level2 tax name",
                "description": "level2 tax"
            },
            "duty": {
                "amount": "8.55",
                "name": "duty name",
                "description": "duty description"
            },
            "shipping": {
                "amount": "4.26",
                "name": "level2 tax name",
                "description": "level2 tax"
            },
            "poNumber": "456654",
            "customer": {
                "id": "99999456654"
            },
            "billTo": {
                "firstName": "Ellen",
                "lastName": "Johnson",
                "company": "Souveniropolis",
                "address": "14 Main Street",
                "city": "Pecan Springs",
                "state": "TX",
                "zip": "44628",
                "country": "USA"
            },
            "shipTo": {
                "firstName": "China",
                "lastName": "Bayles",
                "company": "Thyme for Tea",
                "address": "12 Main Street",
                "city": "Pecan Springs",
                "state": "TX",
                "zip": "44628",
                "country": "USA"
            },
            "customerIP": "192.168.1.1",

            "retail": {
                "marketType": 2,
                "deviceType": 3
            },

            "transactionSettings": {
                "setting": {
                    "settingName": "testRequest",
                    "settingValue": "false"
                }
            },

            "userFields": {
                "userField": [
                    {
                        "name": "MerchantDefinedFieldName1",
                        "value": "MerchantDefinedFieldValue1"
                    },
                    {
                        "name": "favorite_color",
                        "value": "blue"
                    }
                ]
            },

			"processingOptions": {
             "isSubsequentAuth": "true"
            },

            "subsequentAuthInformation": {
             "originalNetworkTransId": "123456789NNNH",
             "originalAuthAmount": "45.00",
             "reason": "resubmission"         
            },	

            "authorizationIndicatorType": {
            "authorizationIndicator": "final"
          }

        }

    }
}

View solution in original post

simplytrue
Member
2 REPLIES 2

Through trial and error I found the right place.  For others here is the code that works:

 

"createTransactionRequest": {
        "merchantAuthentication": {
            "name": "8Mfn3yN5r",
            "transactionKey": "8738EskJb4X83k36"
        },
        "refId": "123456",
        "transactionRequest": {
            "transactionType": "authCaptureTransaction",
            "amount": "5",
               "payment": {
                "trackData": {
                    "track2": "4497844492644078=2401123123400001230"
                }
              },

            "lineItems": {
                "lineItem": {
                    "itemId": "1",
                    "name": "vase",
                    "description": "Cannes logo",
                    "quantity": "18",
                    "unitPrice": "45.00"
                }
            },
            "tax": {
                "amount": "4.26",
                "name": "level2 tax name",
                "description": "level2 tax"
            },
            "duty": {
                "amount": "8.55",
                "name": "duty name",
                "description": "duty description"
            },
            "shipping": {
                "amount": "4.26",
                "name": "level2 tax name",
                "description": "level2 tax"
            },
            "poNumber": "456654",
            "customer": {
                "id": "99999456654"
            },
            "billTo": {
                "firstName": "Ellen",
                "lastName": "Johnson",
                "company": "Souveniropolis",
                "address": "14 Main Street",
                "city": "Pecan Springs",
                "state": "TX",
                "zip": "44628",
                "country": "USA"
            },
            "shipTo": {
                "firstName": "China",
                "lastName": "Bayles",
                "company": "Thyme for Tea",
                "address": "12 Main Street",
                "city": "Pecan Springs",
                "state": "TX",
                "zip": "44628",
                "country": "USA"
            },
            "customerIP": "192.168.1.1",

            "retail": {
                "marketType": 2,
                "deviceType": 3
            },

            "transactionSettings": {
                "setting": {
                    "settingName": "testRequest",
                    "settingValue": "false"
                }
            },

            "userFields": {
                "userField": [
                    {
                        "name": "MerchantDefinedFieldName1",
                        "value": "MerchantDefinedFieldValue1"
                    },
                    {
                        "name": "favorite_color",
                        "value": "blue"
                    }
                ]
            },

			"processingOptions": {
             "isSubsequentAuth": "true"
            },

            "subsequentAuthInformation": {
             "originalNetworkTransId": "123456789NNNH",
             "originalAuthAmount": "45.00",
             "reason": "resubmission"         
            },	

            "authorizationIndicatorType": {
            "authorizationIndicator": "final"
          }

        }

    }
}
simplytrue
Member

For those wondering how I came up with the track data... I did it with help from this site:

 

https://neapay.com/online-tools/card-track1-track2-generator.html