cancel
Showing results for 
Search instead for 
Did you mean: 

createCustomerProfileRequest won't recognize the nameOnAccount field

Whenever I try to post this json data (I redacted the merchantAuthentication fields):

 

{
    "createCustomerProfileRequest": {
        "merchantAuthentication": {
            "name": "XXXXXX",
            "transactionKey": "XXXXXXXXXXXXX"
        },
        "profile": {
            "merchantCustomerId": "4928",
            "paymentProfiles": {
                "customerType": "business",
                "payment": {
                    "bankAccount": {
                        "nameOnAccount": "John Doe",
                        "accountType": "checking",
                        "routingNumber": "21000021",
                        "accountNumber": "28342398",
                        "echeckType": "WEB",
                        "bankName": "Test bank",
                    }
                }
            }
        },
        "validationMode": "testMode"
    }
}

I get the following error message:

 

{"messages":{"resultCode":"Error","message":[{"code":"E00003","text":"The element 'bankAccount' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'nameOnAccount' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'accountType, routingNumber' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'."}]}}

 

When I removed the nameOnAccount field, the error returned suggested that other fields should be removed as well.  When I removed those fields, the error message I recieved told me that I needed to add nameOnAccount back.  Any idea what's going on here?

sskacy18
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Hi  @sskacy18

 

Sorry for the trouble, the Json API which you are using has strict policy on the order of the elements, its because it based on the XML APIs, and thus you are getting the xsd error.

 

To get the correct result you will need to give the elements in the prescribed order only.

"bankAccount": {
                    "accountType": "checking",
                    "routingNumber": "121042882",
                    "accountNumber": "123456789",
                    "nameOnAccount": "John Doe",
                    "echeckType" : "WEB",
                    "bankName" : "Bank Name"
                }

Also, you can look into our SDKs for faster integration.

 

Hope this Helps !

View solution in original post

kikmak42
Authorize.Net Expert Authorize.Net Expert
Authorize.Net Expert
2 REPLIES 2

Hi  @sskacy18

 

Sorry for the trouble, the Json API which you are using has strict policy on the order of the elements, its because it based on the XML APIs, and thus you are getting the xsd error.

 

To get the correct result you will need to give the elements in the prescribed order only.

"bankAccount": {
                    "accountType": "checking",
                    "routingNumber": "121042882",
                    "accountNumber": "123456789",
                    "nameOnAccount": "John Doe",
                    "echeckType" : "WEB",
                    "bankName" : "Bank Name"
                }

Also, you can look into our SDKs for faster integration.

 

Hope this Helps !

kikmak42
Authorize.Net Expert Authorize.Net Expert
Authorize.Net Expert

That fixed it!  Thank you!!  I could have spent the rest of my life working on this and might have never figured it out.