Visanet connect acceptance bad request

sijoyjoseph
New Contributor

Visanet connect acceptance bad request

Hi, I am trying to execute the sample sale api but I always receive a 400 bad request.

 

Request Body:

{
  "msgIdentfctn": {
    "clientId": "1VISAGCT000001",
    "correlatnId": "abcdefga0000005N"
  },
  "Body": {
    "Tx": {
      "AddtlSvc": {
        "Tp": "DCCV"
      },
      "TxAttr": [
        "INST"
      ],
      "TxDesc": "transactiondescription",
      "SpclPrgrmmQlfctn": {
        "Dtls": [
          {
            "Val": "Y",
            "Nm": "ACI"
          }
        ],
        "Prgrmm": "CPS"
      },
      "TxAmts": {
        "TxAmt": {
          "Ccy": "008",
          "Amt": "100.1"
        }
      }
    },
    "Envt": {
      "Accptr": {
        "PaymentFacltId": "52014057",
        "CstmrSvc": "1 4155552235",
        "Id": "520142254322",
        "FrgnRtlrInd": true,
        "Adr": {
          "Ctry": "US"
        }
      },
      "Termnl": {
        "TermnlId": {
          "Id": "10012343"
        }
      },
      "Card": {
        "XpryDt": "2312",
        "PAN": "4000220177656623"
      }
    },
    "Cntxt": {
      "Vrfctn": [
        {
          "VrfctnInf": {
            "Val": {
              "HexBinryVal": "1234"
            },
            "Tp": "authenticationValue"
          },
          "Tp": "THDS"
        },
        {
          "VrfctnInf": {
            "Val": {
              "TxtVal": "PO Box 12345"
            }
          },
          "Tp": "ADDB"
        },
        {
          "VrfctnInf": {
            "Val": {
              "TxtVal": "12345"
            }
          },
          "Tp": "PCDV"
        }
      ],
      "TxCntxt": {
        "MrchntCtgySpcfcData": "B"
      },
      "PtOfSvcCntxt": {
        "CardDataNtryMd": "CDFL"
      },
      "RskCntxt": {
        "RskInptData": {
          "Val": "172.20.253.209",
          "Tp": "IPAddr"
        }
      },
      "SaleCntxt": {
        "GoodsAndSvcsTp": "ELEC",
        "GoodsAndSvcsSubTp": "CRCU"
      }
    },
    "SplmtryData": [
      {
        "Envlp": {
          "StrngCstmrAuthntcn": {
            "Xmptn": [
              {
                "Val": "CLAI",
                "Tp": "TMBE"
              },
              {
                "Val": "NCLA",
                "Tp": "LOWA"
              }
            ],
            "DlgtdAuthrty": "CLAI"
          }
        },
        "PlcAndNm": "EUPSD2SCADataSD1V01"
      }
    ],
    "AdddmData": {
      "AddtlData": {
        "Val": "1234567890",
        "Tp": "PlanRegSysId"
      },
      "Instlmt": {
        "PmtSeqNb": "12",
        "Plan": [
          {
            "DfrrdInstlmtInd": true,
            "PrdUnit": "WEEK",
            "SbsqntAmt": "9999.99",
            "TtlNbOfPmts": 24,
            "InstlmtCcy": 840,
            "NbOfPrds": "2",
            "PlanOwnr": "ISSR",
            "GrdTtlAmt": "234.56"
          }
        ]
      }
    }
  }
}

 

Response body:

{
    "responseStatus": {
        "status": 400,
        "code": "9125",
        "severity": "ERROR",
        "message": "Expected input credential was not present",
        "info": ""
    }
}
4 REPLIES 4
sijoyjoseph
New Contributor

Re: Visanet connect acceptance bad request

I think I wasn't considering message level encryption, but after implementing message level encryption I am getting a new error : 

{
    "responseStatus": {
        "status": 403,
        "code": "9611",
        "severity": "ERROR",
        "message": "Authorization Failed for the URL.",
        "info": ""
    }
}
API_Products
Visa Developer Support Specialist

Re: Visanet connect acceptance bad request

Hey @sijoyjoseph,

 

The error message you are encountering indicates an authorization failure:

```json
{
"responseStatus": {
"status": 403,
"code": "9611",
"severity": "ERROR",
"message": "Authorization Failed for the URL.",
"info": ""
}
}
```

 

Possible Reasons and Solutions

1. Incorrect Credentials:
- Ensure that you are using the correct API key and secret. Check if the credentials are precisely entered in the headers or request body.

2. Improper Message Level Encryption:
- Double-check your encryption implementation. Verify that the message is being encrypted correctly according to Visa's specifications.

3. Invalid URL or Endpoint:
- Confirm that the URL you are accessing is correct and matches the path specified in the Visa Developer documentation.

