Reply
Member
Posts: 4
Registered: ‎08-16-2011
Accepted Solution

createCustomerProfileRequest fails when including all of merchantCustomerId, email, and description

Hi,

 

I'm using the CIM API, and having some trouble with the optional fields under the profile node of the createCustomerProfileRequest.

 

I'm sending the following (name and transactionKey obfuscated here):

 

<createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">

<merchantAuthentication>

  <name>NNNNNNNN</name>

  <transactionKey>MMMMMMMMMMMMMMM</transactionKey>

</merchantAuthentication>

  <profile>

    <description>Just some guy</description>

    <merchantCustomerId>999</merchantCustomerId>

    <email>someone@somewhere</email>

  </profile>

</createCustomerProfileRequest>

 

Which fails with

E00003

The element 'profile' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'merchantCustomerId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'email, paymentProfiles, shipToList' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.

 

Oddly though, I only get this error when I include the 'description' field. If I just include 'merchantCustomerId', or 'merchantCustomerId' and 'email', I get success. It also works just fine if I include 'email' and 'description', but not 'merchantCustomerId'.

 

It only fails when I include all three elements.

 

According to the documentation (CIM XML Guide, last revision 5/24/2011, page 21-22), one or more of 'merchantCustomerId', 'email', and 'description' is required under 'profile'. I don't understand why it should fail if I include all three. The error message seems to indicate a bug in the XSD file (or elsewhere), since 'merchantCustomerId' is obviously allowed under 'profile'.

 

I'm using Python 2.6.6 to communicate with the API. More specifically, I'm using a custom version of django-authorizenet (https://github.com/chrislawlor/django-authorizenet), in which I'm attempting to add support for the 'email' and 'description' fields.

 


Accepted Solutions
Solution
Accepted by topic author clawlor
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: createCustomerProfileRequest fails when including all of merchantCustomerId, email, and descript

[ Edited ]

Their sequence matter with CIM XML(bottom of page 19).

"All elements are case sensitive and must be submitted in the order listed here."

 

It should be in the order of

merchantCustomerId

description

email

View solution in original post


All Replies
Solution
Accepted by topic author clawlor
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: createCustomerProfileRequest fails when including all of merchantCustomerId, email, and descript

[ Edited ]

Their sequence matter with CIM XML(bottom of page 19).

"All elements are case sensitive and must be submitted in the order listed here."

 

It should be in the order of

merchantCustomerId

description

email

Highlighted
Member
Posts: 4
Registered: ‎08-16-2011

Re: createCustomerProfileRequest fails when including all of merchantCustomerId, email, and descript

Thanks, that issue was manifesting itself pretty subtly for me, and of course I didn't notice that line in the docs. I was using a Python dict, which is unordered,  to store those values before building the XML. So of course, it always worked when only one value was provided, and had a 50/50 chance of working when two values were provided (though in my initial testing it worked every time...).