Re: API Validation Error: 3001. Invalid PAN or TOKEN.

itsssanu
Newbie

API Validation Error: 3001. Invalid PAN or TOKEN.

I am facing the API Validation Error: 3001, which states 'Invalid PAN or TOKEN.' Could you please provide a brief explanation of this issue? Additionally, I am trying to make a local transaction from India to India.

1 REPLY 1
API_Products
Visa Developer Support Specialist

Re: API Validation Error: 3001. Invalid PAN or TOKEN.

Hey @itsssanu,

 

The API Validation Error: 3001, which states "Invalid PAN or TOKEN," typically indicates that the Primary Account Number (PAN) or the token provided is incorrect or not properly formatted.

 

Possible Causes and Solutions

1. Invalid PAN:
- Ensure the PAN (credit/debit card number) is correctly formatted and valid.
- Check for any typographical errors or missing digits.

2. Invalid Token:
- If you are using a token instead of a PAN, ensure the token is correctly generated and valid.
- Verify that the tokenization process was successful and that the token is not expired or revoked.

3. Testing Environment:
- If you are using a sandbox or testing environment, use the test PANs or tokens provided by Visa for testing purposes.
- Ensure that the test data aligns with the expected formats specified in the API documentation.

 

Local Transaction from India to India

When making a local transaction from India to India, ensure the following:

1. Comply with Local Regulations:
- Ensure that all local regulatory requirements are met.
- Verify that the transaction is allowed by the local payment network and regulatory bodies.

2. Use Correct API Endpoints:
- Ensure you are using the correct Visa Developer API endpoints for local transactions.
- Verify that the endpoints support domestic transactions within India.

3. Currency and Amount:
- Ensure the transaction amount and currency (INR) are correctly specified.
- Check for any restrictions on transaction amounts for local transactions.

 

Example of a Valid PAN/TOKEN Format

Here's a Python example to demonstrate how you might format a PAN or token:

```python
import requests

# START 
# Example PAN (ensure this is a valid PAN for real transactions)
pan = "4111111111111111"

# Visa API endpoint
url = 'https://sandbox.api.visa.com/vdp/your_endpoint'

# Your API request payload
payload = {
"primaryAccountNumber": pan,
"transactionAmount": "100.00",
"currencyCode": "INR"
}

# Your API headers
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer your_access_token"
}

# Make the API request
response = requests.post(url, json=payload, headers=headers)

print(response.status_code)
print(response.json())
# END 
```

 

Summary

- Error 3001: Indicates an invalid PAN or token.
- Solutions: Verify the PAN or token format, ensure it's valid, and use test data if in a sandbox environment.
- Local Transactions: Ensure compliance with local regulations, use correct endpoints, and specify the correct currency and amount.

 




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.