Visa Direct Account and Wallet Receive API
Hi @mohiiuddiin , Thank you for reaching out. An agent will look into this and get back to you soon. Until then, if any community member knows a solution, feel free to reply in this thread.
Hey @mohiiuddiin,
The 403 status code with the message "authorization failed for the URL" indicates that there is an issue with the authorization credentials or permissions for accessing the Visa Direct Account and Wallet Receive API.
Here are some steps to resolve this issue:
1. Verify API Credentials:
Ensure that the API credentials (API Key, Shared Secret) you are using are correct and valid. Double-check that you are using the correct credentials for the Visa Direct Account and Wallet Receive API.
2. Permission Settings:
Confirm that the API Key you are using has the necessary permissions to access the Payout Status Notification endpoint. You may need to contact Visa Developer support to ensure your account has the appropriate access.
3. Endpoint URL:
Make sure you are using the correct endpoint URL for the Payout Status Notification. Refer to the Visa Direct Account and Wallet Receive API documentation at https://developer.visa.com/capabilities/visa_direct/reference for the correct endpoint.
4. HTTP Headers:
Verify that you are setting the correct HTTP headers, including `Content-Type: application/json` and the appropriate authorization header.
5. Check for Restrictions:
Ensure there are no IP restrictions or other security settings that might be blocking your request.
Here is a sample C# code snippet for making a request to the Visa Direct Account and Wallet Receive API:
```csharp
START
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var client = new HttpClient();
var url = "https://sandbox.api.visa.com/visadirect/v1/accountwalletreceive/payoutstatusnotification";
var apiKey = "your_api_key";
var sharedSecret = "your_shared_secret";
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes($"{apiKey}:{sharedSecret}")));
var payload = new
{
// Add your payload data here
};
var jsonPayload = Newtonsoft.Json.JsonConvert.SerializeObject(payload);
var content = new StringContent(jsonPayload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
if (response.IsSuccessStatusCode)
{
var responseData = await response.Content.ReadAsStringAsync();
Console.WriteLine("Response Data: " + responseData);
}
else
{
Console.WriteLine("Status Code: " + response.StatusCode);
Console.WriteLine("Reason: " + response.ReasonPhrase);
}
}
}
END
```
Replace `your_api_key` and `your_shared_secret` with your actual credentials, and ensure the payload contains the required data.