Re: Payment Authorization resulting in 400

muley
Occasional Visitor

Payment Authorization resulting in 400

Dear Visa Community Member,

 

My request for Payment Authorization resulting in 400 Bad Request

 

Calling API: https://sandbox.api.visa.com/acs/v1/payments/authorizations

{

"acctInfo": {

"primryAcctNum": {

"panExpDt": "2025-12",

"pan": "4059540001000007"

}

},

"cardAcceptr": {

"clientId": "1DLMLAPPKDJ04301701",

"crdAcptrPhn": "1 4155552235",

"pymtFaciltrId": "52014057",

"crdAcptrCtryCd": "US",

"crdAcptrNm": "ABC Supplies",

"visaMrchId": "52014057",

"mrchCatgyCd": "4814"

},

"riskAssessmntData": {

"traExmptn": "true",

"delgtdAthntctn": "true",

"trustdMerchntExmptn": "true",

"scpExmptn": "true",

"lowVlExmptn": "true"

},

"freeFormDescrptnData": "freeformdata",

"msgIdentfctn": {

"correlatnId": "12bc567d90f23e56a8f00F"

},

"verfctnData": {

"cvv2Data": {

"value": "321"

},

"billngAddr": {

"postlCd": "12345",

"addrLn": "PO Box 12345"

}

},

"msgTransprtData": "anyroundtripinfo",

"transctn": {

"eComData": {

"cavv": "0100000000000165FD1F99011589904056830000",

"eciCd": "5",

"xid": "EEC4567F90123A5678B0123EA67890D2345678FF",

"digitalGoods": "true"

},

"posData": {

"panEntryMode": "OnFile",

"panSrce": "VCIND"

},

"localDtTm":2022-07-20T20:01:35",

"tranAmt": {

"amt": "51.29",

"numCurrCd": "840"

},

"aciCd": "R",

"marketSpecificDataIdentifier": "B",

"tranDesc": "transactiondescription"

}

}

 

Any help will be greatly appreciated. 

warm regards,

Mukesh

6 REPLIES 6
API_Products
Visa Developer Support Specialist

Re: Payment Authorization resulting in 400

Hi @muley,

 

I ran a sandbox test today using the VDC Playground tool and got a successful request/response payload. Please see my sample request/response payload below and try to test again. Please share your result with us. Also, make sure that the message level encryption is enabled.  

 

End Point https://sandbox.api.visa.com/acs/v1/payments/authorizations
Method POST
Request
{
"acctInfo": {"primryAcctNum": {
"panExpDt": "2019-12",
"pan": "4761739001010135"
}},
"cardAcceptr": {"clientId": "1DLMLAPPKDJ04301701"},
"freeFormDescrptnData": "Freeformdata",
"msgIdentfctn": {
"correlatnId": "auditest20180925_016",
"origId": "468352863713348"
},
"msgTransprtData": "TransportData",
"verfctnData": {"billngAddr": {
"postlCd": "12345",
"addrLn": "PO Box 12345"
}},
"transctn": {
"partialAuthInd": "true",
"eComData": {
"eciCd": "5",
"digitalGoods": "true",
"xid": "EEC4567F90123A5678B0123EA67890D2345678FF"
},
"localDtTm": "2019-02-27T19:41:43",
"posData": {
"envrnmnt": "eCom",
"panEntryMode": "OnFile",
"panSrce": "VCIND"
},
"tranAmt": {
"amt": "51.29",
"numCurrCd": "840"
},
"tranDesc": "Transactiondescription"
}
}
Response
{
"verfctnReslts": {"avsReslt": "U"},
"acctInfo": {"primryAcctNum": {"panLast4": "0135"}},
"freeFormDescrptnData": " Freeformdata",
"transctnReslts": {
"tranReslt": "Declined",
"actionCd": "15"
},
"msgTransprtData": "TransportData",
"settlmntData": {"reconDt": "--07-21"},
"transctn": {
"eComData": {"eciCd": "5"},
"tranAmt": {
"amt": "51.29",
"numCurrCd": "840"
},
"aciCd": "N"
}
}
Response Header
Status Code: 402 Payment Required
Server : nginx
Date : Wed, 20 Jul 2022 16:26:59 GMT
Content-Type : application/json;charset=UTF-8
Content-Length : 991
Connection : keep-alive
X-SERVED-BY : -74979967z7f
X-CORRELATION-ID : 1658334418_672_1574244434_-74979967z7f_VDP_WS
X-ERROR-ORIGIN : 9900
X-APP-STATUS : 402
Content-Encoding : identity
encrypted : true
Content-Language : en-US
Cache-Control : no-cache, no-store, must-revalidate
X-Frame-Options : SAMEORIGIN
X-XSS-Protection : 0
X-Content-Type-Options : nosniff
Strict-Transport-Security : max-age=31536000;includeSubdomains
Pragma : no-cache
Expires : -1

 




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

muley
Occasional Visitor

Re: Payment Authorization resulting in 400

Thank you @API_Products ,

 

It is still 402, how can we get 200?

 

Appreciate your help so far. 

 

warm regards,
Mukesh

API_Products
Visa Developer Support Specialist

Re: Payment Authorization resulting in 400

Hi @muley,

 

Please provide me with the x-correlation-id so that engineering can check the logs. The x-correlation-id can be found in the Response Header.  




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

API_Products
Visa Developer Support Specialist

Re: Payment Authorization resulting in 400

Hi @muley,

 

Are you still experiencing an error? If so, please provide the x-correlation-id so that our engineering team can investigate the error. If the error is fixed, please let me know so that I can close the incident. 




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

API_Products
Visa Developer Support Specialist

Re: Payment Authorization resulting in 400

Hi @muley,

 

I haven't received a reply from you, hence, I'll take you off my contact list. Feel free to reach out to the developer community if you have questions or need help. 




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

dev-tired
Dabbler

Re: Payment Authorization resulting in 400

Are you using the developer center playground?