- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
08-16-2011 06:41 AM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
08-16-2011 06:49 AM - edited 08-16-2011 06:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
08-16-2011 06:49 AM - edited 08-16-2011 06:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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...).
08-16-2011 07:47 AM
