cancel
Showing results for 
Search instead for 
Did you mean: 

Who Me Too'd this topic

E00003:The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:id' element is invalid - .NET SDK

I'm trying to create a subscription, but my Customer ID is apparently too long.  I'm using a Base64 encoded string of the user's account GUID, which is 24 chars long.  I've read that the max length is 50, so IDK why I would be getting this error.

 

E00003:The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:id' element is invalid - The value 'XkqdN7wJ5kyo7nq/ygDQ7A==' is invalid according to its datatype 'String' - The actual length is greater than the MaxLength value.

 

The code I'm using is as follows:

 

var bytes = Guid.Parse(user.Id).ToByteArray();
var encoded = Convert.ToBase64String(bytes);

_customer = new customerType()
{
    type = customerTypeEnum.individual,
    id = encoded,
    email = user.Email
};

...

ARBSubscriptionType subscriptionType = new ARBSubscriptionType()
{
    name = "Test Base",
    amount = amount,
    trialAmount = 0.00m,
    paymentSchedule = schedule,
    billTo = _addressInfo,
    customer = _customer,
    payment = cc
};

var request = new ARBCreateSubscriptionRequest { subscription = subscriptionType };

var controller = new ARBCreateSubscriptionController(request);
controller.Execute(); // This has the error

 

 

What is the max length for an ID, and is there any way to stuff a GUID in there?

joe_coolish
Member
Who Me Too'd this topic