4. Access Permissions:
- Verify that your API key has permissions to access the specific endpoint. You may need to contact Visa Developer Support to check your access rights.

5. Timestamp and Nonce:
- Make sure that your request includes the correct timestamp and nonce if required. These parameters are often crucial for secure API calls.

 

Steps to Troubleshoot

1. Review Documentation:
- Go through the Visa Developer documentation to ensure that all required parameters and headers are correctly set.

2. Check Encryption:
- Verify the encryption method and ensure it aligns with Visa's requirements. This includes checking the encryption algorithm, key management, and proper encoding.

 

By following these steps, you can identify and resolve the authorization error related to message level encryption.




Thanks,

Diana H.



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

sijoyjoseph
New Contributor

VisaNet connect acceptance - Sale Api always returns 400 bad request

Hi, I've been trying to run the sample sales api provided in the api reference but the api always return 400 bad request. 

 

Request body: 

{
  "msgIdentfctn": {
    "clientId": "1VISAGCT000001",
    "correlatnId": "abcdefga0000005N"
  },
  "Body": {
    "Tx": {
      "AddtlSvc": {
        "Tp": "DCCV"
      },
      "TxAttr": [
        "INST"
      ],
      "TxDesc": "transactiondescription",
      "SpclPrgrmmQlfctn": {
        "Dtls": [
          {
            "Val": "Y",
            "Nm": "ACI"
          }
        ],
        "Prgrmm": "CPS"
      },
      "TxAmts": {
        "TxAmt": {
          "Ccy": "008",
          "Amt": "100.1"
        }
      }
    },
    "Envt": {
      "Accptr": {
        "PaymentFacltId": "52014057",
        "CstmrSvc": "1 4155552235",
        "Id": "520142254322",
        "FrgnRtlrInd": true,
        "Adr": {
          "Ctry": "US"
        }
      },
      "Termnl": {
        "TermnlId": {
          "Id": "10012343"
        }
      },
      "Card": {
        "XpryDt": "2312",
        "PAN": "4000220177656623"
      }
    },
    "Cntxt": {
      "Vrfctn": [
        {
          "VrfctnInf": {
            "Val": {
              "HexBinryVal": "1234"
            },
            "Tp": "authenticationValue"
          },
          "Tp": "THDS"
        },
        {
          "VrfctnInf": {
            "Val": {
              "TxtVal": "PO Box 12345"
            }
          },
          "Tp": "ADDB"
        },
        {
          "VrfctnInf": {
            "Val": {
              "TxtVal": "12345"
            }
          },
          "Tp": "PCDV"
        }
      ],
      "TxCntxt": {
        "MrchntCtgySpcfcData": "B"
      },
      "PtOfSvcCntxt": {
        "CardDataNtryMd": "CDFL"
      },
      "RskCntxt": {
        "RskInptData": {
          "Val": "172.20.253.209",
          "Tp": "IPAddr"
        }
      },
      "SaleCntxt": {
        "GoodsAndSvcsTp": "ELEC",
        "GoodsAndSvcsSubTp": "CRCU"
      }
    },
    "SplmtryData": [
      {
        "Envlp": {
          "StrngCstmrAuthntcn": {
            "Xmptn": [
              {
                "Val": "CLAI",
                "Tp": "TMBE"
              },
              {
                "Val": "NCLA",
                "Tp": "LOWA"
              }
            ],
            "DlgtdAuthrty": "CLAI"
          }
        },
        "PlcAndNm": "EUPSD2SCADataSD1V01"
      }
    ],
    "AdddmData": {
      "AddtlData": {
        "Val": "1234567890",
        "Tp": "PlanRegSysId"
      },
      "Instlmt": {
        "PmtSeqNb": "12",
        "Plan": [
          {
            "DfrrdInstlmtInd": true,
            "PrdUnit": "WEEK",
            "SbsqntAmt": "9999.99",
            "TtlNbOfPmts": 24,
            "InstlmtCcy": 840,
            "NbOfPrds": "2",
            "PlanOwnr": "ISSR",
            "GrdTtlAmt": "234.56"
          }
        ]
      }
    }
  }
}

 

Response:

{
    "responseStatus": {
        "status": 400,
        "code": "9125",
        "severity": "ERROR",
        "message": "Expected input credential was not present",
        "info": ""
    }
}

 

I tried to run the api with the integrated test data, in all cases the api return 400 bad request. Could you please help me figure out what's going wrong ? 

SyedSa
Community Moderator

Re: VisaNet connect acceptance - Sale Api always returns 400 bad request

Hi @sijoyjosephThank you for reaching out. An agent will get back to you as soon as possible. Until then, if any community member has information that may be helpful, please feel free to reply.