Hi team,
We are trying to create a consent resource on the https://sandbox.api.visa.com/visaa2a/domestic-vrp-consents and unfortunately we are receiving the following error : Incorrect credentials supplied
We are using the client cert and key to sign the request and the keyid header is present in our request.
:url=>"https://sandbox.api.visa.com/visaa2a/domestic-vrp-consents"
:headers=> {
"Accept"=>"application/json",
"Content-Type"=>"application/json",
"Authorization"=>"Basic NDVTSko3U04yUUhPWjZTNUE2RE4yMTRvTi10eEJmWjlOQVp6QnBLRnNISXFBaHptQTpsU0pMdEROUzMxcTNVeXpudW5tNEsyOWQyampOemZqc1l6Mlk3",
"keyId"=>"3dc2208f-7e44-4425-b3b6-b1bec3b58db4",
"idempotency-key"=>"01eaf309-4936-43c3",
"visa-a2a-beneficiary-id"=>"BEN-12345678",
"visa-a2a-payer-fi-id"=>"PFI-12345678"
}
}
Please advise what should we adjust in our request so that it is successful. We double checked, we are using the corect user and password combination for the basic authorisation.
Best wishes,
Hi @Salted, Thank you for reaching out. An agent will get back to you as soon as possible. Until then, if any community member knows a solution, feel free to reply in this thread.
Hey @Salted,
Here are some steps to troubleshoot and resolve the "Incorrect credentials supplied" error when creating a consent resource on the Visa API:
1. Verify Basic Authorization Credentials:
- Ensure that the `Authorization` header value is correctly base64-encoded. The format should be `Basic base64(userId:password)`. Double-check that your `userId` and `password` are correct and are the same as those provided in your Visa Developer project.
2. Check Certificate and Key:
- Make sure that the client certificate and key are correctly configured and accessible by your application. Ensure that the certificate is valid and not expired.
3. Verify keyId Header:
- Confirm that the `keyId` header matches the key provided in your Visa Developer project settings. This key is essential for mutual SSL authentication.
4. Mutual SSL Authentication:
- Ensure that the client certificate is correctly loaded and that mutual SSL authentication is properly configured. The Visa API requires mutual SSL for secure communication.
5. TLS Version:
- Verify that your application is using TLS 1.2 or higher for secure communication with the Visa API.
6. Endpoint URL:
- Ensure that the URL `https://sandbox.api.visa.com/visaa2a/domestic-vrp-consents` is correct and matches the one specified in the Visa Developer documentation for the sandbox environment.
7. Idempotency Key:
- The `idempotency-key` header should be unique for each request to prevent replay attacks. Ensure that the key is unique for each request you make.
8. Visa-a2a Headers:
- Confirm that the `visa-a2a-beneficiary-id` and `visa-a2a-payer-fi-id` headers are correctly set and match the required values specified in your Visa Developer project.
Here is an example of what your request headers should look like:
```plaintext
:url => "https://sandbox.api.visa.com/visaa2a/domestic-vrp-consents",
:headers => {
"Accept" => "application/json",
"Content-Type" => "application/json",
"Authorization" => "Basic <base64-encoded-credentials>",
"keyId" => "3dc2208f-7e44-4425-b3b6-b1bec3b58db4",
"idempotency-key" => "01eaf309-4936-43c3",
"visa-a2a-beneficiary-id" => "BEN-12345678",
"visa-a2a-payer-fi-id" => "PFI-12345678"
}
```
If you have verified all the above points and are still encountering issues, you may want to:
1. Consult the Visa Developer Documentation:
- Review the Visa Direct API documentation for any additional requirements or constraints.
2. Check Detailed Logs:
- Implement detailed logging to capture the request and response details. This can help identify specific points of failure.
3. Seek Community Assistance:
- If the issue persists, consider reaching out to the Visa Developer Community forums or support channels with specific details of your request and the error received. This will enable community members and Visa support staff to provide more targeted assistance.
By systematically verifying each of these areas, you should be able to identify and resolve the issue with your request. If you need further assistance, please provide specific error messages or logs, and the community will be happy to help.