Showing results for 
Search instead for 
Did you mean: 

Invalid child element 'expirationDate' in profile update

I am trying to update customer profiles. I keep getting an error which tells me that the credit card element has an invalid expiration date. I am logging the expiration dates which I send, and they are valid (for example, 2023-09). I am using the .net api so I cannot do anything about field order or the structure of the xml which gets sent. I have followed the example at almost exactly. I can post some code, but other than the error handling and using real data, it is the same as the sample.

I need an idea of where to look for the problem - nothing I have found in the docs or forums is any help. It would be nice if there was a way to get the xml which is being sent, but I don't see how to do that.


@ray482  if you are using the SDK, your request is formed with JSON and you can enter the fields in any order that you wish. You may still get an error "invalid child element" in some circumstances, but it is not anything to do with the order of the fields. In re your expiration date, I think the .net SDK excludes the dash and uses a MMYY format. Try your request using 0923.

All Star

I am not using the sdk - just using the authorizenet.dll with c#. The docs explicitly say to use the 2023-09 format, but some of the examples show 0923. I will give this a shot and see if it helps. Thanx for responding.


I think I found the problem. When updating a profile, I was not including a masked card number if the card did not change. So the credit card element had an expiration date, but it did not have a card number. I found this by serializing the request object to xml (would be nice if that function was part of the api).

There's a danger of static discharge whilst two metal cans touch throughout decanting and during electrostatic spray painting.