Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 2
Registered: ‎01-21-2018
Accepted Solution

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?


Accepted Solutions
Solution
Accepted by topic author sskacy18
‎01-22-2018 06:56 AM
Authorize.Net Expert
Posts: 75
Registered: ‎07-27-2016

Re: createCustomerProfileRequest won't recognize the nameOnAccount field

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


All Replies
Solution
Accepted by topic author sskacy18
‎01-22-2018 06:56 AM
Authorize.Net Expert
Posts: 75
Registered: ‎07-27-2016

Re: createCustomerProfileRequest won't recognize the nameOnAccount field

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 !

Member
Posts: 2
Registered: ‎01-21-2018

Re: createCustomerProfileRequest won't recognize the nameOnAccount field

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