Skip to content

Invalid Pan field when creating Linked account using razorpay-node #404

@lovestaco

Description

@lovestaco

Steps to reproduce the behavior

export const razorPayInstance = new Razorpay({
	// Replace with your key_id
	key_id: process.env.RAZOR_PAY_KEY_ID!,
	// Replace with your key_secret
	key_secret: process.env.RAZOR_PAY_KEY_SECRET!,
})
const linkedAccBody = {
    "email": "maneshwar@gmail.com",
    "phone": "9620107401",
    "type": "route",
    "legal_business_name": "Antino",
    "business_type": "individual",
    "contact_name": "Antino",
    "profile": {
        "category": "services",
        "subcategory": "automotive_service_shops",
        "addresses": {
            "registered": {
                "street1": "HSR layout",
                "street2": "HSR",
                "city": "Bangalore",
                "state": "KARNATAKA",
                "postal_code": "560041",
                "country": "India"
            }
        },
    },
    "legal_info": {
        "pan": "ETFPM5333C",
        "gst": "18AABCU9603R1ZM"
    }
}
const createLinkedAccRes = await razorPayInstance.accounts.create(linkedAccBody)

Expected behaviour

  1. Expected a linked account to be created and API returning the id.

Actual behaviour

The problem exists both in the Test keys and Live keys.

The problem is we are getting an invalid pan field when giving the original Pan number

{
"code": "BAD_REQUEST_ERROR",
"description": "The pan field is invalid",
"source": "business",
"step": "payment_initiation",
"reason": "input_validation_failed",
"metadata": {},
"field": "pan"
}

Test cases done:

Case 1: Used the test Pan field mentioned in the API docs with Node.js Razorpay Instance.
Result: Works fine

{
"pan": "AAACL1234C",
"gst": "36AAECL6705C1ZS"
}

Case 2: Used the test Pan field mentioned in the API docs with Rest API POST request.
Result: Works fine

{
"pan": "AAACL1234C",
"gst": "36AAECL6705C1ZS"
}

Case 3: Used my real Pan field with Node.js Razorpay Instance.
Result: Pan field invalid

{
"pan": "AGJPY1257C",
"gst": "36AAECL6705C1ZS"
}

Case 4: Used my real Pan field with Rest API POST request.
Result: Pan field invalid

{
"pan": "ETFPM5333C",
"gst": "36AAECL6705C1ZS"
}

Node version

Node v18.18.2

Library version

"razorpay": "^2.9.2"

Additional Information

@razorpay-sanjib @amitrazorpay @KanhaRazorpay @bala-razorpay @ankitdas13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions